:root{
  --bg: #0b0b10;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.035);
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --accent: #60a5fa;     /* blue */
  --accent2:#34d399;     /* green */
  --accent3:#f472b6;     /* pink */
  --shadow: 0 14px 40px rgba(0,0,0,0.45);
  --radius: 18px;
  --content-pad-x: 24px;
  --content-pad-y: 18px;
  --colw: 260px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  background: var(--bg);

  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

a{ color:inherit; text-decoration:none; }

/* ============================
   Full-width container baseline
   - NO centered gutters
   ============================ */
.wrap{
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--content-pad-y) var(--content-pad-x);
}

@media (max-width: 520px){
  :root{ --content-pad-x: 16px; --content-pad-y: 16px; }
}

/* Sticky footer behavior (works on home too) */
main{ flex: 1 0 auto; }
.footer{ flex-shrink: 0; }

/* ============================
   Top bar
   ============================ */
.topbar{
  position:sticky;
  top:0;
  background: rgba(11,11,16,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index:10;
}

.topbar .wrap{
  padding-top:8px;
  padding-bottom:8px;
}

.topbar-inner{
  display:grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items:flex-start;
  column-gap:16px;
}

.brand{
  position:relative;
  display:flex;
  align-items:center;
  gap:0;
  font-weight:700;
  letter-spacing:0.2px;
  min-height: clamp(72px, 7.6vw, 110px);
}

.brand-mark{
  display:block;
  width: clamp(360px, 38vw, 600px);
  aspect-ratio: 3014 / 862;
  height:auto;
  border-radius:10px;
  background-image: url("/assets/images/themis-banner.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  box-shadow:none;
}

@media (max-width: 980px){
  .brand{ min-height: clamp(56px, 8vw, 80px); }
  .brand-mark{ width: clamp(240px, 62vw, 430px); }
}

.brand-text{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.topnav{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  justify-self:end;
  align-self:flex-start;
  column-gap:14px;
  row-gap:8px;
  flex-wrap:wrap;
  padding-top:4px;
}

@media (max-width: 1200px){
  .topbar-inner{
    grid-template-columns: 1fr;
    row-gap:8px;
  }
  .topnav{
    justify-self:start;
    justify-content:flex-start;
    padding-top:2px;
  }
}

.topnav a, .topnav button{
  color:var(--muted);
  font-size:14px;
}

.topnav a:hover,
.topnav button:hover{
  color:var(--text);
}

/* ============================
   Cards / type
   ============================ */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.card.subtle{
  background: var(--panel2);
  box-shadow:none;
}

h1{ margin:0 0 10px; font-size:34px; line-height:1.08; letter-spacing:-0.4px; }
h2{ margin:0 0 10px; font-size:18px; }
h3{ margin:0 0 10px; font-size:16px; }

.lead{ margin:0 0 14px; color:var(--muted); font-size:15px; }
.muted{ color:var(--muted); }
.small{ font-size:12.5px; }

.divider{
  height:1px;
  background: rgba(255,255,255,0.08);
  margin:14px 0;
}

.row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }

.list{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.list-item{ display:flex; justify-content:space-between; gap:12px; }
.li-title{ font-size:13px; }
.li-val{ font-size:13px; }

.stack{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }

/* ============================
   Buttons
   ============================ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size:14px;
  user-select:none;
  cursor:pointer;
  background: transparent;
}

.btn-primary{
  background: linear-gradient(135deg, rgba(96,165,250,0.95), rgba(52,211,153,0.85));
  color:#06111f;
  border-color: transparent;
  font-weight:700;
}

.btn-secondary{ background: rgba(255,255,255,0.06); }
.btn-ghost{ background: transparent; color: var(--muted); }

.btn:hover{ filter: brightness(1.06); }
.btn-icon{ width:40px; height:40px; padding:0; }

/* ============================
   Pills
   ============================ */
.pill-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }

.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius: 999px;
  background: rgba(96,165,250,0.10);
  border: 1px solid rgba(96,165,250,0.22);
  color: rgba(255,255,255,0.86);
  font-size:12px;
}

.pill-soft{
  background: rgba(244,114,182,0.10);
  border-color: rgba(244,114,182,0.20);
}

/* ============================
   Layouts: grid3 + threecol
   - Center column must be fluid and occupy all remaining space
   ============================ */
.grid3{
  display:grid;
  grid-template-columns: var(--colw) minmax(0, 1fr) var(--colw);
  gap:16px;
  padding-top: 20px;
  padding-bottom: 28px;
  width:100%;
  margin:0;
}

.threecol{
  display:grid;
  grid-template-columns: var(--colw) minmax(0, 1fr) var(--colw);
  gap:16px;
  padding:24px 0 28px;
  width:100%;
  margin:0;
}

.col{ min-width:0; }

@media (max-width: 980px){
  .grid3, .threecol{ grid-template-columns: 1fr; }
  .left,.right{ order:2; }
  .center{ order:1; }
}

/* Narrow standalone center cards (login/register pages) */
.card.center-card{
  max-width: 560px;
  margin-left:auto;
  margin-right:auto;
}

/* But inside grid3 we do NOT constrain the center card width */
.grid3 .card.center-card,
.threecol .card.center-card{
  max-width:none;
  margin-left:0;
  margin-right:0;
}

/* ============================
   Forms / Inputs
   ============================ */
.formactions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.formgrid{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap:10px 14px;
  align-items:center;
}

@media (max-width: 720px){
  .formgrid{ grid-template-columns: 1fr; }
}

/* Always full width inside their container */
.input, select.input, textarea.input{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

.helpnote{ margin-top:10px; }

/* Critique grid used on Vote */
.critgrid{
  display:grid;
  grid-template-columns: minmax(180px, 32%) 1fr;
  gap:12px 14px;
  align-items:start;
}

.critlabel{ padding-top:6px; }
.critfield .input{ width:100%; margin-bottom:8px; }

@media (max-width: 860px){
  .critgrid{ grid-template-columns: 1fr; }
  .critlabel{ padding-top:0; }
}

/* ============================
   EXIF box
   ============================ */
.exifbox{
  margin-top:10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px;
  background:rgba(15,21,32,.55);
}

.exifrow{
  display:flex;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.exifrow:last-child{ border-bottom:none; }

.exifk{
  width:44%;
  color:rgba(255,255,255,.72);
  font-size:.86rem;
}

.exifv{
  width:56%;
  color:rgba(255,255,255,.92);
  font-size:.86rem;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ============================
   Tabs
   ============================ */
.tabs{ display:flex; gap:8px; }
.tab{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:transparent;
  color:rgba(255,255,255,.85);
  cursor:pointer;
}
.tab.active{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.18);
}

/* ============================
   Home page: hero + featured
   ============================ */
.hero{ padding:10px 2px 14px; }
.hero-cta{ display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }

.featured{ margin-top:12px; }
.featured-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.kicker{ font-size:12px; color:rgba(96,165,250,0.9); letter-spacing:0.6px; text-transform:uppercase; }
.title{ font-size:18px; font-weight:700; margin-top:4px; }
.meta{ font-size:13px; margin-top:6px; }

.featured-img{
  margin-top:14px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  min-height:240px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.featured-img img{
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:min(56vh, 620px);
  object-fit:contain;
  margin:0 auto;
}

.featured-foot{ margin-top:12px; }

.link{ color: rgba(96,165,250,0.95); font-size:14px; }
.link:hover{ text-decoration:underline; }

/* ============================
   Footer
   ============================ */
.footer{
  border-top: 1px solid var(--border);
  background: rgba(11,18,32,0.55);
}

.footer-inner{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

/* ============================
   Gallery (single, consistent implementation)
   - Wall (grid) on top, detail underneath
   ============================ */
.gallery-layout{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
  align-items:start;
  width:100%;
  margin:0;
}

.gallery-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:14px;
  max-height: 52vh;
  overflow:auto;
  padding-right:6px;
}

@media (max-width: 980px){
  .gallery-grid{
    max-height:none;
    overflow:visible;
    padding-right:0;
  }
}

.gallery-tile{
  display:block;
  width:100%;
  text-align:left;
  cursor:pointer;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius:16px;
  box-shadow:none;
  padding:12px;
  transition: transform .10s ease, filter .10s ease, border-color .10s ease, background .10s ease;
}

.gallery-tile:hover{
  filter: brightness(1.06);
  transform: translateY(-2px);
  border-color: rgba(96,165,250,0.35);
  background: rgba(255,255,255,0.03);
}

.gallery-tile.selected{
  border-color: rgba(96,165,250,0.60);
  box-shadow: 0 0 0 4px rgba(96,165,250,0.12);
}

.gallery-thumb{
  position:relative;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(520px 240px at 20% 20%, rgba(96,165,250,0.18), transparent 60%),
    radial-gradient(520px 240px at 80% 30%, rgba(244,114,182,0.10), transparent 62%),
    rgba(255,255,255,0.03);
}

.gallery-thumb img{
  display:block;
  width:100%;
  height:240px;
  object-fit:cover;
}

.gallery-tile-title{
  margin-top:10px;
  font-weight:800;
  font-size:13.5px;
  line-height:1.25;
}

.gallery-tile-meta{
  margin-top:5px;
  font-size:12.5px;
  color: var(--muted);
}

.gallery-detail{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.gallery-detail-title{
  font-size:22px;
  font-weight:900;
  letter-spacing:-0.2px;
  margin:0;
}

.gallery-detail-meta{
  margin-top:7px;
  font-size:13.5px;
  color: var(--muted);
}

.gallery-detail-img{
  margin-top:14px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(900px 420px at 18% 12%, rgba(96,165,250,0.22), rgba(96,165,250,0.00) 60%),
    radial-gradient(760px 420px at 86% 22%, rgba(244,114,182,0.10), rgba(244,114,182,0.00) 62%),
    radial-gradient(900px 520px at 55% 92%, rgba(52,211,153,0.08), rgba(52,211,153,0.00) 58%),
    rgba(255,255,255,0.03);
}

.gallery-detail-img img{
  display:block;
  width:100%;
  height:auto;
  max-height:72vh;
  object-fit: contain;
}

.gallery-detail-caption{
  margin-top:14px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height:1.5;
  font-size:14px;
}

/* Ribbon badges */
.ribbon{
  position:absolute;
  top:10px;
  left:10px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  letter-spacing:0.2px;
  border:1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
}

.ribbon-1{
  background: linear-gradient(135deg, rgba(96,165,250,0.95), rgba(52,211,153,0.85));
  color:#06111f;
  border-color: rgba(255,255,255,0.10);
}

.ribbon-2{
  background: linear-gradient(135deg, rgba(244,114,182,0.92), rgba(96,165,250,0.78));
  color:#06111f;
  border-color: rgba(255,255,255,0.10);
}
.watermarked-stage{
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #0f1520;
}

.watermarked-stage img{
  display:block;
  width:100%;
  height:auto;
  min-height:340px;
  object-fit:contain;
  user-select:none;
  -webkit-user-drag:none;
}

.wm-overlay{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  text-align:center;
  padding:20px;
}

.wm-line1,
.wm-line2{
  color: rgba(255,255,255,0.20);
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  letter-spacing: 0.5px;
  line-height: 1.15;
}

/* Make these easy to tune */
:root{
  --wm-line1-size: 14pt;
  --wm-line2-size: 14pt;
  --wm-opacity: 0.20;
  --wm-rotate: -18deg;
}

.wm-overlay{
  transform: rotate(var(--wm-rotate));
}

.wm-line1{
  font-size: var(--wm-line1-size);
  font-weight: 600;
  opacity: var(--wm-opacity);
}

.wm-line2{
  font-size: var(--wm-line2-size);
  font-weight: 600;
  opacity: var(--wm-opacity);
  margin-top: 4px;
}
