/* HŌJA – thème Ghost
   Palette inspirée du cadran de la Grand Seiko Snowflake :
   blanc neige, gris titane, bleu de l'aiguille des secondes. */

:root {
    --accent: #1D4E9E;
    --bg: #FAFAF9;
    --bg-tint: #F1F3F4;
    --bg-soft: #EEF0F2;
    --img: #ECEEF0;
    --ink: #1E2124;
    --ink-2: #42474D;
    --muted: #5B6168;
    --line: #E1E4E7;
    --line-2: #DCE0E3;
    --field: #B9BEC4;
    --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
    --sans: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-heading: var(--gh-font-heading, var(--serif));
    --font-body: var(--gh-font-body, var(--sans));
    --container: 1200px;
    --text: 680px;
    --gutter: 24px;
    --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 22px; }
.skip-link:focus { left: 16px; color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--text { max-width: calc(var(--text) + 2 * var(--gutter)); }
.container--text-wide { max-width: calc(860px + 2 * var(--gutter)); }

/* ---------- Éléments communs ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.eyebrow--muted { color: var(--muted); }
.lead { font-size: 19px; line-height: 1.65; color: var(--ink-2); max-width: 34em; }
.meta { font-size: 14px; color: var(--muted); }
.link-underline { font-size: 15px; font-weight: 500; border-bottom: 1px solid currentColor; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; padding: 0 20px; border-radius: 22px; border: 0;
    font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.button--lg { min-height: 50px; padding: 0 26px; border-radius: 25px; font-size: 16px; }
.button--accent { background: var(--accent); color: #fff; }
.button--accent:hover { color: #fff; filter: brightness(1.12); }
.button--dark { background: var(--ink); color: var(--bg); }
.button--dark:hover { color: var(--bg); background: #33373B; }
.button--outline { border: 1px solid var(--ink); background: transparent; color: var(--ink); }

.icon-button {
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); cursor: pointer;
}
.icon-button:hover { color: var(--accent); }

.chip {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
    border: 1px solid var(--line-2); border-radius: 20px; background: transparent;
    font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; min-height: 96px; }
.site-logo img { height: 64px; width: auto; }
.site-nav { display: flex; align-items: center; }
.site-nav .nav { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; margin: 0; padding: 0; font-size: 15px; font-weight: 500; }
.site-nav .nav-current a { color: var(--accent); }
.site-nav__cta { display: none; }
.site-header__actions { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; }
.menu-toggle__close { display: none; }

.reading-progress { height: 2px; background: var(--line); }
.reading-progress span { display: block; height: 2px; width: 0; background: var(--accent); }

/* ---------- Accueil ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 48px; padding-top: 64px; padding-bottom: 72px; }
.hero__text { flex: 1 1 420px; min-width: 0; display: flex; gap: 32px; }
.hero__vertical { writing-mode: vertical-rl; font-family: var(--serif); font-size: 22px; letter-spacing: .3em; color: var(--accent); }
.hero__content { display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.hero__title { font-size: clamp(32px, 4.4vw, 60px); line-height: 1.12; letter-spacing: -.01em; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.hero__media { flex: 1 1 460px; min-height: 460px; border-radius: var(--radius); overflow: hidden; background: var(--img); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

.section { padding: 72px 0; }
.section--bordered { border-top: 1px solid var(--line); }
.section--tint { background: var(--bg-tint); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 36px; }
.section__title { font-size: 34px; }
.section--tint .section__title, .section > .container > .section__title { margin-bottom: 36px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 48px 32px; }
.post-card { display: flex; flex-direction: column; gap: 14px; }
.post-card__media { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--img); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__body { display: flex; flex-direction: column; gap: 10px; }
.post-card__title { font-size: 23px; line-height: 1.3; }
.post-card__meta { font-size: 14px; color: var(--muted); }

.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.topic { display: flex; flex-direction: column; gap: 12px; padding: 32px 28px; background: var(--bg); min-height: 220px; }
.topic__kanji { font-family: var(--serif); font-size: 30px; color: var(--accent); }
.topic__name { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.topic__desc { font-size: 15px; color: var(--ink-2); }
.topic__count { margin-top: auto; font-size: 13px; color: var(--muted); }

.start { display: flex; flex-wrap: wrap; gap: 48px; }
.start__intro { flex: 1 1 320px; min-width: 0; }
.start__intro .section__title { margin: 12px 0 16px; }
.start__intro .lead { font-size: 17px; max-width: 26em; }
.start__list { flex: 2 1 520px; min-width: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.start__list li { border-bottom: 1px solid var(--line); }
.start__list a { display: flex; align-items: baseline; gap: 28px; padding: 26px 0; }
.start__num { font-family: var(--serif); font-size: 20px; color: var(--accent); }
.start__title { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.35; }

/* ---------- Newsletter ---------- */
.newsletter { background: var(--bg-soft); }
.newsletter__inner { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: space-between; padding-top: 80px; padding-bottom: 80px; }
.newsletter__text { flex: 1 1 380px; min-width: 0; }
.newsletter__text h2 { font-size: 38px; line-height: 1.2; margin-bottom: 12px; }
.newsletter__text p { font-size: 17px; color: var(--muted); }
.newsletter__form { flex: 1 1 420px; min-width: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.newsletter__field { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.newsletter__field label { font-size: 14px; color: var(--muted); }
.newsletter__field input { height: 50px; padding: 0 18px; border-radius: 25px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.newsletter__loading, .newsletter__msg { display: none; }
.newsletter__msg { flex-basis: 100%; font-size: 15px; }
.newsletter__msg--error { color: #A3271F; }
.newsletter__form.loading .newsletter__label { display: none; }
.newsletter__form.loading .newsletter__loading { display: inline; }
.newsletter__form.success .newsletter__msg--success,
.newsletter__form.error .newsletter__msg--error { display: block; }
.newsletter__form.success .newsletter__field,
.newsletter__form.success button { display: none; }

/* ---------- Pages de liste ---------- */
.archive-head { padding-top: 72px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 16px; }
.archive-head__kanji { font-family: var(--serif); font-size: 40px; color: var(--accent); }
.archive-head__title { font-size: clamp(36px, 4.4vw, 56px); line-height: 1.12; }
.archive-head__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 64px; }

/* ---------- Article ----------
   Mise en page : bloc de 1040 px centré ; texte aligné à gauche dans une colonne
   de lecture de 680 px (65-75 caractères), sommaire collant à droite sur grand écran. */
.article__layout { max-width: calc(1040px + 2 * var(--gutter)); margin: 0 auto; padding: 56px var(--gutter) 0; }
.article__layout--narrow { max-width: calc(var(--text) + 2 * var(--gutter)); }
.article__head { max-width: 820px; display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.article__title { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.article__excerpt { font-family: var(--font-heading); font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 40em; }
.article__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; color: var(--muted); }
.article__meta a { border-bottom: 1px solid var(--line-2); }
.article__image { margin: 0 0 48px; }
.article__image img { width: 100%; aspect-ratio: 16 / 9; max-height: 520px; object-fit: cover; border-radius: var(--radius); background: var(--img); }
.article__image figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

.article__body { display: grid; grid-template-columns: minmax(0, var(--text)) 240px; gap: 80px; align-items: start; }
.article__main { min-width: 0; }
.article__aside { position: sticky; top: 120px; }
.aside__sticky { display: flex; flex-direction: column; gap: 32px; padding-left: 24px; border-left: 1px solid var(--line); }
.aside__share-links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; font-size: 14px; }
.aside__share-links button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.aside__share-links a:hover, .aside__share-links button:hover { color: var(--accent); }

.toc__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; }
.toc__list a { display: block; padding: 6px 0 6px 12px; margin-left: -25px; border-left: 2px solid transparent; color: var(--ink-2); }
.toc__list a:hover { color: var(--accent); }
.toc__list a.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc--mobile { display: none; }

.article__foot { padding: 16px 0 64px; display: flex; flex-direction: column; gap: 24px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.share .meta { margin-right: 8px; }

/* Contenu éditorial (cartes Ghost) */
.gh-content { font-family: var(--font-heading); font-size: 19px; line-height: 1.75; padding-bottom: 24px; }
.gh-content > * { margin: 0 0 1.3em; }
.gh-content > p:first-child { font-size: 22px; line-height: 1.6; }
.gh-content h2 { font-size: 28px; margin: 1.7em 0 .6em; scroll-margin-top: 110px; }
.gh-content h3 { font-size: 22px; margin: 1.4em 0 .5em; scroll-margin-top: 110px; }
.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li { margin-bottom: .4em; }
.gh-content blockquote { margin: 1.8em 0; padding: 0 0 0 24px; border-left: 2px solid var(--accent); font-size: 22px; line-height: 1.55; }
.gh-content blockquote.kg-blockquote-alt { border: 0; padding: 0; text-align: center; font-size: 26px; color: var(--accent); }
.gh-content figure { margin: 2em 0; }
.gh-content .kg-image-card img { width: auto; max-width: 100%; max-height: 560px; margin: 0 auto; border-radius: var(--radius); }
.gh-content .kg-gallery-card { margin: 2em 0; }
.gh-content .kg-gallery-image img { border-radius: 2px; }
.gh-content .kg-width-wide, .gh-content .kg-width-full { width: 100%; margin-left: 0; margin-right: 0; }
.gh-content figcaption { margin-top: 10px; font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--muted); text-align: left; overflow-wrap: anywhere; }
.gh-content figcaption a { color: var(--muted); }
.gh-content hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.gh-content table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: 15px; display: block; overflow-x: auto; }
.gh-content th, .gh-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.gh-content pre { overflow-x: auto; padding: 16px; background: var(--bg-tint); border-radius: var(--radius); font-size: 15px; }
.gh-content .kg-callout-card, .gh-content .kg-toggle-card, .gh-content .kg-product-card, .gh-content .kg-bookmark-card, .gh-content .kg-button-card { font-family: var(--font-body); }
.gh-content iframe { max-width: 100%; }

/* Pages simples (À propos, mentions…) */
.article--page .article__layout { padding-bottom: 72px; }

/* Grand écran moyen : on garde la colonne de lecture, sans barre latérale */
@media (max-width: 1100px) {
    .article__body { grid-template-columns: minmax(0, 1fr); }
    .article__main { max-width: var(--text); }
    .article__aside { display: none; }
    .toc--mobile:not([hidden]) { display: block; margin-bottom: 32px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-tint); }
    .toc--mobile summary { cursor: pointer; font-weight: 500; font-size: 15px; }
    .toc--mobile .toc__list a { margin-left: 0; padding-left: 0; border: 0; }
}

/* ---------- Pied de page ---------- */
.site-footer { padding: 56px 0 40px; }
.site-footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; margin-bottom: 40px; }
.site-footer__brand { flex: 1 1 280px; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.site-footer__logo { height: 96px; width: auto; align-self: flex-start; }
.site-footer__brand p { font-size: 15px; color: var(--ink-2); }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 48px; }
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.site-footer .nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.site-footer__copy { padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- Page d'erreur ---------- */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.error-page__logo { width: 72px; height: auto; }
.error-page__code { font-family: var(--serif); font-size: 18px; letter-spacing: .3em; color: var(--accent); }

/* ---------- Tablette ---------- */
@media (max-width: 1080px) {
    .site-header__inner { min-height: 72px; }
    .site-logo img { height: 48px; }
    .site-header__newsletter { display: none; }
    .menu-toggle { display: inline-flex; border: 0; }
    .site-header .icon-button { border: 0; }
    .site-nav {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 24px;
        padding: 8px var(--gutter) 28px; background: var(--bg); border-bottom: 1px solid var(--line);
        max-height: calc(100vh - 72px); overflow-y: auto;
    }
    .site-nav .nav { flex-direction: column; gap: 0; }
    .site-nav .nav a { display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 22px; font-weight: 600; }
    .site-nav__cta { display: inline-flex; min-height: 48px; border-radius: 24px; }
    .menu-open .site-nav { display: flex; }
    .menu-open .menu-toggle__open { display: none; }
    .menu-open .menu-toggle__close { display: block; }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
    :root { --gutter: 16px; }
    .site-header__inner { gap: 8px; }
    .site-header__actions { gap: 0; }

    .hero { padding: 0 0 48px; gap: 28px; flex-direction: column-reverse; }
    .hero__media { flex: none; min-height: 300px; height: 300px; border-radius: 0; }
    .hero__text { flex: none; padding: 0 var(--gutter); }
    .hero__vertical { display: none; }
    .hero__content { gap: 16px; }
    .hero__actions { justify-content: space-between; }
    .lead { font-size: 17px; }

    .section { padding: 44px 0; }
    .section__title { font-size: 28px; }
    .section__head { margin-bottom: 8px; }
    .section--tint .section__title, .section > .container > .section__title { margin-bottom: 20px; }

    .post-grid { grid-template-columns: 1fr; gap: 0; }
    .post-card { flex-direction: row; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
    .post-card__media { flex: 0 0 112px; width: 112px; height: 112px; aspect-ratio: auto; }
    .post-card__body { gap: 6px; min-width: 0; }
    .post-card .eyebrow { font-size: 11px; }
    .post-card__title { font-size: 18px; }
    .post-card__meta { font-size: 13px; }

    .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topic { padding: 20px 16px; min-height: 150px; gap: 8px; }
    .topic__kanji { font-size: 24px; }
    .topic__name { font-size: 18px; line-height: 1.25; }
    .topic__desc { display: none; }

    .start { gap: 20px; }
    .start__list a { gap: 16px; padding: 18px 0; }
    .start__num { font-size: 17px; }
    .start__title { font-size: 19px; }

    .newsletter__inner { padding-top: 48px; padding-bottom: 48px; gap: 24px; }
    .newsletter__text h2 { font-size: 28px; }
    .newsletter__form { flex-direction: column; align-items: stretch; }
    .newsletter__field { flex: none; }

    .archive-head { padding-top: 40px; padding-bottom: 32px; }

    .article__layout { padding-top: 28px; }
    .article__head { gap: 12px; padding-bottom: 24px; }
    .article__title { font-size: 29px; line-height: 1.2; }
    .article__excerpt { font-size: 18px; }
    .article__image { margin: 0 calc(-1 * var(--gutter)) 32px; }
    .article__image img { border-radius: 0; aspect-ratio: 4 / 3; max-height: 360px; }
    .article__image figcaption { padding: 0 var(--gutter); }
    .gh-content { font-size: 18px; }
    .gh-content > p:first-child { font-size: 20px; }
    .gh-content h2 { font-size: 24px; }
    .gh-content .kg-image-card img { max-height: 440px; }
    .gh-content blockquote.kg-blockquote-alt { font-size: 22px; }

    .site-footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
    .site-footer__logo { height: 80px; }
    .pagination { flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .post-card__media img { transition: none; }
}

/* ---------- Commentaires ---------- */
.comments .section__title { margin-bottom: 24px; }

/* ---------- Page contact ---------- */
.contact .gh-content { padding-bottom: 8px; }
.contact__box { padding-bottom: 80px; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.contact-form__field { display: flex; flex-direction: column; gap: 8px; }
.contact-form__field label { font-size: 14px; color: var(--muted); }
.contact-form__field input,
.contact-form__field textarea { padding: 14px 18px; border-radius: 12px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.contact-form__field input { height: 50px; padding-top: 0; padding-bottom: 0; border-radius: 25px; }
.contact-form__note { font-size: 14px; color: var(--muted); }
.contact-form__note a { color: var(--accent); text-decoration: underline; }
.contact-form button { align-self: flex-start; }
.contact-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chip--follow { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) { .contact-form button { align-self: stretch; } }
