/* =========================================
   0. FONT IMPORTS (ADDED FOR FUNCTIONALITY)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@300;400;700&display=swap');

/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --gold-primary: #D4AF37;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #C5A028 100%);
    --onyx: #0a0a0a;
    --charcoal: #1a1a1a;
    --paper: #f4f4f4;
    --white: #ffffff;
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
    
    --spacing-standard: 1200px;
}

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

body {
    background-color: var(--white);
    color: var(--charcoal);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}
button, a, div, i, input {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
a { text-decoration: none; color: inherit; transition: 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. CUSTOM SCROLLBAR (LUXURY THEME)
   ========================================= */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--gold-primary) var(--onyx);
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--onyx); }
::-webkit-scrollbar-thumb {
    background-color: var(--gold-primary);
    border-radius: 6px;
    border: 3px solid var(--onyx); 
}
::-webkit-scrollbar-thumb:hover { background-color: #fff; }
button, a, div, i, input {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* SAFARI FIX */
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 90px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: var(--spacing-standard);
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img { height: 60px; width: auto; }

/* Desktop Nav Links */
.desktop-nav ul { display: flex; gap: 35px; }
.desktop-nav a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--onyx);
    position: relative;
}
.desktop-nav a::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 1px;
    background: var(--gold-primary); transition: 0.3s;
}
.desktop-nav a:hover::after { width: 100%; }

/* Mobile Toggle (Hidden on Desktop) */
.mobile-toggle {
    display: none;
    background: none; border: none; font-size: 1.5rem; color: var(--onyx);
}

/* =========================================
   4. DROPDOWN MENUS (DESKTOP)
   ========================================= */
.desktop-nav li.dropdown {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-top: 3px solid var(--gold-primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    z-index: 1100;
    gap: 0 !important;
}

/* WRAPPED IN MEDIA QUERY TO PREVENT MOBILE GLITCHES */
@media (min-width: 769px) {
    .desktop-nav li.dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.dropdown-menu li { width: 100%; margin: 0; }
.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--charcoal);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.dropdown-menu a::after { display: none; }
.dropdown-menu a:hover {
    background: #f9f9f9;
    color: var(--gold-primary);
    padding-left: 25px;
}

/* =========================================
   5. BUTTONS & UI ELEMENTS
   ========================================= */
.btn-gold {
    background: var(--gold-primary);
    color: var(--onyx);
    padding: 12px 25px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--gold-primary);
    cursor: pointer;
    transition: all 0.4s ease;
}

.btn-gold:hover {
    background: #ffffff;
    color: var(--onyx);
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

/* =========================================
   6. HERO SLIDER (HOMEPAGE)
   ========================================= */
.hero-slider-section {
    position: relative;
    height: 85vh;
    min-height: 600px;
    background-color: var(--onyx);
    overflow: hidden;
}

.hero-slider { width: 100%; height: 100%; position: relative; }

.hero-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden; z-index: 1;
    transition: opacity 1.5s ease-in-out, visibility 1.5s;
}
.hero-slide.active { opacity: 1; visibility: visible; z-index: 2; }

/* Ken Burns Effect */
.hero-bg {
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transform: scale(1); transition: transform 7s linear;
}
.hero-slide.active .hero-bg { transform: scale(1.1); }

/* Overlay & Text Visibility */
.hero-overlay {
    position: absolute; inset: 0; z-index: 2;
    background: 
        linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.3)), 
        linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 25%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.95) 100%);
}

.hero-content {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center; color: var(--white);
    z-index: 3; width: 90%; max-width: 900px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9), 0 10px 30px rgba(0,0,0,0.7);
    /* Prevent cropping on small screens */
    max-height: 100%;
    overflow-y: visible;
}

/* Staggered Text Animation */
.hero-slide .hero-label, .hero-slide h1, .hero-slide p, .hero-slide .btn-gold {
    opacity: 0; transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hero-slide.active .hero-label { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.hero-slide.active h1 { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.hero-slide.active p { transition-delay: 0.7s; opacity: 1; transform: translateY(0); }
.hero-slide.active .btn-gold { transition-delay: 0.9s; opacity: 1; transform: translateY(0); }

/* Typography */
.hero-label {
    display: block; color: var(--gold-primary);
    font-size: 0.9rem; letter-spacing: 4px; text-transform: uppercase;
    margin-bottom: 20px; font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.hero h1 {
    font-family: var(--font-heading); font-size: 4rem; line-height: 1.1;
    margin-bottom: 25px; color: var(--white);
    text-shadow: 0 2px 5px rgba(0,0,0,0.9), 0 10px 30px rgba(0,0,0,0.7);
}
.hero p {
    font-size: 1.2rem; font-weight: 300; margin-bottom: 35px;
    color: #f0f0f0; max-width: 600px; margin-left: auto; margin-right: auto;
}

/* Slider Controls */
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.3);
    color: white; font-size: 1.5rem; width: 50px; height: 50px;
    border-radius: 50%; cursor: pointer; z-index: 10;
    transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.slider-arrow:hover {
    background: var(--gold-primary); border-color: var(--gold-primary); color: var(--onyx);
    transform: translateY(-50%) scale(1.1);
}
.prev { left: 30px; }
.next { right: 30px; }

.slider-dots {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    z-index: 10; display: flex; gap: 12px;
}
.dot {
    width: 10px; height: 10px; background: transparent;
    border: 1px solid rgba(255,255,255,0.5); border-radius: 50%;
    cursor: pointer; transition: all 0.3s;
}
.dot.active {
    background: var(--gold-primary); border-color: var(--gold-primary); transform: scale(1.3);
}

/* =========================================
   7. SECTIONS, GRID & CARDS
   ========================================= */
.section-title { text-align: center; margin: 80px 0 50px; }
.section-title h2 { font-family: var(--font-heading); font-size: 2.5rem; color: var(--onyx); }
.section-title span { display: block; width: 60px; height: 2px; background: var(--gold-primary); margin: 15px auto 0; }

.grid-container {
    max-width: var(--spacing-standard); margin: 0 auto 100px; padding: 0 20px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px;
}

.card { background: #fff; transition: transform 0.4s ease, box-shadow 0.4s ease; cursor: pointer; }
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

.card-image { height: 300px; overflow: hidden; position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .card-image img { transform: scale(1.05); }

.card-details { padding: 25px 0; border-bottom: 1px solid #eee; }
.card-cat { color: var(--gold-primary); font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.card-title {
    font-family: var(--font-heading); font-size: 1.5rem; margin: 10px 0;
    line-height: 1.3; color: var(--onyx);
}
.read-btn {
    display: inline-block; margin-top: 10px; font-size: 0.7rem;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    border-bottom: 1px solid var(--onyx); padding-bottom: 3px;
}

/* Author Info */
.card-author {
    display: flex; align-items: center; gap: 10px;
    margin-top: 15px; padding-top: 15px; border-top: 1px solid #f0f0f0;
}
.author-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.author-meta { display: flex; flex-direction: column; line-height: 1.2; }
.author-name { font-size: 0.7rem; font-weight: 700; color: #333; text-transform: uppercase; }
.post-date { font-size: 0.65rem; color: #888; }

/* =========================================
   8. FILTER & PAGINATION
   ========================================= */
.category-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-bottom: 40px; }
.cat-btn {
    padding: 8px 20px; border: 1px solid #ddd; background: transparent;
    color: var(--onyx); font-family: var(--font-body); font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 1px; transition: 0.3s;
}
.cat-btn:hover { border-color: var(--gold-primary); color: var(--gold-primary); }
.cat-btn.active { background: var(--onyx); color: var(--gold-primary); border-color: var(--onyx); }

.pagination-container { display: flex; justify-content: center; margin-bottom: 60px; margin-top: 40px; }
.pagination { display: flex; gap: 10px; align-items: center; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 15px;
    border: 1px solid #ccc; background: #fff; color: var(--onyx);
    font-family: var(--font-body); font-size: 0.9rem; text-decoration: none;
    transition: 0.3s; white-space: nowrap;
}
.page-link:hover { border-color: var(--gold-primary); color: var(--gold-primary); }
.page-link.active { background: var(--onyx); color: var(--gold-primary); border-color: var(--onyx); }

/* =========================================
   9. MAGAZINE SLIDER
   ========================================= */
.mag-section {
    background-color: var(--charcoal); padding: 80px 0; position: relative;
    border-top: 1px solid var(--gold-primary); border-bottom: 1px solid var(--gold-primary);
}
.mag-header { text-align: center; margin-bottom: 40px; color: var(--white); }
.mag-header h2 { font-family: var(--font-heading); font-size: 2.5rem; color: var(--gold-primary); }

.mag-slider-container {
    max-width: var(--spacing-standard); margin: 0 auto;
    overflow-x: auto; white-space: nowrap;
    padding-bottom: 20px; padding-left: 20px; padding-right: 20px;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    scroll-behavior: smooth;
}
.mag-slider-container::-webkit-scrollbar { height: 6px; }
.mag-slider-container::-webkit-scrollbar-track { background: #1a1a1a; }
.mag-slider-container::-webkit-scrollbar-thumb { background-color: var(--gold-primary); border-radius: 10px; }

.mag-card {
    display: inline-block; width: 250px; margin: 0 15px; vertical-align: top;
    transition: transform 0.3s ease; cursor: pointer;
}
.mag-card:hover { transform: translateY(-10px); }
.mag-cover {
    width: 100%; aspect-ratio: 3/4; object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.mag-title {
    color: var(--gold-primary); font-size: 0.8rem; margin-top: 15px;
    text-align: center; letter-spacing: 1px; text-transform: uppercase; white-space: normal;
}
.show-more-container { text-align: center; margin-top: 40px; }

/* READER MODAL SPECIFIC STYLES */
.reader-content {
    width: 95%;
    max-width: 1400px;
    height: 90vh; /* Takes up 90% of screen height */
    padding: 0;   /* Remove padding so magazine fills edge-to-edge */
    background: #000; /* Black background looks better for readers */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Hide scrollbars on the container */
}

.reader-content .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    color: #000;
    z-index: 10;
}

/* fram bg 
.modal-content.reader-content {
    background-color: var(--gold-primary) !important;
    border: 1px solid var(--onyx) !important;
}
*/
#magFrame {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

/* =========================================
   10. POPUP MODAL
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* SAFARI FIX */
    z-index: 2000; display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.modal-content {
    background: var(--white); width: 90%; max-width: 1000px; height: 80vh;
    padding: 40px; border: 1px solid var(--gold-primary);
    position: relative; overflow-y: auto;
    animation: slideUp 0.4s ease forwards;
    scrollbar-width: thin; scrollbar-color: var(--gold-primary) #f4f4f4;
}
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-modal {
    position: sticky; top: 10px; display: block; margin-left: auto;
    z-index: 3000; margin-top: -20px; margin-right: -10px;
    background: rgba(255, 255, 255, 0.8); border-radius: 50%; width: 40px; height: 40px;
    border: none; font-size: 2rem; cursor: pointer; color: var(--onyx); line-height: 1;
}
.modal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 30px; margin-top: 20px;
}
.modal-grid .mag-card { width: 100%; margin: 0; display: block; }
.modal-grid .mag-title { color: var(--onyx); }

/* =========================================
   11. FOOTER
   ========================================= */
footer { background-color: var(--onyx); color: #b0b0b0; padding-top: 80px; font-size: 0.9rem; }
.footer-container { max-width: var(--spacing-standard); margin: 0 auto; padding: 0 30px; }
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 60px; margin-bottom: 80px; padding-bottom: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.footer-col h4 {
    font-family: var(--font-heading); color: var(--gold-primary);
    margin-bottom: 25px; font-size: 1.1rem; letter-spacing: 2px;
}
.footer-col ul li { margin-bottom: 15px; }
.footer-col ul li a { color: #b0b0b0; font-weight: 300; }
.footer-col ul li a:hover { color: var(--gold-primary); padding-left: 5px; }
.footer-form { display: flex; flex-direction: column; gap: 15px; }
.input-minimal {
    background: transparent; border: none; border-bottom: 1px solid #444;
    padding: 15px 0; color: var(--white); font-family: var(--font-body); outline: none; transition: 0.3s;
}
.input-minimal:focus { border-color: var(--gold-primary); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding: 30px 0 50px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
}
.social-links { display: flex; gap: 20px; }
.social-links a { font-size: 1.1rem; color: var(--white); }
.social-links a:hover { color: var(--gold-primary); transform: translateY(-3px); }

/* =========================================
   12. INSTAGRAM EMBED
   ========================================= */
.insta-native-section { padding: 60px 20px; background-color: var(--white); border-top: 1px solid rgba(0,0,0,0.05); }
.insta-native-container { max-width: var(--spacing-standard); margin: 0 auto; display: flex; justify-content: center; }
.instagram-media { min-width: 320px !important; }

/* =========================================
   13. PRELOADER
   ========================================= */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--onyx); z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}
body.loaded #preloader { transform: translateY(-100%); }
.loader-content { text-align: center; }
.loader-logo {
    font-family: var(--font-heading); font-size: 3rem; color: var(--gold-primary);
    letter-spacing: 8px; font-weight: 700; text-transform: uppercase; margin-bottom: 20px;
    background: linear-gradient(120deg, #b8860b, #D4AF37, #fff, #D4AF37, #b8860b);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite, fadeInUp 1s ease forwards;
}
.loader-progress { width: 200px; height: 2px; background: rgba(255, 255, 255, 0.1); margin: 0 auto; position: relative; overflow: hidden; }
.progress-bar {
    position: absolute; top: 0; left: 0; height: 100%; width: 0%;
    background-color: var(--gold-primary); animation: loadProgress 2s ease-in-out forwards;
    box-shadow: 0 0 10px var(--gold-primary);
}
@keyframes shine { to { background-position: 200% center; } }
@keyframes loadProgress { 0% { width: 0%; } 50% { width: 60%; } 100% { width: 100%; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   14. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    /* Header */
    .desktop-nav {
        /* HIDDEN STATE */
        display: block; opacity: 0; visibility: hidden;
        /* FIXED FOR SCROLLING BUG */
        position: fixed; 
        top: 90px; 
        left: 0; 
        width: 100%;
        height: calc(100vh - 90px); /* Allow menu to fill screen */
        overflow-y: auto; /* Enable vertical scroll */
        background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--gold-primary); padding: 20px 0 50px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1); z-index: 999;
        transform: translateY(-20px); transition: all 0.5s ease-in-out;
    }
    .desktop-nav.active { opacity: 1; visibility: visible; transform: translateY(0); }
    .desktop-nav ul { flex-direction: column; align-items: center; gap: 20px; }
    .desktop-nav a { font-size: 1rem; display: block; padding: 10px; width: 100%; text-align: center; }
    
    .mobile-toggle { display: block; cursor: pointer; }
    .nav-container { justify-content: flex-start; gap: 15px; }
    .logo { margin-right: auto; }
    .btn-gold { padding: 8px 15px; font-size: 0.65rem; }

    /* Dropdown Fix */
    .dropdown-menu {
        display: none !important; position: static !important;
        background: rgba(0,0,0,0.03); box-shadow: none !important; border-top: none !important;
        width: 100%; padding: 0; opacity: 1; visibility: visible; transform: none !important;
    }
    .dropdown.open .dropdown-menu { display: block !important; animation: fadeIn 0.3s ease; }
    .dropdown-menu a { padding-left: 30px; font-size: 0.85rem; color: #555; border-bottom: 1px solid rgba(0,0,0,0.05); }

    /* Hero */
    .hero-slider-section { height: 100vh; min-height: 600px; }
    .hero h1 { font-size: 2.8rem; }
    .hero p { font-size: 1rem; }
    .hero-content { width: 95%; padding: 0; }
    .slider-arrow { display: none; }

    /* Preloader */
    .loader-logo { font-size: 2rem; letter-spacing: 4px; }

    /* Footer */
    .footer-grid { text-align: center; gap: 40px; }
    .footer-col img { margin-left: auto; margin-right: auto; }
    .footer-form { align-items: center; }
    .input-minimal { text-align: center; width: 100%; max-width: 300px; }
    .social-links { justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
    
    /* Category Filter */
    .category-nav { gap: 10px; }
    .cat-btn { padding: 6px 15px; font-size: 0.7rem; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- HERO BUTTON SPACING FIX --- */

/* 1. Base State (Hidden) */
.hero-slide .btn-gold {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* FIX: Add margin to push it away from the paragraph */
    margin-top: 30px; 
    display: inline-block; /* Ensures margin works correctly */
}

/* 2. Active State (Visible) */
.hero-slide.active .btn-gold {
    transition-delay: 0.9s;
    opacity: 1;
    transform: translateY(0);
}

/* 3. Mobile Adjustment (If needed) */
@media (max-width: 768px) {
    .hero-slide .btn-gold {
        margin-top: 20px; /* Slightly smaller gap on mobile */
        padding: 10px 20px; /* Adjust padding for touch targets */
    }
}