/* AMS: theme layer on top of the AMS foundation. CSS only. */
:root{ --ams-ui: var(--wp--custom--font-ui, system-ui, sans-serif); --ams-h-weight: var(--wp--custom--heading-weight, 600); }
.ams-ui, .ams-eyebrow, .ams-byline, .ams-meta, .wp-block-post-terms, .wp-block-post-date, .wp-block-post-author-name { font-family: var(--ams-ui); }
.ams-eyebrow a, .ams-eyebrow { color: var(--ams-accent-ink); font-size: var(--wp--preset--font-size--small); font-weight: 600; text-decoration: none; }
.ams-byline { color: var(--ams-ink-soft); font-size: var(--wp--preset--font-size--small); gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30); }
.ams-byline a { color: inherit; }
.is-style-deck, .ams-deck { font-size: var(--wp--preset--font-size--medium); color: var(--ams-ink-soft); line-height: 1.45; }

/* Header built for large structures: topics menu wraps, never hides items on desktop. */
.ams-header { border-bottom: 1px solid var(--ams-line); }
.ams-header .wp-block-navigation { font-family: var(--ams-ui); font-size: var(--wp--preset--font-size--small); }
.ams-header .wp-block-navigation__container { flex-wrap: wrap; row-gap: var(--wp--preset--spacing--10); }
.wp-block-navigation__responsive-container.is-menu-open { padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: var(--wp--preset--font-size--large); padding-block: .4em; }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; }

/* Pillar at a glance */
.ams-facts { border-block: 1px solid var(--ams-line); font-family: var(--ams-ui); }
.ams-facts > * + * { border-left: 1px solid var(--ams-line); }
.ams-facts strong { display: block; font-family: var(--wp--custom--font-display); font-size: var(--wp--preset--font-size--x-large); line-height: 1.1; }

/* Visual index: "In this guide" */
.ams-index .wp-block-post-template { counter-reset: ams-ch; display: grid; gap: var(--wp--preset--spacing--20); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.ams-index .wp-block-post { counter-increment: ams-ch; display: grid; grid-template-columns: auto 1fr; gap: var(--wp--preset--spacing--20); padding: var(--wp--preset--spacing--30); border: 1px solid var(--ams-line); border-radius: var(--wp--custom--radius--base); }
.ams-index .wp-block-post::before { content: counter(ams-ch, decimal-leading-zero); font-family: var(--ams-ui); font-size: var(--wp--preset--font-size--small); color: var(--ams-accent-ink); font-weight: 600; }
.ams-index .wp-block-post:hover { border-color: var(--ams-accent); }
.ams-index .wp-block-post-title { font-size: var(--wp--preset--font-size--base); margin: 0; }
.ams-index .wp-block-post-title a { color: var(--ams-ink); text-decoration: none; }

/* Supporting cards adapt to their column, not the screen */
.ams-cards .wp-block-post { container-type: inline-size; }
.ams-card { border: 1px solid var(--ams-line); border-radius: calc(var(--wp--custom--radius--base) * 2); overflow: hidden; height: 100%; }
.ams-card .wp-block-post-featured-image { margin: 0; aspect-ratio: 16 / 9; background: var(--ams-accent-soft); }
.ams-card .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.ams-card .wp-block-post-title { font-size: var(--wp--preset--font-size--medium); overflow-wrap: anywhere; hyphens: auto; }
.ams-card .wp-block-post-title a { color: var(--ams-ink); text-decoration: none; }
.ams-card:hover .wp-block-post-title a { color: var(--ams-accent-ink); }
@container (min-width: 36rem) { .ams-card { display: grid; grid-template-columns: 38% 1fr; } .ams-card .wp-block-post-featured-image { aspect-ratio: auto; height: 100%; } }

/* Block style variations */
.wp-block-group.is-style-takeaway { background: var(--ams-accent-soft); border-radius: calc(var(--wp--custom--radius--base) * 2); padding: var(--wp--preset--spacing--40); }
.wp-block-group.is-style-takeaway > :first-child { font-family: var(--ams-ui); font-size: var(--wp--preset--font-size--small); color: var(--ams-accent-ink); font-weight: 600; margin: 0; }
.wp-block-group.is-style-definition { border-left: 3px solid var(--ams-accent); padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--40); }
.wp-block-group.is-style-panel { border: 1px solid var(--ams-line); border-radius: calc(var(--wp--custom--radius--base) * 2); padding: var(--wp--preset--spacing--40); }
.wp-block-quote.is-style-editorial { border: 0; padding: 0; font-family: var(--wp--custom--font-display); font-size: var(--wp--preset--font-size--x-large); line-height: 1.3; }
.wp-block-quote.is-style-evidence { border-left: 3px solid var(--ams-accent); background: var(--ams-surface-2); padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40); }
.wp-block-quote.is-style-key-point { border: 1px solid var(--ams-accent); border-radius: var(--wp--custom--radius--base); padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40); font-weight: 600; }
.wp-block-quote cite { display: block; font-family: var(--ams-ui); font-size: var(--wp--preset--font-size--small); font-style: normal; color: var(--ams-ink-soft); margin-top: var(--wp--preset--spacing--20); }
.wp-block-image.is-style-document img { border: 1px solid var(--ams-line); box-shadow: var(--wp--preset--shadow--soft); }
.wp-block-image.is-style-data { background: var(--ams-surface-2); padding: var(--wp--preset--spacing--30); border-radius: var(--wp--custom--radius--base); }
.wp-block-image.is-style-wide-frame img { aspect-ratio: 21 / 9; object-fit: cover; width: 100%; }
.wp-block-table { font-family: var(--ams-ui); font-size: var(--wp--preset--font-size--small); }
.wp-block-table table { border-collapse: collapse; }
.wp-block-table th, .wp-block-table td { border: 0; border-bottom: 1px solid var(--ams-line); padding: .7em 1em; text-align: left; }
.wp-block-table.is-style-data td { font-variant-numeric: tabular-nums; }
.wp-block-table.is-style-data tbody tr:nth-child(even) { background: var(--ams-surface-2); }
.wp-block-table.is-style-comparison td:nth-child(3), .wp-block-table.is-style-comparison th:nth-child(3) { background: var(--ams-accent-soft); }

/* Numbers and stats */
.ams-number { font-family: var(--wp--custom--font-display); font-size: var(--wp--preset--font-size--display); line-height: 1; color: var(--ams-accent-ink); font-weight: var(--ams-h-weight); }

/* Timeline */
.ams-timeline > .wp-block-group { border-left: 2px solid var(--ams-line); padding-left: var(--wp--preset--spacing--40); position: relative; }
.ams-timeline > .wp-block-group::before { content: ""; position: absolute; left: -7px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: var(--ams-accent); }

/* To the pillar */
.ams-to-pillar { padding: var(--wp--preset--spacing--50); background: var(--ams-ink); color: var(--ams-surface); border-radius: calc(var(--wp--custom--radius--base) * 2); }
.ams-to-pillar a { color: var(--ams-surface); }

/* Author */
.ams-author-card { border: 1px solid var(--ams-line); border-radius: calc(var(--wp--custom--radius--base) * 2); }
.wp-block-post-author-biography:empty { display: none; }


/* Pagination, search, footer */
.wp-block-query-pagination { font-family: var(--ams-ui); }
.wp-block-search__input { min-height: 44px; }
.ams-footer { border-top: 1px solid var(--ams-line); color: var(--ams-ink-soft); font-family: var(--ams-ui); font-size: var(--wp--preset--font-size--small); }
.ams-credit a { color: inherit; }
