/* Primary brand blue — links, buttons, switches */
:root {
    --font-family: "Roboto", sans-serif;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-rgb: 59, 130, 246;
    --accent: var(--primary);
    --accent-hover: var(--primary-hover);
    --content-inset: 10%;
}

/* Auth-aware page copy (see includes/guest-content.php) */
body.is-logged-in .guest-only {
    display: none !important;
}

body.is-guest .member-only {
    display: none !important;
}

/* Theme tokens — dark default, light via [data-theme="light"] */
:root,
[data-theme="dark"] {
    --bg: #0f1115;
    --bg-elevated: #171a21;
    --bg-bar: #1a1d26;
    --border: #2a2f3a;
    --text: #e8eaed;
    --text-muted: #9aa0a6;
    --top-bar-h: 32px;
    --header-h: auto;
    --nav-h: 48px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --hero-overlay: linear-gradient(to top, rgba(15, 17, 21, 0.92) 0%, rgba(15, 17, 21, 0.2) 55%);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f8f9fa;
    --bg-elevated: #ffffff;
    --bg-bar: #23282d;
    --border: #dadce0;
    --text: #202124;
    --text-muted: #5f6368;
    --shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
    --hero-overlay: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.15) 55%);
    color-scheme: light;
}

/* Top bar and footer stay dark regardless of site theme */
.top-bar,
.site-footer {
    --bg-bar: #1a1d26;
    --bg-elevated: #1a1d26;
    --border: #3c434a;
    --text: #f0f0f1;
    --text-muted: #c3c4c7;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

*, *::before, *::after {
    box-sizing: border-box;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

h1,
h2,
h3,
.top-bar__nav-item > a,
.top-bar__submenu a,
.top-bar__menu a,
.main-nav__item > a,
.main-nav__submenu a,
.main-nav__toggle,
.hero__nav-btn {
    text-transform: uppercase;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-hover);
}

.site-shell {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: var(--content-inset);
    box-sizing: border-box;
}

/* —— Top bar (WP admin-bar style) —— */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: var(--top-bar-h);
    background: var(--bg-bar);
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}

.top-bar__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: var(--top-bar-h);
    gap: 1rem;
}

.top-bar--show-main-nav .top-bar__inner {
    justify-content: space-between;
}

.top-bar__main-nav {
    flex: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

.top-bar__nav-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-bar__nav-item {
    position: relative;
}

.top-bar__nav-item > a {
    display: block;
    padding: 0.35rem 0.55rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    border-radius: 0;
    white-space: nowrap;
}

.top-bar__nav-item > a:hover,
.top-bar__nav-item.is-active > a {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
}

.top-bar__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 11rem;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: var(--bg-bar);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 50;
}

.top-bar__nav-item.has-children:hover .top-bar__submenu,
.top-bar__nav-item.has-children:focus-within .top-bar__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-bar__submenu a {
    display: block;
    padding: 0.4rem 0.65rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.top-bar__submenu a:hover,
.top-bar__submenu a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
}

.top-bar__menu {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-bar__audio,
.top-bar__theme {
    margin-left: 0.35rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border);
}

.top-bar__menu a {
    display: block;
    padding: 0.35rem 0.65rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 0;
}

.top-bar__menu a:hover,
.top-bar__menu a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.bar-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0.35rem;
    border-radius: 0;
    color: var(--text);
}

.bar-switch:hover {
    background: rgba(255, 255, 255, 0.06);
}

.bar-switch__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bar-switch__icon {
    display: inline-flex;
    opacity: 0.4;
    line-height: 0;
}

.bar-switch__icon svg {
    display: block;
}

.bar-switch__track {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.15rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
    transition: background 0.2s;
}

.bar-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.15rem - 4px);
    height: calc(1.15rem - 4px);
    background: #fff;
    border-radius: 0;
    transition: transform 0.2s;
}

.bar-switch__input:checked + .bar-switch__track {
    background: var(--accent);
}

.bar-switch__input:checked + .bar-switch__track::after {
    transform: translateX(1.1rem);
}

.form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}

.form-switch__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-switch__track {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.35rem;
    flex-shrink: 0;
    background: rgba(var(--primary-rgb), 0.22);
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 0;
    transition: background 0.2s, border-color 0.2s;
}

.form-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.35rem - 6px);
    height: calc(1.35rem - 6px);
    background: var(--text);
    border-radius: 0;
    transition: transform 0.2s, background 0.2s;
}

.form-switch__input:checked + .form-switch__track {
    background: var(--accent);
    border-color: var(--accent);
}

.form-switch__input:checked + .form-switch__track::after {
    transform: translateX(1.35rem);
    background: #fff;
}

.form-switch__input:focus-visible + .form-switch__track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-switch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: rgba(var(--primary-rgb), 0.06);
    cursor: pointer;
}

[data-theme="dark"] .form-switch-row {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: #3d4d66;
}

.form-switch-row__title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.form-switch-row__desc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

[data-theme="dark"] .theme-switch .bar-switch__icon--moon,
[data-theme="light"] .theme-switch .bar-switch__icon--sun {
    opacity: 1;
}

.audio-switch:has(.bar-switch__input:checked) .bar-switch__icon--vol,
.audio-switch:has(.bar-switch__input:not(:checked)) .bar-switch__icon--mute {
    opacity: 1;
}

/* —— Site header —— */
.site-header {
    position: relative;
    background-color: var(--bg-elevated);
    background-image: var(--header-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(25, 70, 140, 0.45) 0%,
        rgba(12, 40, 95, 0.62) 100%
    );
    pointer-events: none;
}

[data-theme="light"] .site-header::before {
    background: linear-gradient(
        135deg,
        rgba(140, 185, 245, 0.5) 0%,
        rgba(90, 140, 220, 0.65) 100%
    );
}

.site-header__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-brand {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.site-brand:hover {
    color: var(--text);
}

.site-brand__logo {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-brand__text {
    display: flex;
    flex-direction: column;
}

.site-brand__name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.site-brand__tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* —— Main navigation —— */
.main-nav {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.main-nav__inner {
    display: flex;
    align-items: center;
    min-height: var(--nav-h);
}

.main-nav__toggle {
    display: none;
    margin-right: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.main-nav__menu {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.main-nav__item {
    position: relative;
}

.main-nav__item > a {
    display: block;
    padding: 0 1rem;
    line-height: var(--nav-h);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.main-nav__item > a:hover,
.main-nav__item.is-active > a {
    color: var(--accent);
    background: rgba(var(--primary-rgb), 0.08);
}

.main-nav__submenu-toggle {
    display: none;
}

.main-nav__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 50;
}

.main-nav__item.has-children:hover .main-nav__submenu,
.main-nav__item.has-children:focus-within .main-nav__submenu,
.main-nav__item.is-open .main-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav__submenu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    white-space: nowrap;
}

.main-nav__submenu a:hover,
.main-nav__submenu a[aria-current="page"] {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--accent);
}

/* —— Hero (16:9 viewport + right nav) —— */
.hero {
    background-color: var(--bg-elevated);
    background-image: var(--hero-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0;
    overflow: visible;
    --hero-nav-width: 14rem;
}

.hero__grid {
    width: 100%;
    padding-inline: var(--content-inset);
    overflow: visible;
    box-sizing: border-box;
}

.hero__content {
    position: relative;
    box-sizing: border-box;
    isolation: isolate;
}

.hero__content::before,
.hero__content::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #808080;
    z-index: 30;
    pointer-events: none;
}

.hero__content::before {
    left: 0;
}

.hero__content::after {
    right: 0;
}

.hero__stage {
    width: calc(100% - var(--hero-nav-width));
    min-width: 0;
    min-height: 0;
}

.hero__viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    overflow: hidden;
    background: var(--bg);
    border: none;
    border-right: 1px solid var(--border);
}

.hero__panel {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.hero__panel.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.hero__panel-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.hero__panel-link:hover .hero__title,
.hero__panel-link:focus-visible .hero__title {
    color: var(--accent);
}

.hero__read-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

.hero__panel-link:hover .hero__read-more,
.hero__panel-link:focus-visible .hero__read-more {
    text-decoration: underline;
}

.hero__media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

.hero__media--image {
    background: #0f1115;
}

.hero__media-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__media--video {
    background: #000;
}

.hero__video-scale {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero__video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* YouTube API wraps the iframe in a div — keep both flush to the 16:9 frame */
.hero__video-player > div,
.hero__video-player iframe,
.hero__iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    border: 0;
    pointer-events: none;
}

.hero__preloader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(15, 17, 21, 0.94);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

[data-theme="light"] .hero__preloader {
    background: rgba(15, 17, 21, 0.88);
}

.hero__preloader--done,
.hero__preloader[hidden],
#hero-welcome-preloader.is-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.hero__preloader--done .hero__preloader-spinner {
    animation: none;
}

.hero__preloader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 0;
    animation: hero-preloader-spin 0.85s linear infinite;
}

.hero__preloader-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes hero-preloader-spin {
    to {
        transform: rotate(360deg);
    }
}

.hero__video-shield {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: transparent;
    pointer-events: auto;
    cursor: default;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px 15px 10px 15px;
    background: var(--hero-overlay);
    z-index: 1;
}

.hero__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 700;
}

.hero__excerpt {
    margin: 0;
    max-width: 36rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.45;
}

.hero__overlay .hero__title {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .hero__excerpt {
    color: rgba(255, 255, 255, 0.95);
}

.hero__nav {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--hero-nav-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background-color: var(--bg);
    z-index: 1;
}

.hero__nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.hero__nav-list > li {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
}

.hero__nav-btn {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    text-align: left;
    padding: clamp(0.2rem, 0.35vw, 0.65rem) 0.65rem;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.hero__nav-btn:hover {
    border-color: var(--accent);
}

.hero__nav-btn.is-active {
    border-color: var(--accent);
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--accent);
}

.hero__nav-label {
    font-weight: 600;
    font-size: clamp(0.62rem, 0.5vw + 0.55rem, 0.9rem);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* —— Page / post banner (below main nav) —— */
.page-banner {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.page-banner--embed {
    height: min(42vh, 380px);
    min-height: 280px;
}

.page-banner__embed {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: auto;
}

.page-banner--embed .page-banner__overlay {
    background: linear-gradient(to top, rgba(15, 17, 21, 0.94) 0%, rgba(15, 17, 21, 0.55) 40%, rgba(15, 17, 21, 0.2) 100%);
}

[data-theme="light"] .page-banner--embed .page-banner__overlay {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.65) 45%, rgba(255, 255, 255, 0.25) 100%);
}

.page-banner__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.page-banner__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(15, 17, 21, 0.92) 0%, rgba(15, 17, 21, 0.35) 55%, rgba(15, 17, 21, 0.15) 100%);
}

[data-theme="light"] .page-banner__overlay {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 55%, rgba(255, 255, 255, 0.2) 100%);
}

.page-banner__inner {
    width: 100%;
    padding: 1.25rem var(--content-inset) 1.5rem;
    box-sizing: border-box;
}

.page-banner__meta {
    margin: 0 0 0.35rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .page-banner__meta {
    color: var(--text-muted);
}

.page-banner__title {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .page-banner__title {
    color: var(--text);
    text-shadow: none;
}

.has-page-banner .page-content > h1:first-child,
.has-page-banner .post-single__content > h1:first-child {
    display: none;
}

.site-main--with-banner {
    padding-top: 2rem;
}

.site-main--with-account-tabs {
    padding-top: 1.75rem;
}

.has-account-tabs.has-page-banner .page-content--account > h1:first-child {
    display: none;
}

/* —— Account area: tab bar (below page banner; same content width as .main-nav) —— */
.account-tabs {
    width: 100%;
    background: linear-gradient(180deg, #1a2233 0%, #151b28 100%);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .account-tabs {
    background: linear-gradient(180deg, #eef2f8 0%, #e8edf4 100%);
    border-bottom-color: #d5dce8;
}

.account-tabs__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    min-height: var(--nav-h);
}

.account-tabs__list {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

.account-tabs__tab {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 1rem;
    min-height: var(--nav-h);
    border-radius: 0;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    color: var(--text-muted);
    background: transparent;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.account-tabs__tab:hover {
    color: var(--text);
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.25);
}

.account-tabs__tab.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.4);
}

[data-theme="light"] .account-tabs__tab.is-active {
    color: #fff;
}

.account-tabs__admin-link {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: #f8d48a;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(248, 180, 73, 0.45);
    border-radius: 0;
    white-space: nowrap;
}

.account-tabs__admin-link:hover {
    color: #fde68a;
    background: rgba(248, 180, 73, 0.12);
}

.page-content--account {
    width: 100%;
    max-width: none;
}

.page-content--account .auth-notice {
    max-width: none;
}

.page-content--account .auth-form.account-form {
    max-width: none;
}

.page-content--account .auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.page-content--account .auth-form select {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

.account-panels {
    width: 100%;
    max-width: none;
}

.account-panel.is-active {
    display: block;
}

.account-panel__lead {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 52rem;
}

.account-panel__card {
    padding: 1.15rem 1.25rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: var(--bg-elevated);
}

[data-theme="dark"] .account-panel__card {
    background: #1a2233;
    border-color: #3d4d66;
}

.account-panel__title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-hover);
}

.account-panel__card p {
    margin: 0;
    color: var(--text-muted);
}

.account-form {
    max-width: none;
}

/* —— Account layout shell —— */
.account-layout {
    width: 100%;
}

.account-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    padding: 1.75rem 2rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.32);
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.22) 0%, transparent 55%),
        var(--bg-elevated);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .account-hero {
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.18) 0%, transparent 50%),
        #1a2233;
    border-color: #3d4d66;
}

.account-hero__avatar {
    width: 7rem;
    height: 7rem;
    border-radius: 0;
    object-fit: cover;
    border: 3px solid rgba(var(--primary-rgb), 0.45);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.account-hero__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.account-hero__name {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
}

.account-hero__meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.account-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 10rem;
}

.account-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    max-width: none;
}

.account-stat-card {
    margin: 0;
    padding: 1.1rem 1.2rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: var(--bg-elevated);
    min-height: 5.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

[data-theme="dark"] .account-stat-card {
    background: #1a2233;
    border-color: #3d4d66;
}

.account-stat-card--accent {
    border-color: rgba(var(--primary-rgb), 0.5);
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.12), var(--bg-elevated));
}

.account-stat-card__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.account-stat-card__value {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.account-stat-card__value a {
    font-weight: 600;
}

.account-stat-card__hint {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
}

.account-profile__birthday-public.form-switch-row {
    margin-top: 1rem;
}

.members-directory__label--private {
    color: var(--text-muted);
    font-style: italic;
}

.account-surface-card {
    padding: 1.35rem 1.5rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: var(--bg-elevated);
}

[data-theme="dark"] .account-surface-card {
    background: #1a2233;
    border-color: #3d4d66;
}

.account-surface-card__title {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.account-surface-card--wide {
    grid-column: 1 / -1;
}

.account-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.account-form-grid__photo {
    grid-column: span 4;
}

.account-form-grid__account {
    grid-column: span 8;
}

.account-form-grid__directory,
.account-form-grid__security {
    grid-column: span 6;
}

.account-form-grid__actions {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(var(--primary-rgb), 0.2);
}

.account-profile__section {
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
}

.account-profile__legend {
    padding: 0;
    margin: 0 0 0.85rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-hover);
}

.account-profile__avatar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem;
}

.account-profile__avatar-preview {
    width: 6rem;
    height: 6rem;
    border-radius: 0;
    object-fit: cover;
    border: 2px solid rgba(var(--primary-rgb), 0.35);
    flex-shrink: 0;
}

.account-profile__avatar-preview--large {
    width: 7.5rem;
    height: 7.5rem;
}

.account-profile__avatar-row--card {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.account-profile__avatar-row--card .account-profile__avatar-actions {
    width: 100%;
}

.account-profile__avatar-actions {
    flex: 1 1 12rem;
    min-width: 0;
}

.account-profile__upload-btn {
    display: inline-block;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.account-profile__upload-status--error {
    color: #f87171;
}

.avatar-crop-modal-open {
    overflow: hidden;
}

.avatar-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.avatar-crop-modal[hidden] {
    display: none;
}

.avatar-crop-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.avatar-crop-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(32rem, 100%);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: 0;
    background: var(--surface-elevated, #1a2332);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
}

.avatar-crop-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-hover);
}

.avatar-crop-modal__hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.avatar-crop-modal__stage {
    width: 100%;
    max-height: min(60vh, 24rem);
    overflow: hidden;
    background: #0d1117;
    border-radius: 0;
}

.avatar-crop-modal__image {
    display: block;
    max-width: 100%;
}

.avatar-crop-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.account-profile__birthday-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0.65rem;
}

.account-profile__birthday-row select,
.account-profile__birthday-row input {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}

.auth-form__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.account-checklist {
    display: grid;
    gap: 0.85rem;
}

.account-checklist__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
    cursor: pointer;
}

.account-checklist__item > input[type="checkbox"],
.account-checklist__item > input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.2rem 0 0;
    padding: 0;
    flex-shrink: 0;
    align-self: start;
    accent-color: var(--accent);
}

.account-checklist__desc {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
}

.account-notify-layout {
    max-width: none;
}

.account-notify-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.account-notify-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 1.25rem 1.35rem;
    min-height: 8rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.account-notify-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.account-notify-card:has(.form-switch__input:checked) {
    border-color: var(--accent);
    background: linear-gradient(160deg, rgba(var(--primary-rgb), 0.14), var(--bg-elevated));
    box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.35);
}

[data-theme="dark"] .account-notify-card {
    background: #1a2233;
    border-color: #3d4d66;
}

[data-theme="dark"] .account-notify-card:has(.form-switch__input:checked) {
    background: linear-gradient(160deg, rgba(var(--primary-rgb), 0.2), #1f2a3d);
}

.account-notify-card .form-switch {
    align-self: center;
}

.account-notify-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.account-notify-card__title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.account-notify-card__desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.account-billing-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.account-billing-layout__coming {
    grid-column: 1 / -1;
}

.account-billing-plan {
    margin: 0 0 1rem;
}

.account-billing-plan__badge {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fde68a;
    background: rgba(var(--primary-rgb), 0.25);
    border: 1px solid rgba(var(--primary-rgb), 0.45);
}

.account-billing-features {
    margin: 0;
    padding: 0 0 0 1.2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem 1.5rem;
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .account-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-form-grid__photo {
        grid-column: span 5;
    }

    .account-form-grid__account {
        grid-column: span 7;
    }
}

@media (max-width: 900px) {
    .account-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
    }

    .account-hero__avatar {
        margin-inline: auto;
    }

    .account-hero__actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: 0;
    }

    .account-form-grid__photo,
    .account-form-grid__account,
    .account-form-grid__directory,
    .account-form-grid__security {
        grid-column: 1 / -1;
    }

    .account-notify-grid {
        grid-template-columns: 1fr;
    }

    .account-billing-layout {
        grid-template-columns: 1fr;
    }

    .account-billing-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .account-profile__birthday-row {
        grid-template-columns: 1fr;
    }

    .account-dashboard {
        grid-template-columns: 1fr;
    }

    .auth-form__field-row.account-form-grid__split {
        grid-template-columns: 1fr;
    }

    .account-hero__actions {
        flex-direction: column;
        width: 100%;
    }
}

.auth-form__field-row {
    display: grid;
    grid-template-columns: 1fr minmax(6rem, 8rem);
    gap: 0.75rem 1rem;
}

.auth-form__field-row.account-form-grid__split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 480px) {
    .auth-form__field-row {
        grid-template-columns: 1fr;
    }
}

/* —— Public members directory —— */
.members-directory {
    margin-top: 2rem;
}

.members-directory__heading {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--primary-hover);
}

.members-directory__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
    margin-bottom: 0.75rem;
}

.members-directory__search-wrap,
.members-directory__sort-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.members-directory__search-wrap {
    flex: 1 1 14rem;
}

.members-directory__sort-wrap {
    flex: 0 0 auto;
}

.members-directory__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.members-directory__search,
.members-directory__sort {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}

.members-directory__search:focus,
.members-directory__sort:focus {
    outline: 2px solid rgba(var(--primary-rgb), 0.45);
    outline-offset: 1px;
    border-color: var(--primary);
}

.members-directory__count {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.members-directory__table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    border-radius: 0;
    background: var(--bg-elevated);
}

[data-theme="dark"] .members-directory__table-wrap {
    background: #1a2233;
    border-color: #3d4d66;
}

.members-directory__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.members-directory__table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(var(--primary-rgb), 0.08);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.members-directory__th--avatar {
    width: 5rem;
}

.members-directory__th--username {
    width: 22%;
    min-width: 8rem;
}

.members-directory__th--location {
    width: 32%;
    min-width: 10rem;
}

.members-directory__table thead th.members-directory__th--birthday {
    width: 26%;
    min-width: 9rem;
    text-align: right;
}

.members-directory__list {
    margin: 0;
}

.members-directory__item td {
    padding: 0.65rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.members-directory__item:last-child td {
    border-bottom: none;
}

.members-directory__item:nth-child(even) td {
    background: rgba(var(--primary-rgb), 0.04);
}

.members-directory__item.members-directory__item--hidden,
.members-directory__item[hidden] {
    display: none !important;
}

.members-directory__col--avatar {
    width: 5rem;
    text-align: left;
}

.members-directory__avatar {
    display: block;
    width: 3rem;
    height: 3rem;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    border: 2px solid rgba(var(--primary-rgb), 0.35);
    background: var(--bg);
}

.members-directory__username {
    font-weight: 600;
    color: var(--text);
}

.members-directory__col--location {
    color: var(--text-muted);
}

.members-directory__col--birthday {
    color: var(--text-muted);
    text-align: right;
}

.members-directory__birthday-soon {
    margin-left: 0.35rem;
    font-weight: 600;
    color: var(--primary-hover);
    white-space: nowrap;
}

.members-directory__muted {
    font-style: italic;
    opacity: 0.85;
}

.members-directory__empty {
    margin: 1rem 0 0;
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 0;
}

.members-directory__empty--static {
    border-style: solid;
    background: var(--bg-elevated);
}

.members-directory__pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.members-directory__page-btn {
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.members-directory__page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary-hover);
    background: rgba(var(--primary-rgb), 0.08);
}

.members-directory__page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.members-directory__page-status {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 7rem;
    text-align: center;
}

@media (max-width: 640px) {
    .members-directory__table {
        min-width: 32rem;
    }

    .members-directory__item td,
    .members-directory__table thead th {
        padding: 0.55rem 0.65rem;
    }

    .members-directory__avatar {
        width: 2.5rem;
        height: 2.5rem;
    }
}

@media (max-width: 640px) {
    .account-tabs__inner {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
        padding: 0.5rem 0;
    }

    .account-tabs__list {
        flex: 1 1 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        -webkit-overflow-scrolling: touch;
    }

    .account-tabs__tab {
        flex: 1 0 auto;
        min-height: 2.75rem;
        padding: 0.5rem 1rem;
    }

    .account-tabs__admin-link {
        align-self: flex-start;
    }
}

/* —— Home: bar below hero (matches main nav height) —— */
.home-sub-bar {
    width: 100%;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.home-sub-bar__inner {
    min-height: var(--nav-h);
}

/* —— Home: 4 recent posts —— */
.home-recent-posts {
    width: 100%;
    padding: 2rem 0 2.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.home-recent-posts__inner {
    width: 100%;
}

.home-recent-posts__grid {
    list-style: none;
    margin: 15px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.home-recent-posts__item {
    margin: 0;
    min-width: 0;
}

.home-recent-post {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.home-recent-post__image-link {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f1115;
}

.home-recent-post__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.home-recent-post__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 1.125rem 1.25rem;
    gap: 0.5rem;
}

.home-recent-post__date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.home-recent-post__title {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.3;
    font-weight: 600;
}

.home-recent-post__title a {
    color: var(--text);
    text-decoration: none;
}

.home-recent-post__title a:hover {
    color: var(--accent);
}

.home-recent-post__excerpt {
    margin: 0;
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.home-recent-post__more {
    align-self: flex-start;
    margin-top: 0.35rem;
    text-decoration: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.has-hero .site-main {
    padding-top: 2rem;
}

@media (max-width: 1100px) {
    .home-recent-posts__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .home-recent-posts__grid {
        grid-template-columns: 1fr;
    }
}

/* —— Main content (WordPress .entry-content friendly) —— */
.site-main {
    flex: 1;
    width: 100%;
    padding: 2rem 0 3rem;
}

.site-main__inner {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: var(--content-inset);
    box-sizing: border-box;
}

/* —— Blog posts —— */
.post-list {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    gap: 2rem;
}

.post-card {
    margin: 0;
}

.post-card__link {
    display: grid;
    grid-template-columns: minmax(200px, 320px) 1fr;
    gap: 1.25rem;
    align-items: start;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.post-card__link:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.post-card__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.post-card__body {
    display: block;
    padding: 1rem 1.25rem 1.25rem 0;
}

.post-card__date {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.post-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--text);
}

.post-card__link:hover .post-card__title {
    color: var(--accent);
}

.post-card--sticky .post-card__link {
    border-color: var(--accent);
}

.post-card__badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 0;
    vertical-align: middle;
}

.post-card__excerpt {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.post-single__back {
    margin: 0 0 1rem;
    font-size: 0.875rem;
}

.post-single__back a {
    text-decoration: none;
}

.post-single__header {
    margin-bottom: 1.25rem;
}

.post-single__date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.post-single__title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.25;
}

.post-single__featured {
    margin: 0 0 1.5rem;
}

.post-single__featured img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid var(--border);
}

.page-content__featured {
    margin: 0 0 1.5rem;
}

.page-content__featured img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid var(--border);
}

.post-single__content h2 {
    margin-top: 1.75em;
}

.page-content h1,
.page-content h2,
.page-content h3 {
    line-height: 1.25;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.page-content h1:first-child {
    margin-top: 0;
}

.page-content > p:first-of-type {
    font-size: 1.05rem;
    color: var(--text-muted);
}

.page-content p,
.page-content ul,
.page-content blockquote {
    margin: 0 0 1em;
}

.page-content ul {
    padding-left: 1.25rem;
}

.page-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.page-content code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.contact-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 52rem;
    margin-bottom: 1.75rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 2rem 2.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.contact-layout__aside {
    min-width: 0;
}

.contact-layout__form {
    min-width: 0;
    position: sticky;
    top: calc(var(--top-bar-h) + var(--nav-h) + 1rem);
}

@media (max-width: 900px) {
    .contact-layout__form {
        position: static;
    }
}

.page-content--contact .contact-notice {
    max-width: none;
    margin-bottom: 1.5rem;
}

.contact-page__section-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.contact-info-list {
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.contact-info-card {
    margin: 0;
    padding: 1rem 1.1rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: var(--bg-elevated);
}

[data-theme="dark"] .contact-info-card {
    background: #1a2233;
    border-color: #3d4d66;
}

.contact-info-card__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.contact-info-card a {
    font-weight: 500;
}

.contact-tips {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.contact-tips li {
    margin-bottom: 0.5rem;
}

.contact-notice {
    margin: 0 0 1.25rem;
    max-width: 42rem;
    padding: 0.85rem 1rem;
    border-radius: 0;
    border: 1px solid var(--border);
}

.contact-notice--success {
    background: rgba(46, 160, 67, 0.18);
    border-color: rgba(72, 200, 104, 0.55);
    color: #b8f0c8;
}

[data-theme="light"] .contact-notice--success {
    color: #1e4620;
}

.contact-notice--error {
    background: rgba(248, 81, 73, 0.16);
    border-color: rgba(248, 120, 110, 0.55);
    color: #ffc9c5;
}

[data-theme="light"] .contact-notice--error {
    color: #5c1a16;
}

.contact-notice ul {
    margin: 0.35rem 0 0;
    padding-left: 1.25rem;
}

.contact-notice p {
    margin: 0;
}

.contact-form-panel {
    margin-top: 0;
    max-width: none;
    padding: 1.75rem 1.85rem 1.65rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    background: linear-gradient(165deg, #1e2636 0%, #171d2a 100%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

[data-theme="light"] .contact-form-panel {
    background: linear-gradient(165deg, #ffffff 0%, #f3f6fb 100%);
    border-color: rgba(var(--primary-rgb), 0.22);
    box-shadow:
        0 6px 24px rgba(60, 64, 67, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.contact-form-panel__heading {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.contact-form-panel__hint {
    margin: 0 0 1.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-form__section {
    margin-bottom: 0.25rem;
}

.contact-form__section[hidden] {
    display: none !important;
}

.contact-form__section-title {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.contact-form__section-note {
    margin: -0.35rem 0 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.contact-form__optional {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.contact-form__hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form__field {
    margin-bottom: 1.15rem;
}

.contact-form__field:last-of-type {
    margin-bottom: 1.35rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f3f4f6;
}

[data-theme="light"] .contact-form label {
    color: var(--text);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    display: block;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #4d5d75;
    border-radius: 0;
    background: #2a3447;
    color: #f8fafc;
    font: inherit;
    line-height: 1.45;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.contact-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b9bb3' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
}

[data-theme="light"] .contact-form input,
[data-theme="light"] .contact-form textarea,
[data-theme="light"] .contact-form select {
    border-color: #c5cdd8;
    background: #ffffff;
    color: var(--text);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #8b9bb3;
}

[data-theme="light"] .contact-form input::placeholder,
[data-theme="light"] .contact-form textarea::placeholder {
    color: #9aa0a6;
}

.contact-form input:hover,
.contact-form textarea:hover,
.contact-form select:hover {
    border-color: #6b7f9e;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--primary);
    background: #303c52;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.35);
}

[data-theme="light"] .contact-form input:focus,
[data-theme="light"] .contact-form textarea:focus,
[data-theme="light"] .contact-form select:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.contact-form textarea {
    min-height: 9rem;
    resize: vertical;
}

.contact-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin: 0;
    padding-top: 0.25rem;
}

.btn--secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid #4d5d75;
}

[data-theme="light"] .btn--secondary {
    border-color: #c5cdd8;
    color: var(--text);
}

.btn--secondary:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
    filter: none;
}

.btn--prefill {
    padding: 0.7rem 1rem;
    border-radius: 0;
    font-weight: 600;
}

.btn--contact {
    min-width: 10rem;
    padding: 0.7rem 1.35rem;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.35);
}

.btn--contact:hover {
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.45);
}

.auth-notice {
    margin: 0 0 1.25rem;
    max-width: 28rem;
    padding: 0.85rem 1rem;
    border-radius: 0;
    border: 1px solid var(--border);
}

.auth-notice--error {
    background: rgba(248, 81, 73, 0.16);
    border-color: rgba(248, 120, 110, 0.55);
}

.auth-notice--success {
    background: rgba(46, 160, 67, 0.18);
    border-color: rgba(72, 200, 104, 0.55);
}

.auth-notice ul {
    margin: 0;
    padding-left: 1.2rem;
}

.auth-form {
    max-width: 28rem;
}

.auth-form__field {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.auth-form__help,
.auth-form__optional {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-form__footer {
    margin-top: 1rem;
    color: var(--text-muted);
}

.auth-form label {
    font-weight: 500;
}

.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
    width: 100%;
    max-width: 28rem;
    margin-top: 0.25rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
}

[data-theme="dark"] .auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
    background: #2a3447;
    border-color: #4d5d75;
    color: #f8fafc;
}

.auth-form input[type="checkbox"]:not(.form-switch__input),
.auth-form input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    accent-color: var(--accent);
}

.auth-form__actions {
    margin-top: 1.25rem;
}

/* Legacy account-card kept for any older markup */
.account-card {
    padding: 1rem 1.1rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: var(--bg-elevated);
}

[data-theme="dark"] .account-card {
    background: #1a2233;
    border-color: #3d4d66;
}

.account-card__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-hover);
}

.account-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1.5rem;
}

.account-links__item {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    text-decoration: none;
    font-weight: 500;
}

.account-links__item--admin {
    border-color: rgba(248, 180, 73, 0.55);
    color: #f8d48a;
}

.top-bar__user-name {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    filter: brightness(1.08);
}

/* —— Footer —— */
.site-footer {
    position: sticky;
    bottom: 0;
    z-index: 999;
    min-height: var(--top-bar-h);
    border-top: 1px solid var(--border);
    background: var(--bg-bar);
    padding: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    min-height: var(--top-bar-h);
    padding-inline: calc(var(--content-inset) + 15px);
}

.site-footer__copy {
    margin: 0;
    line-height: 1.2;
    min-width: 0;
    justify-self: start;
}

.site-footer__center {
    justify-self: center;
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.site-footer__maintenance-label {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: #c62828;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-radius: 0;
}

.site-footer__back-top-label {
    margin: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 0;
    background: #fff;
    color: #000;
    cursor: pointer;
}

.site-footer__back-top {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: inherit;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: opacity 0.15s;
}

.site-footer__back-top-label:hover .site-footer__back-top,
.site-footer__back-top-label:focus-within .site-footer__back-top,
.site-footer__back-top:hover,
.site-footer__back-top:focus-visible {
    opacity: 0.85;
    outline: none;
}

.site-footer__social {
    flex-shrink: 0;
}

.site-footer__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
    justify-self: end;
    grid-column: 3;
}

.site-footer__ftp-deploy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.site-footer__ftp-deploy:hover,
.site-footer__ftp-deploy:focus-visible {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    outline: none;
}

.site-footer__ftp-deploy:disabled {
    opacity: 0.55;
    cursor: wait;
}

.site-footer__ftp-deploy-icon {
    display: block;
}

.site-footer__ftp-status {
    position: absolute;
    right: calc(var(--content-inset) + 15px);
    bottom: calc(var(--top-bar-h) + 0.35rem);
    margin: 0;
    padding: 0.35rem 0.55rem;
    max-width: min(20rem, 70vw);
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.site-footer__ftp-status--error {
    color: #f87171;
}

.site-footer__social-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 0;
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus-visible {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.site-footer__social-link--unlinked {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.site-footer__social-icon {
    display: block;
}

/* —— Responsive —— */
@media (max-width: 1400px) {
    :root {
        --content-inset: 7%;
    }
}

@media (max-width: 1200px) {
    :root {
        --content-inset: 4%;
    }

    .hero {
        --hero-nav-width: 12rem;
    }
}

@media (max-width: 992px) {
    :root {
        --content-inset: 2%;
    }

    .hero {
        --hero-nav-width: 10.5rem;
    }
}

@media (max-width: 860px) {
    :root {
        --content-inset: 0;
    }
}

@media (max-width: 768px) {
    .post-card__link {
        grid-template-columns: 1fr;
    }

    .post-card__body {
        padding: 1rem 1.25rem 1.25rem;
    }

    .hero__content {
        display: block;
    }

    .hero__stage {
        width: 100%;
    }

    .hero__viewport {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .hero__nav {
        position: static;
        width: 100%;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .hero__nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        flex: none;
    }

    .hero__nav-list > li {
        flex: 0 0 auto;
        display: block;
    }

    .hero__nav-btn {
        flex: none;
        height: auto;
        min-height: 2.75rem;
        display: block;
        padding: 0.65rem 0.85rem;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }

    .hero__nav-label {
        font-size: 0.9rem;
        white-space: normal;
    }

    .main-nav__toggle {
        display: block;
    }

    .main-nav__menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 0.5rem;
    }

    .main-nav__menu.is-open {
        display: flex;
    }

    .main-nav__item > a {
        line-height: 2.75rem;
        padding-inline: 0.5rem;
    }

    .main-nav__submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        display: none;
    }

    .main-nav__item.is-open .main-nav__submenu {
        display: block;
    }

    .main-nav__submenu-toggle {
        display: inline-block;
        position: absolute;
        right: 0;
        top: 0;
        width: 2.75rem;
        height: 2.75rem;
        border: none;
        background: transparent;
        cursor: pointer;
    }

    .main-nav__submenu-toggle::after {
        content: "";
        display: inline-block;
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid var(--text-muted);
    }
}
