/*
Theme Name: 食文化の起源
Theme URI: https://japanworld.media/
Author: 食文化の起源 編集部
Description: 料理史・食文化メディア「食文化の起源」のためのクラシックWordPressテーマ。
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: culinary-origins-jp
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
    --bg: #faf6ef;
    --surface: #ffffff;
    --surface-alt: #f3ece0;
    --line: #e6dccd;
    --text: #2a2420;
    --muted: #6b6058;
    --primary: #b3402a;
    --primary-dark: #8e3020;
    --primary-soft: #f6e3dc;
    --accent: #b88a3e;
    --ink: #1f2f3d;
    --ink-soft: #2c4052;
    --success: #2f6b3f;
    --error: #a3261b;

    --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(42, 36, 32, .06);
    --shadow: 0 1px 2px rgba(42, 36, 32, .05), 0 10px 30px rgba(42, 36, 32, .07);
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --section: clamp(48px, 7vw, 96px);
    --header-h: 72px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: .03em;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: anywhere;
}

body.menu-open {
    overflow: hidden;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: var(--primary);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6,
.card__title,
.category-card__name,
.post-nav__title {
    word-break: auto-phrase;
    text-wrap: balance;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    line-height: 1.4;
    color: var(--text);
    letter-spacing: .04em;
}

p, figure, blockquote {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    clip: auto;
    width: auto;
    height: auto;
    margin: 0;
    padding: 12px 16px;
    left: 12px;
    top: 12px;
    z-index: 1000;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
}

/* WordPress core helpers */
.alignleft { float: left; margin: .4em 1.5em 1em 0; }
.alignright { float: right; margin: .4em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption, .gallery-caption { max-width: 100%; }
.wp-caption-text { color: var(--muted); font-size: .85rem; }
.bypostauthor { display: block; }

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container--mid {
    max-width: calc(1080px + var(--gutter) * 2);
}

.container--narrow {
    max-width: calc(800px + var(--gutter) * 2);
}

.section {
    padding: var(--section) 0;
}

.section--tight {
    padding-top: clamp(32px, 4vw, 48px);
}

.section--alt {
    background: var(--surface-alt);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: clamp(24px, 3vw, 36px);
}

.section-head--center {
    justify-content: center;
    text-align: center;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
    font-weight: 700;
}

.section-title--sm {
    font-size: 1.4rem;
    margin: 56px 0 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
}

.eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: currentColor;
}

.eyebrow--light {
    color: #ffd9cc;
}

.link-arrow {
    flex-shrink: 0;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
}

.link-arrow:hover {
    text-decoration: underline;
}

.paper {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 48px);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Buttons, chips, forms
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 28px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn--ghost:hover {
    background: var(--primary);
    color: #fff;
}

.btn--dark {
    background: var(--ink);
    color: #fff;
}

.btn--dark:hover {
    background: #111c26;
    color: #fff;
}

.btn--sm {
    min-height: 40px;
    padding: 6px 20px;
    font-size: .9rem;
}

.btn--block {
    width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button-row--center {
    justify-content: center;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .2s, color .2s, background-color .2s;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.chips--filter {
    margin-bottom: 32px;
}

.tag {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
}

.input {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}

.input::placeholder {
    color: #9d928a;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.input--textarea {
    min-height: 160px;
    resize: vertical;
}

.field {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.field label {
    font-weight: 700;
    font-size: .92rem;
}

.field .required {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .72rem;
    vertical-align: 1px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 20px;
    font-size: .9rem;
    cursor: pointer;
}

.checkbox input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 5px;
    accent-color: var(--primary);
}

.checkbox--light a {
    color: #fff;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .92rem;
    font-weight: 500;
}

.notice--success {
    background: #e5f2e7;
    color: var(--success);
}

.notice--error {
    background: #fbe6e3;
    color: var(--error);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-form__input {
    width: 100%;
    height: 54px;
    padding: 0 60px 0 22px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
}

.search-form__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.search-form__button {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

.search-form__button:hover {
    background: var(--primary-dark);
}

.search-panel {
    max-width: 640px;
    margin: 0 auto 40px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.admin-bar .site-header {
    top: 32px;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

.brand:hover {
    color: var(--text);
}

.brand__mark {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.brand__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand__name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.brand__tagline {
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.primary-nav__list a {
    position: relative;
    display: block;
    padding: 8px 14px;
    color: var(--text);
    font-size: .93rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
    transition: background-color .2s, color .2s;
}

.primary-nav__list a:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.primary-nav__list .current-menu-item > a,
.primary-nav__list .current_page_item > a {
    color: var(--primary);
}

.primary-nav__list .current-menu-item > a::after,
.primary-nav__list .current_page_item > a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: currentColor;
}

.menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
}

.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    margin-left: -9px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s, background-color .25s;
}

.menu-toggle__bar {
    top: 50%;
    margin-top: -1px;
}

.menu-toggle__bar::before,
.menu-toggle__bar::after {
    content: "";
    left: 0;
    margin-left: 0;
}

.menu-toggle__bar::before { top: -6px; }
.menu-toggle__bar::after { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bar {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar::before {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar::after {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav {
    border-top: 1px solid var(--line);
    background: var(--bg);
    padding: 12px 0 24px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
}

.mobile-nav[hidden] {
    display: none;
}

.mobile-nav__list {
    list-style: none;
    margin-bottom: 16px;
}

.mobile-nav__list a {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}

.mobile-nav__list .current-menu-item > a,
.mobile-nav__list .current_page_item > a {
    color: var(--primary);
}

/* ==========================================================================
   Home
   ========================================================================== */
.hero {
    padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 6vw, 88px);
    background:
        radial-gradient(circle at 85% 10%, rgba(179, 64, 42, .08), transparent 45%),
        radial-gradient(circle at 5% 90%, rgba(184, 138, 62, .10), transparent 40%);
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
}

.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 1rem + 2.6vw, 3.4rem);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .05em;
}

.hero__lead {
    margin-top: 20px;
    max-width: 34em;
    color: var(--muted);
    font-size: clamp(1rem, .95rem + .2vw, 1.08rem);
}

.hero__search {
    max-width: 520px;
    margin: 28px 0 20px;
}

.hero__frame {
    position: relative;
    z-index: 0;
}

.hero__media img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero__frame::before {
    content: "";
    position: absolute;
    inset: 18px -18px -18px 18px;
    z-index: -1;
    border: 2px solid var(--accent);
    border-radius: 24px;
    opacity: .5;
}

.photo-credit {
    margin-top: 10px;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.5;
}

.photo-credit a {
    color: inherit;
}

.mission {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.mission__text p:not(.eyebrow) {
    margin-top: 16px;
    color: var(--muted);
}

.principles {
    display: grid;
    gap: 16px;
    list-style: none;
}

.principles--grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.principles__item {
    display: flex;
    gap: 16px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.principles--grid .principles__item {
    flex-direction: column;
}

.principles__icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-alt);
    font-size: 1.6rem;
}

.principles__item h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.principles__item p {
    color: var(--muted);
    font-size: .93rem;
}

/* ==========================================================================
   Cards & grids
   ========================================================================== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
}

.post-grid--spaced {
    margin-top: clamp(24px, 3vw, 32px);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card__media {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--surface-alt);
    overflow: hidden;
}

.card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.card:hover .card__media img {
    transform: scale(1.04);
}

.card__placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--surface-alt), var(--primary-soft));
}

.card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 22px 22px;
}

.card__cat {
    align-self: flex-start;
    position: relative;
    z-index: 2;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
}

.card__cat:hover {
    text-decoration: underline;
}

.card__title {
    font-family: var(--font-serif);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.55;
}

.card__title a {
    color: var(--text);
    text-decoration: none;
}

.card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.card:hover .card__title a {
    color: var(--primary-dark);
}

.card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.75;
}

.card__meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: auto;
    padding-top: 14px;
    color: var(--muted);
    font-size: .8rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-item + .meta-item::before {
    content: "";
    width: 3px;
    height: 3px;
    margin-right: 10px;
    border-radius: 50%;
    background: currentColor;
    opacity: .6;
}

.card--featured {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.card--featured .card__media {
    aspect-ratio: auto;
    min-height: 100%;
}

.card--featured .card__body {
    justify-content: center;
    padding: clamp(24px, 4vw, 48px);
}

.card--featured .card__title {
    font-size: clamp(1.35rem, 1rem + 1vw, 1.8rem);
    line-height: 1.5;
}

.card--featured .card__excerpt {
    -webkit-line-clamp: 4;
    font-size: .98rem;
}

.card--featured .card__meta {
    margin-top: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px 22px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: var(--text);
}

.category-card__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--surface-alt);
    font-size: 1.8rem;
}

.category-card__name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.category-card__desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.7;
}

.category-card__count {
    margin-top: auto;
    padding-top: 10px;
    color: var(--primary);
    font-size: .82rem;
    font-weight: 700;
}

.empty-state {
    max-width: 640px;
    margin: 0 auto 40px;
    padding: 48px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.empty-state h2 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    margin-top: 48px;
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pagination .page-numbers {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}

.pagination a.page-numbers:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-numbers.current {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ==========================================================================
   Page header & breadcrumbs
   ========================================================================== */
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    list-style: none;
    color: var(--muted);
    font-size: .8rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 8px;
    opacity: .6;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumbs [aria-current] {
    max-width: 32em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.page-hero {
    padding: 28px 0 clamp(36px, 5vw, 56px);
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
}

.page-hero__body {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: clamp(24px, 4vw, 40px);
}

.page-hero__icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 2.6rem;
}

.page-hero__title {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
    font-weight: 700;
}

.page-hero__lead {
    max-width: 44em;
    margin-top: 10px;
    color: var(--muted);
}

.page-hero__lead p {
    margin: 0;
}

.page-updated {
    margin-top: 16px;
    color: var(--muted);
    font-size: .82rem;
    text-align: right;
}

/* ==========================================================================
   Single article
   ========================================================================== */
.article-header {
    padding: 28px 0 0;
}

.article-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin-top: clamp(28px, 4vw, 44px);
}

.article-title {
    max-width: 30em;
    margin-top: 14px;
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.45;
}

.article-lead {
    max-width: 44em;
    margin-top: 16px;
    color: var(--muted);
    font-size: 1.05rem;
}

.article-meta {
    margin-top: 20px;
    padding-top: 0;
    font-size: .85rem;
}

.article-figure {
    margin-top: 32px;
}

.article-figure img {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: var(--radius);
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 56px;
    align-items: start;
    padding-top: 40px;
}

.article-layout--no-aside {
    grid-template-columns: minmax(0, 1fr);
    max-width: calc(800px + var(--gutter) * 2);
}

.article-main {
    min-width: 0;
}

.toc {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 20px 22px;
    font-size: .9rem;
}

.toc__title {
    font-weight: 700;
    margin-bottom: 10px;
}

.toc__list {
    list-style: none;
    counter-reset: toc;
    display: grid;
    gap: 8px;
}

.toc__list li {
    counter-increment: toc;
    display: flex;
    gap: 10px;
    line-height: 1.6;
}

.toc__list li::before {
    content: counter(toc, decimal-leading-zero);
    flex-shrink: 0;
    min-width: 1.6em;
    color: var(--primary);
    font-weight: 700;
    font-size: .8rem;
    padding-top: 2px;
}

.toc__list a {
    color: var(--text);
    text-decoration: none;
}

.toc__list a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.toc--sticky {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.toc--inline {
    display: none;
    margin-bottom: 32px;
}

.toc--inline summary {
    cursor: pointer;
    margin-bottom: 0;
}

.toc--inline[open] summary {
    margin-bottom: 12px;
}

/* Share & author */
.share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 48px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.share__label {
    font-weight: 700;
    font-size: .9rem;
}

.share__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.share__link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .85rem;
    text-decoration: none;
    cursor: pointer;
}

.share__link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.author-box {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.author-box .brand__mark {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
}

.author-box__name {
    font-weight: 700;
}

.author-box__text {
    margin-top: 4px;
    color: var(--muted);
    font-size: .9rem;
}

/* Post navigation */
.post-nav {
    margin-top: 48px;
}

.post-nav .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.post-nav .nav-next {
    grid-column: 2;
    text-align: right;
}

.post-nav a {
    display: block;
    height: 100%;
    padding: 18px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .2s;
}

.post-nav a:hover {
    border-color: var(--primary);
}

.post-nav__label {
    display: block;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
}

.post-nav__title {
    display: block;
    margin-top: 4px;
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.6;
}

.related {
    margin-top: var(--section);
}

.related .section-title {
    margin-bottom: 28px;
}

/* ==========================================================================
   Entry content typography
   ========================================================================== */
.entry-content {
    font-size: 1.05rem;
    line-height: 2;
}

.entry-content > * + * {
    margin-top: 1.4em;
}

.entry-content > :first-child {
    margin-top: 0;
}

.entry-content h2 {
    margin-top: 2.6em;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--line);
    font-family: var(--font-serif);
    font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem);
    font-weight: 700;
    line-height: 1.5;
    position: relative;
}

.entry-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 64px;
    height: 2px;
    background: var(--primary);
}

.entry-content h3 {
    margin-top: 2em;
    padding-left: 14px;
    border-left: 4px solid var(--primary);
    font-size: clamp(1.12rem, 1rem + .4vw, 1.3rem);
    font-weight: 700;
    line-height: 1.6;
}

.entry-content h4 {
    margin-top: 1.8em;
    font-size: 1.05rem;
    font-weight: 700;
}

.entry-content h2 + *,
.entry-content h3 + *,
.entry-content h4 + * {
    margin-top: .9em;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li + li {
    margin-top: .4em;
}

.entry-content li::marker {
    color: var(--primary);
}

.entry-content strong {
    font-weight: 700;
    background: linear-gradient(transparent 62%, rgba(184, 138, 62, .28) 62%);
}

.entry-content blockquote {
    padding: 20px 24px;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--surface-alt);
    color: var(--text);
}

.entry-content blockquote cite {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: .85rem;
    font-style: normal;
}

.entry-content figure {
    margin-left: 0;
    margin-right: 0;
}

.entry-content img {
    border-radius: var(--radius-sm);
}

.entry-content figcaption,
.entry-content .wp-element-caption {
    margin-top: 8px;
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    line-height: 1.7;
    background: var(--surface);
}

.entry-content .wp-block-table {
    overflow-x: auto;
}

.entry-content th,
.entry-content td {
    padding: 12px 14px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.entry-content thead th {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.entry-content tbody tr:nth-child(even) {
    background: #fcfaf6;
}

.entry-content hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2.5em 0;
}

.entry-content .point {
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.entry-content .point > :first-child {
    margin-top: 0;
}

.entry-content .point-title {
    font-weight: 700;
    color: var(--primary-dark);
}

.entry-content .sources {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.8;
}

.entry-content .sources h2 {
    font-size: 1.1rem;
}

.paper.entry-content > h2:first-child {
    margin-top: 0;
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments {
    margin-top: 56px;
    padding-bottom: 24px;
}

.comments__title,
.comment-reply-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.comment-list {
    list-style: none;
    margin-bottom: 32px;
}

.comment-list .children {
    list-style: none;
    padding-left: clamp(16px, 4vw, 40px);
}

.comment-body {
    margin-top: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-meta a,
.comment-metadata a {
    color: var(--muted);
    font-size: .8rem;
    text-decoration: none;
}

.comment-content {
    margin-top: 10px;
}

.comment-respond {
    padding: clamp(20px, 4vw, 36px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.comment-notes,
.logged-in-as {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 16px;
}

.comment-form p {
    margin: 0 0 16px;
}

.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: .9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.comment-form .comment-form-cookies-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.comment-form .comment-form-cookies-consent label {
    font-weight: 400;
    margin: 0;
}

.comment-form .comment-form-cookies-consent input {
    margin-top: 6px;
    accent-color: var(--primary);
}

.comment-form .form-submit {
    margin: 8px 0 0;
}

.required-field-message {
    display: block;
}

/* ==========================================================================
   About / Expertise / Contact
   ========================================================================== */
.about-intro .section-title {
    margin-bottom: 28px;
}

.about-intro__text {
    column-count: 2;
    column-gap: 48px;
    color: var(--muted);
}

.about-intro__text p {
    margin-bottom: 1.2em;
    break-inside: avoid;
}

.feature-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.feature-row--reverse .feature-row__text {
    order: 2;
}

.feature-row__text p:not(.eyebrow) {
    margin-top: 16px;
    color: var(--muted);
}

.feature-row__media img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--radius);
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.contact-info .entry-content {
    font-size: 1rem;
    margin-bottom: 32px;
}

.contact-list {
    display: grid;
    gap: 14px;
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.contact-list li > div {
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.contact-list__icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 1.3rem;
}

.contact-list__label {
    color: var(--muted);
    font-size: .8rem;
}

.contact-form__title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   404
   ========================================================================== */
.error-404 {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.error-404__code {
    font-family: var(--font-serif);
    font-size: clamp(4.5rem, 3rem + 8vw, 8rem);
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    opacity: .9;
}

.error-404__title {
    margin: 16px 0 12px;
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
}

.error-404 > p {
    color: var(--muted);
    margin-bottom: 28px;
}

.error-404 .button-row {
    margin-top: 0;
}

/* ==========================================================================
   Newsletter & footer
   ========================================================================== */
.newsletter {
    padding: var(--section) 0 0;
    position: relative;
    z-index: 1;
    margin-bottom: -72px;
}

.newsletter__box {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 32px 56px;
    align-items: center;
    padding: clamp(28px, 5vw, 56px);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 255, 255, .12), transparent 45%),
        var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
}

.newsletter__title {
    color: #fff;
    font-family: var(--font-serif);
    font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem);
    line-height: 1.5;
}

.newsletter__lead {
    margin-top: 10px;
    color: rgba(255, 255, 255, .85);
    font-size: .93rem;
}

.newsletter__row {
    display: flex;
    gap: 10px;
}

.newsletter__row .input {
    border-color: transparent;
    border-radius: 999px;
    padding-left: 22px;
}

.newsletter__row .btn {
    flex-shrink: 0;
}

.newsletter .checkbox {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .9);
}

.newsletter .notice {
    margin-bottom: 14px;
}

.site-footer {
    padding: calc(72px + 56px) 0 28px;
    background: var(--ink);
    color: rgba(255, 255, 255, .78);
    font-size: .9rem;
}

.site-footer a {
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.brand--footer {
    color: #fff;
}

.brand--footer:hover {
    color: #fff;
    text-decoration: none !important;
}

.footer-about__text {
    max-width: 30em;
    margin-top: 16px;
    line-height: 1.9;
}

.footer-col__title {
    margin-bottom: 14px;
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
}

.footer-links {
    display: grid;
    gap: 8px;
    list-style: none;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .8rem;
}

/* Cookie banner & back to top */
.cookie-banner {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 16px 20px;
    max-width: 640px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 40px rgba(42, 36, 32, .18);
    font-size: .85rem;
    line-height: 1.7;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner__actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background-color .2s;
}

.to-top:hover {
    background: var(--primary);
}

.to-top[hidden] {
    display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
    .article-layout {
        grid-template-columns: minmax(0, 1fr);
        max-width: calc(800px + var(--gutter) * 2);
    }

    .article-aside {
        display: none;
    }

    .toc--inline {
        display: block;
    }

    .footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    :root {
        --header-h: 64px;
    }

    .primary-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .hero__grid,
    .mission,
    .feature-row,
    .contact-layout,
    .newsletter__box {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero__media {
        max-width: 640px;
    }

    .feature-row--reverse .feature-row__text {
        order: 0;
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card--featured {
        grid-template-columns: minmax(0, 1fr);
    }

    .card--featured .card__media {
        aspect-ratio: 16 / 9;
    }

    .principles--grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-intro__text {
        column-count: 1;
    }
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .brand__tagline {
        display: none;
    }

    .brand__mark {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
    }

    .brand__name {
        font-size: 1.1rem;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .category-card {
        padding: 18px 16px 16px;
    }

    .category-card__icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .category-card__name {
        font-size: 1rem;
    }

    .category-card__desc {
        display: none;
    }

    .hero__frame::before {
        inset: 8px -6px -8px 6px;
    }

    .page-hero__body {
        gap: 16px;
    }

    .page-hero__icon {
        width: 64px;
        height: 64px;
        font-size: 1.9rem;
    }

    .entry-content {
        font-size: 1rem;
        line-height: 1.95;
    }

    .post-nav .nav-links {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-nav .nav-next {
        grid-column: auto;
    }

    .newsletter__row {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 32px 24px;
    }

    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner__actions .btn {
        flex: 1;
    }

    .to-top {
        right: 12px;
        bottom: 12px;
        width: 44px;
        height: 44px;
    }

    .author-box {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
