/* ==========================================================================
   E21 — visitor discovery. Loaded on every page after the E15 shell sheets.
   1. Navigation: the Tools trigger, and the Try a tool grid in the drawer
   2. Homepage (E21.1): hero actions and hint, Surprise me, the six-tool grid, the closing story; E21.2: the making card
   3. Invitations to a fitting tool on reading pages; guide onward step
   ========================================================================== */

/* ---------- 1. Navigation ---------- */
.am-trigger--tools{box-shadow:inset 0 0 0 1px var(--e-line-2)}
.am-trigger--tools:hover,.am-trigger--tools[aria-expanded="true"]{box-shadow:inset 0 0 0 1px var(--e-garnet)}
.am-menu>li.am-quick{display:none}
@media (max-width:1023px){
  .am-trigger--tools{box-shadow:none}
  .am-menu>li.am-tools-group{display:none}
  .am-trigger,.am-toplink{font-size:1.35rem;padding:14px 2px}
  .am-menu>li.am-quick{display:block;border-bottom:0;padding:18px 0 8px}
  .am-quick-h{margin:0 0 10px;font:600 .72rem var(--e-text);letter-spacing:.18em;text-transform:uppercase;color:var(--e-garnet)}
  .am-quick-h span{display:block;margin-top:3px;font:400 .8rem var(--e-text);letter-spacing:0;text-transform:none;color:var(--e-muted)}
  .am-quick ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .am-quick a{display:block;height:100%;box-sizing:border-box;padding:11px 12px;border:1px solid var(--e-line);border-radius:var(--e-radius-lg);background:var(--e-card);text-decoration:none;color:var(--e-ink)}
  .am-quick a:hover,.am-quick a:focus-visible{border-color:var(--e-garnet)}
  .am-quick b{display:block;font:600 1.05rem/1.15 var(--e-display)}
  .am-quick a span{display:block;margin-top:3px;font-size:.76rem;line-height:1.35;color:var(--e-muted)}
}
@media (max-width:340px){.am-quick ul{grid-template-columns:1fr}}

/* ---------- 2. Homepage (E21.1) ---------- */
.h-mast-top a{color:inherit;text-decoration:none;border-bottom:1px solid var(--e-line-2)}
.h-mast-top a:hover{color:var(--e-garnet);border-color:var(--e-garnet)}
.e21-begin{margin:14px 0 0!important;font-size:.88rem!important}
.e21-begin a{font-weight:600;color:var(--e-garnet)}
.e21-hero-hint{max-width:1680px;margin:14px auto 0;padding:0 var(--e-gutter);font-size:.82rem;color:var(--e-muted)}
.e21-surprise{border-style:dashed!important;color:var(--e-garnet)!important}

/* the six tools: the E20.3.1 grid as one collection, three across, then two; on phones a compact two-column set */
.e21-tools-sec .h-tool small{line-height:1.45}
@media (max-width:860px){.e21-tools-sec .h-tools{grid-template-columns:1fr 1fr}}
@media (max-width:600px){
  .e21-tools-sec .e-head{margin-bottom:22px}
  .e21-tools-sec .h-tools{grid-template-columns:1fr 1fr;gap:12px}
  .e21-tools-sec .h-tool figure{aspect-ratio:4/3}
  .e21-tools-sec .h-tool div{padding:11px 12px 14px}
  .e21-tools-sec .h-tool h3{order:-1;font-size:1.16rem;line-height:1.15;margin:0 0 4px}
  .e21-tools-sec .h-tool small{font:400 .8rem/1.38 var(--e-text);letter-spacing:0;text-transform:none;color:var(--e-muted)}
  .e21-tools-sec .h-tool p,.e21-tools-sec .h-tool strong{display:none}
}

/* the story, told once, as the closing chapter */
.e21-story .e21-story-q{font:italic 500 clamp(1.45rem,2.2vw,1.95rem)/1.2 var(--e-display);color:var(--e-ink-2);margin:.3em 0 .7em;letter-spacing:0}
.e21-story .h-trap-copy .e-btn{margin-top:10px}
.e21-story-m{display:none}
@media (max-width:860px){
  .e21-story-m{display:block;margin:26px 0 4px}
  .e21-story-m img{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;object-position:50% 30%;border-radius:var(--e-radius,10px);background:var(--e-sand)}
}

/* phones: the reading sections become rows, so the page is shorter without losing anything */
@media (max-width:600px){
  .h-ways{gap:12px}
  .h-way{display:grid;grid-template-columns:104px 1fr;column-gap:14px;align-items:start}
  .h-way figure{grid-row:1/span 3;aspect-ratio:1/1!important}
  .h-way small{margin:4px 0 4px}
  .h-way h3{font-size:1.4rem;margin:0 0 4px}
  .h-way p{font-size:.86rem;line-height:1.5}
  .h-twin a{grid-template-columns:110px 1fr;min-height:0}
  .h-twin div{padding:16px}
  .h-twin h3{font-size:1.45rem}
}

@media (max-width:600px){.h-map-art{max-width:300px;margin-left:auto;margin-right:auto}}
.h-way img.e21-making{object-position:28% 50%}   /* E21.2: keep the weaver in a narrower crop of the wide loom photograph */

/* ---------- 3. Invitations ---------- */
.e21-invite-wrap.e-wrap{max-width:calc(var(--e-wrap) + 2 * var(--e-gutter));box-sizing:border-box;margin-top:clamp(28px,4vw,48px);margin-bottom:0}   /* the chapter nav’s column */
.e21-invite{max-width:760px}
.e21-invite a{display:grid;grid-template-columns:112px 1fr;gap:0;text-decoration:none;color:var(--e-ink);background:var(--e-card);border:1px solid var(--e-line);border-left:3px solid var(--e-zari);border-radius:var(--e-radius-lg);overflow:hidden;transition:border-color .2s,box-shadow .2s}
.e21-invite a:hover{box-shadow:var(--e-shadow);border-color:var(--e-line-2);border-left-color:var(--e-garnet)}
.e21-invite img{width:112px;height:100%;min-height:112px;object-fit:cover;background:var(--e-sand)}
.e21-invite a>span{display:flex;flex-direction:column;padding:14px 18px}
.e21-invite small{font:600 .64rem var(--e-text);letter-spacing:.2em;text-transform:uppercase;color:var(--e-garnet)}
.e21-invite b{font:600 1.35rem/1.15 var(--e-display);margin:4px 0 4px}
.e21-invite a>span>span{font-size:.88rem;line-height:1.5;color:var(--e-muted)}
.e21-invite em{font:normal 600 .84rem var(--e-text);margin-top:8px}
.e21-invite a:hover em{color:var(--e-garnet)}
@media (max-width:480px){.e21-invite a{grid-template-columns:84px 1fr}.e21-invite img{width:84px;min-height:0}}

/* E21.3: the Tools panel's Posebook feature (portrait 31) sits lower in its 4:3 frame than the panel's 14% default, so the
   embroidered pallu shares the picture with her face */
.am-feature img[src*="posebook-31-pallu-framed-portrait"]{object-position:50% 28%}

/* the guides' onward step into a tool */
.e18-onward a[href^="showroom-companion.html"]{border-left:3px solid var(--e-zari)}

@media (prefers-reduced-motion:reduce){.e21-invite a{transition:none}}
