/* =====================================================================
   Japan House Diary — brand stylesheet

   Palette drawn from the channel's own identity — the view over a
   Kitakyushu valley: misted greens, pine-slate ink, aizome indigo,
   with one spot of autumn persimmon reserved for the YouTube action.

   Display type: Shippori Mincho (Japanese book serif)
   Body type:    Mulish
   Signature:    layered valley-ridge silhouette (hero + footer)

   Bootstrap remains loaded first for the admin/account pages; the
   public site is styled by the jhd-* classes below.
   ===================================================================== */

:root {
    --jhd-ink: #253243;
    --jhd-ink-soft: #4a5a6e;
    --jhd-paper: #f7f7fa;
    --jhd-mist: #e2e5ee;
    --jhd-mist-deep: #c6cdde;
    --jhd-moss: #687c9b; /* slate roofs */
    --jhd-indigo: #42556b; /* dusk hills */
    --jhd-indigo-deep: #2c3b4d;
    --jhd-kaki: #c98a1e; /* village lamp amber */
    --jhd-white: #ffffff;
    --jhd-font-display: "Shippori Mincho", "Times New Roman", serif;
    --jhd-font-body: "Mulish", "Segoe UI", Arial, sans-serif;
    --jhd-max: 1100px;
    --jhd-narrow: 720px;
    --jhd-radius: 6px;
}

html {
    font-size: 17px; /* generous default for a 35–70 audience */
    position: relative;
    min-height: 100%;
}

body.jhd-body {
    margin: 0;
    background: var(--jhd-paper);
    color: var(--jhd-ink);
    font-family: var(--jhd-font-body);
    line-height: 1.7;
}

.jhd-body h1,
.jhd-body h2,
.jhd-body h3 {
    font-family: var(--jhd-font-display);
    font-weight: 600;
    line-height: 1.25;
    color: var(--jhd-ink);
    letter-spacing: 0.005em;
}

.jhd-body h1 {
    font-size: 2.4rem;
    margin: 0.4rem 0 1rem;
}

.jhd-body h2 {
    font-size: 1.7rem;
    margin: 2.2rem 0 0.8rem;
}

.jhd-body a {
    color: var(--jhd-indigo);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

    .jhd-body a:hover {
        color: var(--jhd-indigo-deep);
    }

.jhd-container {
    max-width: var(--jhd-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.jhd-narrow {
    max-width: var(--jhd-narrow);
}

.jhd-center {
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.jhd-header {
    background: var(--jhd-paper);
    border-bottom: 1px solid var(--jhd-mist);
}

.jhd-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.jhd-wordmark {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--jhd-ink);
}

    .jhd-wordmark:hover {
        color: var(--jhd-ink);
    }

.jhd-mark-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    box-shadow: 0 0 0 2px var(--jhd-mist-deep);
}

.jhd-wordmark-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.jhd-wordmark-name {
    font-family: var(--jhd-font-display);
    font-weight: 700;
    font-size: 1.2rem;
}

.jhd-wordmark-sub {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--jhd-moss);
}

.jhd-nav {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}

    .jhd-nav a {
        text-decoration: none;
        color: var(--jhd-ink-soft);
        font-weight: 600;
        font-size: 0.95rem;
    }

        .jhd-nav a:hover {
            color: var(--jhd-indigo);
        }

.jhd-nav-account {
    opacity: 0.85;
}

/* ------------------------------------------------------------------ */
/* Hero + valley ridge signature                                       */
/* ------------------------------------------------------------------ */

.jhd-hero {
    position: relative;
    padding-top: 5rem;
    background: linear-gradient(180deg, rgba(28, 36, 50, 0.25) 0%, rgba(28, 36, 50, 0.55) 55%, rgba(28, 36, 50, 0.82) 100%), url('/images/valley-hero.jpg') center 40% / cover no-repeat;
}

.jhd-hero-inner {
    max-width: 780px;
    padding-bottom: 3.5rem;
}

.jhd-hero-title {
    font-size: 2.9rem;
    margin: 0.5rem 0 1.2rem;
    color: #ffffff;
    text-shadow: 0 2px 24px rgba(20, 26, 38, 0.55);
}

.jhd-hero-lede {
    font-size: 1.12rem;
    color: var(--jhd-ink-soft);
    max-width: 46em;
}

.jhd-hero .jhd-hero-lede {
    color: #e8ebf2;
    text-shadow: 0 1px 14px rgba(20, 26, 38, 0.6);
}

.jhd-hero .jhd-eyebrow {
    color: #f3d491;
}

.jhd-hero-actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.8rem;
}

.jhd-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--jhd-moss);
    font-weight: 700;
    margin: 0;
}

.jhd-ridge {
    display: block;
    width: 100%;
    height: 90px;
}

.jhd-ridge-hero {
    height: 110px;
}

.jhd-ridge-far {
    fill: var(--jhd-mist-deep);
}

.jhd-ridge-near {
    fill: var(--jhd-moss);
}

.jhd-ridge-hero {
    position: relative;
}

    .jhd-ridge-hero .jhd-ridge-far {
        fill: rgba(247, 247, 250, 0.45);
    }

    .jhd-ridge-hero .jhd-ridge-near {
        fill: var(--jhd-paper);
    }

@media (prefers-reduced-motion: no-preference) {
    .jhd-hero-inner > * {
        animation: jhd-rise 0.7s ease-out both;
    }

        .jhd-hero-inner > *:nth-child(2) {
            animation-delay: 0.08s;
        }

        .jhd-hero-inner > *:nth-child(3) {
            animation-delay: 0.16s;
        }

        .jhd-hero-inner > *:nth-child(4) {
            animation-delay: 0.24s;
        }
}

@keyframes jhd-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

.jhd-section {
    padding: 3.5rem 0;
}

.jhd-section-alt {
    background: #eef3ec;
}

.jhd-band {
    background: var(--jhd-indigo);
    color: var(--jhd-paper);
}

    .jhd-band h2 {
        color: var(--jhd-white);
        margin-top: 0;
    }

    .jhd-band p {
        color: #d8e2ea;
    }

.jhd-band-inner {
    text-align: center;
}

.jhd-link-arrow {
    font-weight: 700;
    text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.jhd-btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: var(--jhd-radius);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: var(--jhd-font-body);
}

.jhd-btn-primary {
    background: var(--jhd-indigo);
    color: var(--jhd-white);
}

    .jhd-btn-primary:hover {
        background: var(--jhd-indigo-deep);
        color: var(--jhd-white);
    }

.jhd-btn-ghost {
    background: transparent;
    color: var(--jhd-indigo);
    border-color: var(--jhd-indigo);
}

    .jhd-btn-ghost:hover {
        background: var(--jhd-indigo);
        color: var(--jhd-white);
    }

/* Persimmon is reserved for the single YouTube action. */
.jhd-btn-youtube {
    background: var(--jhd-kaki);
    color: var(--jhd-white);
}

    .jhd-btn-youtube:hover {
        background: #9c4522;
        color: var(--jhd-white);
    }

/* ------------------------------------------------------------------ */
/* Video embed                                                         */
/* ------------------------------------------------------------------ */

.jhd-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--jhd-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(34, 48, 47, 0.14);
    margin-top: 1rem;
}

    .jhd-video-frame iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

/* ------------------------------------------------------------------ */
/* Forms (contact + newsletter)                                        */
/* ------------------------------------------------------------------ */

.jhd-form {
    margin-top: 1.5rem;
}

.jhd-field {
    margin-bottom: 1.1rem;
}

.jhd-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.jhd-field label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.jhd-optional {
    font-weight: 400;
    color: var(--jhd-moss);
}

.jhd-field input,
.jhd-field select,
.jhd-field textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1.5px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    color: var(--jhd-ink);
    font-family: var(--jhd-font-body);
    font-size: 1rem;
    box-sizing: border-box;
}

    .jhd-field input:focus,
    .jhd-field select:focus,
    .jhd-field textarea:focus {
        outline: none;
        border-color: var(--jhd-indigo);
        box-shadow: 0 0 0 3px rgba(44, 74, 99, 0.18);
    }

.jhd-flash {
    background: #e7efe4;
    border: 1px solid var(--jhd-mist-deep);
    border-left: 4px solid var(--jhd-moss);
    border-radius: var(--jhd-radius);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
}

.jhd-news-form {
    max-width: 460px;
    margin: 1.2rem auto 0;
}

.jhd-news-row {
    display: flex;
    gap: 0.6rem;
}

    .jhd-news-row input {
        flex: 1;
        padding: 0.65rem 0.8rem;
        border: 1.5px solid transparent;
        border-radius: var(--jhd-radius);
        font-family: var(--jhd-font-body);
        font-size: 1rem;
        min-width: 0;
    }

        .jhd-news-row input:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(245, 247, 242, 0.4);
        }

/* ------------------------------------------------------------------ */
/* Story page                                                          */
/* ------------------------------------------------------------------ */

.jhd-story-header {
    padding-bottom: 1rem;
}

.jhd-story-body {
    padding-bottom: 3rem;
}

    .jhd-story-body p {
        max-width: 44em;
    }

.jhd-story-cta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.jhd-footer {
    margin-top: 3rem;
}

    .jhd-footer .jhd-ridge {
        margin-bottom: -1px;
    }

    .jhd-footer .jhd-ridge-far {
        fill: #33504a;
    }

    .jhd-footer .jhd-ridge-near {
        fill: var(--jhd-ink);
    }

.jhd-footer-body {
    background: var(--jhd-ink);
    color: #c9d4cd;
    padding: 2.5rem 0 1.5rem;
}

.jhd-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1.2fr;
    gap: 2.5rem;
}

.jhd-footer-title {
    font-family: var(--jhd-font-display);
    color: var(--jhd-white);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 0.6rem;
}

.jhd-footer a {
    color: #c9d4cd;
}

    .jhd-footer a:hover {
        color: var(--jhd-white);
    }

.jhd-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

    .jhd-footer-links .jhd-footer-title {
        margin-bottom: 0.6rem;
    }

.jhd-footer-news .jhd-news-form {
    margin: 0.8rem 0 0;
}

.jhd-footer .jhd-btn-youtube {
    margin-top: 0.6rem;
}

.jhd-footer-legal {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #3a4a45;
    font-size: 0.85rem;
    color: #8ba095;
}

/* ------------------------------------------------------------------ */
/* Accessibility + responsive                                          */
/* ------------------------------------------------------------------ */

.jhd-body :focus-visible {
    outline: 3px solid var(--jhd-indigo);
    outline-offset: 2px;
}

.jhd-band :focus-visible,
.jhd-footer :focus-visible {
    outline-color: var(--jhd-paper);
}

@media (max-width: 820px) {
    .jhd-footer-grid {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }

    .jhd-hero-title {
        font-size: 2.2rem;
    }

    .jhd-body h1 {
        font-size: 2rem;
    }
}

@media (max-width: 560px) {
    .jhd-field-row {
        grid-template-columns: 1fr;
    }

    .jhd-news-row {
        flex-direction: column;
    }

    .jhd-hero {
        padding-top: 2.5rem;
    }

    .jhd-hero-title {
        font-size: 1.85rem;
    }
}

/* Dev database status banner (development only) */
.jhd-dev-status {
    font-size: 12px;
    padding: 4px 10px;
    text-align: center;
}

.jhd-dev-status-ok {
    background: #e6ffed;
    color: #0f5132;
}

.jhd-dev-status-error {
    background: #ffe6e6;
    color: #842029;
}

/* YouTube link in the main nav */
.jhd-nav-youtube {
    color: var(--jhd-kaki) !important;
    font-weight: 700;
}

/* Utility classes (previously provided by Bootstrap, now self-contained) */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.text-danger {
    color: #a13333;
    font-size: 0.85rem;
}

/* ------------------------------------------------------------------ */
/* Nav account area                                                    */
/* ------------------------------------------------------------------ */

.jhd-nav-user {
    color: var(--jhd-ink);
    font-weight: 700;
    font-size: 0.95rem;
}

.jhd-nav-form {
    display: inline;
    margin: 0;
}

.jhd-nav-signout,
.jhd-nav-account {
    background: none;
    border: none;
    padding: 0;
    color: var(--jhd-ink-soft);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--jhd-font-body);
    cursor: pointer;
    text-decoration: none;
}

    .jhd-nav-signout:hover,
    .jhd-nav-account:hover {
        color: var(--jhd-indigo);
    }

/* ------------------------------------------------------------------ */
/* Auth pages                                                          */
/* ------------------------------------------------------------------ */

.jhd-auth {
    max-width: 520px;
}

.jhd-auth-alt {
    margin-top: 1.5rem;
    color: var(--jhd-ink-soft);
}

.jhd-field-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.jhd-field-check input {
    width: auto;
}

.jhd-flash-error {
    background: #f7e7e5;
    border-left-color: #a13333;
}

.jhd-form-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/* Community forum                                                     */
/* ------------------------------------------------------------------ */

.jhd-forum {
    max-width: 860px;
}

.jhd-forum-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.jhd-forum-actions {
    flex: none;
}

.jhd-breadcrumb {
    margin-bottom: 1rem;
}

    .jhd-breadcrumb a {
        text-decoration: none;
        font-weight: 600;
        color: var(--jhd-ink-soft);
    }

.jhd-thread-list {
    border: 1px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    overflow: hidden;
}

/* Dense, scannable rows (FlyerTalk-style information density, kept modern):
   one grid shared by the column header and every row. */
.jhd-thread-cols,
.jhd-thread-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4.2rem 4.2rem 10.5rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.9rem;
}

.jhd-thread-cols {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--jhd-ink-soft);
    background: var(--jhd-paper);
    border-bottom: 1px solid var(--jhd-mist-deep);
}

.jhd-thread-col-num {
    text-align: right;
}

.jhd-thread-row {
    text-decoration: none;
    color: var(--jhd-ink);
    border-bottom: 1px solid var(--jhd-mist);
}

    .jhd-thread-row:last-child {
        border-bottom: none;
    }

    .jhd-thread-row:hover {
        background: #f0f2f8;
        color: var(--jhd-ink);
    }

.jhd-thread-pinned {
    background: #f6f3ea;
}

.jhd-thread-main {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.jhd-thread-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}

.jhd-thread-meta {
    font-size: 0.78rem;
    color: var(--jhd-ink-soft);
    font-weight: 400;
}

.jhd-thread-num {
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    color: var(--jhd-ink-soft);
}

/* Number labels ("replies"/"views"): visually hidden on desktop (the column
   header shows them for sighted users, but it's aria-hidden — these keep the
   numbers labelled for screen readers), plainly visible on mobile. */
.jhd-num-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    font-weight: 400;
}

.jhd-thread-last {
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--jhd-ink-soft);
    display: flex;
    flex-direction: column;
}

.jhd-thread-lastby {
    font-weight: 600;
}

/* Forum search — the bar on the index and the results page. */
.jhd-forum-search {
    display: flex;
    gap: 0.6rem;
    margin: 0 0 1.6rem;
}

    .jhd-forum-search input[type="search"] {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.55rem 0.8rem;
        border: 1px solid var(--jhd-mist-deep);
        border-radius: var(--jhd-radius);
        font: inherit;
        font-size: 0.95rem;
        background: var(--jhd-white);
        color: var(--jhd-ink);
    }

    .jhd-forum-search input[type="search"]:focus {
        outline: 2px solid var(--jhd-moss);
        outline-offset: 1px;
    }

.jhd-search-results {
    border: 1px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    overflow: hidden;
}

.jhd-search-result {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: var(--jhd-ink);
    border-bottom: 1px solid var(--jhd-mist);
}

    .jhd-search-result:last-child {
        border-bottom: none;
    }

    .jhd-search-result:hover {
        background: #f0f2f8;
        color: var(--jhd-ink);
    }

.jhd-search-result-title {
    font-weight: 600;
    font-size: 0.98rem;
}

.jhd-search-result-snippet {
    font-size: 0.85rem;
    color: var(--jhd-ink-soft);
    line-height: 1.45;
}

/* Archived (removed / prior-version) content — admin-only surfaces. */
.jhd-post-archived {
    border: 1px dashed var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-paper);
    padding: 0.8rem 1rem;
    margin-top: 0.6rem;
    opacity: 0.85;
}

.jhd-post-archived-meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--jhd-ink-soft);
    margin-bottom: 0.5rem;
}

.jhd-tag {
    display: inline-block;
    background: var(--jhd-kaki);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-right: 0.45rem;
    vertical-align: middle;
}

.jhd-tag-muted {
    background: var(--jhd-ink-soft);
}

.jhd-tag-ok {
    background: #2f7d4f;
}

.jhd-forum-empty {
    border: 1.5px dashed var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    padding: 1.6rem;
    text-align: center;
    color: var(--jhd-ink-soft);
    margin-top: 1.5rem;
}

.jhd-thread-head h1 {
    margin-bottom: 0.4rem;
}

.jhd-mod-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #f0ead9;
    border: 1px solid #e0d3ac;
    border-radius: var(--jhd-radius);
    padding: 0.5rem 0.8rem;
    margin: 0.8rem 0;
}

    .jhd-mod-bar form {
        margin: 0;
    }

.jhd-mod-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7a6524;
}

.jhd-btn-mini {
    background: var(--jhd-white);
    border: 1px solid var(--jhd-mist-deep);
    border-radius: 6px;
    padding: 0.25rem 0.7rem;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--jhd-ink);
    font-family: var(--jhd-font-body);
}

    .jhd-btn-mini:hover {
        border-color: var(--jhd-indigo);
        color: var(--jhd-indigo);
    }

.jhd-btn-mini-danger {
    color: #a13333;
}

    .jhd-btn-mini-danger:hover {
        border-color: #a13333;
        color: #a13333;
    }

.jhd-post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.jhd-post {
    background: var(--jhd-white);
    border: 1px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    padding: 1rem 1.2rem;
}

.jhd-post-moderator {
    border-left: 4px solid var(--jhd-kaki);
}

.jhd-post-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.jhd-post-author {
    font-weight: 700;
}

.jhd-post-date {
    color: var(--jhd-ink-soft);
}

.jhd-post-body p {
    margin: 0 0 0.7rem;
}

    .jhd-post-body p:last-child {
        margin-bottom: 0;
    }

.jhd-post-removed {
    color: var(--jhd-ink-soft);
    font-style: italic;
}

.jhd-post-modform {
    margin-top: 0.6rem;
    text-align: right;
}

.jhd-reply-box {
    background: #f0f2f8;
    border-radius: var(--jhd-radius);
    padding: 1.2rem;
    margin-top: 1.5rem;
}

    .jhd-reply-box h2 {
        margin-top: 0;
        font-size: 1.2rem;
    }

@media (max-width: 640px) {
    .jhd-thread-cols {
        display: none;
    }

    .jhd-thread-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.15rem 0.9rem;
    }

    .jhd-thread-main {
        flex: 1 1 100%;
    }

    .jhd-thread-num {
        text-align: left;
        font-size: 0.78rem;
        font-weight: 400;
    }

    .jhd-num-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .jhd-thread-last {
        flex-direction: row;
        gap: 0.3rem;
    }
}

/* ------------------------------------------------------------------ */
/* Contrast & specificity fixes                                        */
/* The global `.jhd-body a` and `.jhd-body h1` rules outranked the     */
/* component classes below them, turning anchor-buttons indigo-on-     */
/* indigo and the hero title ink-on-photo. These higher-specificity   */
/* rules restore the intended colors.                                  */
/* ------------------------------------------------------------------ */

/* Anchor buttons: force intended text colors */
.jhd-body a.jhd-btn {
    text-decoration: none;
}

.jhd-body a.jhd-btn-primary,
.jhd-body button.jhd-btn-primary {
    background: var(--jhd-indigo);
    color: #ffffff;
}

    .jhd-body a.jhd-btn-primary:hover,
    .jhd-body a.jhd-btn-primary:focus,
    .jhd-body button.jhd-btn-primary:hover {
        background: var(--jhd-indigo-deep);
        color: #ffffff;
    }

.jhd-body a.jhd-btn-youtube,
.jhd-body button.jhd-btn-youtube {
    background: var(--jhd-kaki);
    color: #ffffff;
}

    .jhd-body a.jhd-btn-youtube:hover,
    .jhd-body a.jhd-btn-youtube:focus {
        background: #a86f12;
        color: #ffffff;
    }

.jhd-body a.jhd-btn-ghost {
    color: var(--jhd-indigo);
    border-color: var(--jhd-indigo);
    background: transparent;
}

    .jhd-body a.jhd-btn-ghost:hover,
    .jhd-body a.jhd-btn-ghost:focus {
        background: var(--jhd-indigo);
        color: #ffffff;
    }

/* Hero: white title and photo-appropriate ghost button */
.jhd-body .jhd-hero h1.jhd-hero-title {
    color: #ffffff;
}

.jhd-body .jhd-hero a.jhd-btn-ghost {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.9);
}

    .jhd-body .jhd-hero a.jhd-btn-ghost:hover,
    .jhd-body .jhd-hero a.jhd-btn-ghost:focus {
        background: #ffffff;
        color: var(--jhd-ink);
        border-color: #ffffff;
    }

/* Dark bands (navy newsletter band + footer): indigo buttons vanish
   against the navy background, so CTAs there use lamp amber instead. */
.jhd-body .jhd-band a.jhd-btn-primary,
.jhd-body .jhd-band button.jhd-btn-primary,
.jhd-body .jhd-footer a.jhd-btn-primary,
.jhd-body .jhd-footer button.jhd-btn-primary {
    background: var(--jhd-kaki);
    color: #ffffff;
}

    .jhd-body .jhd-band a.jhd-btn-primary:hover,
    .jhd-body .jhd-band button.jhd-btn-primary:hover,
    .jhd-body .jhd-footer a.jhd-btn-primary:hover,
    .jhd-body .jhd-footer button.jhd-btn-primary:hover {
        background: #a86f12;
        color: #ffffff;
    }

/* Links inside the dark band should be light, not indigo */
.jhd-body .jhd-band a:not(.jhd-btn) {
    color: #dbe3ee;
}

/* ------------------------------------------------------------------ */
/* Community — category blocks                                         */
/* ------------------------------------------------------------------ */

.jhd-cat-block {
    margin-bottom: 1.7rem;
}

.jhd-cat-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--jhd-mist-deep);
    padding-bottom: 0.35rem;
    margin-bottom: 0.6rem;
}

.jhd-cat-title {
    margin: 0;
    font-size: 1.35rem;
}

.jhd-cat-desc {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: var(--jhd-ink-soft);
    max-width: 52em;
}

/* Attention tag for held / pending-review content (admins only). */
.jhd-tag-review {
    background: #a13333;
}

/* "Approve" mini button — the one positive moderation action. */
.jhd-btn-mini-go {
    color: #2f7d4f;
}

    .jhd-btn-mini-go:hover {
        border-color: #2f7d4f;
        color: #2f7d4f;
    }

.jhd-post-held {
    border-left: 4px solid #a13333;
    background: #fbf4f4;
}

/* ------------------------------------------------------------------ */
/* Admin area                                                          */
/* ------------------------------------------------------------------ */

.jhd-nav-admin {
    color: var(--jhd-kaki) !important;
    font-weight: 700;
}

.jhd-admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    padding: 0.8rem 0;
    margin: 0.5rem 0 1.5rem;
    border-top: 1px solid var(--jhd-mist);
    border-bottom: 1px solid var(--jhd-mist);
}

    .jhd-admin-nav a {
        text-decoration: none;
        font-weight: 600;
        font-size: 0.92rem;
        color: var(--jhd-ink-soft);
    }

        .jhd-admin-nav a:hover {
            color: var(--jhd-indigo);
        }

.jhd-admin-nav-active {
    color: var(--jhd-indigo) !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
}

.jhd-admin-nav-back {
    margin-left: auto;
}

.jhd-admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.jhd-admin-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.3rem;
    border: 1px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    text-decoration: none;
    color: var(--jhd-ink);
}

    .jhd-admin-card:hover {
        border-color: var(--jhd-indigo);
        color: var(--jhd-ink);
    }

/* "Something needs your attention" state — must be unmissable next to the
   plain cards, so: amber ring (no layout shift vs the 1px base border),
   warm tint, and the count itself in the accent colour. */
.jhd-admin-card-alert {
    border-color: var(--jhd-kaki);
    box-shadow: 0 0 0 1.5px var(--jhd-kaki), 0 2px 10px rgba(201, 138, 30, 0.25);
    background: #fdf3e2;
}

    .jhd-admin-card-alert:hover {
        border-color: var(--jhd-kaki);
    }

    .jhd-admin-card-alert .jhd-admin-card-num {
        color: var(--jhd-kaki);
    }

    .jhd-admin-card-alert .jhd-admin-card-label {
        color: var(--jhd-ink);
        font-weight: 600;
    }

.jhd-admin-card-num {
    font-family: var(--jhd-font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.jhd-admin-card-label {
    font-size: 0.85rem;
    color: var(--jhd-ink-soft);
}

.jhd-admin-hint {
    color: var(--jhd-ink-soft);
    font-size: 0.9rem;
    max-width: 60em;
}

/* Review queue */
.jhd-queue-item {
    border: 1px solid var(--jhd-mist-deep);
    border-left: 4px solid #a13333;
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.jhd-queue-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.jhd-queue-meta {
    font-size: 0.82rem;
    color: var(--jhd-ink-soft);
    margin: 0.3rem 0 0.7rem;
}

.jhd-queue-body {
    white-space: pre-wrap;
    background: var(--jhd-paper);
    border-radius: var(--jhd-radius);
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.jhd-queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

    .jhd-queue-actions form {
        margin: 0;
    }

/* Admin forms + tables */
.jhd-admin-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1rem 0 2rem;
}

.jhd-admin-form {
    border: 1px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    padding: 1.2rem;
    margin-top: 0;
}

    .jhd-admin-form h2 {
        margin-top: 0;
        font-size: 1.1rem;
    }

.jhd-admin-addcat {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    align-items: end;
}

    .jhd-admin-addcat .jhd-field {
        margin-bottom: 0;
    }

.jhd-admin-table-wrap {
    overflow-x: auto;
}

.jhd-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .jhd-admin-table th,
    .jhd-admin-table td {
        text-align: left;
        padding: 0.6rem 0.7rem;
        border-bottom: 1px solid var(--jhd-mist);
        vertical-align: middle;
    }

    .jhd-admin-table th {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--jhd-ink-soft);
    }

.jhd-row-muted {
    opacity: 0.55;
}

.jhd-muted {
    color: var(--jhd-ink-soft);
}

/* Blocked-word chips */
.jhd-chip-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 0;
}

.jhd-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--jhd-white);
    border: 1px solid var(--jhd-mist-deep);
    border-radius: 999px;
    padding: 0.25rem 0.35rem 0.25rem 0.8rem;
    font-size: 0.9rem;
}

    .jhd-chip form {
        margin: 0;
        display: inline;
    }

.jhd-chip-remove {
    background: var(--jhd-mist);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--jhd-ink);
    font-size: 0.95rem;
}

    .jhd-chip-remove:hover {
        background: #a13333;
        color: #fff;
    }

/* Category admin rows */
.jhd-cat-admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid var(--jhd-mist-deep);
    border-radius: var(--jhd-radius);
    background: var(--jhd-white);
    padding: 0.8rem 1rem;
    margin-bottom: 0.7rem;
}

.jhd-cat-admin-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: end;
    flex: 1;
}

    .jhd-cat-admin-fields label {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--jhd-ink-soft);
        font-weight: 700;
    }

    .jhd-cat-admin-fields input[type="text"],
    .jhd-cat-admin-fields input[type="number"] {
        padding: 0.4rem 0.6rem;
        border: 1.5px solid var(--jhd-mist-deep);
        border-radius: var(--jhd-radius);
        font-family: var(--jhd-font-body);
        font-size: 0.95rem;
        text-transform: none;
        letter-spacing: normal;
    }

.jhd-cat-admin-order input {
    width: 4.5rem;
}

.jhd-cat-admin-name input {
    width: 12rem;
}

.jhd-cat-admin-desc input {
    width: 20rem;
    max-width: 100%;
}

.jhd-cat-admin-active {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem !important;
}

    .jhd-cat-admin-active input {
        width: auto;
    }

.jhd-cat-admin-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.82rem;
}

@media (max-width: 820px) {
    .jhd-admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .jhd-admin-forms {
        grid-template-columns: 1fr;
    }

    .jhd-admin-addcat {
        grid-template-columns: 1fr;
    }
}

/* ---- Forum: reply-to-post ---- */
.jhd-post-replyref { font-size: 0.82rem; color: var(--jhd-moss); margin: 0 0 0.5rem; }
.jhd-post-replyref a { color: var(--jhd-indigo); }
.jhd-post-actions { margin-top: 0.5rem; }
.jhd-reply-context { background: var(--jhd-mist); border-radius: var(--jhd-radius); padding: 0.5rem 0.9rem; margin-bottom: 0.8rem; font-size: 0.9rem; display: flex; gap: 0.6rem; align-items: center; }

/* ---- Forum: post image galleries + upload ---- */
.jhd-post-gallery { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0.25rem; }
.jhd-post-thumb { display: block; border-radius: var(--jhd-radius); overflow: hidden; border: 1px solid var(--jhd-mist-deep); background: var(--jhd-paper); }
.jhd-post-thumb img { display: block; width: 100%; height: 160px; max-width: 220px; object-fit: cover; }
@media (max-width: 560px) { .jhd-post-thumb img { height: 120px; max-width: 46vw; } }
.jhd-field-hint { font-size: 0.82rem; color: var(--jhd-moss); margin: 0.35rem 0 0; }
.jhd-image-popup { position: fixed; inset: 0; background: rgba(37,50,67,0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.jhd-image-popup[hidden] { display: none; }
.jhd-image-popup-card { background: #fff; border-radius: var(--jhd-radius); padding: 1.5rem 1.6rem; max-width: 420px; box-shadow: 0 12px 40px rgba(37,50,67,0.25); }
.jhd-image-popup-card p { margin: 0 0 1.1rem; color: var(--jhd-ink); }
/* ---- Forum: edited-by note ---- */
.jhd-post-edited { font-size: 0.78rem; color: var(--jhd-moss); font-style: italic; margin: 0.5rem 0 0; }
