/* ===== REGION PAGES — DARK THEME ===== */
/* Shared stylesheet for all 12 region pages */
/* Matches the class-pages.css dark aesthetic */

/* --- Page Base --- */
body.region-page {
    background-color: var(--background-dark, #1a202c);
    color: var(--text-primary, #e2e8f0);
}

body.region-page main {
    background-color: var(--background-dark, #1a202c);
}

/* --- Dark Theme Navigation Override --- */
body.region-page header.main-header {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 50%, #34495e 100%);
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--accent-arcane-bright, #bb6bd9);
}

body.region-page header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

body.region-page header .logo a,
body.region-page header .main-nav a {
    color: #fff;
    text-decoration: none;
}

body.region-page header .main-nav a:hover {
    color: var(--accent-arcane-bright, #bb6bd9);
}

body.region-page header .main-nav li.active a {
    color: var(--accent-arcane-bright, #bb6bd9);
    border-bottom: 2px solid var(--accent-arcane-bright, #bb6bd9);
    padding-bottom: 2px;
}

/* --- Hero Banner --- */
.region-hero {
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.region-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26, 32, 44, 0.3) 0%,
        rgba(26, 32, 44, 0.6) 60%,
        rgba(26, 32, 44, 1) 100%
    );
    z-index: 1;
}

.region-hero .hero-content {
    position: relative;
    z-index: 2;
    padding: 80px 20px 60px;
    max-width: 900px;
}

.region-hero h1 {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    font-size: 3.5rem;
    margin-bottom: 10px;
    color: #fff !important;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 0, 0, 0.7);
    letter-spacing: 2px;
}

.region-hero .subtitle {
    font-size: 1.4rem;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 20px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 1px 1px 6px rgba(0, 0, 0, 0.9);
    color: var(--accent-arcane-bright, #bb6bd9);
}

.region-hero .tagline {
    font-size: 1.05rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.85;
}

/* --- Quick Facts Bar --- */
.quick-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    max-width: 1100px;
    margin: -30px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 3;
}

.fact-card {
    background: var(--surface-color, #2d3748);
    border: 1px solid var(--border-color, #4a5568);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.fact-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-arcane-bright, #bb6bd9);
    margin-bottom: 6px;
}

.fact-card .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

/* --- Content Container --- */
.region-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* --- Section Styling --- */
.region-section {
    margin-bottom: 40px;
}

.region-section h2 {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    font-size: 2rem;
    color: var(--accent-arcane-bright, #bb6bd9);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #4a5568);
}

.region-section p {
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-primary, #e2e8f0);
}

.region-section h3,
.region-section h4 {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    color: var(--text-primary, #e2e8f0);
    margin-top: 28px;
}

/* Bare sub-headings directly inside a collapsible section (e.g. uttaragiri's
   "The Tenth Winter"). Without this they fall through to the global .card h3
   rule (color: var(--primary-dark)), which is unreadable on the dark theme.
   Direct-child selector so settlement-card/species-card h3s are untouched. */
.region-collapse .collapse-content > h3 {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    color: var(--text-primary, #e2e8f0);
    margin-top: 28px;
}

/* --- Collapsible Sections using details/summary --- */
details.region-collapse {
    background: var(--surface-color, #2d3748);
    border: 1px solid var(--border-color, #4a5568);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

details.region-collapse summary {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    font-size: 1.5rem;
    color: var(--accent-arcane-bright, #bb6bd9);
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    list-style: none;
}

details.region-collapse summary::-webkit-details-marker {
    display: none;
}

details.region-collapse summary::before {
    content: '▶';
    font-size: 0.8rem;
    transition: transform 0.2s;
    color: var(--text-secondary, #a0aec0);
}

details.region-collapse[open] summary::before {
    transform: rotate(90deg);
}

details.region-collapse summary:hover {
    background: rgba(155, 89, 182, 0.1);
}

details.region-collapse .collapse-content {
    padding: 0 25px 25px;
}

details.region-collapse .collapse-content p {
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-primary, #e2e8f0);
}

/* --- Settlement Cards --- */
.settlement-card {
    background: rgba(45, 55, 72, 0.5);
    border: 1px solid var(--border-color, #4a5568);
    border-left: 4px solid var(--accent-arcane, #9b59b6);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.settlement-card h3 {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    font-size: 1.3rem;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 5px;
}

.settlement-card .settlement-type {
    font-size: 0.85rem;
    color: var(--accent-arcane-bright, #bb6bd9);
    font-style: italic;
    margin-bottom: 15px;
}

.settlement-card .settlement-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary, #a0aec0);
}

.settlement-card p {
    line-height: 1.7;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 10px;
}

/* --- Flora/Fauna Cards --- */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.species-card {
    background: rgba(45, 55, 72, 0.5);
    border: 1px solid var(--border-color, #4a5568);
    border-radius: 8px;
    padding: 20px;
}

.species-card h4 {
    color: var(--accent-arcane-bright, #bb6bd9);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.species-card p {
    font-size: 0.9rem;
    color: var(--text-secondary, #a0aec0);
    line-height: 1.6;
}

/* --- Image Gallery --- */
.region-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color, #4a5568);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-item .caption {
    padding: 12px 15px;
    background: var(--surface-color, #2d3748);
    font-size: 0.85rem;
    color: var(--text-secondary, #a0aec0);
}

/* --- Region Navigation (bottom of page) --- */
.other-regions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color, #4a5568);
}

.other-regions a {
    display: block;
    background: var(--surface-color, #2d3748);
    border: 1px solid var(--border-color, #4a5568);
    border-radius: 6px;
    padding: 15px;
    text-decoration: none;
    text-align: center;
    color: var(--text-primary, #e2e8f0);
    transition: all 0.2s;
}

.other-regions a:hover {
    border-color: var(--accent-arcane, #9b59b6);
    background: rgba(155, 89, 182, 0.1);
    transform: translateY(-2px);
}

.other-regions a .region-name {
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}

.other-regions a .region-sub {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0aec0);
    font-style: italic;
}

/* --- Back to Map Link --- */
.back-to-map {
    text-align: center;
    margin: 30px 0;
}

.back-to-map a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-arcane-bright, #bb6bd9);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

.back-to-map a:hover {
    color: #fff;
}

/* --- Interactive Map (regions.html index) --- */
.region-map-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.region-map-container .map-base {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.region-map-container .map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.region-path {
    fill: transparent;
    stroke: transparent;
    transition: fill 0.3s ease, stroke 0.3s ease;
    cursor: pointer;
}

.region-path:hover,
.region-path:focus {
    fill: rgba(187, 107, 217, 0.2);
    stroke: rgba(187, 107, 217, 0.7);
    stroke-width: 2;
}

.region-path.no-click {
    cursor: default;
    pointer-events: none;
}

.map-point {
    fill: var(--accent-arcane-bright, #bb6bd9);
    stroke: #fff;
    stroke-width: 1.5;
    cursor: pointer;
    transition: r 0.2s;
}

.map-point:hover {
    r: 8;
}

.map-tooltip {
    position: absolute;
    background: rgba(26, 32, 44, 0.95);
    border: 1px solid var(--accent-arcane, #9b59b6);
    border-radius: 6px;
    padding: 8px 14px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    display: none;
}

/* --- Region Index Cards Grid --- */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.region-card {
    background: var(--surface-color, #2d3748);
    border: 1px solid var(--border-color, #4a5568);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary, #e2e8f0);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: block;
}

.region-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-arcane, #9b59b6);
}

.region-card .card-banner {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.region-card .card-banner-gradient {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.7;
}

.region-card .card-body {
    padding: 18px;
}

.region-card h3 {
    font-family: var(--font-header, 'Spectral', Georgia, serif);
    font-size: 1.2rem;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 4px;
}

.region-card .card-subtitle {
    font-size: 0.82rem;
    color: var(--accent-arcane-bright, #bb6bd9);
    font-style: italic;
    margin-bottom: 10px;
}

.region-card p {
    font-size: 0.88rem;
    color: var(--text-secondary, #a0aec0);
    line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .region-hero h1 { font-size: 2.2rem; }
    .region-hero .subtitle { font-size: 1.1rem; }
    .quick-facts { grid-template-columns: repeat(2, 1fr); margin-top: -15px; }
    details.region-collapse summary { font-size: 1.2rem; padding: 15px 20px; }
    .other-regions { grid-template-columns: repeat(2, 1fr); }
    .regions-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
    .quick-facts { grid-template-columns: 1fr; }
    .other-regions { grid-template-columns: 1fr; }
    .region-hero h1 { font-size: 1.8rem; }
    .regions-grid { grid-template-columns: 1fr 1fr; }
}
