/* ============================================================================
   Valmier — guide pages stylesheet (v2, 2026-10-23)
   PAGE LAYER ONLY: loaded after /ui.css, which owns tokens, base typography,
   nav, footer, buttons, cards, callouts, tags and motion. Nothing here
   re-declares those. This file styles the guide shell: reading column, article
   hero, prose, step lists, hub grid and the compact CTA band.
   Palette: docs/BRAND.md (Vormir at dusk) via the ui.css custom properties.
   ========================================================================== */

/* ---- page shell ---------------------------------------------------------- */
.guide-page{
  position:relative;
  padding-block:calc(var(--nav-h) + clamp(14px,2.4vw,26px)) clamp(6px,1.6vw,14px);
}
/* the article column: ~72 characters, centred, never wider than the screen */
.guide-shell{width:min(100% - clamp(32px,7vw,72px),72ch);margin-inline:auto}
.guide-page .horizon{margin-block:clamp(24px,4vw,36px)}

/* ---- article hero -------------------------------------------------------- */
.guide-hero{position:relative;isolation:isolate}
/* a low dusk glow behind the title; the only decorative light on the page */
.guide-hero::before{
  content:"";position:absolute;z-index:-1;pointer-events:none;
  inset-block-start:-120px;inset-inline:-14%;height:340px;
  background:radial-gradient(58% 100% at 74% 0%,rgba(179,18,46,.22),rgba(122,44,102,.10) 46%,rgba(13,13,15,0) 72%);
}
.guide-hero .kicker{margin-bottom:clamp(10px,1.6vw,14px)}
.guide-hero h1{font-size:clamp(1.9rem,4.2vw,3rem);line-height:1.34;margin:0 0 clamp(12px,1.8vw,16px);text-wrap:balance}
.guide-lead{margin:0;max-width:60ch;color:var(--ash);font:400 clamp(1rem,1.5vw,1.1rem)/1.95 var(--text);text-wrap:pretty}
.guide-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;
  margin-top:clamp(16px,2.4vw,22px);color:var(--ash-dim);font-size:.8rem;line-height:1.8;
}
.guide-meta__item{display:inline-flex;align-items:center;gap:7px}
.guide-meta__item svg{
  width:15px;height:15px;flex:none;fill:none;stroke:var(--soul);stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;opacity:.85;
}
.guide-meta__sep{width:4px;height:4px;border-radius:50%;background:var(--line-3)}
.guide-meta .tag{font-size:.73rem;padding-block:2px}

/* ---- article prose ------------------------------------------------------- */
.article{font-size:var(--fs-body);line-height:2;overflow-wrap:break-word}
.article>*:first-child{margin-top:0}
.article h2{
  font:400 clamp(1.55rem,2.9vw,2.05rem)/1.44 var(--display);
  margin:clamp(30px,4.6vw,44px) 0 clamp(12px,1.8vw,16px);
}
.article h2::after{
  content:"";display:block;width:44px;height:2px;margin-top:10px;border-radius:2px;
  background:linear-gradient(90deg,var(--soul),rgba(242,134,42,0));
}
.article h3{font-size:clamp(1.04rem,1.5vw,1.16rem);margin:clamp(22px,3vw,30px) 0 6px}
.article p,.article ul,.article ol{margin:0 0 1.15em}
.article p,.article li{color:var(--ash)}
.article p:last-child,.article ul:last-child,.article ol:last-child{margin-bottom:0}
.article strong,.article b{color:var(--bone)}
.article a:not(.btn){
  color:var(--gold);text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:4px;text-decoration-color:rgba(242,134,42,.42);overflow-wrap:anywhere;
}
.article a:not(.btn):hover{color:#FFE7C4;text-decoration-color:rgba(242,134,42,.8)}
/* inline code (app labels such as + or a URL) */
.article code{
  display:inline-block;direction:ltr;unicode-bidi:isolate;
  font:600 .88em/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  padding:1px 7px;border-radius:7px;border:1px solid var(--line);
  background:rgba(246,239,233,.07);color:var(--gold);overflow-wrap:anywhere;
}
/* plain bullet lists inside the prose */
.article>ul{list-style:none;padding:0}
.article>ul>li{position:relative;padding-inline-start:20px;margin-block-end:8px}
.article>ul>li::before{
  content:"";position:absolute;inset-inline-start:2px;top:.72em;width:7px;height:7px;border-radius:2px;
  background:linear-gradient(135deg,var(--soul),var(--ember));transform:rotate(45deg);
}

/* ---- numbered steps: circle + connecting line ----------------------------
   The Persian numeral lives in the markup (<span class="step-n">) instead of a
   CSS counter: no dependency on @counter-style, identical on every browser. */
.steps{list-style:none;margin:0 0 1.2em;padding:0}
.steps>li{
  position:relative;color:var(--ash);
  padding-inline-start:60px;padding-block-end:clamp(16px,2.2vw,22px);
}
.steps>li:last-child{padding-block-end:0}
.step-n{
  position:absolute;inset-inline-start:0;top:0;width:40px;height:40px;border-radius:50%;
  display:grid;place-items:center;font:400 1.12rem/1 var(--display);color:#fff;
  background:var(--sky);border:1px solid rgba(255,217,168,.26);
  box-shadow:0 12px 26px -16px rgba(179,18,46,.95),inset 0 1px 0 rgba(255,255,255,.22);
}
.steps>li::after{
  content:"";position:absolute;inset-inline-start:19px;top:48px;bottom:-2px;width:2px;border-radius:2px;
  background:linear-gradient(180deg,rgba(242,134,42,.42),rgba(246,239,233,.07));
}
.steps>li:last-child::after{display:none}
.steps b{display:block;margin-bottom:3px;color:var(--bone);font:700 1.02rem/1.62 var(--text)}

/* ---- callouts + cards inside the article --------------------------------- */
.article .callout{margin:clamp(22px,3.2vw,30px) 0;align-items:flex-start}
.article .callout>div{flex:1;min-width:0}
.article .callout p:last-child{margin-bottom:0}
.article .card{margin:clamp(20px,3vw,28px) 0}
.article .card ul{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.article .card li{position:relative;margin:0;padding-inline-start:20px;line-height:1.9}
.article .card li::before{
  content:"";position:absolute;inset-inline-start:2px;top:.68em;width:7px;height:7px;border-radius:2px;
  background:linear-gradient(135deg,var(--soul),var(--ember));transform:rotate(45deg);
}

/* ---- compact CTA band ---------------------------------------------------- */
.guide-cta{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;
  gap:clamp(14px,2.4vw,20px);padding:clamp(18px,2.8vw,26px);margin-block:clamp(34px,5vw,48px) 0;
}
.guide-cta__text{flex:1 1 240px;min-width:0}
.guide-cta b{display:block;margin-bottom:4px;font:400 clamp(1.2rem,2vw,1.45rem)/1.5 var(--display);color:var(--bone)}
.guide-cta p{margin:0;color:var(--ash);font-size:.9rem;line-height:1.88}
.guide-cta .row{gap:10px;flex:0 0 auto}

/* ---- "other guides" cards ------------------------------------------------ */
.next{margin-block:clamp(30px,4.4vw,44px) 0}
.next>.section-head{margin-bottom:clamp(16px,2.4vw,22px)}
.next>.section-head h2{margin:0;font:400 clamp(1.5rem,2.6vw,1.9rem)/1.4 var(--display)}
.next-cards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.next-cards>li{display:flex}
.next-card{display:flex;gap:12px;align-items:flex-start;width:100%;padding:16px;border-radius:var(--r-md)}
.next-card .tile{width:42px;height:42px;border-radius:12px}
.next-card .tile svg{width:20px;height:20px}
.next-card__body{min-width:0}
.next-card b{display:block;color:var(--bone);font-size:.92rem;font-weight:700;line-height:1.66}
.next-card small{display:block;margin-top:3px;color:var(--ash-dim);font-size:.76rem;line-height:1.78}

/* revealed cards must still lift on hover: ui.css sets transform:none on .is-in */
.guide-grid .card--interactive.is-in:hover,
.next-cards .card--interactive.is-in:hover{transform:translateY(-4px)}

/* ---- back to the hub ----------------------------------------------------- */
.back-row{display:flex;margin-block:clamp(24px,3.6vw,36px) 0}
.back-row .btn--quiet:hover svg{transform:translateX(3px)}

/* ---- guide hub (guides/index.html) --------------------------------------- */
.guide-hub-hero{position:relative;isolation:isolate;max-width:62ch}
.guide-hub-hero::before{
  content:"";position:absolute;z-index:-1;pointer-events:none;
  inset-block-start:-120px;inset-inline:-22%;height:360px;
  background:radial-gradient(55% 100% at 72% 0%,rgba(179,18,46,.22),rgba(122,44,102,.12) 46%,rgba(13,13,15,0) 74%);
}
.guide-hub-hero .kicker{margin-bottom:clamp(8px,1.2vw,12px)}
.guide-hub-hero h1{margin:0 0 clamp(10px,1.6vw,14px)}
.guide-hub-hero .guide-lead{max-width:56ch}
.guide-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(min(330px,100%),1fr));
  gap:clamp(12px,1.8vw,16px);margin-block-start:clamp(26px,4vw,38px);
}
/* same card family as the guide cards on the home page: tile, text, one arrow */
.guide-card{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:start;
  height:100%;padding:clamp(18px,2.2vw,22px);
}
.guide-card .tile{width:46px;height:46px;border-radius:13px}
.guide-card .tile svg{width:22px;height:22px}
.guide-card__body{min-width:0}
.guide-card h2{margin:0 0 4px;color:var(--bone);font:700 1.02rem/1.62 var(--text)}
.guide-card p{margin:0;color:var(--ash);font-size:.88rem;line-height:1.86}
.guide-card__tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.guide-card__tags .tag{font-size:.72rem}
.guide-card__go{
  width:18px;height:18px;flex:none;align-self:center;
  fill:none;stroke:var(--soul);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
  opacity:.95;transition:transform .3s var(--ease),stroke .2s;
}
.guide-card:hover .guide-card__go{transform:translateX(-4px);stroke:var(--gold)}

/* ---- responsive ---------------------------------------------------------- */
@media(max-width:900px){
  .guide-shell{width:min(100% - clamp(28px,6vw,52px),72ch)}
  .guide-hero h1{line-height:1.36}
  .guide-grid{grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),1fr))}
}
@media(max-width:600px){
  .guide-hero::before,.guide-hub-hero::before{inset-block-start:-90px;height:260px}
  .guide-hero h1{font-size:clamp(1.7rem,7vw,2.2rem)}
  .guide-lead{font-size:1rem}
  .guide-meta{gap:6px 8px;font-size:.77rem}
  .steps>li{padding-inline-start:52px}
  .step-n{width:36px;height:36px;font-size:1rem}
  .steps>li::after{inset-inline-start:17px;top:42px}
  .next-cards{grid-template-columns:1fr}
  .guide-grid{grid-template-columns:1fr}
  .guide-cta{display:grid;align-items:start}
  .guide-cta .row{display:grid;grid-template-columns:1fr;gap:10px}
  .guide-cta .btn{width:100%}
}
