/* =========================================
   KOREAN EDITORIAL THEME - GLOBAL
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600&family=Noto+Serif+KR:wght@300;400;500;700&display=swap');

:root {
    --bg-paper: #F7F7F5;
    --ink-black: #1A1A18;
    --ink-light: #666660;
    --accent-rust: #9D3C31;
    --line-color: #E2E2DE;
    --font-serif: 'Noto Serif KR', serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background-color: var(--bg-paper); color: var(--ink-black); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.3s ease; }
img { width: 100%; height: 100%; object-fit: cover; display: block; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }

/* =========================================
   EDITORIAL NAVIGATION
========================================= */
/* Added 'body >' so it ONLY targets the main top menu, not the article headers */
body > header { 
    border-bottom: 1px solid var(--line-color); 
    padding: 20px 0; 
    position: sticky; 
    top: 0; 
    /* Made the background slightly more solid so text doesn't bleed through */
    background: rgba(247, 247, 245, 0.98); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999; /* Forces the menu to always stay on top of images/text */
}

.nav-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav-left { display: flex; gap: 30px; font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.nav-left a:hover { color: var(--accent-rust); }
.nav-center .logo { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; letter-spacing: -1px; text-align: center; display: block; }
.nav-center .logo span { color: var(--accent-rust); }
.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 20px; font-size: 0.85rem; }
.auth-btn { border: 1px solid var(--ink-black); padding: 8px 16px; border-radius: 40px; font-weight: 500; }
.auth-btn:hover { background: var(--ink-black); color: var(--bg-paper); }
.nav-right .auth-btn i { display: none; }
/* =========================================
   HERO: THE MAGAZINE COVER
========================================= */
.hero-editorial { padding: 60px 0; border-bottom: 1px solid var(--line-color); }
.hero-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: center; }
.hero-text h1 { font-family: var(--font-serif); font-size: 5.5rem; line-height: 1.05; font-weight: 400; margin-bottom: 30px; }
.hero-text p { font-size: 1.1rem; color: var(--ink-light); max-width: 400px; margin-bottom: 40px; }
.read-issue-btn { display: inline-flex; align-items: center; gap: 15px; font-family: var(--font-serif); font-size: 1.2rem; font-style: italic; border-bottom: 1px solid var(--ink-black); padding-bottom: 5px; }
.read-issue-btn:hover { color: var(--accent-rust); border-color: var(--accent-rust); gap: 25px; }
.hero-visual { position: relative; height: 700px; }
.hero-image { width: 100%; height: 100%; overflow: hidden; }
.hero-image img { transition: transform 0.7s ease; }
.hero-visual:hover img { transform: scale(1.03); }
.vertical-text { position: absolute; right: -20px; top: 50px; writing-mode: vertical-rl; font-family: var(--font-serif); font-size: 0.9rem; letter-spacing: 4px; color: var(--ink-light); }

/* =========================================
   DYNAMIC STORIES GRID (PHP Sourced)
========================================= */
.featured-stories { padding: 100px 0; }
.section-title { font-family: var(--font-sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 40px; display: flex; align-items: center; gap: 15px; }
.section-title::after { content: ""; flex-grow: 1; height: 1px; background: var(--line-color); }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 60px 40px; }
.story-card { display: flex; flex-direction: column; gap: 20px; }
.story-card:hover .story-img img { transform: scale(1.05); }
.story-img { overflow: hidden; aspect-ratio: 4/3; }
.story-meta { font-size: 0.8rem; font-weight: 600; color: var(--accent-rust); text-transform: uppercase; letter-spacing: 1px; }
.story-card h3 { font-family: var(--font-serif); font-size: 1.8rem; line-height: 1.3; font-weight: 500; margin-bottom: 10px; }
.story-card p.date { color: var(--ink-light); font-size: 0.9rem; }

/* =========================================
   PROVINCIAL ARCHIVE 
========================================= */
.province-archive { background: var(--ink-black); color: var(--bg-paper); padding: 100px 0; }
.province-archive .section-title::after { background: #333; }
.province-archive .section-title { color: var(--bg-paper); }
.archive-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #333; border: 1px solid #333; }
.archive-card { background: var(--ink-black); padding: 40px 30px; height: 450px; display: flex; flex-direction: column; justify-content: space-between; transition: 0.4s ease; position: relative; overflow: hidden; }
.archive-card::before { content: ""; position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: 0.4s ease; z-index: 1; }
.archive-card:nth-child(1)::before { background-image: url('https://images.unsplash.com/photo-1589309736404-2e142a2acdf0?q=80&w=600'); }
.archive-card:nth-child(2)::before { background-image: url('https://images.unsplash.com/photo-1546874177-9e664107314e?q=80&w=600'); }
.archive-card:nth-child(3)::before { background-image: url('https://images.unsplash.com/photo-1580651315530-69c8e0026377?q=80&w=600'); }
.archive-card:nth-child(4)::before { background-image: url('https://images.unsplash.com/photo-1517154421773-0529f29ea451?q=80&w=600'); }
.archive-card:hover::before { opacity: 0.4; }
.archive-card:hover { transform: translateY(-10px); }
.archive-card-content { position: relative; z-index: 2; }
.archive-num { font-family: var(--font-sans); font-size: 0.9rem; font-weight: 300; opacity: 0.6; margin-bottom: 20px; display: block;}
.archive-card h4 { 
    font-family: var(--font-serif); 
    font-size: 2.5rem; 
    font-weight: 300; 
    margin-bottom: 10px; 
    
    /* Add these two lines to handle long English words */
    word-wrap: break-word;
    hyphens: auto; 
}
.archive-card p { font-size: 0.9rem; opacity: 0.8; font-weight: 300; }

/* =========================================
   FORMS, LOGIN, ADMIN & SINGLE POST
========================================= */
.form-container, .admin-container { max-width: 600px; margin: 80px auto; background: #fff; padding: 50px; border: 1px solid var(--line-color); }
.admin-container { max-width: 900px; }
.form-container h2, .admin-container h2 { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 30px; text-align: center; }
.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-light); }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"], .form-group select { width: 100%; padding: 15px; border: 1px solid var(--line-color); background: var(--bg-paper); font-size: 1rem; font-family: var(--font-sans); outline: none; transition: 0.3s; }
.form-group input:focus, .form-group select:focus { border-color: var(--ink-black); }
.btn-publish { background: var(--ink-black); color: var(--bg-paper); padding: 15px 30px; border: none; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; width: 100%; font-family: var(--font-sans); transition: 0.3s; }
.btn-publish:hover { background: var(--accent-rust); }
.error { color: var(--accent-rust); background: #fdf5f5; padding: 15px; border: 1px solid var(--accent-rust); margin-bottom: 20px; font-size: 0.9rem; }
.success { color: #2b7a4b; background: #f0fdf4; padding: 15px; border: 1px solid #2b7a4b; margin-bottom: 20px; font-size: 0.9rem; }

/* Single Article */
.single-post { max-width: 800px; margin: 80px auto; }
.post-header { text-align: center; margin-bottom: 40px; }
.post-header h1 { font-family: var(--font-serif); font-size: 3.5rem; line-height: 1.2; margin: 20px 0; }
.hero-image { width: 100%; height: 500px; object-fit: cover; margin-bottom: 50px; }
.post-content { font-size: 1.15rem; color: var(--ink-black); }
.post-content p { margin-bottom: 25px; }
.post-content h2, .post-content h3 { font-family: var(--font-serif); margin: 40px 0 20px; }

/* =========================================
   FOOTER
========================================= */
footer { padding: 80px 0 40px; text-align: center; border-top: 1px solid var(--line-color); }
.footer-cta { max-width: 500px; margin: 0 auto 60px; }
.footer-cta h2 { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 15px; font-weight: 400; }
.footer-cta p { color: var(--ink-light); margin-bottom: 30px; font-size: 0.95rem; }
.footer-bottom { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-light); border-top: 1px solid var(--line-color); padding-top: 20px; }




/* =========================================
   HERO SLIDER UPDATES
========================================= */
.hero-slider-container {
    position: relative;
    height: 70vh; /* Adjust height here */
    min-height: 600px;
    width: 100%;
    overflow: hidden;
    background: var(--ink-black);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: white;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-content {
    max-width: 800px;
    position: relative;
    z-index: 3;
}

.slide-meta {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-rust);
    font-weight: 600;
    display: block;
    margin-bottom: 20px;
}

.slide-content h1 {
    font-family: var(--font-serif);
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 40px;
    font-weight: 400;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.slider-btn {
    color: white;
    border-color: white;
}
.slider-btn:hover {
    color: var(--accent-rust);
    border-color: var(--accent-rust);
}

.slider-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 15px;
}

.slider-controls button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}
.slider-controls button:hover {
    background: white;
    color: var(--ink-black);
}

/* =========================================
   HORIZONTAL REGION SCROLL (BEAUTIFUL CARDS)
========================================= */
.horizontal-scroll-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 30px; /* Space between cards */
    background: transparent; /* Removed the ugly black background */
    border: none; 
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0 60px 0; /* Extra bottom padding for shadows */
}

/* Hide scrollbar for a clean look */
.horizontal-scroll-wrapper::-webkit-scrollbar { height: 8px; }
.horizontal-scroll-wrapper::-webkit-scrollbar-track { background: transparent; }
.horizontal-scroll-wrapper::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.horizontal-scroll-wrapper .archive-card {
    width: 320px; /* Forces exact width */
    flex: 0 0 320px; /* Stops it from stretching */
    scroll-snap-align: start;
    height: 450px;
    border-radius: 20px;
    background: var(--ink-black);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* Base image overlay setup */
.horizontal-scroll-wrapper .archive-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3; /* Base darkness */
    transition: all 0.5s ease;
    z-index: 1;
}

/* THE LIGHT UP HOVER EFFECT */
.horizontal-scroll-wrapper .archive-card:hover {
    transform: translateY(-15px); /* Lift up */
    box-shadow: 0 20px 40px rgba(157, 60, 49, 0.2); /* Glows slightly red (accent color) */
}
.horizontal-scroll-wrapper .archive-card:hover::before {
    opacity: 0.7; /* Lights up the background image */
    transform: scale(1.05); /* Slight zoom on image */
}

.archive-card-content {
    position: relative;
    z-index: 2;
    padding: 40px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); /* Makes text readable over bright images */
}



/* =========================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
========================================= */

/* -------------- TABLET (Max 1024px) -------------- */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    
    /* Shrink giant typography slightly */
    .hero-slide .slide-content h1 { font-size: 4rem; }
    .post-header h1 { font-size: 2.8rem; }
    
    /* Grid adjustments */
    .story-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 20px; }
    
    /* Make region cards slightly smaller to fit better */
    .horizontal-scroll-wrapper .archive-card { width: 280px; flex: 0 0 280px; height: 400px; }
}

/* -------------- MOBILE (Max 768px) -------------- */
@media (max-width: 768px) {
    /* 1. Header & Navigation (Editorial Stacked Layout) */
    body > header { padding: 15px 0; }
    .nav-grid { 
        grid-template-columns: 1fr; /* Stacks logo and links */
        gap: 15px; 
        justify-items: center; 
    }
    .nav-center { order: 1; } /* Logo on top */
    .nav-left { 
        order: 3; /* Menu links on bottom */
        width: 100%; 
        justify-content: center; 
        gap: 15px; 
        font-size: 0.75rem; 
        flex-wrap: wrap; /* Allows links to break to next line if needed */
    }
    .nav-right { 
        position: absolute; /* Pins auth/language to the top right */
        top: 20px; 
        right: 20px; 
        order: 2; 
        gap: 10px;
    }
    
    /* 2. Transform Auth Buttons into Icons (HEADER ONLY) */
    .hide-mobile { display: none !important; } 
    
    /* Notice we added .nav-right so it ONLY affects the top menu! */
    .nav-right .auth-btn { 
        padding: 0; 
        width: 36px; 
        height: 36px; 
        display: inline-flex; 
        justify-content: center; 
        align-items: center; 
        border-radius: 50%; 
    }
    .nav-right .auth-btn i { display: inline-block; margin: 0; font-size: 0.9rem; }
    
    /* 3. Hero Slider Adjustments */
    .hero-slider-container { min-height: 500px; height: 60vh; }
    .hero-slide .slide-content h1 { font-size: 2.5rem; margin-bottom: 20px; }
    .slide-meta { font-size: 0.75rem; margin-bottom: 10px; }
    .vertical-text { display: none; } /* Hide side text to save space */
    .slider-controls { bottom: 20px; }
    
    /* 4. Stories & Single Post Adjustments */
    .section-title { font-size: 0.75rem; margin-bottom: 25px; }
    .story-card h3 { font-size: 1.5rem; }
    .post-header h1 { font-size: 2rem; }
    .hero-image { height: 300px; margin-bottom: 30px; }
    
    /* 5. Admin & Forms */
    .form-container, .admin-container { margin: 40px auto; padding: 30px 20px; }
    .form-group[style*="display: flex"] { flex-direction: column; gap: 0; } /* Stack inline inputs */
    
    /* 6. Footer Layout */
    footer { padding: 60px 0 30px; }
    .footer-cta h2 { font-size: 1.5rem; line-height: 1.3; }
    .footer-bottom { 
        flex-direction: column; /* Stack copyright and socials */
        gap: 15px; 
        align-items: center; 
        text-align: center; 
    }
}

/* -------------- SMALL MOBILE (Max 480px) -------------- */
@media (max-width: 480px) {
    /* Final tweaks for very small screens (like iPhone SE) */
    .nav-left { gap: 10px; font-size: 0.7rem; }
    .nav-center .logo { font-size: 1.8rem; }
    .hero-slide .slide-content h1 { font-size: 2.1rem; }
    .horizontal-scroll-wrapper .archive-card { width: 260px; flex: 0 0 260px; }
}