/* === Color Palette ===
   Bordeaux deep:   #6B1D2A
   Bordeaux medium: #8B3A4A
   Bordeaux light:  #A85060
   Navy deep:       #1B2A4A
   Navy medium:     #2C3E6B
   Cream bg:        #F7F5F2
   Warm white:      #FDFCFA
   Text:            #3A3A3A
   Text light:      #6B6B6B
   Border:          #E2DDD8
*/

/* === Base Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Georgia', 'Times New Roman', 'Palatino Linotype', serif;
    line-height: 1.7;
    color: #3A3A3A;
    background: #F7F5F2;
}

a {
    color: #8B3A4A;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #6B1D2A;
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Header === */
.site-header {
    background: linear-gradient(135deg, #6B1D2A 0%, #7A2535 50%, #6B1D2A 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(107, 29, 42, 0.3);
    border-bottom: 3px solid #4A1420;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.site-title {
    padding: 0.9rem 0;
    flex-shrink: 0;
}
.site-title a {
    color: #F7F5F2;
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.site-title a:hover {
    color: white;
    text-decoration: none;
}

/* === Hamburger button === */
.menu-toggle {
    display: block;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    color: #F7F5F2;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    transition: border-color 0.2s, background 0.2s;
}
.menu-toggle:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.12);
}
.menu-toggle .label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.82rem;
    margin-left: 0.4rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* === Navigation — dropdown panel, right-aligned === */
.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #1B2A4A;
    box-shadow: 0 8px 24px rgba(27, 42, 74, 0.4);
    border-radius: 0 0 6px 6px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1001;
}
.main-nav.open {
    display: block;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0.3rem 0;
}

/* On phones, go full width */
@media (max-width: 600px) {
    .main-nav {
        width: 100%;
        left: 0;
        border-radius: 0;
    }
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.5rem;
    color: #C8CDD8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.nav-menu > li > a:hover,
.nav-menu > li.active > a {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.07);
}

.nav-menu > li > a .fa-caret-down {
    font-size: 0.7rem;
    opacity: 0.45;
    transition: transform 0.2s;
}
.has-children.open > a .fa-caret-down {
    transform: rotate(180deg);
    opacity: 0.8;
}

/* === Submenus === */
.sub-menu {
    display: none;
    list-style: none;
    background: rgba(0,0,0,0.15);
    padding: 0;
    margin: 0;
}
.has-children.open > .sub-menu {
    display: block;
}

.sub-menu li a {
    display: block;
    padding: 0.45rem 1.5rem 0.45rem 2.5rem;
    color: #9AA0B0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.84rem;
    border-bottom: 1px solid rgba(255,255,255,0.025);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
.sub-menu li:last-child a {
    border-bottom: none;
}
.sub-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    text-decoration: none;
}
.sub-menu li a .fa-external-link-alt {
    opacity: 0.35;
    margin-left: 4px;
    font-size: 0.65rem;
}

/* Scrollbar */
.main-nav::-webkit-scrollbar {
    width: 5px;
}
.main-nav::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.main-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

/* === Content === */
.content-wrapper {
    max-width: 960px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.page {
    background: #FDFCFA;
    padding: 2.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border: 1px solid #E2DDD8;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.page-title {
    font-family: 'Georgia', serif;
    font-size: 1.7rem;
    margin-bottom: 1.5rem;
    color: #1B2A4A;
    border-bottom: 2px solid #6B1D2A;
    padding-bottom: 0.6rem;
    letter-spacing: 0.01em;
}

.page-content h1 {
    font-family: 'Georgia', serif;
    font-size: 1.7rem;
    color: #1B2A4A;
    margin-bottom: 1rem;
}

.page-content h2 {
    font-family: 'Georgia', serif;
    font-size: 1.35rem;
    margin: 2rem 0 0.8rem;
    color: #1B2A4A;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #E2DDD8;
}
.page-content h3 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.6rem;
    color: #2C3E6B;
}

.page-content ul, .page-content ol {
    margin: 0.8rem 0 0.8rem 1.5rem;
}
.page-content li {
    margin-bottom: 0.35rem;
}

.page-content p {
    margin-bottom: 1rem;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Profile photo on home page */
.page-content img.profile-photo {
    max-width: 340px;
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(107, 29, 42, 0.15);
    border: 3px solid #E2DDD8;
    margin: 0.5rem auto;
    display: block;
}

.page-content hr {
    border: none;
    border-top: 1px solid #E2DDD8;
    margin: 1.8rem 0;
}

/* Blockquote / citation style */
.page-content blockquote,
.page-content p[style*="text-align:right"] {
    border-left: 3px solid #6B1D2A;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #6B6B6B;
    font-style: italic;
}

/* Tables */
.page-content table {
    width: 100%;
    overflow-x: auto;
    display: block;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.92rem;
}
.page-content td, .page-content th {
    padding: 0.55rem 0.7rem;
    border: 1px solid #E2DDD8;
}
.page-content th {
    background: #1B2A4A;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.page-content tr:nth-child(even) {
    background: #F7F5F2;
}

.text-center {
    text-align: center;
}

.row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.col {
    flex: 1;
    min-width: 250px;
}

/* === Footer === */
.site-footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
    color: #FDFCFA;
    font-size: 0.85rem;
    background: #1B2A4A;
    border-radius: 6px 6px 0 0;
    margin-top: 3rem;
}
.site-footer a {
    color: #C8A88E;
    text-decoration: none;
}
.site-footer a:hover {
    color: #F7F5F2;
    text-decoration: underline;
}
.footer-note {
    font-size: 0.75rem;
    margin: 0.8rem 0;
    color: #8090AA;
    line-height: 1.5;
}

/* === Back to top === */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #6B1D2A;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(107, 29, 42, 0.3);
}
.back-to-top.visible {
    opacity: 0.7;
}
.back-to-top:hover {
    opacity: 1;
    text-decoration: none;
    color: white;
}

/* === Responsive === */

/* Phone */
@media (max-width: 600px) {
    .site-title a {
        font-size: 1.05rem;
    }
    .menu-toggle .label {
        display: none;
    }

    .content-wrapper {
        padding: 0 0.8rem;
        margin: 1rem auto;
    }

    .page {
        padding: 1.2rem;
        border-radius: 4px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .page-content h1 {
        font-size: 1.3rem;
    }

    .page-content h2 {
        font-size: 1.15rem;
    }

    .page-content ul, .page-content ol {
        margin-left: 1rem;
    }

    .row {
        flex-direction: column;
        gap: 1rem;
    }
    .col {
        min-width: 100%;
    }

    .site-footer {
        padding: 1.2rem 0.8rem;
        border-radius: 0;
        margin-top: 2rem;
    }
}
