/* --- Reset & Variables --- */
:root {
    /* Warm, Storytelling Serif */
    --font-serif: 'Lora', serif;
    /* Friendly, Humanist Sans */
    --font-sans: 'Lato', sans-serif;
    --color-text-main: #1a1a1a;
    --color-text-sub: #555;
    --color-accent: #ff5e5e; 
    --color-bg-blob: #ffede6;
    --radius-card: 16px;
    --radius-btn: 50px;
    --header-height: 80px;
}

/* CRITICAL FIX: Locks the width on mobile to prevent side-scrolling/white gaps */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; 
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: #fff;
    line-height: 1.6;
    position: relative; /* Helps contain absolute elements */
}

a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
a:hover { opacity: 0.7; }
img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- Utility Classes --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.highlight {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-accent);
    font-weight: 400;
}

/* --- Background Blobs --- */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.6;
    pointer-events: none;
}

.blob-1 { top: -100px; left: -100px; width: 600px; height: 600px; background: #fff0f0; }
.blob-2 { top: 0; right: -200px; width: 800px; height: 700px; background: #fff5e6; }
.blob-3 { top: 50%; left: 30%; width: 400px; height: 400px; background: #ffebeb; }
.blob-footer { bottom: -100px; left: 50%; transform: translateX(-50%); width: 600px; height: 400px; background: #ffe4e4; position: absolute;}

/* --- Header & Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    position: relative;
    z-index: 100;
}

.logo {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-accent);
    z-index: 101;
	font-style: italic;
}

/* ============================
   DESKTOP MENU (FLOATING PILL)
   ============================ */

/* Only apply the Pill style on Desktop */
@media (min-width: 769px) {
    
    header .menu {
        /* Layout */
        display: flex;
        align-items: center;
        gap: 30px; /* Clean spacing between links */
        
        /* The Pill Shape */
        background-color: rgba(255, 255, 255, 0.7); /* Milky white transparency */
        backdrop-filter: blur(12px); /* The "Frosted Glass" effect */
        -webkit-backdrop-filter: blur(12px); /* Safari support */
        
        /* Spacing & Borders */
        padding: 12px 40px; 
        border-radius: 50px; /* Makes it a capsule */
        border: 1px solid rgba(255, 255, 255, 0.6); /* Subtle border for definition */
        
        /* The Soft Shadow (Neumorphic feel) */
        box-shadow: 
            0 10px 30px rgba(0,0,0,0.04), /* Deep soft shadow */
            0 2px 8px rgba(0,0,0,0.02);   /* Sharp detail shadow */
            
        /* Reset any floats */
        clear: none;
        max-height: none;
    }

    /* Link Styling inside the Pill */
    header .menu a {
        margin-left: 0; /* Remove old margins, we use gap now */
        font-family: var(--font-sans);
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--color-text-main);
        display: inline-block;
        transition: all 0.2s ease;
        position: relative;
    }

    /* Hover Effect - Subtle Color Shift + Lift */
    header .menu a:hover {
        color: var(--color-accent);
        transform: translateY(-1px);
        opacity: 1;
    }

    /* Active State */
    header .menu a.active {
        color: var(--color-accent);
        font-weight: 600;
    }
}

/* Checkbox Hack hidden by default */
.menu-btn { display: none; }
.menu-icon { display: none; cursor: pointer; }

/* Red Notification Badge */
.nav-item-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--color-accent);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Shared Components --- */
.btn {
    padding: 10px 24px;
    border-radius: var(--radius-btn);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.btn-red { background: var(--color-accent); color: white; }
.btn-black { background: #000; color: white; }

.section-block { margin-bottom: 80px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 5px;
}
.section-sub { font-size: 0.9rem; color: var(--color-text-sub); }

.category-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-text-sub);
    margin-bottom: 5px;
    display: block;
}

/* ============================
   HOME PAGE SPECIFIC STYLES
   ============================ */

.hero {
    text-align: center;
    padding: 60px 0 80px;
    max-width: 1000px;
    margin: 0 auto;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 20px;
}
.hero .subtitle {
    font-size: 1.1rem;
    color: var(--color-text-sub);
    max-width: 900px;
    margin: 0 auto;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 80px;
}
.card-vertical {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    height: 400px;
    background: #f0f0f0;
}
.card-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: rgba(255,255,255, 0.95);
    padding: 15px;
    border-radius: 12px;
}
.card-overlay h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.3;
}
.card-overlay .meta {
    font-size: 0.75rem;
    color: #888;
}

.editors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.card-standard .img-wrapper-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 15px;
}
.card-standard h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 8px;
    line-height: 1.3;
}
.card-standard .date {
    font-size: 0.8rem;
    color: var(--color-text-sub);
}

.latest-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.card-large .img-wrapper-large {
    width: 100%;
    height: 450px;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}
.on-image {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #000;
}
.large-content h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 15px;
}
.large-content p {
    color: var(--color-text-sub);
    font-size: 1rem;
    max-width: 90%;
}

.latest-small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.card-small .img-wrapper-small {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}
.card-small h4 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.3;
}

/* ============================
   CATEGORY PAGE SPECIFIC STYLES
   ============================ */

.category-hero {
    text-align: center;
    padding: 50px 0 80px;
    max-width: 800px;
    margin: 0 auto;
}

.category-hero h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.category-hero p {
    font-size: 1.1rem;
    color: var(--color-text-sub);
    line-height: 1.6;
}

.category-feed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    row-gap: 60px;
    margin-bottom: 100px;
}

.feed-card {
    display: flex;
    flex-direction: column;
}

.feed-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 25px;
}

.feed-content h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 15px;
    line-height: 1.25;
}

.feed-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-sub);
    margin-bottom: 15px;
    line-height: 1.6;
}

.feed-date {
    font-size: 0.8rem;
    color: #999;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 100px;
}

.page-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f8f8;
    color: var(--color-text-main);
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-link:hover { background: #e0e0e0; }
.page-link.active { background: var(--color-accent); color: white; }
.page-link.arrow { font-size: 1.2rem; background: transparent; }
.page-link.arrow:hover { background: #f0f0f0; }


/* ============================
   ARTICLE PAGE SPECIFIC STYLES
   ============================ */

.article-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    margin: 40px 0 40px;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 25px;
    color: #000;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--color-text-sub);
    border-top: 1px solid transparent; 
}

.meta-left .sep {
    margin: 0 10px;
    color: #ccc;
}

.meta-right {
    display: flex;
    align-items: center;
}

.article-featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 50px;
}

.article-body {
    max-width: 100%;
    margin-bottom: 60px;
}

.article-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 24px;
    color: #333;
}

/* --- Article List Styling --- */
.article-body ul {
    margin: 30px 0 30px 10px; 
    padding: 0;
    list-style: none;
}

.article-body ul li {
    position: relative;
    padding-left: 30px; 
    margin-bottom: 15px; 
    line-height: 1.7;
    color: var(--color-text-main);
}

.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background-color: var(--color-accent); 
    border-radius: 50%;
}

.article-body ol {
    margin: 30px 0 30px 10px;
    padding: 0;
    list-style: none;
    counter-reset: article-counter;
}

.article-body ol li {
    position: relative;
    padding-left: 30px; 
    margin-bottom: 15px; 
    line-height: 1.7; 
    counter-increment: article-counter; 
}

.article-body ol li::before {
    content: counter(article-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
    font-weight: 600;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

.article-body .intro-text {
    font-size: 1.2rem;
    color: #111;
}

.article-body h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin: 50px 0 20px;
    color: #000;
}

.article-divider {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 80px 0 0;
}

/* --- Contact Form Styles --- */
.form-group { margin-bottom: 20px; }
.form-label { 
    display: block; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--color-text-main); 
    font-family: var(--font-sans); 
    font-size: 0.9rem; 
}
.form-input, .form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px; 
    font-family: var(--font-sans);
    font-size: 1rem;
    background: #fdfdfd;
    transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus { 
    border-color: var(--color-accent); 
    outline: none; 
    background: #fff; 
}
.form-textarea { height: 150px; resize: vertical; }

/* Align button right */
.form-actions { text-align: right; }

.form-btn {
    background-color: #000;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}
.form-btn:hover { opacity: 0.8; }

.alert { padding: 15px; border-radius: 8px; margin-bottom: 30px; font-size: 0.95rem; }
.alert-success { background-color: #e6f9ed; color: #1e7e34; border: 1px solid #c3e6cb; }
.alert-error { background-color: #fce8e6; color: #c62828; border: 1px solid #fadbd8; }

.contact-note { margin-top: 40px; font-size: 0.9rem; color: #777; }

/* --- Footer --- */
.footer-cta {
    text-align: center;
    padding: 80px 0 40px;
    position: relative;
    border-top: 1px solid transparent; 
	overflow: hidden;
}
.footer-cta h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    max-width: 1000px;
    margin: 0 auto 100px;
    line-height: 1.2;
}
.copyright {
    font-size: 0.8rem;
    color: #222;
}

/* --- Responsive & Hamburger Menu Logic --- */

@media (max-width: 1024px) {
    .featured-grid, .editors-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1, .category-hero h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
    /* 1. Hamburger Icon Styling */
    .menu-icon {
        display: block;
        padding: 10px;
        position: relative;
        z-index: 102;
    }

    .navicon {
        background: #333;
        display: block;
        height: 2px;
        position: relative;
        transition: background .2s ease-out;
        width: 24px;
    }

    .navicon:before,
    .navicon:after {
        background: #333;
        content: '';
        display: block;
        height: 100%;
        position: absolute;
        transition: all .2s ease-out;
        width: 100%;
    }

    .navicon:before { top: 7px; }
    .navicon:after { top: -7px; }

    /* 2. ELEGANT MOBILE MENU (Glassmorphism Card) */
    header .menu {
        display: none; /* Hidden by default */
        
        /* Positioning: Floating Card */
        position: absolute;
        top: 90px; /* Just below the header */
        left: 20px;
        width: calc(100% - 40px); /* 20px margin on each side */
        
        /* UPDATED BACKGROUND: Warm Gradient */
        background: linear-gradient(to bottom, #ffffff, #ffede6);
        
        backdrop-filter: blur(15px); /* Strong blur for depth */
        -webkit-backdrop-filter: blur(15px);
        
        /* Shape & Depth */
        border-radius: 24px; /* Soft, rounded edges */
        box-shadow: 
            0 20px 40px rgba(0,0,0,0.08), /* Soft drop shadow */
            0 0 0 1px rgba(255,255,255, 0.5); /* Subtle white border ring */
            
        padding: 15px 0;
        z-index: 99;
        text-align: center;
    }

    /* 3. Show Menu when Checked */
    .menu-btn:checked ~ .menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        animation: fadeSlideDown 0.3s ease-out forwards;
    }

    /* Animation for smooth opening */
    @keyframes fadeSlideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Menu Links Styling */
    header .menu a {
        display: block;
        position: relative; /* For the divider */
        margin: 0;
        padding: 12px 0; /* Vertical breathing room */
        font-family: var(--font-sans);
        font-size: 0.95rem; /* Slightly smaller, more elegant */
        font-weight: 500;
        color: var(--color-text-main);
        width: 100%;
        transition: color 0.2s;
    }
    
    header .menu a:hover {
        color: var(--color-accent);
    }

    /* 4. Elegant Half-Width Dividers */
    /* We add a line after every link... */
    header .menu a::after {
        content: '';
        display: block;
        width: 40px; /* The "Half-Width" feel (small dash) */
        height: 1px;
        background-color: rgba(0,0,0,0.06); /* Very subtle grey */
        margin: 8px auto 0; /* Centered below text */
    }

    /* ...except the last one (no divider at the bottom) */
    header .menu a:last-child::after {
        display: none;
    }

    /* 5. Animate Icon to X */
    .menu-btn:checked ~ .menu-icon .navicon { background: transparent; }
    .menu-btn:checked ~ .menu-icon .navicon:before { transform: rotate(-45deg); top: 0; }
    .menu-btn:checked ~ .menu-icon .navicon:after { transform: rotate(45deg); top: 0; }


    /* --- General Grid Stacking --- */
    .featured-grid, .editors-grid, .latest-layout, .latest-small-grid, .category-feed {
        grid-template-columns: 1fr;
    }
    
    .hero h1, .category-hero h1, .article-title { font-size: 2.2rem; }
    
    .feed-content h2 { font-size: 1.5rem; }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .card-large .img-wrapper-large { height: 300px; }

    .footer-cta h2 {
        font-size: 2rem;
        margin-bottom: 60px;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .article-featured-image {
        aspect-ratio: 4/3;
    }

    /* Reset header alignment for mobile row */
    header { 
        flex-direction: row; 
        gap: 0; 
        text-align: left; 
    }

    /* 5. Tame the Background Blobs for Mobile (CRITICAL FIX) */
    .blob-1 {
        width: 300px;
        height: 300px;
        left: -50px;
        top: -50px;
    }

    .blob-2 {
        width: 350px;
        height: 350px;
        right: -100px; /* Pull it in tighter */
        top: 50px;
    }

    /* Hide the middle blob to reduce clutter */
    .blob-3 {
        display: none; 
    }
    
    /* Ensure the footer blob stays contained */
    .blob-footer {
        width: 100%;
        left: 0;
        transform: none;
        bottom: -50px;
    }
}
