:root {
    --thv-ink: #17202a;
    --thv-muted: #586677;
    --thv-soft: #f6f8fb;
    --thv-white: #ffffff;
    --thv-blue: #1d4f7a;
    --thv-blue-dark: #12395c;
    --thv-cyan: #4ca9c9;
    --thv-gold: #c99a2e;
    --thv-line: rgba(18, 57, 92, .12);
    --thv-line-strong: rgba(18, 57, 92, .2);
    --thv-shadow: 0 16px 44px rgba(18, 57, 92, .08);
    --thv-radius: 18px;
    --thv-radius-small: 12px;
    --thv-container: 1160px;
    --thv-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--thv-font);
    color: var(--thv-ink);
    background: var(--thv-white);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.admin-bar .site-header { top: 32px; }
a {
    color: var(--thv-blue);
    text-decoration-thickness: .08em;
    text-underline-offset: .18em;
}
a:hover,
a:focus { color: var(--thv-blue-dark); }
img { max-width: 100%; height: auto; }
.container {
    width: min(calc(100% - 40px), var(--thv-container));
    margin-inline: auto;
}
.screen-reader-text,
.skip-link {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.skip-link:focus {
    clip: auto !important;
    clip-path: none;
    display: block;
    height: auto;
    left: 16px;
    top: 16px;
    width: auto;
    z-index: 100000;
    padding: 12px 16px;
    background: var(--thv-white);
    color: var(--thv-blue-dark);
    border-radius: 10px;
    box-shadow: var(--thv-shadow);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--thv-line);
    backdrop-filter: blur(14px);
}
.site-topbar {
    background: var(--thv-soft);
    color: var(--thv-muted);
    border-bottom: 1px solid var(--thv-line);
    font-size: .86rem;
}
.site-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding-block: 7px;
}
.site-topbar a { color: var(--thv-blue-dark); text-decoration: none; }
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding-block: 15px;
}
.site-branding { min-width: 250px; }
.site-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--thv-blue-dark);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.02em;
}
.site-title-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--thv-white);
    background: var(--thv-blue-dark);
    box-shadow: 0 10px 26px rgba(18, 57, 92, .18);
}
.site-title-text { max-width: 330px; line-height: 1.16; }
.site-description {
    margin: 5px 0 0;
    color: var(--thv-muted);
    font-size: .92rem;
}
.primary-navigation { margin-left: auto; }
.primary-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.primary-navigation li { position: relative; }
.primary-navigation a {
    display: block;
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--thv-muted);
    text-decoration: none;
    font-weight: 650;
    font-size: .94rem;
}
.primary-navigation a:hover,
.primary-navigation a:focus,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a {
    color: var(--thv-blue-dark);
    background: var(--thv-soft);
}
.primary-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1100;
    min-width: 250px;
    display: grid;
    align-items: stretch;
    gap: 2px;
    padding: 12px 10px 10px;
    background: var(--thv-white);
    border: 1px solid var(--thv-line);
    border-radius: 16px;
    box-shadow: var(--thv-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .14s ease, visibility .14s ease;
}
.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.primary-navigation .sub-menu .sub-menu {
    top: -12px;
    left: 100%;
}
.primary-navigation .sub-menu a { border-radius: 10px; }
.menu-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--thv-line-strong);
    background: var(--thv-white);
    color: var(--thv-blue-dark);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}
.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    content: "";
}
.menu-toggle-icon::before { transform: translateY(-6px); }
.menu-toggle-icon::after { transform: translateY(4px); }

.home-hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(246,248,251,.96), rgba(255,255,255,.98)),
        radial-gradient(circle at top right, rgba(76,169,201,.18), transparent 32%);
    border-bottom: 1px solid var(--thv-line);
    color: var(--thv-ink);
    padding: clamp(44px, 7vw, 78px) 0 clamp(34px, 6vw, 64px);
}
.home-hero::after {
    content: "";
    position: absolute;
    right: max(20px, calc((100vw - var(--thv-container)) / 2));
    bottom: -34px;
    width: 170px;
    height: 170px;
    border: 1px solid rgba(29,79,122,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.45);
}
.home-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 860px;
}
.eyebrow,
.section-label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-size: .78rem;
    font-weight: 800;
    color: var(--thv-gold);
}
.home-hero h1,
.page-hero h1 {
    margin: 0;
    max-width: 880px;
    color: var(--thv-blue-dark);
    font-size: clamp(2.05rem, 4.4vw, 4.2rem);
    line-height: 1.03;
    letter-spacing: -.055em;
}
.hero-lead {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--thv-muted);
    font-size: clamp(1.04rem, 1.7vw, 1.22rem);
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}
.button,
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover,
.wp-block-button__link:hover { transform: translateY(-1px); }
.button-primary,
.wp-block-button__link {
    color: var(--thv-white);
    background: var(--thv-blue-dark);
    box-shadow: 0 12px 28px rgba(18, 57, 92, .18);
}
.button-secondary {
    color: var(--thv-blue-dark);
    background: var(--thv-white);
    border: 1px solid var(--thv-line-strong);
}

.home-intro,
.home-cards,
.page-shell { padding: clamp(38px, 6vw, 70px) 0; }
.home-intro { padding-bottom: 16px; }
.home-cards { padding-top: 18px; }
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 26px;
    align-items: start;
}
.content-layout-wide { grid-template-columns: 1fr; }
.content-card,
.side-card,
.service-card {
    background: var(--thv-white);
    border: 1px solid var(--thv-line);
    border-radius: var(--thv-radius);
    box-shadow: 0 12px 34px rgba(18, 57, 92, .055);
}
.content-card { padding: clamp(24px, 4.6vw, 48px); }
.front-content-card { margin-top: 0; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h1,
.entry-content h2,
.entry-content h3 {
    color: var(--thv-blue-dark);
    line-height: 1.18;
    letter-spacing: -.03em;
}
.entry-content h2 { margin-top: 1.7em; font-size: clamp(1.55rem, 2.5vw, 2.05rem); }
.entry-content h3 { margin-top: 1.4em; font-size: 1.2rem; }
.entry-content p,
.entry-content li { color: var(--thv-muted); }
.entry-content ol,
.entry-content ul { padding-left: 1.35rem; }
.entry-content li + li { margin-top: .48rem; }
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--thv-radius-small);
    overflow: hidden;
}
.entry-content th,
.entry-content td { padding: 12px 14px; border-bottom: 1px solid var(--thv-line); }
.entry-content th { background: var(--thv-soft); text-align: left; color: var(--thv-blue-dark); }
.entry-content blockquote {
    margin: 28px 0;
    padding: 18px 22px;
    border-left: 4px solid var(--thv-cyan);
    background: var(--thv-soft);
    border-radius: 0 var(--thv-radius-small) var(--thv-radius-small) 0;
}
.section-heading {
    display: grid;
    gap: 6px;
    max-width: 760px;
    margin-bottom: 22px;
}
.section-heading h2 {
    margin: 0;
    color: var(--thv-blue-dark);
    font-size: clamp(1.65rem, 2.7vw, 2.45rem);
    line-height: 1.12;
    letter-spacing: -.04em;
}
.service-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.service-card {
    position: relative;
    display: flex;
    min-height: 168px;
    flex-direction: column;
    justify-content: flex-start;
    padding: 22px;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.service-card:hover,
.service-card:focus {
    transform: translateY(-3px);
    border-color: rgba(29, 79, 122, .26);
    box-shadow: var(--thv-shadow);
}
.service-card h3 {
    margin: 0 34px 8px 0;
    color: var(--thv-blue-dark);
    line-height: 1.18;
    font-size: 1.08rem;
}
.service-card p { margin: 0; color: var(--thv-muted); font-size: .96rem; }
.service-card-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    color: var(--thv-blue-dark);
    background: var(--thv-soft);
    border: 1px solid var(--thv-line);
    font-weight: 900;
}

.page-hero {
    padding: clamp(38px, 6vw, 66px) 0;
    background: linear-gradient(135deg, var(--thv-soft), var(--thv-white));
    border-bottom: 1px solid var(--thv-line);
    color: var(--thv-ink);
}
.page-hero-compact h1 { font-size: clamp(2rem, 3.6vw, 3.3rem); }
.page-hero p:not(.eyebrow) { color: var(--thv-muted); max-width: 720px; }
.entry-title { margin: 0 0 22px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
.side-card {
    position: sticky;
    top: 126px;
    padding: 20px;
}
.side-card h2 { margin: 0 0 12px; font-size: 1.05rem; color: var(--thv-blue-dark); }
.quick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.quick-list a {
    display: block;
    padding: 9px 11px;
    border-radius: 11px;
    color: var(--thv-muted);
    text-decoration: none;
    background: var(--thv-soft);
    font-weight: 700;
}
.quick-list a:hover,
.quick-list a:focus { background: rgba(76,169,201,.12); color: var(--thv-blue-dark); }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-field {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--thv-line);
    border-radius: 999px;
    font: inherit;
}
.search-submit {
    min-height: 44px;
    border: 0;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--thv-blue-dark);
    color: var(--thv-white);
    font-weight: 800;
}
.search-result + .search-result { border-top: 1px solid var(--thv-line); margin-top: 24px; padding-top: 24px; }
.search-result h2 { margin: 0 0 8px; }
.site-footer {
    margin-top: 34px;
    background: var(--thv-soft);
    color: var(--thv-muted);
    border-top: 1px solid var(--thv-line);
    padding: 44px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 34px;
}
.site-footer h2 {
    margin: 0 0 10px;
    color: var(--thv-blue-dark);
    font-size: 1rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--thv-blue-dark); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--thv-line);
    font-size: .9rem;
}
.wp-block-image img { border-radius: var(--thv-radius-small); }
.wp-block-separator { border: 0; border-top: 1px solid var(--thv-line); margin: 32px 0; }
.wp-block-group.has-background { border-radius: var(--thv-radius); padding: 24px; }

@media (max-width: 1080px) {
    .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    body.admin-bar .site-header { top: 0; }
    .site-topbar-inner { display: none; }
    .site-header-inner { align-items: flex-start; }
    .menu-toggle { display: inline-flex; }
    .primary-navigation {
        position: absolute;
        top: 100%;
        left: 20px;
        right: 20px;
        display: none;
        padding: 12px;
        background: var(--thv-white);
        border: 1px solid var(--thv-line);
        border-radius: 18px;
        box-shadow: var(--thv-shadow);
    }
    .primary-navigation.is-open { display: block; }
    .primary-navigation ul { display: grid; align-items: stretch; }
    .primary-navigation a { border-radius: 12px; }
    .primary-navigation .sub-menu {
        position: static;
        min-width: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border: 0;
        padding: 4px 0 4px 14px;
        background: transparent;
    }
    .content-layout,
    .footer-grid { grid-template-columns: 1fr; }
    .side-card { position: static; }
}
@media (max-width: 640px) {
    .container { width: min(calc(100% - 28px), var(--thv-container)); }
    .site-header-inner { gap: 14px; }
    .site-title-text { max-width: 210px; font-size: .92rem; }
    .site-description { display: none; }
    .home-hero { padding-top: 42px; }
    .hero-actions { display: grid; }
    .service-grid { grid-template-columns: 1fr; }
    .content-card { padding: 22px; }
    .footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.authority-note {
    margin-top: 24px;
    max-width: 760px;
    padding: 16px 18px;
    border: 1px solid rgba(201, 154, 46, .28);
    border-radius: var(--thv-radius-small);
    background: rgba(201, 154, 46, .08);
    color: var(--thv-muted);
}
.authority-note strong {
    color: var(--thv-blue-dark);
}
.home-authority {
    padding: clamp(38px, 6vw, 66px) 0 18px;
    background: var(--thv-white);
}
.authority-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.authority-card {
    min-height: 190px;
    padding: 24px;
    border: 1px solid var(--thv-line);
    border-radius: var(--thv-radius);
    background: linear-gradient(180deg, var(--thv-white), rgba(246,248,251,.72));
    box-shadow: 0 12px 34px rgba(18, 57, 92, .045);
}
.authority-card h3 {
    margin: 0 0 10px;
    color: var(--thv-blue-dark);
    font-size: 1.08rem;
    line-height: 1.2;
}
.authority-card p {
    margin: 0;
    color: var(--thv-muted);
    font-size: .98rem;
}
.topic-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.topic-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 17px;
    border: 1px solid var(--thv-line);
    border-radius: var(--thv-radius-small);
    background: var(--thv-white);
    color: var(--thv-blue-dark);
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(18, 57, 92, .04);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.topic-link:hover,
.topic-link:focus {
    transform: translateY(-2px);
    border-color: rgba(29, 79, 122, .24);
    box-shadow: var(--thv-shadow);
}

@media (max-width: 1080px) {
    .authority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .authority-grid,
    .topic-list { grid-template-columns: 1fr; }
    .authority-card { min-height: 0; }
}
