﻿@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
    --font-display: 'Cinzel', Georgia, serif;
    --font-body: 'Manrope', 'Segoe UI', Tahoma, sans-serif;

    --bg: #f6f8fb;
    --bg-accent: #e7eef8;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-muted: #f1f5fa;
    --text: #162032;
    --text-muted: #53617a;
    --line: rgba(28, 51, 90, 0.16);

    --primary: #1d63c2;
    --primary-strong: #114a96;
    --primary-soft: rgba(29, 99, 194, 0.12);
    --danger: #be3a3a;
    --status-active-fg: #0d6f26;
    --status-active-bg: #eaf7ee;
    --status-active-border: #8fcfa0;
    --status-hiatus-fg: #7a620b;
    --status-hiatus-bg: #fff8e1;
    --status-hiatus-border: #dec578;
    --status-complete-fg: #244d7d;
    --status-complete-bg: #e9f1fb;
    --status-complete-border: #94b5de;
    --status-dead-fg: #8a1c1c;
    --status-dead-bg: #fdecec;
    --status-dead-border: #e2a5a5;
    --status-retired-fg: #3f4d64;
    --status-retired-bg: #eef2f8;
    --status-retired-border: #b3c0d5;
    --status-missing-fg: #7a620b;
    --status-missing-bg: #fff8e1;
    --status-missing-border: #dec578;
    --status-coming-soon-fg: #6f7782;
    --status-coming-soon-bg: #eef1f5;
    --status-coming-soon-border: #cfd5dd;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 10px 25px rgba(14, 35, 65, 0.08);
    --shadow-md: 0 18px 42px rgba(13, 30, 62, 0.14);
}

body.dark-mode {
    --bg: #0f1726;
    --bg-accent: #17233a;
    --surface: rgba(24, 35, 56, 0.82);
    --surface-strong: #1c2a42;
    --surface-muted: #243452;
    --text: #eaf1ff;
    --text-muted: #b4c1d8;
    --line: rgba(170, 193, 232, 0.22);

    --primary: #8ec1ff;
    --primary-strong: #69a9f7;
    --primary-soft: rgba(142, 193, 255, 0.17);
    --danger: #f18686;
    --status-active-fg: #7ee28e;
    --status-active-bg: rgba(126, 226, 142, 0.14);
    --status-active-border: rgba(126, 226, 142, 0.5);
    --status-hiatus-fg: #ffd166;
    --status-hiatus-bg: rgba(255, 209, 102, 0.14);
    --status-hiatus-border: rgba(255, 209, 102, 0.5);
    --status-complete-fg: #8ec1ff;
    --status-complete-bg: rgba(142, 193, 255, 0.14);
    --status-complete-border: rgba(142, 193, 255, 0.48);
    --status-dead-fg: #ff9c9c;
    --status-dead-bg: rgba(255, 156, 156, 0.14);
    --status-dead-border: rgba(255, 156, 156, 0.5);
    --status-retired-fg: #d0def7;
    --status-retired-bg: rgba(208, 222, 247, 0.14);
    --status-retired-border: rgba(208, 222, 247, 0.45);
    --status-missing-fg: #ffe08a;
    --status-missing-bg: rgba(255, 224, 138, 0.14);
    --status-missing-border: rgba(255, 224, 138, 0.5);
    --status-coming-soon-fg: #d2d8e0;
    --status-coming-soon-bg: rgba(210, 216, 224, 0.14);
    --status-coming-soon-border: rgba(210, 216, 224, 0.5);

    --shadow-sm: 0 12px 28px rgba(3, 9, 22, 0.42);
    --shadow-md: 0 20px 44px rgba(2, 6, 16, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(86, 143, 219, 0.2), transparent 42%),
        radial-gradient(circle at -15% -25%, rgba(27, 87, 160, 0.12), transparent 50%),
        linear-gradient(165deg, var(--bg) 0%, var(--bg-accent) 100%);
    transition: background-color 0.65s ease, color 0.65s ease;
    line-height: 1.6;
}

body.calendar-page {
    overflow-x: hidden;
}

body.theme-fading {
    animation: theme-fade 0.7s ease;
}

@keyframes theme-fade {
    0% {
        opacity: 0.82;
    }
    100% {
        opacity: 1;
    }
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

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

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

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem clamp(0.9rem, 2vw, 2rem);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(13, 30, 62, 0.12);
}

.nav-left,
.nav-right {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.nav-right {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--line);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    flex: 1.4;
}

.nav-list li {
    margin: 0;
}

.nav-list a {
    display: block;
    padding: 0.58rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-strong);
    background-color: var(--primary-soft);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.nav-button,
.edit-button,
.delete-button,
button[type='submit'],
button[type='button'] {
    border: 1px solid var(--line);
    background-color: var(--surface-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 0.52rem 0.95rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-button:hover,
.edit-button:hover,
.delete-button:hover,
button[type='submit']:hover,
button[type='button']:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.theme-toggle {
    --toggle-width: 84px;
    --toggle-height: 36px;
    --thumb-size: 24px;
    --thumb-inset: 4px;
    --thumb-left: var(--thumb-inset);
    --thumb-right: calc(100% - var(--thumb-size) - var(--thumb-inset));
    display: inline-block;
    width: var(--toggle-width);
    height: var(--toggle-height);
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    border-radius: 999px;
}

button.theme-toggle,
.theme-toggle.nav-button {
    width: var(--toggle-width);
    min-width: var(--toggle-width);
    height: var(--toggle-height);
    padding: 0;
}

.theme-toggle__track {
    display: inline-block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(140deg, #f9ca66 0%, #f29f35 48%, #ea7f2a 100%);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
    transition: background 0.65s ease, box-shadow 0.65s ease;
}

.theme-toggle__thumb {
    position: absolute;
    top: 50%;
    left: var(--thumb-left);
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 50%;
    background: #fff9ef;
    color: #f28d2a;
    box-shadow: 0 5px 12px rgba(13, 30, 62, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    transition: left 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), background-color 0.65s ease, color 0.65s ease, box-shadow 0.3s ease;
}

.theme-toggle__thumb svg {
    width: 16px;
    height: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transition: opacity 0.3s ease, transform 0.38s ease;
}

.theme-toggle__sun-icon circle {
    fill: currentColor;
    stroke: none;
}

.theme-toggle__sun-icon line,
.theme-toggle__moon-icon path {
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle__sun-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.theme-toggle__moon-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(-20deg);
}

body.dark-mode .theme-toggle {
    color: #dce8fb;
}

body.dark-mode .theme-toggle__track {
    background: linear-gradient(145deg, #0f1f3d 0%, #1b365f 55%, #2e5488 100%);
    border-color: rgba(151, 176, 216, 0.5);
    box-shadow: inset 0 0 0 1px rgba(163, 190, 230, 0.24);
}

body.dark-mode .theme-toggle__thumb {
    left: var(--thumb-right);
    background: #dbe7fb;
    color: #1b3762;
}

body.dark-mode .theme-toggle__sun-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(20deg);
}

body.dark-mode .theme-toggle__moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.theme-toggle:hover .theme-toggle__thumb {
    box-shadow: 0 6px 14px rgba(13, 30, 62, 0.3);
}

.navbar,
.main-content > section,
.section,
.map-section,
.message,
.wiki-item,
.wiki-modal-content,
.modal-content,
.login-container,
.nav-button,
.edit-button,
.delete-button,
button[type='submit'],
button[type='button'],
input,
select,
textarea {
    transition: background-color 0.65s ease, color 0.65s ease, border-color 0.65s ease, box-shadow 0.65s ease;
}

.delete-button {
    color: var(--danger);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    padding: 0.48rem 0.65rem;
    cursor: pointer;
}

.mobile-page-title {
    display: none;
}

.mobile-nav-control {
    display: none;
}

.mobile-only {
    display: none;
}

.banner {
    margin: 1rem auto 0;
    width: min(1260px, calc(100% - 2rem));
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}

.banner img {
    width: 100%;
    display: block;
    max-height: 300px;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.banner:hover img {
    transform: scale(1.03);
}

.main-content {
    width: min(1220px, calc(100% - 2rem));
    margin: 1.25rem auto 3rem;
    display: grid;
    gap: 1rem;
}

.main-content > section,
.section,
.map-section,
.message,
.wiki-item,
.wiki-modal-content,
.modal-content,
.login-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.main-content > section,
.section,
.map-section,
.message,
.wiki-modal-content,
.modal-content {
    padding: clamp(1rem, 2.4vw, 1.5rem);
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list li {
    margin: 0.55rem 0;
}

.list a {
    font-weight: 700;
    text-decoration: none;
}

.message-board {
    display: grid;
    gap: 0.9rem;
}

.message {
    position: relative;
    overflow: hidden;
}

.message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--primary-strong));
}

.message h3,
.message h2 {
    margin-bottom: 0.55rem;
}

.message p + p {
    margin-top: 0.45rem;
}

.feed-section-title {
    margin-bottom: 0.2rem;
}

.feed-section-subtitle {
    margin: 0 0 0.6rem;
    color: var(--text-muted);
}

.feed-items {
    margin-top: 0.55rem;
    border-top: 2px solid color-mix(in srgb, var(--line) 55%, var(--text-muted) 45%);
}

.feed-item {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item h3 {
    margin: 0 0 0.25rem;
}

.feed-body-text {
    white-space: pre-line;
}

.feed-view-full-link {
    display: inline-block;
    margin-top: 0.3rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.home-two-column-feeds {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.feed-open-entry-button {
    margin-top: 0.85rem;
    display: inline-block;
}

.feed-wiki-item .wiki-item-meta {
    margin-bottom: 0.25rem;
}

.login-container {
    width: min(480px, calc(100% - 2rem));
    margin: 8vh auto;
    padding: clamp(1.2rem, 2.8vw, 1.8rem);
    text-align: center;
}

body.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 2.2rem);
    background:
        radial-gradient(circle at 20% 15%, rgba(82, 139, 220, 0.23), transparent 42%),
        radial-gradient(circle at 80% 82%, rgba(48, 85, 142, 0.26), transparent 46%),
        linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 460px);
    gap: clamp(1rem, 3vw, 2.4rem);
    align-items: stretch;
}

.login-intro,
body.login-page .login-container {
    margin: 0;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
    box-shadow: var(--shadow-md);
}

.login-intro {
    padding: clamp(1.2rem, 3vw, 2rem);
    display: grid;
    gap: 0.65rem;
    align-content: center;
}

.login-crest {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.login-kicker {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.login-intro h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.login-subtitle {
    max-width: 44ch;
    font-size: 1rem;
}

body.login-page .login-container {
    padding: clamp(1.2rem, 2.8vw, 1.9rem);
    display: grid;
    gap: 0.65rem;
    align-content: center;
}

body.login-page .login-container h2 {
    margin-bottom: 0;
}

.login-copy {
    margin-bottom: 0.35rem;
}

.login-google-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    margin-top: 0.2rem;
}

.login-google-wrap .g_id_signin {
    display: inline-flex;
    justify-content: center;
}

.login-google-wrap > div,
.login-google-wrap iframe {
    margin-left: auto !important;
    margin-right: auto !important;
}

.login-status {
    min-height: 1.25em;
    margin-top: 1rem;
    font-weight: 700;
}

.login-status.error {
    color: var(--danger);
}

.login-status.success {
    color: #2d9155;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 0.58rem 0.72rem;
    font-family: var(--font-body);
    font-size: 0.94rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
    outline-offset: 1px;
}

.map-section label {
    color: var(--text);
    font-weight: 700;
    display: inline-block;
    margin-bottom: 0.35rem;
}

.map-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    align-items: end;
}

.campaign-map-focus {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    padding: 0.9rem;
    margin-bottom: 0.85rem;
}

.campaign-map-focus-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.campaign-map-location-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

.campaign-map-location-button {
    width: auto;
}

#map-container {
    height: min(72vh, 760px);
    width: 100%;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.mouse-position {
    margin-top: 0.6rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.calendar-iframe,
#calendar-iframe {
    width: 100%;
    height: calc(100vh - 190px);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
}

.calendar-embed-shell {
    width: 100%;
    overflow: hidden;
}

.calendar-mobile-tools {
    display: none;
}

.calendar-mobile-note {
    margin-bottom: 0.45rem;
}

.wiki-content {
    text-align: left;
}

.wiki-controls {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(200px, 1fr);
    gap: 0.8rem;
    margin: 1rem 0;
}

.wiki-section {
    margin-top: 0.85rem;
}

.wiki-section h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0;
    cursor: pointer;
}

.wiki-section h3::after {
    content: '\25BC';
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.wiki-section.open h3::after {
    transform: rotate(180deg);
}

.wiki-items {
    margin-top: 0.7rem;
    padding-left: 0;
    display: none;
}

.wiki-item {
    margin-bottom: 0.6rem;
    padding: 0.9rem;
    background: var(--surface-muted);
    cursor: pointer;
}

.wiki-item-title {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.25;
}

.wiki-item-meta {
    margin-top: 0.28rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.wiki-item-meta-pill {
    display: inline-block;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.wiki-item-summary {
    margin-top: 0.5rem;
}

.location-tag {
    font-style: italic;
    color: var(--text-muted);
}

.wiki-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background-color: rgba(4, 11, 24, 0.45);
    z-index: 1500;
}

.wiki-modal-content {
    width: min(720px, calc(100% - 1.4rem));
}

.wiki-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.wiki-entry {
    margin-top: 1rem;
    width: 100%;
}

#entry-content {
    width: 100%;
    max-width: none;
}

#entry-content > * + * {
    margin-top: 0.7rem;
}

#entry-content p {
    max-width: none;
}

.wiki-entry .nav-button {
    margin-bottom: 0.85rem;
}

#scroll-to-top {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 900;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1200;
    inset: 0;
    overflow: auto;
    background-color: rgba(4, 11, 24, 0.45);
}

.modal-content {
    width: min(860px, calc(100% - 1.6rem));
    margin: 10vh auto;
    position: relative;
}

.close-button {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--text);
}

.leaflet-marker-icon {
    transition: transform 0.2s ease;
}

.leaflet-marker-icon:hover {
    transform: scale(1.16);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--surface-strong);
    color: var(--text);
}

.leaflet-tooltip.town-label {
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.fade-in {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .navbar {
        position: sticky;
        top: 0;
        flex-wrap: wrap;
        gap: 0;
        padding: 0.6rem 0.8rem;
    }

    .nav-left {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .nav-left .logo {
        flex-shrink: 0;
    }

    .mobile-page-title {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        text-align: center;
        pointer-events: none;
        font-family: var(--font-display);
        font-size: 0.9rem;
        font-weight: 700;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0 80px;
    }

    .mobile-dark-toggle {
        flex-shrink: 0;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: 0;
        justify-self: end;
        grid-column: 3;
    }

    #email-directory-nav {
        display: none !important;
    }

    .nav-list {
        display: none;
        width: 100%;
        order: 3;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface-strong);
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 0.45rem;
    }

    .nav-list.nav-list-active {
        display: flex;
    }

    .nav-list a {
        border-radius: var(--radius-sm);
    }

    .nav-right {
        display: none;
    }

    .mobile-nav-control {
        display: block;
    }

    .mobile-nav-control button,
    .mobile-nav-control a {
        width: 100%;
        text-align: left;
    }

    .mobile-only {
        display: inline-flex;
    }

    .banner,
    .main-content {
        width: calc(100% - 1rem);
    }

    .banner img {
        max-height: 140px;
        object-fit: cover;
    }

    .map-controls {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .campaign-map-focus-header {
        flex-direction: column;
        align-items: stretch;
    }

    .map-section {
        display: flex;
        flex-direction: column;
    }

    .map-controls > div {
        min-height: 44px;
    }

    .map-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.45rem;
    }

    .map-filter-actions .nav-button {
        width: 100%;
        min-height: 44px;
        padding: 0.5rem;
    }

    .map-filters-collapsed .map-controls,
    .map-filters-collapsed .map-filter-actions {
        display: none;
    }

    #map-container {
        height: 62vh;
        order: 1;
    }

    .map-mobile-filter-row {
        order: 2;
        display: flex;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .map-controls-wrapper {
        order: 3;
    }

    .home-welcome-text.mobile-collapsed {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .feed-list .message {
        padding: 0.8rem 0.9rem;
    }

    .feed-item {
        padding: 0.55rem 0;
    }

    .wiki-controls {
        grid-template-columns: 1fr;
    }

    .calendar-mobile-tools {
        display: block;
        margin-top: 0.85rem;
        padding: 0.75rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface-muted);
    }

    .calendar-open-full {
        width: 100%;
        text-align: center;
        min-height: 44px;
    }

    .calendar-embed-shell {
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        background: var(--surface-strong);
    }

    #calendar-iframe {
        height: 72dvh !important;
        min-height: 520px;
    }
}

@media (min-width: 1000px) {
    .home-two-column-feeds {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (max-width: 600px) {
    .nav-button,
    .edit-button,
    .delete-button,
    button[type='submit'],
    button[type='button'] {
        width: 100%;
        text-align: center;
    }

    .map-controls {
        grid-template-columns: 1fr;
    }

    #map-container {
        height: 54vh;
    }

    .logo {
        width: 42px;
        height: 42px;
    }

    .mobile-page-title {
        font-size: 0.95rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    #calendar-iframe {
        height: 76dvh !important;
        min-height: 460px;
    }

}

@media (prefers-reduced-motion: reduce) {
    body {
        transition: none;
    }

    body.theme-fading {
        animation: none;
    }

    .theme-toggle__track,
    .theme-toggle__thumb,
    .theme-toggle__thumb svg {
        transition: none;
    }

    .navbar,
    .main-content > section,
    .section,
    .map-section,
    .message,
    .wiki-item,
    .wiki-modal-content,
    .modal-content,
    .login-container,
    .nav-button,
    .edit-button,
    .delete-button,
    button[type='submit'],
    button[type='button'],
    input,
    select,
    textarea {
        transition: none;
    }
}

/* Collapsible Section Styles */
.collapsible-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-display);
    font-size: inherit;
    font-weight: inherit;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.collapsible-toggle:hover {
    color: var(--primary);
}

.collapsible-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.85em;
}

.collapsible-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.collapsible-content.expanded {
    max-height: 5000px;
    transition: max-height 0.6s ease-in;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
}

.mobile-dark-toggle,
.mobile-admin-toggle,
.mobile-admin-container {
    display: none;
}

.desktop-dark-toggle,
.desktop-admin-toggle {
    display: inline-block;
}

@media (max-width: 900px) {
    /* Hide desktop nav items */
    .nav-list {
        display: none !important;
    }

    .desktop-dark-toggle,
    .desktop-admin-toggle {
        display: none !important;
    }

    /* Show mobile-specific elements */
    .mobile-dark-toggle {
        display: inline-block;
    }

    .mobile-admin-container {
        display: block;
        text-align: center;
        padding: 8px 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }

    .mobile-admin-toggle {
        display: inline-block;
    }

    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface-strong);
        border-top: 1px solid var(--line);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 4px;
        text-decoration: none;
        color: var(--text-muted);
        transition: color 0.2s ease, transform 0.2s ease;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .mobile-nav-item i {
        font-size: 1.4rem;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item:focus {
        color: var(--primary);
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    /* Add bottom padding to main content to account for fixed bottom nav */
    .main-content {
        padding-bottom: 80px;
    }

    /* Hide the old mobile nav toggle button */
    .nav-toggle {
        display: none;
    }
}
