:root {
    --site-accent: #0d6efd;
    --site-accent-dark: #0d6efd;

    /* Derived theme tokens. Static fallbacks first; color-mix() overrides
       where supported so every tint follows the two DB-driven accents. */
    --site-ink: #1b1e24;
    --site-ink: color-mix(in srgb, var(--site-accent-dark) 22%, #14171c);
    --site-ink-deep: #101318;
    --site-ink-deep: color-mix(in srgb, var(--site-accent-dark) 12%, #0d0f13);
    --site-on-ink: rgba(255, 255, 255, 0.87);
    --site-on-ink-muted: rgba(255, 255, 255, 0.6);
    --site-accent-soft: #f3f4f6;
    --site-accent-soft: color-mix(in srgb, var(--site-accent) 10%, #ffffff);
    --site-accent-border: #e2e4e8;
    --site-accent-border: color-mix(in srgb, var(--site-accent) 22%, #e5e7ea);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #fbfbfc;
}

/* ---------------------------------------------------------------- header band */

.navbar {
    background-color: var(--site-ink) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar .navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}

.navbar .navbar-brand::before {
    content: "";
    display: inline-block;
    width: 0.65em;
    height: 0.65em;
    margin-right: 0.5em;
    border-radius: 2px;
    background-color: var(--site-accent);
}

.nav-link {
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.8;
}

.network-bar {
    background-color: var(--site-ink);
    border-bottom: 3px solid var(--site-accent);
    padding: 8px 0 12px;
    font-size: 0.85rem;
    color: var(--site-on-ink-muted);
}

.network-bar .badge {
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--site-on-ink-muted);
    font-weight: 500;
}

.network-bar .badge:hover {
    color: var(--site-on-ink);
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.network-bar .badge.active {
    background-color: var(--site-accent) !important;
    color: #fff;
}

/* ---------------------------------------------------------------- banner */

.site-banner {
    position: relative;
    min-height: clamp(180px, 24vw, 320px);
    background-color: var(--site-ink-deep);
    overflow: hidden;
}

.site-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.site-banner-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(transparent, rgba(10, 12, 16, 0.75));
    color: #fff;
}

.site-banner-title h1 {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 0.1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.site-banner-title p {
    margin-bottom: 0;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ---------------------------------------------------------------- buttons, links */

.btn-primary {
    background-color: var(--site-accent);
    border-color: var(--site-accent);
}

.btn-primary:hover {
    background-color: var(--site-accent-dark);
    border-color: var(--site-accent-dark);
}

.badge.bg-primary {
    background-color: var(--site-accent) !important;
}

.post-body {
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.post-body a {
    color: var(--site-accent);
    text-decoration: underline;
}

.post-body a:hover {
    color: var(--site-accent-dark);
}

/* ---------------------------------------------------------------- cards */

.card {
    border: 1px solid var(--site-accent-border);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card .card-title a {
    color: inherit;
}

.card .card-title a:hover {
    color: var(--site-accent);
}

.news-card {
    cursor: pointer;
    transition: background-color 0.2s;
}

.news-card:hover {
    background-color: var(--site-accent-soft);
}

.news-card.active {
    background-color: var(--site-accent-soft);
    border-left: 3px solid var(--site-accent);
}

/* ---------------------------------------------------------------- home page grid */

.home-squares .square {
    aspect-ratio: 1 / 1;
    min-height: 320px;
    border: 1px solid var(--site-accent-border);
    border-radius: 0.375rem;
    background-color: #fff;
    overflow: hidden;
}

.home-squares .square-map {
    position: relative;
}

.home-squares .square-map .leaflet-container,
.home-squares .square-map #home-map {
    width: 100%;
    height: 100%;
}

.home-squares .square-feed {
    overflow-y: auto;
}

.square-heading {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background-color: var(--site-ink);
    border-bottom: 2px solid var(--site-accent);
}

.square-feed .news-card {
    border: 0;
    border-bottom: 1px solid var(--site-accent-border);
    border-radius: 0;
    margin: 0;
}

.square-feed .news-card .card-body {
    padding: 0.7rem 0.85rem;
}

.square-feed .news-card .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.square-feed .news-card p {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.square-feed .feed-more {
    display: block;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    text-align: center;
    color: var(--site-accent);
    text-decoration: none;
}

.news-loc {
    color: var(--site-accent);
    font-weight: 600;
}

/* astro tabs fill the map square */
.square-map .astro-tabs {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.square-map .astro-tabs .nav-tabs {
    flex: 0 0 auto;
    background-color: var(--site-ink);
    border-bottom: 2px solid var(--site-accent);
    padding: 0.35rem 0.5rem 0;
}

.square-map .astro-tabs .nav-tabs .nav-link {
    color: var(--site-on-ink-muted);
    border: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.square-map .astro-tabs .nav-tabs .nav-link.active {
    color: #fff;
    background-color: transparent;
    border-bottom: 2px solid var(--site-accent);
}

.square-map .astro-tabs .tab-content {
    flex: 1 1 auto;
    min-height: 0;
    background-color: #000;
}

.square-map .astro-tabs .tab-pane {
    height: 100%;
}

.square-map .astro-tabs .tab-pane .leaflet-container,
.square-map .astro-tabs .tab-pane canvas,
.square-map .astro-tabs .tab-pane > div {
    width: 100%;
    height: 100%;
}

.astro-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    gap: 0.75rem;
}

/* ---------------------------------------------------------------- sidebars */

.home-widget {
    background-color: #fff;
    border: 1px solid var(--site-accent-border);
    border-left: 3px solid var(--site-accent);
    border-radius: 0.375rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.home-widget h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    padding: 0.55rem 0.85rem;
    background-color: var(--site-accent-soft);
    border-bottom: 1px solid var(--site-accent-border);
}

.home-widget .widget-body {
    padding: 0.75rem 0.85rem;
    font-size: 0.88rem;
}

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

.home-widget ul li {
    padding: 0.45rem 0;
    border-bottom: 1px solid #f0f1f3;
}

.home-widget ul li:last-child {
    border-bottom: 0;
}

.home-widget a {
    color: #212529;
    text-decoration: none;
}

.home-widget a:hover {
    color: var(--site-accent);
}

.home-widget .widget-meta {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
}

.home-widget .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.home-widget .tag-list a {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    border: 1px solid var(--site-accent-border);
    border-radius: 999px;
    color: #495057;
}

.home-widget .tag-list a:hover {
    background-color: var(--site-accent-soft);
    color: var(--site-accent-dark);
}

.home-widget .tag-list .tag-count {
    color: var(--site-accent);
    font-weight: 600;
    margin-left: 0.25em;
}

/* moon phase widget */
.moon-widget {
    text-align: center;
}

.moon-widget svg {
    display: block;
    margin: 0.25rem auto 0.5rem;
}

.moon-widget .moon-name {
    font-weight: 600;
}

.moon-widget .moon-detail {
    font-size: 0.78rem;
    color: #6c757d;
}

/* ---------------------------------------------------------------- section headings */

.home-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--site-accent);
    padding-bottom: 0.35rem;
    margin: 1.75rem 0 1rem;
}

/* ---------------------------------------------------------------- footer */

footer.site-footer {
    background-color: var(--site-ink-deep);
    border-top: 3px solid var(--site-accent);
    color: var(--site-on-ink-muted);
    margin-top: 4rem;
    padding: 2.5rem 0 2rem;
}

footer.site-footer h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--site-on-ink);
    margin-bottom: 0.75rem;
}

footer.site-footer a {
    color: var(--site-on-ink-muted);
    text-decoration: none;
}

footer.site-footer a:hover {
    color: #fff;
}

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

footer.site-footer ul li {
    padding: 0.15rem 0;
}

footer.site-footer .footer-fineprint {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
}

/* ---------------------------------------------------------------- misc */

.text-muted a {
    color: #6c757d;
}

.text-muted a:hover {
    color: var(--site-accent);
}

article {
    max-width: 800px;
    margin: 0 auto;
}
