/* ==========================================================================
   pages.css — About, FAQ, Contact (EN + ES) on the key-rack theme.
   Loads after /rack.css and only extends it: tokens, .plate, .btn, .hero,
   .close, .mini, .hooks all come from rack.css. Nothing here redefines them.
   ========================================================================== */

/* ---------- Reading pages: .post (About, FAQ) ---------- */
.post { width: min(100% - var(--s-8), var(--wrap)); margin-inline: auto; padding: var(--s-12) 0 var(--s-16); display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.post-head .meta b, .post-body a { overflow-wrap: anywhere; }
.post-head { display: grid; gap: var(--s-4); padding-bottom: var(--s-8); }
.post-head .plate { justify-self: start; margin-bottom: var(--s-2); }
.post h1 { font-size: var(--t-4xl); max-width: 18ch; }
.post-head .meta { font-family: var(--f-display); font-style: italic; font-variation-settings: "opsz" 36; font-size: var(--t-xl); line-height: 1.3; color: var(--slate); max-width: 34ch; margin: 0; }
.post-head .meta b { font-family: var(--f-mono); font-style: normal; font-weight: 600; font-size: .85em; color: var(--ink); letter-spacing: -.01em; }
.post > .hooks { margin: 0; }

.post-body { max-width: var(--measure); padding-top: var(--s-8); font-size: var(--t-lg); line-height: 1.6; color: var(--ink); }
.post-body > * + * { margin-top: 1.25em; }
.post-body h2 { font-size: var(--t-2xl); margin-top: 2em; line-height: 1.12; }
.post-body h2 + * { margin-top: .9em; }
.post-body h3 { font-size: var(--t-xl); }
.post-body p { max-width: none; }
.post-body a { color: var(--crimson); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body a:hover { color: var(--crimson-2); }
.post-body strong { font-weight: 700; }
/* Lists: the small key-tag bullet from the ledger */
.post-body ul { list-style: none; margin: 1.25em 0 0; padding: 0; display: grid; gap: var(--s-3); }
.post-body ul li { display: flex; gap: var(--s-4); align-items: baseline; }
.post-body ul li::before { content: ""; flex: none; width: 6px; height: 11px; margin-top: .35em; border-radius: 2px; background: var(--grad); box-shadow: inset 0 -1px 0 rgba(0,0,0,.2); }
/* A pull quote, only where the article already has one */
.post-body blockquote, .post-body .claim { font-family: var(--f-display); font-style: italic; font-size: var(--t-xl); line-height: 1.35; color: var(--ink); margin: 2em 0 0; padding-left: var(--s-4); border-left: 3px solid var(--crimson-2); max-width: 34ch; }
.post-body blockquote p { margin: 0; }

/* The closing tag at the end of the article: a dark plate with hooks along the top */
.post-cta { position: relative; margin-top: var(--s-16); background: var(--dark); color: #fff; border: 1px solid var(--night-line); border-radius: 6px; padding: var(--s-8) var(--s-6) var(--s-6); overflow: hidden; }
.post-cta::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 28px; opacity: .8;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28'%3E%3Ccircle cx='24' cy='6' r='2.5' fill='%23C22B55'/%3E%3Cpath d='M24 8v10a4 4 0 0 0 8 0' fill='none' stroke='%23C22B55' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x center; }
.post-cta h3 { font-size: var(--t-2xl); margin-top: var(--s-4); max-width: 20ch; }
.post-cta p { color: var(--slate-2); font-size: var(--t-md); margin-top: var(--s-3); }
.post-body .post-cta .btn { margin-top: var(--s-6); color: #fff; text-decoration: none; }
.post-cta .btn:focus-visible { outline-color: #fff; }
@media (min-width: 640px) { .post-cta { padding: var(--s-12) var(--s-8) var(--s-8); } }

/* Author: the key tag with the founder's initial on it */
.post-author { display: flex; gap: var(--s-4); align-items: center; margin-top: var(--s-12); padding-top: var(--s-8); border-top: 1px solid var(--line); }
.post-author .avatar { flex: none; position: relative; width: 44px; height: 60px; background: var(--grad); border-radius: var(--r-tag); box-shadow: inset 0 -2px 0 rgba(0,0,0,.22); color: #fff; font: 700 var(--t-lg)/1 var(--f-mono); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.post-author .avatar::before { content: ""; position: absolute; top: 7px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; border: 2px solid #fff; opacity: .8; }
.post-author .who b { display: block; font-family: var(--f-display); font-weight: 600; font-size: var(--t-lg); }
.post-author .who span { display: block; font-size: var(--t-sm); color: var(--slate); margin-top: var(--s-1); max-width: 40ch; }

/* Desktop: the article column at its measure, the author hanging beside it */
@media (min-width: 1000px) {
  .post { grid-template-columns: minmax(0, var(--measure)) 1fr; column-gap: var(--s-16); padding: var(--s-16) 0 var(--s-24); }
  .post-head { grid-column: 1 / -1; grid-row: 1; grid-template-columns: 7fr 5fr; align-items: end; gap: var(--s-12); padding-bottom: var(--s-12); }
  .post-head .plate { grid-column: 1; }
  .post-head h1 { grid-column: 1; }
  .post-head .meta { grid-column: 2; grid-row: 1 / span 2; align-self: end; justify-self: end; text-align: right; text-wrap: balance; }
  .post > .hooks { grid-column: 1 / -1; grid-row: 2; }
  .post-body { grid-column: 1; grid-row: 3; padding-top: var(--s-12); }
  .post-author { grid-column: 2; grid-row: 3; align-self: start; position: sticky; top: 96px; margin-top: var(--s-12); padding-top: 0; border-top: 0; flex-direction: column; align-items: flex-start; }
  /* No author rail (FAQ): let the article column take the full measure instead of leaving the rail empty */
  .post-solo { grid-template-columns: minmax(0, 52rem) 1fr; }
  .post-solo .post-body { max-width: 52rem; }
}

/* ---------- FAQ: each question is a hook; open it and the key comes off ---------- */
.faq { border-top: 1px solid var(--line); margin-top: 0; }
.faq > summary { list-style: none; cursor: pointer; display: flex; gap: var(--s-4); align-items: flex-start; justify-content: space-between; padding: var(--s-6) 0; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary h2 { font-size: var(--t-xl); margin: 0; line-height: 1.2; text-wrap: balance; }
.faq > summary:hover h2 { color: var(--crimson); }
.faq > summary:focus-visible { outline-offset: 6px; }
/* the marker: a key on its hook */
.faq > summary .k { flex: none; position: relative; width: 22px; height: 36px; margin-top: 1px; }
.faq > summary .k::before { content: ""; position: absolute; left: 5px; top: 0; width: 10px; height: 10px; border: 2px solid var(--crimson-3); border-radius: 50%; transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease; }
.faq > summary .k::after { content: ""; position: absolute; left: 4px; top: 13px; width: 14px; height: 20px; background: var(--grad); border-radius: 3px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease; }
.faq > summary .k i { position: absolute; left: 8px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s ease, box-shadow .2s ease; }
.faq[open] > summary .k::before, .faq[open] > summary .k::after { transform: translateY(-6px) rotate(-14deg); opacity: 0; }
.faq[open] > summary .k i { background: var(--crimson-3); box-shadow: 0 0 8px 2px rgba(214,69,69,.5); }
.faq .a { padding: 0 0 var(--s-8); }
.faq .a p { margin-top: 0; }
.faq + .faq { margin-top: 0; }
.faq:last-of-type { border-bottom: 1px solid var(--line); }
.post-body .faq + .post-cta { margin-top: var(--s-16); }

/* ---------- Contact ---------- */
.contact-hero .wrap { grid-template-columns: minmax(0, 1fr); }
.contact-hero h1 { max-width: 14ch; }
.contact-hero .cta .btn-ghost { font-family: var(--f-mono); letter-spacing: 0; font-weight: 600; overflow-wrap: anywhere; }

/* Three ways in: key tags hanging on a rail */
.ways { padding: var(--s-16) 0; background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ways ul { list-style: none; margin: 0; padding: 18px 0 0; display: grid; gap: var(--s-8) var(--s-6); }
.ways li { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-tag); padding: var(--s-8) var(--s-6) var(--s-6); box-shadow: inset 0 -3px 0 rgba(0,0,0,.05); }
.ways li::before { content: ""; position: absolute; left: var(--s-6); top: -18px; width: 16px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='22' viewBox='0 0 16 22'%3E%3Ccircle cx='8' cy='3' r='2.5' fill='%23C22B55'/%3E%3Cpath d='M8 5v9a4 4 0 0 0 8 0' fill='none' stroke='%23C22B55' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center top; }
.ways li::after { content: ""; position: absolute; left: calc(var(--s-6) + 5px); top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); }
.ways .ico { width: 28px; height: 28px; color: var(--crimson); margin-bottom: var(--s-4); }
.ways .ico svg { width: 28px; height: 28px; }
.ways h2 { font-size: var(--t-xl); }
.ways p { color: var(--slate); margin-top: var(--s-3); font-size: var(--t-md); }
.ways a, .ways .linkish { color: var(--crimson); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ways .linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; }
.ways a:hover, .ways .linkish:hover { color: var(--crimson-2); }
@media (min-width: 900px) {
  .ways { padding: var(--s-24) 0; }
  .ways ul { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 404: an empty rack, the one page where no key is out ---------- */
.notfound-hero .wrap { display: grid; gap: var(--s-12); align-items: center; }
.notfound-links { list-style: none; margin: var(--s-12) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2) var(--s-8); border-top: 1px solid var(--line); padding-top: var(--s-6); }
.notfound-links a { display: inline-block; padding: .5rem 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink); text-decoration: none; }
.notfound-links a:hover { color: var(--crimson); }
.notfound-rack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; background: var(--night); border: 1px solid var(--night-line); border-radius: 6px; padding: var(--s-4); }
.notfound-rack span { aspect-ratio: 1 / 1.35; background: var(--night-2); border-radius: 3px; position: relative; }
.notfound-rack span::before { content: ""; position: absolute; left: 50%; top: 24%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--slate-2); box-shadow: 0 0 0 1.5px #1a1a2e; }
@media (min-width: 40em) { .notfound-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56.25em) { .notfound-hero .wrap { grid-template-columns: 1.1fr .9fr; } .notfound-rack { max-width: 420px; justify-self: end; } }

/* Large browser text: cards and long addresses must fit the column */
.ways ul { grid-template-columns: minmax(0, 1fr); }
.ways li, .ways p, .ways a { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 40em) { .ways ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56.25em) { .ways ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
