/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&family=Lora:wght@400;500;700&display=swap');

/* Reset styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

/* Body styling */
body {
    font-family: 'Lora', serif;
    line-height: 1.6;
    color: #403D39;
    background-color: #F6F4EF;
    background-image: url('https://www.transparenttextures.com/patterns/linen.png');
    background-repeat: repeat;
    background-size: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Wrapper for centering sidebar and main */
.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    flex: 1;
    background: linear-gradient(to bottom, #F6F4EF 0%, #FFE8D6 100%);
}

/* Toggle checkbox (hidden) */
.menu-toggle {
    display: none;
}

/* Hamburger button */
.hamburger {
    font-size: 2rem;
    color: #403D39;
    background: none;
    border: none;
    padding: 15px;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    width: 200px;
    background-color: rgba(46, 42, 44, 0.95);
    color: #F6F4EF;
    transition: width 0.3s ease;
    overflow: hidden;
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}

/* Sidebar links */
.sidebar-content {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
}

.sidebar.collapsed .sidebar-content {
    display: none;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: #F6F4EF;
    text-decoration: none;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.95rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: pointer;
}

.nav-links a:hover,
.nav-links a.active {
    color: #FFB997;
    font-weight: 600;
    border-left: 3px solid #D4A373;
    padding-left: 10px;
}

/* Toggle effect */
.menu-toggle:checked ~ .sidebar {
    width: 0;
}

/* Main content */
main {
    flex: 1;
    padding: 10px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 20px;
}

main h1 {
    font-family: 'Open Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 300;
    color: #2E2A2C;
    text-transform: uppercase;
    margin: 20px 0;
    text-align: center;
}

main p {
    font-family: 'Lora', serif;
    font-size: 1rem;
    color: #403D39;
    text-align: justify;
    text-indent: 20px;
}

/* Hero image */
.hero-image {
    width: 100%;
    margin-bottom: 40px;
}

.hero-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.hero-image .image-caption {
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Side-by-side images */
.image-pair {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 30px 0 50px 0;
}

.image-pair-item-1 {
    flex: 1;
    height: 800px;
    overflow: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.image-pair-item-1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #2c3e50;
    opacity: 0.9;
}

.image-pair-item-1 .image-caption {
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
}

.image-pair-item-2 {
    flex: 1;
    height: 400px;
    overflow: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.image-pair-item-2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #2c3e50;
    opacity: 0.9;
}

.image-pair-item-2 .image-caption {
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Footer */
footer {
    background-color: #2E2A2C;
    color: #F6F4EF;
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

footer a {
    font-family: 'Lora', serif;
    color: #FFB997;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.external-links {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

.external-links li {
    margin-bottom: 10px;
}

.external-links a {
    font-family: 'Lora', serif;
    color: #c2782f;
    text-decoration: none;
}

.external-links a:hover {
    color: #322e25;
}

.back-to-top {
    display: block;
    margin-top: 10px;
}

/* Table styling */
table {
    font-family: 'Lora', serif;
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #4A403A;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #A9A9A9;
    color: #000000;
}

td em {
    font-style: italic;
}

/* Subheadings */
main h2 {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.8rem;
    font-weight: 300;
    color: #4A403A;
    text-transform: uppercase;
    margin: 15px 0;
    text-align: center;
}

/* Hero overlay */
.hero-image {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 185, 151, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 2.5rem;
    color: #F6F4EF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* CTA button */
.cta-container {
    text-align: center;
    margin: 20px 0;
}

.cta-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #FFB997;
    color: #F6F4EF;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 400;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    background-color: #D4A373;
    box-shadow: 0 0 10px rgba(212, 163, 115, 0.5);
}

/* Home wrapper */
.home-wrapper {
    background: linear-gradient(to bottom, #F6F4EF 0%, #FFE8D6 100%);
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    flex: 1;
}

/* Intro highlight */
.intro-highlight {
    background-color: rgba(255, 185, 151, 0.2);
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Bookmarks Navigation */
.bookmarks {
    margin: 20px 0;
    text-align: center;
}

.bookmarks ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.bookmarks li {
    display: inline;
}

.bookmarks a {
    font-family: 'Lora', serif;
    color: #403D39;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bookmarks a:hover {
    background-color: #FFB997;
    color: #F6F4EF;
}

/* Responsive */
@media (max-width: 768px) {
    /* Wrapper */
    .wrapper {
        flex-direction: column;
        background: linear-gradient(to bottom, #F6F4EF 0%, #F6F4EF 25%, #FFE8D6 100%);
    }

    /* Hamburger Button */
    .hamburger {
        position: fixed;
        top: 10px;
        left: 10px;
        padding: 10px;
        font-size: 1.5rem;
    }

    /* Sidebar */
    .sidebar {
        width: 100%;
        min-height: auto;
        height: auto;
        position: relative;
    }

    .sidebar.collapsed {
        width: 0;
        display: none;
    }

    .menu-toggle:checked ~ .sidebar {
        width: 0;
    }

    .nav-links {
        gap: 10px;
        padding: 10px 0;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding-left: 5px;
    }

    /* Main Content */
    main {
        padding: 15px;
        margin-left: 0;
        justify-content: flex-start;
    }

    main h1 {
        font-family: 'Open Sans', sans-serif;
        font-size: 1.8rem;
        margin: 15px 0;
    }

    main h2 {
        font-family: 'Open Sans', sans-serif;
        font-size: 1.4rem;
        margin: 10px 0;
    }

    main p {
        font-family: 'Lora', serif;
        font-size: 0.9rem;
        text-indent: 15px;
    }

    /* Hero Image */
    .hero-image {
        width: 100%;
        height: auto;
        margin-bottom: 20px;
    }

    .hero-image img {
        height: 200px;
        object-fit: cover;
        width: 100%;
    }

    .hero-overlay {
        height: 100%;
    }

    .hero-text {
        font-family: 'Open Sans', sans-serif;
        font-size: 1.8rem;
        padding: 10px;
    }

    /* CTA Button (index.html) */
    .cta-container {
        margin: 15px 0;
    }

    .cta-button {
        padding: 8px 15px;
        font-size: 0.9rem;
        border-radius: 20px;
    }

    /* External Links (references.html, footers) */
    .external-links {
        margin: 15px 0;
        padding: 0 10px;
    }

    .external-links li {
        margin-bottom: 8px;
    }

    .external-links a {
        font-family: 'Lora', serif;
        font-size: 0.85rem;
    }

    /* Table (references.html) */
    table {
        font-family: 'Lora', serif;
        display: block;
        overflow-x: auto;
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px;
        min-width: 100px;
    }

    /* Footer */
    footer {
        padding: 15px;
        font-size: 0.9rem;
    }

    footer a {
        font-family: 'Lora', serif;
        font-size: 0.85rem;
    }

    .back-to-top {
        margin-top: 8px;
    }

    /* Bookmarks */
    .bookmarks ul {
        flex-direction: column;
        gap: 10px;
    }

    .bookmarks a {
        font-family: 'Lora', serif;
        font-size: 0.9rem;
        display: block;
        padding: 8px;
    }

    /* Image pair */
    .image-pair,
    .image-pair-item-1,
    .image-pair-item-2 {
        display: none;
    }
}
