@font-face {
    font-family: "Source Sans 3";
    src: url("../../template/001/assets/fonts/guide/source-sans-3.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 200 900;
}

@font-face {
    font-family: Sora;
    src: url("../../template/001/assets/fonts/guide/sora.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 100 900;
}

.numbered-template {
    --ink: #1a3047;
    --muted: #516579;
    --accent: #1261a4;
    --surface: #edf5fc;
    --line: #d3e0eb;
    --paper: #fff;
    --body: "Source Sans 3", system-ui, sans-serif;
    --display: Sora, system-ui, sans-serif;
    --gutter: clamp(1rem, 4vw, 4.5rem);
    --section-space: clamp(2rem, 5vw, 4.5rem);
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.52 var(--body);
    overflow-wrap: anywhere;
}

.theme-003 {
    --ink: #242427;
    --muted: #625c5b;
    --accent: #ae3027;
    --surface: #f9f0eb;
    --line: #e7dcd5;
    --display: var(--body);
}

.theme-004 {
    --ink: #193c43;
    --muted: #4c6468;
    --accent: #972a55;
    --surface: #edf7f7;
    --line: #cfdfdf;
    --display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; }
a { color: inherit; text-underline-offset: .19em; }
a:hover { color: var(--accent); }
img, video { max-inline-size: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.frame { inline-size: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link {
    position: fixed;
    inset: .75rem auto auto .75rem;
    z-index: 5;
    padding: .55rem .9rem;
    color: var(--ink);
    background: var(--paper);
}

.site-masthead { border-block-start: .25rem solid var(--accent); }
.masthead-inner {
    display: flex;
    align-items: center;
    gap: clamp(.65rem, 2vw, 1.5rem);
    min-block-size: 5.5rem;
    padding-block: .8rem;
}
.site-brand {
    color: inherit;
    font: 730 clamp(1.35rem, 3vw, 2.2rem)/1.08 var(--display);
    letter-spacing: -.04em;
    text-decoration: none;
}
.masthead-inner > .site-brand { margin-inline-end: auto; }
.site-brand img {
    display: block;
    inline-size: clamp(7rem, 19vw, 11.25rem);
    block-size: 3rem;
    object-fit: contain;
    object-position: left center;
}
[dir="rtl"] .site-brand img { object-position: right center; }
.theme-003 .site-masthead { background: #242427; color: #fff; border-color: #ce574c; }
.theme-004 .site-masthead { background: #125761; color: #fff; border-color: #3d8387; }
:is(.theme-003, .theme-004) .site-masthead .site-brand:hover { color: #fff; text-decoration: underline; }
:is(.theme-003, .theme-004) .site-brand img {
    padding: .3rem .5rem;
    border-radius: .2rem;
    background: #fff;
}

.search-form { display: flex; align-items: stretch; color: var(--ink); }
.header-search { inline-size: min(100%, 21rem); }
.search-form input {
    min-inline-size: 0;
    inline-size: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-inline-end: 0;
    border-start-start-radius: .28rem;
    border-end-start-radius: .28rem;
    color: inherit;
    background: var(--paper);
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
    flex: 0 0 auto;
    min-block-size: 2.65rem;
    padding: .48rem .8rem;
    border: 1px solid var(--accent);
    border-start-end-radius: .28rem;
    border-end-end-radius: .28rem;
    background: var(--accent);
    color: #fff;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
}
.search-form input:focus-visible { outline-offset: -3px; }
.search-form button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.language-picker { position: relative; }
.language-picker summary { cursor: pointer; padding: .5rem .15rem; font-weight: 650; }
.language-picker ul {
    position: absolute;
    inset-inline-end: 0;
    z-index: 2;
    min-inline-size: 9rem;
    max-block-size: 15rem;
    overflow-y: auto;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    padding: .25rem;
    margin: 0;
    list-style: none;
}
.language-picker a { display: block; padding: .4rem .6rem; text-decoration: none; }
.language-picker a:hover { background: var(--surface); }

.navigation-bar { border-block: 1px solid var(--line); }
.theme-002 .navigation-bar { background: var(--surface); }
.site-navigation { display: flex; flex-wrap: wrap; gap: 0 clamp(1.15rem, 2.6vw, 2.1rem); }
.site-navigation a {
    display: flex;
    align-items: center;
    min-block-size: 2.85rem;
    border-block-end: 2px solid transparent;
    font-weight: 660;
    text-decoration: none;
}
.site-navigation a[aria-current] { color: var(--accent); border-color: currentColor; }
.navigation-toggle {
    min-block-size: 2.75rem;
    padding: .5rem 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}
.navigation-toggle::before {
    content: "";
    display: inline-block;
    inline-size: .85rem;
    block-size: .65rem;
    margin-inline-end: .45rem;
    border-block: 2px solid;
    background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

h1 {
    font-size: clamp(2.15rem, 4.8vw, 4.25rem);
    font-weight: 750;
    letter-spacing: -.045em;
    text-wrap: balance;
}
.story { min-inline-size: 0; }
.story-copy { display: grid; align-content: start; justify-items: start; gap: .36rem; }
.story-title { font-size: clamp(1.12rem, 1.7vw, 1.42rem); letter-spacing: -.023em; }
.story-title a { text-decoration: none; }
.story-title a:hover { text-decoration: underline; }
.story-category { color: var(--accent); font-weight: 700; font-size: .92rem; text-decoration: none; }
.story-category:hover { text-decoration: underline; }
.story-summary { max-inline-size: 62ch; color: var(--muted); }
.story-meta { display: flex; flex-wrap: wrap; gap: .15rem .75rem; color: var(--muted); font-size: .9rem; }
.story-image { display: block; background: var(--surface); }
.story-image img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 8 / 5; object-fit: cover; }

.feature-section { padding-block: clamp(1.25rem, 4.1vw, 3.6rem); }
.feature-layout { display: grid; gap: clamp(1.15rem, 3vw, 2.6rem); }
.feature-lead h1 { font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1.09; letter-spacing: -.048em; }
.feature-lead .story-copy { gap: .7rem; }
.feature-lead .story-summary { font-size: clamp(1.1rem, 1.6vw, 1.27rem); line-height: 1.4; }

.theme-002 .feature-lead .story { background: var(--surface); border-radius: .65rem; overflow: hidden; }
.theme-002 .feature-lead .has-cover { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); }
.theme-002 .feature-lead .story-copy { align-self: center; padding: clamp(1.25rem, 4vw, 3rem); }
.theme-002 .feature-lead img { block-size: 100%; aspect-ratio: 16 / 10; }

.theme-003 .feature-section { border-block-end: 1px solid var(--line); }
.theme-003 .feature-layout:has(.feature-secondary) { grid-template-columns: minmax(0, 1.95fr) minmax(0, 1fr); }
.theme-003 .feature-lead .story { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 1.1rem; }
.theme-003 .feature-lead .story-image img { aspect-ratio: 2 / 1; }
.theme-003 .feature-lead h1 { line-height: 1; letter-spacing: -.033em; }
.theme-003 .feature-secondary { align-self: start; border-block-start: .24rem solid var(--accent); }
.theme-003 .feature-secondary .story { padding-block: 1rem; border-block-end: 1px solid var(--line); }
.theme-003 .feature-secondary .has-cover {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(4.4rem, 30%);
    align-items: center;
    gap: .95rem;
}
.theme-003 .feature-secondary .story-image { grid-column: 2; grid-row: 1; }
.theme-003 .feature-secondary .story-copy { grid-column: 1; grid-row: 1; }
.theme-003 .feature-secondary img { aspect-ratio: 1; }
.theme-003 .feature-secondary .story-title { font-size: clamp(1.2rem, 2vw, 1.62rem); }

.theme-004 .feature-section { background: var(--surface); }
.theme-004 .feature-layout:has(.feature-secondary) { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.theme-004 .feature-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-content: start; }
.theme-004 .feature-section .story { background: var(--paper); border-block-end: .18rem solid #b96e85; }
.theme-004 .feature-section .story-copy { padding: clamp(.9rem, 2vw, 1.55rem); }
.theme-004 .feature-lead img { aspect-ratio: 2 / 1; }
.theme-004 .feature-secondary img { aspect-ratio: 4 / 5; }
.theme-004 .story-title { letter-spacing: -.025em; }
.theme-004 .feature-secondary .story-title { font-size: clamp(1.2rem, 2vw, 1.55rem); }

.content-section { display: grid; align-items: start; gap: clamp(1.5rem, 4vw, 3.25rem); padding-block: var(--section-space); }
.content-section.has-sidebar:has(> :first-child + .popular) { grid-template-columns: minmax(0, 1fr) minmax(13rem, 25%); }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    margin-block-end: 1.25rem;
    padding-block-end: .7rem;
    border-block-end: 1px solid var(--line);
}
.section-heading h2, .popular h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); letter-spacing: -.035em; }
.section-heading > a { color: var(--accent); font-weight: 650; }
.story-list, .related-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.55rem clamp(.85rem, 2vw, 1.5rem); }
.story-list .story, .related-list .story { border-block-end: 1px solid var(--line); padding-block-end: 1rem; }
.story-list .story-image, .related-list .story-image { margin-block-end: .7rem; }
.theme-002 :is(.story-list, .related-list) .story-image { border-radius: .3rem; overflow: hidden; }
.theme-002 .archive-results .story-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.theme-003 .story-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.theme-003 .story-list .story { padding-block: .95rem; }
.theme-003 .story-list .has-cover { display: grid; grid-template-columns: minmax(0, 25%) minmax(0, 1fr); gap: 1.05rem; }
.theme-003 .story-list .story-image { align-self: start; margin: 0; }
.theme-003 .story-list .story-title { font-size: clamp(1.35rem, 2.25vw, 1.9rem); }
.theme-003 .section-heading { border-block-end: 2px solid var(--ink); }

.theme-004 .story-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.theme-004 .story-list img { aspect-ratio: 5 / 4; }
.theme-004 .story-list .story-title { font-size: clamp(1.2rem, 1.85vw, 1.55rem); }

.popular { background: var(--surface); border-block-start: 3px solid var(--accent); padding: clamp(.85rem, 2vw, 1.35rem); }
.popular ol { margin-block: .65rem 0; padding-inline-start: 1.45rem; }
.popular li { padding: .6rem .2rem; font-weight: 660; line-height: 1.35; }
.popular li + li { border-block-start: 1px solid var(--line); }
.popular li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }
.popular a { text-decoration: none; }
.popular a:hover { text-decoration: underline; }

.listing-header { background: var(--surface); padding-block: clamp(1.55rem, 4vw, 3.3rem); }
.listing-header h1 { margin-block: .45rem .35rem; }
.listing-header p, .empty-state, .empty-home p { color: var(--muted); }
.listing-search { max-inline-size: 34rem; margin-block-start: 1rem; }
.archive-results { min-inline-size: 0; min-block-size: 11rem; }
.empty-state { margin-block-end: .6rem; }
.empty-home, .missing-page { padding-block: var(--section-space); min-block-size: 45vh; }
.error-code { color: var(--accent); font-size: 1.3rem; font-weight: 700; }
.error-actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-block-start: .8rem; }

.pagination ul { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: 1.8rem 0; padding: 0; list-style: none; }
.pagination :is(a, span) {
    display: grid;
    min-inline-size: 2.65rem;
    min-block-size: 2.65rem;
    place-items: center;
    padding-inline: .55rem;
    border: 1px solid var(--line);
    border-radius: .28rem;
    text-decoration: none;
    font-weight: 650;
}
.pagination a:hover { border-color: var(--accent); }
.pagination [aria-current] { color: #fff; background: var(--accent); border-color: var(--accent); }

.article-page { padding-block: 1.125rem var(--section-space); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .25rem .6rem; color: var(--muted); font-size: .94rem; }
.article-header { max-inline-size: 63rem; padding-block: clamp(1rem, 3.3vw, 2.65rem) 1.4rem; }
.article-header .story-meta { margin-block-start: .65rem; }
.article-summary { max-inline-size: 58ch; margin-block-start: .75rem; color: var(--muted); font-size: clamp(1.16rem, 2vw, 1.4rem); }
.article-layout { display: grid; align-items: start; gap: clamp(1rem, 4vw, 3rem); }
.article-layout.has-sidebar { grid-template-columns: minmax(0, 1fr) minmax(13rem, 25%); }
.article-sidebar { display: grid; gap: 1.25rem; grid-column: 2; grid-row: 1; }
.article-main { min-inline-size: 0; grid-column: 1; grid-row: 1; }
.article-contents { background: var(--surface); padding: 1rem 1.15rem; }
.article-contents h2 { font-size: 1.2rem; }
.article-contents ol { margin-block: .6rem 0; padding-inline-start: 1.25rem; }
.article-contents li + li { margin-block-start: .4rem; }

.rich-text { max-inline-size: 70ch; font-size: clamp(1.08rem, 1.45vw, 1.2rem); line-height: 1.72; }
.rich-text :is(h2, h3, h4) { margin-block: 1.4em .5em; scroll-margin-block-start: 1rem; }
.rich-text h2 { font-size: 1.55em; }
.rich-text h3 { font-size: 1.25em; }
.rich-text :is(p, ul, ol, dl, blockquote, figure, pre, table) { margin-block: .7em 1em; }
.rich-text > :first-child { margin-block-start: 0; }
.rich-text a { color: var(--accent); }
.rich-text img { max-inline-size: 100% !important; block-size: auto !important; }
.rich-text :is(video, iframe) { max-inline-size: 100%; }
.rich-text :is(pre, table) { display: block; max-inline-size: 100%; overflow: auto; }
.rich-text pre { padding: .75rem; background: var(--surface); }
.rich-text blockquote { margin-inline: 0; padding-inline-start: 1rem; border-inline-start: 3px solid var(--accent); }
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.article-tags a { display: block; padding: .35rem .6rem; border-radius: .2rem; background: var(--surface); }
.related { margin-block-start: clamp(2rem, 5vw, 3.5rem); }

.site-footer { background: var(--surface); border-block-start: 1px solid var(--line); }
.footer-inner { display: flex; align-items: baseline; flex-wrap: wrap; gap: .65rem 1.45rem; padding-block: 1.4rem; }
.footer-inner > .site-brand { font-size: clamp(1.2rem, 2.5vw, 1.55rem); margin-inline-end: auto; }
.footer-inner > p { color: var(--muted); }

@media (max-width: 900px) {
    .theme-004 .story-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .theme-004 .feature-layout:has(.feature-secondary) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

@media (max-width: 680px) {
    .masthead-inner { flex-wrap: wrap; gap: .62rem 1rem; min-block-size: 0; }
    .header-search { inline-size: 100%; }
    .site-brand img { block-size: 2.5rem; }
    .navigation-toggle:not([hidden]) + .site-navigation { border-block-start: 1px solid var(--line); }
    .site-navigation a { min-block-size: 2.65rem; }
    .theme-002 .feature-lead .has-cover,
    .theme-003 .feature-layout:has(.feature-secondary),
    .theme-004 .feature-layout:has(.feature-secondary),
    .content-section.has-sidebar:has(> :first-child + .popular),
    .article-layout.has-sidebar { grid-template-columns: minmax(0, 1fr); }
    .theme-002 .feature-lead img { block-size: auto; }
    .theme-003 .feature-secondary .story { padding-block: .7rem; }
    .theme-003 .feature-lead .story-image img { aspect-ratio: 8 / 5; }
    .theme-004 .feature-secondary img { aspect-ratio: 5 / 4; }
    .story-list, .related-list, .theme-004 .story-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-sidebar { display: contents; }
    .article-main { grid-area: auto; order: 1; }
    .article-popular { order: 2; }
}

@media (max-width: 355px) {
    .story-list, .related-list, .theme-002 .archive-results .story-list, .theme-004 .story-list { grid-template-columns: minmax(0, 1fr); }
}
