:root {
        --bg: #0b0c0e; --fg: #e9eef5; --muted:#98a2b3; --card:#14161a; --accent:#7aa2ff;
      }
      *{box-sizing:border-box} body{margin:0; font-family:system-ui, sans-serif; background:var(--bg); color:var(--fg)}
      a{color:inherit; text-decoration:none}
      .site-header{display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid #222}
      .brand a{font-weight:700}
      .avatar{width:28px;height:28px;border-radius:50%;vertical-align:middle;margin-right:8px}
      main{max-width:1100px;margin:0 auto;padding:16px}
      .hero{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 0}
      .hero form.inline input, .hero form.inline select{padding:8px;border-radius:8px;border:1px solid #333;background:#0f1115;color:var(--fg)}
      .hero form.inline button{padding:8px 12px;border-radius:8px;border:1px solid #333;background:var(--card);color:var(--fg);cursor:pointer}
      .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
      .card{background:var(--card);border:1px solid #222;border-radius:16px;overflow:hidden;display:flex;flex-direction:column}
      .thumb{background:#111 center/cover no-repeat;width:100%;aspect-ratio:3/2}
      .card-body{padding:10px}
      .card-title{font-weight:600}
      .card-meta{color:var(--muted);font-size:.9em}
      .muted{color:var(--muted)}
      .statement-header{display:grid;grid-template-columns:260px 1fr;gap:16px;margin-bottom:18px}
      .statement-image{width:100%;border-radius:12px}
      .stack{display:flex;flex-direction:column;gap:10px}
      .flash{display:grid;gap:6px;margin:12px 0}
      .flash-ok{background:#113b2a;color:#b4f3d1;padding:8px;border-radius:8px}
      .flash-warn{background:#3b2f11;color:#ffe2a7;padding:8px;border-radius:8px}
      .flash-error{background:#3b1111;color:#ffb4b4;padding:8px;border-radius:8px}
      .example-figure{margin:0}
      .example-figure img{width:100%;height:auto;border-radius:12px}
      button{background:var(--accent);border:none;color:#001;border-radius:10px;padding:8px 12px;cursor:pointer}
      button:hover{filter:brightness(1.1)}
      input, textarea, select{background:#0f1115;color:var(--fg);border:1px solid #333;border-radius:8px;padding:8px}

.nav-btn {
  display:inline-block; margin-right:10px; padding:6px 10px;
  border:1px solid #333; border-radius:10px; background:#14161a; color:#e9eef5;
}
.nav-btn:hover { filter:brightness(1.1); }
      
/* Primary button look for links */
a.button {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent);
  color: #001;              /* readable on accent */
  border: none;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
a.button:hover { filter: brightness(1.1); }

/* Secondary / nav buttons (header) */
a.nav-btn {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 10px;
  border: 1px solid #333;
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}
a.nav-btn:hover { filter: brightness(1.1); }

/* On statement pages, don't stretch the submit button full-width */
.statement .submit-form .stack { align-items: flex-start; }
.statement .submit-form button { align-self: flex-start; width: auto; }

.btn-sm { padding: 4px 8px; font-size: .9rem; border-radius: 8px; }
.edit-panel summary { cursor: pointer; color: var(--muted); margin-top:.5rem; }
.edit-panel[open] summary { color: var(--fg); }

.card-with-controls { position: relative; }
.card-with-controls .card-link { display:block; color:inherit; text-decoration:none; }

.card-control.remove-control {
  position: absolute;
  top: 6px; right: 6px;
  margin: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid #333;
  background: #1b1e24;
  color: #e9eef5;
  cursor: pointer;
  line-height: 1;
  font-weight: 700;
}
.btn-icon:hover { filter: brightness(1.1); }

/* Make the Create buttons on the new pages not full-width */
form[action="/example"], 
form[action="/statement"] {
  align-items: flex-start;           /* don't stretch children */
}
form[action="/example"] button, 
form[action="/statement"] button {
  align-self: flex-start;            /* keep button to its content width */
  width: auto;
  padding: 6px 12px;                 /* smaller/narrower feel */
  border-radius: 8px;
  font-size: 0.95rem;
}


/* Variable-size grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  grid-auto-flow: dense; /* helps pack larger items */
}

/* Variable card spans: --span is set inline per card */
.card.variable {
  grid-column: span var(--span, 1);
  display: flex;
  flex-direction: column;
}

/* Make the main body split roughly 50/50 between text and image */
.card-body.halves {
  display: flex;
  flex-direction: column;
  min-height: 240px; /* base height; larger width will naturally increase height */
}

/* Text half */
.card-text {
  flex: 1 1 50%;
  padding: 10px;
}

/* Image half */
.card.variable .thumb {
  flex: 1 1 50%;
  background: #111 center/cover no-repeat;
  width: 100%;
  aspect-ratio: 3 / 2; /* keeps a nice crop as width grows */
}

/* Title scales up a bit on wider spans */
.card-title.big {
  font-weight: 100;
  /* grows slightly with span, stays readable */
  font-size: clamp(1rem, calc(1rem + 0.2rem * var(--span, 1)), 2rem);
  line-height: 1.2;
  margin-bottom: .25rem;
}

/* 2–3 line description clamp (optional) */
.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Small meta line */
.card-meta.small {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 6px 10px 10px;
}

/* Ensure anchors act like blocks for overlay etc. */
.card.variable { color: inherit; text-decoration: none; }
.card.variable:hover { filter: brightness(1.03); }

.artist-line a { color: var(--accent); text-decoration: none; }
.artist-line a:hover { text-decoration: underline; }
.btn-sm { padding: 4px 8px; font-size: .9rem; border-radius: 8px; }
.edit-panel summary { cursor:pointer; color: var(--muted); }
.edit-panel[open] summary { color: var(--fg); }
