/* ============================================================================
   Atelier Nord — site-local styles (Gallery / creative studio template)
   Scoped under .theme-atelier. The one sanctioned DARK template: near-black
   canvas, single aurora-teal accent reserved for active/hover/focus states.
   ============================================================================ */

.theme-atelier {
  --bg: #0B0D10;            /* near-black */
  --surface: #14171C;       /* tiles / cards */
  --surface-2: #1B1F26;
  --text: #F4F6F8;
  --text-muted: #9AA3AD;    /* AA on near-black (~7:1) */
  --border: #262C34;
  --accent: #38E1C6;        /* aurora-teal — active/hover/focus only */
  --accent-soft: rgba(56, 225, 198, 0.14);
  --accent-contrast: #07100E; /* near-black text ON the teal accent */
  --ink: #07100E;
  --tracking-tight: -0.02em;
}
.theme-atelier body, .theme-atelier { background: var(--bg); color: var(--text); }
.theme-atelier .text-muted { color: var(--text-muted); }
.theme-atelier h1, .theme-atelier h2, .theme-atelier h3 { color: var(--text); letter-spacing: var(--tracking-tight); }

.theme-atelier .eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--accent); font-weight: 700; font-size: var(--fs-sm);
  letter-spacing: 0.18em; text-transform: uppercase;
}

/* ---- Nav ---- */
.theme-atelier .nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 13, 16, 0.7); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease, background .2s ease;
}
.theme-atelier .nav.is-scrolled { border-bottom-color: var(--border); background: rgba(11,13,16,0.9); }
.theme-atelier .nav__brand { color: var(--text); }
.theme-atelier .nav__links a { color: var(--text-muted); }
.theme-atelier .nav__links a:hover { color: var(--text); }
.theme-atelier .nav__links a[aria-current="page"] { color: var(--accent); }

/* Buttons on dark: teal fill w/ dark text, or ghost outline */
.theme-atelier .btn--primary { background: var(--accent); color: var(--accent-contrast); }
.theme-atelier .btn--primary:hover { background: #5BE9D2; }
.theme-atelier .btn--ghost { color: var(--text); border-color: var(--border); }
.theme-atelier .btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

/* Focus ring visible on dark */
.theme-atelier a:focus-visible, .theme-atelier button:focus-visible, .theme-atelier .tile:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* Live studio clock */
.theme-atelier .clock { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: var(--fs-sm); letter-spacing: 0.06em; }

/* ============================================================================
   HERO
   ============================================================================ */
.theme-atelier .at-hero { padding-block: var(--space-10) var(--space-8); position: relative; }
.theme-atelier .at-hero .eyebrow { margin-bottom: var(--space-3); }
.theme-atelier .at-hero h1 { font-size: clamp(2.75rem, 8vw, 6rem); line-height: 1.0; letter-spacing: -0.03em; }
.theme-atelier .at-hero .hero__lede { color: var(--text-muted); max-width: 56ch; }
.theme-atelier .at-hero__line { height: 2px; width: 0; background: var(--accent); margin-top: var(--space-6); animation: at-line 1.4s ease forwards; }
@keyframes at-line { to { width: min(420px, 60%); } }
@media (prefers-reduced-motion: reduce) { .theme-atelier .at-hero__line { animation: none; width: min(420px, 60%); } }
.theme-atelier .hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ============================================================================
   FILTER BAR
   ============================================================================ */
.theme-atelier .filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.theme-atelier .filter-bar__label { color: var(--text-muted); font-size: var(--fs-sm); letter-spacing: 0.18em; text-transform: uppercase; }
.theme-atelier .filter-chip {
  min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-full);
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  font: inherit; font-weight: 600; font-size: var(--fs-sm); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-atelier .filter-chip:hover { color: var(--text); border-color: var(--text-muted); }
.theme-atelier .filter-chip[aria-pressed="true"] { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }

/* ============================================================================
   SIGNATURE — the "aurora index wall" (CSS masonry, no photography)
   ============================================================================ */
.theme-atelier .wall { column-count: 4; column-gap: var(--space-4); }
@media (max-width: 1100px) { .theme-atelier .wall { column-count: 3; } }
@media (max-width: 760px)  { .theme-atelier .wall { column-count: 2; } }
@media (max-width: 460px)  { .theme-atelier .wall { column-count: 1; } }

.theme-atelier .tile {
  display: block; width: 100%; break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid; margin: 0 0 var(--space-4);
  position: relative; border: 0; padding: 0; cursor: pointer; text-align: left;
  border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
  transition: transform .2s ease, box-shadow .2s ease;
}
.theme-atelier .tile[hidden] { display: none; }
/* On gallery-home the tiles are anchors, so shared .section a:not(.btn) would tint the
   caption title with the accent; keep tile text neutral to match the Work-page tiles. */
.theme-atelier a.tile { color: #fff; }
.theme-atelier .tile__art {
  display: block; width: 100%; aspect-ratio: 1 / 1; position: relative;
  background-image: var(--img, none),
    radial-gradient(70% 60% at 30% 20%, hsl(var(--h, 180) 50% 22%) 0%, transparent 60%),
    linear-gradient(150deg, hsl(var(--h, 180) 45% 20%), hsl(calc(var(--h, 180) + 30) 50% 8%));
  background-size: cover; background-position: center;
}
.theme-atelier .tile--tall .tile__art { aspect-ratio: 3 / 4; }
.theme-atelier .tile--wide .tile__art { aspect-ratio: 4 / 3; }
.theme-atelier .tile__art::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1.3px);
  background-size: 16px 16px;
}
.theme-atelier .tile__idx {
  position: absolute; top: var(--space-3); left: var(--space-3);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-sm);
  color: #fff; z-index: 2;
  /* Chip so the number stays legible over any region of a real photo */
  padding: 2px 8px; border-radius: var(--radius-full);
  background: rgba(7,16,14,0.55); backdrop-filter: blur(2px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.theme-atelier .tile__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: linear-gradient(to top, rgba(7,16,14,0.85), transparent);
  opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.theme-atelier .tile__cap b { display: block; }
.theme-atelier .tile__cap small { color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: var(--fs-xs); }
.theme-atelier .tile:hover, .theme-atelier .tile:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--accent), 0 24px 60px -16px rgba(56,225,198,0.4);
}
.theme-atelier .tile:hover .tile__cap, .theme-atelier .tile:focus-visible .tile__cap { opacity: 1; transform: none; }
@media (hover: none) { .theme-atelier .tile__cap { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .theme-atelier .tile { transition: none; } .theme-atelier .tile__cap { transition: none; } }

/* ============================================================================
   LIGHTBOX
   ============================================================================ */
.theme-atelier .lightbox { position: fixed; inset: 0; z-index: 200; display: none; }
.theme-atelier .lightbox[open], .theme-atelier .lightbox.is-open { display: grid; place-items: center; }
.theme-atelier .lightbox__backdrop { position: absolute; inset: 0; background: rgba(5,7,9,0.88); backdrop-filter: blur(4px); }
.theme-atelier .lightbox__panel {
  position: relative; z-index: 1; width: min(92vw, 880px);
  max-height: calc(100dvh - 2 * var(--space-5)); display: flex; flex-direction: column; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.theme-atelier .lightbox__art { width: 100%; aspect-ratio: 16 / 10; max-height: 58vh; flex: 0 0 auto; background: linear-gradient(150deg, hsl(180 45% 22%), hsl(210 50% 9%)); }
.theme-atelier .lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5); }
.theme-atelier .lightbox__title b { display: block; }
.theme-atelier .lightbox__title small { color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: var(--fs-xs); }
.theme-atelier .lightbox__nav { display: flex; gap: var(--space-2); }
.theme-atelier .lb-btn {
  width: 44px; height: 44px; border-radius: var(--radius-full); border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: var(--fs-lg); cursor: pointer; line-height: 1;
}
.theme-atelier .lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-atelier .lightbox__close { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 2; }

/* ============================================================================
   STUDIO / CONTENT BLOCKS
   ============================================================================ */
.theme-atelier .section--alt { background: var(--surface); }
.theme-atelier .cap-list { display: grid; gap: 0; }
.theme-atelier .cap { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: baseline; padding: var(--space-5) 0; border-top: 1px solid var(--border); }
.theme-atelier .cap:last-child { border-bottom: 1px solid var(--border); }
.theme-atelier .cap__no { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; }
.theme-atelier .cap__name { font-size: var(--fs-xl); }
.theme-atelier .cap__meta { color: var(--text-muted); font-size: var(--fs-sm); text-align: right; }

.theme-atelier .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.theme-atelier .stat__num { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: var(--tracking-tight); }
.theme-atelier .stat__label { color: var(--text-muted); font-size: var(--fs-sm); }

.theme-atelier .card { background: var(--surface); border: 1px solid var(--border); }

/* Contact form (dark) */
.theme-atelier .at-form { display: grid; gap: var(--space-4); }
.theme-atelier .at-field { display: grid; gap: var(--space-2); }
.theme-atelier .at-field label { font-weight: 600; font-size: var(--fs-sm); }
.theme-atelier .at-field input, .theme-atelier .at-field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
}
.theme-atelier .at-field input::placeholder, .theme-atelier .at-field textarea::placeholder { color: var(--text-muted); }
.theme-atelier .at-field input:focus-visible, .theme-atelier .at-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.theme-atelier .at-form__ok { display: none; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-atelier .at-form__ok.is-shown { display: block; }

/* Footer on dark */
.theme-atelier .footer { background: var(--bg); border-top: 1px solid var(--border); }

/* Reveal */
.theme-atelier .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.theme-atelier .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .theme-atelier .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 640px) {
  .theme-atelier .stat-row { grid-template-columns: 1fr; gap: var(--space-4); }
  .theme-atelier .cap { grid-template-columns: auto 1fr; }
  .theme-atelier .cap__meta { grid-column: 2; text-align: left; }
}
