/* Ancient Civilizations - Shared Styles */
:root {
    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Refined Color Palette */
    --gold: #D4AF37;
    --gold-dark: #B8860B;
    --gold-light: rgba(212, 175, 55, 0.12);
    --purple: #6B21A8;
    --purple-deep: #4C1D95;
    --purple-light: rgba(107, 33, 168, 0.08);
    --purple-glow: rgba(107, 33, 168, 0.15);

    /* Neutral Tones */
    --black: #1C1917;
    --gray: #57534E;
    --gray-light: #78716C;
    --light-gray: #F7F5F3;
    --white: #FFFCF9;
    --border-subtle: rgba(0, 0, 0, 0.06);

    --max-width: 1200px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 16px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.08), 0 24px 48px rgba(0,0,0,0.1);
}

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

body {
    font-family: var(--font-body);
    background: var(--white);
    color: var(--black);
    line-height: 1.7;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: var(--purple);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--purple-deep);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 252, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--purple);
    text-decoration: none;
    letter-spacing: -0.02em;
    font-family: var(--font-display);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--purple);
}

.nav-links .nav-highlight {
    color: var(--gold-dark);
    font-weight: 600;
}

.nav-links .nav-highlight:hover {
    color: var(--gold);
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--black);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Video Page Styles */
.video-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 7rem 2rem 4rem;
}

.video-page h1 {
    font-size: 2.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--black);
    line-height: 1.3;
}

.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--gray);
}

.video-meta span {
    font-weight: 500;
}

.video-meta a {
    color: var(--purple);
    font-weight: 500;
}

.video-meta a:hover {
    color: var(--purple-deep);
    text-decoration: underline;
}

.video-page > p {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.video-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--purple-light);
    color: var(--purple);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.video-page .back-link:hover {
    background: var(--purple);
    color: var(--white);
    text-decoration: none;
}

/* Related Videos Section */
.related-videos {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.related-videos h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--black);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.related-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-subtle);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.related-card .thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #1a1a1a;
}

.related-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover .thumb img {
    transform: scale(1.05);
}

.related-card .thumb .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(107, 33, 168, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.related-card:hover .thumb .play-icon {
    opacity: 1;
}

.related-card .card-info {
    padding: 0.875rem;
}

.related-card .card-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--black);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card .card-info .card-geo {
    font-size: 0.75rem;
    color: var(--gray-light);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

/* Responsive related videos */
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .related-videos h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .related-card .card-info {
        padding: 0.75rem;
    }
}

/* Footer */
footer {
    padding: 3rem 2rem;
    background: var(--black);
    color: var(--white);
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
}

.footer-section a {
    display: block;
    color: var(--gray-light);
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #333;
    text-align: center;
    color: var(--gray-light);
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(107, 33, 168, 0.25);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 33, 168, 0.35);
    color: #fff;
}

.btn-secondary {
    padding: 0.85rem 2rem;
    background: transparent;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.01em;
}

.btn-secondary:hover {
    background: var(--purple-light);
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-container {
        padding: 1rem 1.25rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 5rem 2rem 2rem;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--light-gray);
    }

    .video-page {
        padding: 6rem 1.5rem 3rem;
    }

    .video-page h1 {
        font-size: 1.75rem;
    }

    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .nav-links {
        width: 100%;
    }

    .video-page {
        padding: 5rem 1rem 2rem;
    }

    .video-page h1 {
        font-size: 1.5rem;
    }

    .video-page > p {
        font-size: 1rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .nav-container {
        padding-left: max(1.25rem, env(safe-area-inset-left));
        padding-right: max(1.25rem, env(safe-area-inset-right));
    }

    .video-page {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}
