/* ============================================================================
   templates.css — page-template layouts (Foundation 08)
   Loads AFTER home.css. Only adds layouts specific to inner pages: breadcrumb,
   article + sticky sidebar, contact split, team grid, 404. All read tokens.
   ============================================================================ */

/* ---- compact page hero (inner pages) ----------------------------------- */
.page-hero { padding-block: clamp(var(--space-12), 7vw, var(--space-20)) clamp(var(--space-8), 4vw, var(--space-12)); }
.page-hero__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl)); line-height: 1.0; letter-spacing: -0.02em; color: var(--color-fg); margin: var(--space-5) 0 var(--space-5); max-width: 18ch; text-wrap: balance; }
[data-type="anton"] .page-hero__title, [data-type="archivo"] .page-hero__title { text-transform: uppercase; font-weight: 400; }
[data-type="dmserif"] .page-hero__title { font-weight: 400; }
.page-hero__lede { font-family: var(--font-body); font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--color-muted); max-width: 52ch; margin: 0; }

/* ---- breadcrumb --------------------------------------------------------- */
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); }
.crumb a { color: var(--color-muted); text-decoration: none; }
.crumb a:hover { color: var(--color-accent); }
.crumb span[aria-current] { color: var(--color-fg); }
.crumb__sep { opacity: .5; }

/* ---- article + sticky sidebar ------------------------------------------ */
.article { display: grid; grid-template-columns: 1fr; gap: clamp(var(--space-8), 5vw, var(--space-16)); align-items: start; }
@media (min-width: 920px) { .article { grid-template-columns: 1fr 320px; } }
.article__aside { display: flex; flex-direction: column; gap: var(--space-5); }
@media (min-width: 920px) { .article__aside { position: sticky; top: calc(72px + var(--space-6)); } }
.aside-card { background: var(--color-surface); border: var(--border-thin) solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); }
[data-shape="brutalist"] .aside-card { border-width: var(--border-default); }
.aside-card h3 { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-fg); margin: 0 0 var(--space-2); font-weight: 700; }
[data-type="dmserif"] .aside-card h3 { font-weight: 400; }
.aside-card p { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-muted); margin: 0 0 var(--space-4); line-height: var(--leading-normal); }
.aside-card .c-btn { width: 100%; justify-content: center; }
.aside-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.aside-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-fg); text-decoration: none; padding: var(--space-3) 0; border-bottom: var(--border-thin) solid var(--color-border); }
.aside-list a:last-child { border-bottom: 0; }
.aside-list a:hover { color: var(--color-accent); }
.aside-list a span { color: var(--color-muted); }

/* ---- contact split ------------------------------------------------------ */
.contact { display: grid; grid-template-columns: 1fr; gap: clamp(var(--space-8), 5vw, var(--space-16)); align-items: start; }
@media (min-width: 880px) { .contact { grid-template-columns: 1fr 1fr; } }
.contact__form { display: flex; flex-direction: column; gap: var(--space-5); }
.form-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 520px) { .form-row { grid-template-columns: 1fr 1fr; } }
.contact__detail { display: flex; flex-direction: column; gap: var(--space-6); }
.detail-item { display: flex; gap: var(--space-4); }
.detail-item__icon { flex: none; width: 42px; height: 42px; border-radius: var(--radius-md); display: grid; place-items: center; background: color-mix(in srgb, var(--color-accent) 16%, var(--color-bg)); color: var(--color-accent); }
.detail-item__icon svg { width: 20px; height: 20px; }
.detail-item h4 { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; color: var(--color-fg); margin: 0 0 var(--space-1); }
.detail-item p { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-muted); margin: 0; line-height: var(--leading-normal); }
.detail-item a { color: var(--color-accent); text-decoration: none; }
.detail-item a:hover { text-decoration: underline; }
.map-ph { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); border: var(--border-thin) solid var(--color-border); background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 14%, var(--color-surface)), var(--color-surface)); display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); }
[data-shape="brutalist"] .map-ph { border-width: var(--border-default); }

/* ---- team grid ---------------------------------------------------------- */
.team { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 560px) { .team { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .team { grid-template-columns: repeat(3, 1fr); } }
.member__photo { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(150deg, color-mix(in srgb, var(--color-accent) 24%, var(--color-surface)), var(--color-surface)); display: grid; place-items: center; margin-bottom: var(--space-4); border: var(--border-thin) solid var(--color-border); }
[data-shape="brutalist"] .member__photo { border-width: var(--border-default); }
.member__photo span { font-family: var(--font-display); font-size: var(--text-5xl); font-weight: 700; color: color-mix(in srgb, var(--color-accent) 70%, var(--color-fg)); }
[data-type="anton"] .member__photo span, [data-type="archivo"] .member__photo span { font-weight: 400; }
.member__name { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-fg); margin: 0 0 2px; font-weight: 700; }
[data-type="dmserif"] .member__name { font-weight: 400; }
.member__role { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--color-accent); margin: 0 0 var(--space-3); }
.member__bio { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-muted); margin: 0; line-height: var(--leading-normal); }

/* ---- timeline ----------------------------------------------------------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 92px 1fr; gap: var(--space-5); padding-bottom: var(--space-8); position: relative; }
.tl-item::before { content: ""; position: absolute; left: 99px; top: var(--space-2); bottom: 0; width: var(--border-default); background: var(--color-border); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-year { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--color-accent); position: relative; }
.tl-year::after { content: ""; position: absolute; right: -8px; top: 5px; width: 11px; height: 11px; border-radius: var(--radius-pill); background: var(--color-accent); border: 3px solid var(--color-bg); }
[data-shape="brutalist"] .tl-year::after { border-radius: 0; }
.tl-body h4 { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-fg); margin: 0 0 var(--space-1); font-weight: 700; line-height: var(--leading-snug); }
[data-type="dmserif"] .tl-body h4 { font-weight: 400; }
.tl-body p { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-muted); margin: 0; line-height: var(--leading-normal); max-width: 52ch; }

/* ---- 404 ---------------------------------------------------------------- */
.nf { min-height: 64vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--space-6); padding-block: var(--space-16); }
.nf__code { font-family: var(--font-display); font-size: clamp(5rem, 22vw, 12rem); line-height: 0.9; font-weight: 700; color: var(--color-fg); letter-spacing: -0.04em; }
[data-type="anton"] .nf__code, [data-type="archivo"] .nf__code { font-weight: 400; }
.nf__code em { color: var(--color-accent); font-style: normal; }
.nf__title { font-family: var(--font-display); font-size: var(--text-3xl); color: var(--color-fg); margin: 0; font-weight: 700; }
[data-type="dmserif"] .nf__title { font-weight: 400; }
.nf__lede { font-family: var(--font-body); font-size: var(--text-lg); color: var(--color-muted); max-width: 48ch; margin: 0; line-height: var(--leading-normal); }

/* a hairline section divider used between inner-page bands */
.rule-band { border: 0; border-top: var(--border-thin) solid var(--color-border); margin: 0; }

/* ---- inline validation + success state (form.js) ----------------------- */
.c-field.is-invalid .c-input, .c-field.is-invalid .c-textarea, .c-field.is-invalid .c-select { border-color: var(--color-danger); }
.field-error:empty { display: none; }
.form-success { background: color-mix(in srgb, var(--color-success) 12%, var(--color-bg)); border: var(--border-thin) solid color-mix(in srgb, var(--color-success) 34%, var(--color-border)); border-radius: var(--radius-lg); padding: clamp(var(--space-6), 5vw, var(--space-10)); text-align: center; outline: none; }
[data-shape="brutalist"] .form-success { border-width: var(--border-default); }
.form-success__icon { width: 56px; height: 56px; border-radius: var(--radius-pill); background: var(--color-success); color: #fff; display: grid; place-items: center; margin: 0 auto var(--space-4); }
.form-success__icon svg { width: 28px; height: 28px; }
.form-success h3 { font-family: var(--font-display); font-size: var(--text-2xl); color: var(--color-fg); margin: 0 0 var(--space-2); }
[data-type="dmserif"] .form-success h3 { font-weight: 400; }
.form-success p { font-family: var(--font-body); font-size: var(--text-base); color: var(--color-muted); margin: 0 auto var(--space-5); max-width: 46ch; line-height: var(--leading-normal); }

/* page-template note ribbon (so reviewers know what they're looking at) */
.tpl-ribbon { background: var(--color-fg); color: var(--color-bg); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; text-align: center; padding: var(--space-2); }
.tpl-ribbon b { color: var(--color-accent); }
.tpl-ribbon a { color: inherit; }

/* ---- comparison table (pricing page) ----------------------------------- */
.cmp-table { width: 100%; overflow-x: auto; border: var(--border-thin) solid var(--color-border); border-radius: var(--radius-lg); }
[data-shape="brutalist"] .cmp-table { border-width: var(--border-default); }
.cmp-table table { width: 100%; border-collapse: collapse; min-width: 560px; }
.cmp-table th, .cmp-table td { text-align: left; padding: var(--space-4) var(--space-5); border-bottom: var(--border-thin) solid var(--color-border); font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-fg); }
.cmp-table thead th { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted); background: var(--color-surface); vertical-align: bottom; }
.cmp-table thead th.is-feat { color: var(--color-accent); }
.cmp-table tbody th { font-weight: 600; color: var(--color-fg); }
.cmp-table td.is-feat { background: color-mix(in srgb, var(--color-accent) 8%, var(--color-bg)); }
.cmp-table tr:last-child td, .cmp-table tr:last-child th { border-bottom: 0; }
.cmp-table .tick { color: var(--color-accent); }
.cmp-table .dash { display: inline-block; width: 16px; height: 2px; background: var(--color-muted); opacity: .45; vertical-align: middle; border-radius: 1px; }
.cmp-table .cell-note { display: block; color: var(--color-muted); font-size: var(--text-xs); margin-top: 2px; }
