/* ============================================
   COLOR SCHEME - Deep Navy & Burgundy
   ============================================ */
:root {
    --primary-navy: #1a2332;
    --primary-burgundy: #8b2e3a;
    --accent-wine: #a64253;
    --accent-gold: #c9a86a;
    --background-cream: #f8f6f3;
    --background-light: #faf9f7;
    --text-dark: #2a2520;
    --text-medium: #5a5550;
    --border-light: #e0dad0;
    --white: #ffffff;
    
    /* Spectrum gradient */
    --spectrum-gradient: linear-gradient(90deg, #1a2332 0%, #8b2e3a 35%, #a64253 70%, #c9a86a 100%);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--white);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
    font-family: 'Libre Baskerville', serif;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--text-dark);
}

h1 { 
    font-size: 2.5rem; 
    margin-bottom: 0.25em;
}

h2 { 
    font-size: 2rem; 
    margin-top: 2em; 
    margin-bottom: 0.75em;
    color: var(--primary-navy);
}

/* Remove excessive top margin from first h2 in sections */
section h2:first-of-type {
    margin-top: 0;
}

h3 { 
    font-size: 1.5rem; 
    margin-top: 1.5em;
    scroll-margin-top: 100px;
}

h4 {
    font-size: 1.25rem;
    margin-top: 1em;
    color: var(--primary-burgundy);
}

p {
    margin-bottom: 1em;
}

ul {
    margin-bottom: 1em;
    margin-left: 1.5em;
}

ol {
    margin-bottom: 1em;
    margin-left: 2rem;
}

li {
    margin-bottom: 0.5em;
}

ol li {
    margin-bottom: 0.75em;
}

a {
    color: var(--primary-navy);
    transition: color 0.2s;
    text-decoration: none;
}

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

strong {
    font-weight: 700;
}

em {
    font-style: italic;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--background-cream);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--primary-burgundy);
}

/* ============================================
   LAYOUT
   ============================================ */
.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

section {
    margin-bottom: 2rem;
    scroll-margin-top: 100px;
}

section:last-of-type {
    margin-bottom: 0;
}

/* Full-width section backgrounds */
main > section:nth-child(even) {
    background: var(--background-light);
}

main > section:nth-child(odd) {
    background: white;
}

/* Spectrum gradient section dividers */
main > section:not(:last-child)::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--spectrum-gradient);
    margin-top: 3rem;
    opacity: 0.6;
}

/* ============================================
   HEADER
   ============================================ */
.hero-header {
    background: linear-gradient(135deg, #1a2332 0%, #2a3849 50%, #8b2e3a 100%);
    padding: 1.25rem 0 1rem 0;
    border-bottom: 3px solid var(--accent-gold);
}

.hero-header h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.hero-header .subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
}

.page-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-medium);
    font-weight: 300;
    font-family: 'Source Sans 3', sans-serif;
}

/* ============================================
   NAVIGATION - MOBILE FIRST (HAMBURGER)
   ============================================ */
.main-nav {
    background: var(--background-cream);
    border-bottom: 2px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
}

.hamburger {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    color: var(--text-dark);
}

.hamburger:hover {
    opacity: 0.7;
}

.nav-container {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
    overflow-x: visible;
    padding: 3rem 1rem 1rem 1rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-container.open {
    left: 0;
}

.nav-container a {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
}

.nav-container > a:hover,
.nav-item-with-submenu > a:hover {
    background: var(--background-light);
    color: var(--primary-navy);
}

/* Active nav link with spectrum gradient accent */
.nav-container a.active {
    border-left: 4px solid transparent;
    border-image: var(--spectrum-gradient) 1;
    background: linear-gradient(90deg, 
        rgba(26, 35, 50, 0.08) 0%, 
        rgba(139, 46, 58, 0.12) 35%, 
        rgba(166, 66, 83, 0.12) 70%, 
        rgba(201, 168, 106, 0.08) 100%);
    color: var(--primary-navy);
    font-weight: 700;
}

/* First link (home) styling - direct child of nav-container */
.nav-container > a:first-of-type {
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-burgundy);
}

/* Parent menu items with submenus */
.nav-item-with-submenu {
    position: relative;
}

.nav-item-with-submenu > a {
    cursor: pointer;
}

.nav-item-with-submenu > a::after {
    content: '›';
    position: absolute;
    right: 1rem;
    font-size: 1.2rem;
    color: var(--primary-burgundy);
    transition: transform 0.2s;
}

/* Mobile: Show all submenus flat, always visible */
@media (max-width: 1199px) {
    .nav-submenu {
        display: block !important;
    }
    
    .nav-item-with-submenu > a::after {
        display: none; /* Hide arrow on mobile since no toggle */
    }
}

/* Submenu container */
.nav-submenu {
    display: none;
    background: var(--background-light);
    padding-left: 1rem;
    border-left: 3px solid var(--primary-burgundy);
    margin-left: 1rem;
}

/* Submenu links */
.nav-submenu a {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.nav-submenu a::before {
    content: '−';
    margin-right: 0.5rem;
    color: var(--primary-burgundy);
}

.close-nav {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    color: #666;
}

.close-nav:hover {
    color: #333;
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.nav-overlay.open {
    display: block;
}

/* ============================================
   DESKTOP STICKY TOC (SCROLLSPY)
   Only shows on desktop (min-width: 1200px)
   ============================================ */
@media (min-width: 1200px) {
    /* Hide mobile hamburger on desktop */
    .hamburger {
        display: none;
    }
    
    /* Transform nav into sticky sidebar TOC */
    .nav-container {
        position: fixed;
        top: 0;
        left: 20px;
        width: 260px;
        height: 100vh;
        background: var(--background-cream);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-radius: 8px;
        border: 1px solid var(--border-light);
        padding: 1.5rem 0;
        overflow-y: auto;
        overflow-x: hidden;
        transition: none;
    }
    
    /* Always show on desktop */
    .nav-container.open,
    .nav-container {
        left: 20px;
    }
    
    /* Hide close button on desktop */
    .close-nav {
        display: none;
    }
    
    /* Desktop nav link styling */
    .nav-container a {
        padding: 0.5rem 1.25rem;
        font-size: 0.9rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-container a:hover {
        background: rgba(139, 46, 58, 0.08);
        border-left-color: var(--accent-wine);
    }
    
    /* Active link with spectrum gradient */
    .nav-container a.active {
        background: linear-gradient(90deg, 
            rgba(26, 35, 50, 0.08) 0%, 
            rgba(139, 46, 58, 0.12) 35%, 
            rgba(166, 66, 83, 0.12) 70%, 
            rgba(201, 168, 106, 0.08) 100%);
        border-left: 4px solid transparent;
        border-image: var(--spectrum-gradient) 1;
        font-weight: 700;
        color: var(--primary-navy);
        padding-left: calc(1.25rem - 1px); /* Adjust for thicker border */
    }
    
    /* First link styling on desktop */
    .nav-container > a:first-of-type {
        font-size: 1.05rem;
        padding: 0.75rem 1.25rem;
        margin-bottom: 0.75rem;
        border-bottom: 2px solid transparent;
        border-image: var(--spectrum-gradient) 1;
    }
    
    /* Submenu on desktop - inline, not flyout */
    .nav-submenu {
        position: static;
        width: auto;
        background: transparent;
        box-shadow: none;
        display: block;
        border-left: none;
        padding-left: 0.75rem;
        max-height: none;
    }
    
    .nav-submenu a {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .nav-submenu a::before {
        content: '•';
        margin-right: 0.5rem;
    }
    
    /* Parent items - remove arrow on desktop */
    .nav-item-with-submenu > a::after {
        display: none;
    }
    
    /* No overlay on desktop */
    .nav-overlay {
        display: none !important;
    }
    
    /* Adjust main content to accommodate sidebar */
    body {
        margin-left: 300px;
    }
    
    main {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* For ultra-wide screens */
@media (min-width: 1600px) {
    .nav-container {
        left: calc(50% - 850px);
    }
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--background-cream);
    font-weight: 600;
    font-family: 'Libre Baskerville', serif;
    color: var(--primary-navy);
}

tbody tr:hover {
    background: var(--background-light);
}

.comparison-table {
    margin: 2rem 0;
}

.role-table {
    margin: 1.5rem 0;
}

/* ============================================
   CALLOUT BOXES
   ============================================ */
.example-box {
    background: #f0f4f8;
    border-left: 4px solid var(--primary-navy);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
}

.example-box h4 {
    margin-top: 0;
    color: var(--primary-navy);
}

.example-box ul,
.example-box ol {
    margin-bottom: 0.5em;
}

.example-box ul:last-child,
.example-box ol:last-child,
.example-box p:last-child {
    margin-bottom: 0;
}

.principle-callout {
    background: var(--background-cream);
    border: 2px solid var(--primary-burgundy);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    border-radius: 4px;
}

.principle-callout p {
    margin: 0;
    font-size: 1.25rem;
}

.disclaimer-box {
    background: #fef9f5;
    border: 2px solid var(--accent-wine);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.disclaimer-box h2 {
    margin-top: 0;
    color: var(--primary-burgundy);
    font-size: 1.5rem;
}

.disclaimer-box h3 {
    color: var(--primary-burgundy);
    font-size: 1rem;
    margin-top: 1em;
}

.disclaimer-box h3:first-of-type {
    margin-top: 0.5em;
}

.disclaimer-box p {
    margin-bottom: 0.5em;
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

/* ============================================
   VISUAL ELEMENTS
   ============================================ */
.hierarchy-visual {
    background: var(--background-cream);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.hierarchy-flow {
    font-size: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    color: var(--primary-navy);
}

.distinction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

.distinction-item {
    background: var(--background-cream);
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.distinction-item h4 {
    margin-top: 0;
    color: var(--primary-navy);
}

.distinction-item p {
    margin-bottom: 0.5em;
}

.distinction-item p:last-child {
    margin-bottom: 0;
}

/* ============================================
   ROLE SECTIONS
   ============================================ */
.role-section {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
    scroll-margin-top: 100px;
}

.role-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
    padding-bottom: 0;
}

.role-purpose {
    font-size: 1.2rem;
    color: var(--primary-navy);
    font-weight: 600;
    font-style: italic;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-burgundy);
}

/* ============================================
   RELATED PAGES
   ============================================ */
.related-pages {
    background: var(--background-cream);
    padding: 2rem;
    margin-top: 3rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.related-pages h3 {
    margin-top: 0;
    color: var(--primary-navy);
}

.related-pages ul {
    list-style: none;
    margin-left: 0;
}

.related-pages li {
    margin-bottom: 0.75rem;
}

.related-pages a {
    color: var(--primary-navy);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
}

.related-pages a:hover {
    text-decoration: underline;
    color: var(--accent-wine);
}

.role-detail-link {
    font-style: italic;
    color: var(--text-medium);
}

/* ============================================
   RESOURCES SECTION - Compact styling
   ============================================ */
#resources .content {
    font-size: 0.9rem;
    line-height: 1.5;
}

#resources h3 {
    font-size: 1.25rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

#resources h3:first-of-type {
    margin-top: 0;
}

#resources h4 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

#resources p {
    margin-bottom: 0.75rem;
}

#resources strong {
    font-size: 0.85rem;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--primary-navy);
    border-top: 2px solid var(--accent-gold);
    padding: 1rem 2rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.footer-inner img {
    height: 60px;
    width: auto;
    opacity: 0.85;
    flex-shrink: 0;
}

.footer-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

footer .footer-brand {
    color: var(--accent-gold);
    font-family: 'Special Elite', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
}

footer .tagline {
    font-style: italic;
    font-family: 'Libre Baskerville', serif;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
}

footer .license-line {
    font-family: 'Special Elite', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

/* Collapsible Sections */
.collapsible-section {
    margin: 1.5rem 0;
}

.collapsible-header {
    background: var(--background-cream);
    border: 2px solid var(--border-light);
    border-radius: 4px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.collapsible-header:hover {
    background: var(--background-light);
    border-color: var(--primary-burgundy);
}

.collapsible-header h3,
.collapsible-header h4 {
    margin: 0;
    color: var(--primary-navy);
}

.collapsible-toggle {
    font-size: 1.5rem;
    color: var(--primary-burgundy);
    transition: transform 0.3s ease;
}

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

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    border-left: 2px solid var(--border-light);
    border-right: 2px solid var(--border-light);
    border-bottom: 2px solid var(--border-light);
    border-radius: 0 0 4px 4px;
}

.collapsible-content.open {
    max-height: 3000px;
    padding: 1.5rem;
}

/* Quick Reference Table */
.quick-roles-table {
    width: 100%;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.quick-roles-table th {
    background: var(--primary-navy);
    color: var(--white);
}

.quick-roles-table td:first-child {
    font-weight: 600;
    color: var(--primary-burgundy);
}

/* Visual Example Comparison */
.comparison-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.comparison-column {
    background: var(--background-cream);
    padding: 1.5rem;
    border-radius: 4px;
    border: 2px solid var(--border-light);
}

.comparison-column h4 {
    margin-top: 0;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.comparison-before {
    border-color: #d4a574;
}

.comparison-after {
    border-color: var(--primary-burgundy);
}

.comparison-list {
    list-style: none;
    margin: 1rem 0 0 0;
}

.comparison-list li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--white);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.comparison-arrow {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-burgundy);
    padding: 2rem 0;
}

.duplicate-highlight {
    background: #fff3cd !important;
    border-left: 3px solid #ffc107;
    padding-left: 0.75rem !important;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-burgundy);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 98;
}

.back-to-top:hover {
    background: var(--accent-wine);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.back-to-top.visible {
    display: flex;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .distinction-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .comparison-visual {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .comparison-arrow {
        display: none;
    }
    
    .content {
        padding: 1rem;
    }
    
    .page-header {
        margin-bottom: 2rem;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    code {
        font-size: 0.85em;
    }
}

@media (max-width: 500px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav {
        padding: 0.5rem 1rem;
    }
    
    .hamburger {
        font-size: 1.25rem;
        padding: 0.25rem;
    }
    
    /* Slightly narrower mobile nav for small screens */
    .nav-container {
        width: 260px;
    }
}

.file-link {
    background: #f0f4f8;
    padding: 4px 12px;
    border-radius: 4px;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #d0d8e0;
}
.file-link:hover {
    background: #e0e8f0;
}
mark {
  background-color: #fff3cd; /* soft yellow */
  color: inherit;
  padding: 0 2px;
}
/* ============================================
   PAGE NAVIGATION (Top Nav Bar)
   ============================================ */
.page-nav {
    display: flex;
    gap: 0;
    margin-left: auto;
}

.page-nav a {
    padding: 0.75rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.page-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
}

.page-nav a.active {
    border-bottom-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ============================================
   SIDEBAR PAGE LINKS
   ============================================ */
.nav-page-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.nav-page-link {
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.nav-page-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--accent-gold);
}

.nav-page-link.active {
    background: rgba(201, 168, 106, 0.2);
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
}

/* Mobile: Hide top page nav, show in sidebar */
@media (max-width: 768px) {
    .page-nav {
        display: none;
    }
}

/* Desktop: Keep both visible */
@media (min-width: 1200px) {
    .nav-page-links {
        /* Keep visible in sidebar on desktop too for consistency */
    }
}
/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(26, 35, 50, 0.95);
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.fade-in {
  opacity: 1;
}

/* Modal Content Container */
.modal-content {
  position: relative;
  background-color: var(--color-cream);
  border-radius: 12px;
  max-width: 1200px;
  width: 95vw;
  max-height: 90vh;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: auto;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--color-burgundy);
  color: var(--color-cream);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--color-wine);
  transform: scale(1.1);
}

/* SVG Container */
.modal-svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-svg-container img {
  width: 100%;
  height: auto;
  display: block;
}
/* Mobile Optimizations */
@media (max-width: 768px) {
  .modal-content {
    padding: 1rem;
    max-width: 95vw;
	width: 95vw;
  } 
  .modal-svg-container {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-svg-container img {
    width: 100%;      /* ← CHANGED: was min-width 680px */
    height: auto;
    max-width: 100%;  /* ← ADDED: never exceed container */
  }
}

/* Dark mode support for modal */
@media (prefers-color-scheme: dark) {
  .modal-overlay {
    background-color: rgba(26, 35, 50, 0.98);
  }
  
  .modal-content {
    background-color: #1a2332;
  }
}
