/* 
 * Perintis Berdaya - Main Stylesheet
 * Mobile-First Approach
 */

/* ==========================================================================
   1. CSS Variables & Theme Configuration
   ========================================================================== */
:root {
    /* Colors - Brand Kit Perintis Berdaya */
    --primary-color: #7B1414;    /* Deep Maroon / Dark Red */
    --primary-light: #8A1A17;
    --primary-dark: #5A0E0E;
    
    --accent-color: #C89B5A;     /* Golden-Beige / Warm Ochre */
    --accent-light: #D0A25F;
    
    /* Editorial Colors */
    --text-main: #1E1E1E;        /* Dark Charcoal from logo text */
    --text-muted: #555555;
    --bg-main: #fcfcfc;          /* Slight off-white for print feel */
    --bg-alt: #f4f4f4;
    --border-color: #d1d1d1;
    --border-dark: #1E1E1E;
    
    /* Typography - Magazine Feel */
    --font-heading: 'Playfair Display', serif; /* Elegant Serif for Magazine feel */
    --font-sans: 'Inter', sans-serif;
    --font-body: 'Lora', serif; /* Classic serif for long reads */
    --font-meta: 'Inter', sans-serif;
    
    /* Spacing & Layout */
    --container-padding: 1.5rem;
    --section-padding: 4rem 0;
    --border-radius: 0; /* Sharp edges for editorial look */
    --transition-speed: 0.4s;
    
    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.03);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 19px; /* Slightly larger for editorial */
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text-main);
}

h1 { font-size: 2.75rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 1px; }

p {
    margin-bottom: 1.5rem;
}

.text-uppercase { text-transform: uppercase; letter-spacing: 1px; }
.text-serif { font-family: var(--font-heading); }
.text-sans { font-family: var(--font-sans); }

/* Editorial Elements */
.drop-cap::first-letter {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 0.8;
    float: left;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    color: var(--primary-color);
    font-weight: 700;
}

.pull-quote {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    line-height: 1.4;
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
    margin: 3rem 0;
    border-top: 2px solid var(--border-dark);
    border-bottom: 2px solid var(--border-dark);
    color: var(--primary-color);
}

/* ==========================================================================
   4. Layout & Utilities
   ========================================================================== */
.container {
    width: 100%;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    margin-left: auto;
    margin-right: auto;
}

.section {
    padding: var(--section-padding);
}

/* Magazine Style Section Title */
.section-title {
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title h2 {
    margin: 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-family: var(--font-sans);
    letter-spacing: 2px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-dark);
}

/* Buttons - Editorial Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
    text-align: center;
    min-height: 48px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--text-main);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-dark);
}

.btn-outline:hover {
    background-color: var(--text-main);
    color: white;
}

/* ==========================================================================
   5. Components (Mobile First)
   ========================================================================== */

/* Header & Navigation - Editorial Style */
.site-header {
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: none;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px; /* Adjust based on actual logo proportion */
    width: auto;
}

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

.menu-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-main);
    transition: all 0.3s linear;
}

.nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--bg-main);
    flex-direction: column;
    align-items: center;
    padding-top: 3rem;
    transition: left 0.3s ease;
    display: flex;
}

.nav-menu.active {
    left: 0;
}

.nav-menu li {
    margin-bottom: 2rem;
}

.nav-menu a {
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
    color: var(--text-main);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Editorial Cards */
.mag-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
    group-hover: var(--primary-color);
}

.mag-card-img-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.mag-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.mag-card-category {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary-color);
    color: white;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.mag-card-meta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 10px;
    align-items: center;
}

.mag-card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.mag-card-title a {
    color: var(--text-main);
}

.mag-card:hover .mag-card-title a {
    color: var(--primary-color);
}

.mag-card-excerpt {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer Editorial */
.site-footer {
    background-color: #520b06;
    color: white;
    padding: 5rem 0 2rem;
    border-top: 4px solid var(--primary-color);
}

.footer-grid {
    display: grid;
    gap: 3rem;
}

.footer-logo {
    display: inline-block;
    border-radius: 4px;
}

.footer-logo img {
    height: 50px;
    width: auto;
}

.footer-widget h3 {
    color: white;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.footer-widget h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links li {
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.footer-links a {
    color: #a0a0a0;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #888;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   6. Media Queries (Desktop Enhancement)
   ========================================================================== */

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .top-bar {
        display: block;
    }
    
    .grid-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem 2rem;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Editorial Layouts */
    .mag-featured {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: center;
    }
    
    .mag-featured .mag-card-img-wrapper {
        margin-bottom: 0;
        height: 100%;
    }
    
    .mag-featured .mag-card-img {
        height: 100%;
        aspect-ratio: auto;
    }
    
    .mag-featured .mag-card-content {
        padding: 2rem;
        background: white;
        margin-left: -4rem; /* Overlapping effect */
        z-index: 10;
        position: relative;
        box-shadow: var(--shadow-sm);
        border-top: 4px solid var(--primary-color);
    }
    
    .mag-featured .mag-card-title {
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    h1 { font-size: 4rem; }
    
    .grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem 2rem;
    }
    
    /* Asymmetric Magazine Grid */
    .mag-grid-complex {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .mag-item-large {
        grid-column: span 2;
        grid-row: span 2;
    }
    
    .mag-item-large .mag-card-title {
        font-size: 2rem;
    }
    
    /* Navigation Desktop */
    .menu-toggle {
        display: none;
    }
    
    .nav-menu {
        position: static;
        width: auto;
        height: auto;
        flex-direction: row;
        padding-top: 0;
        background: transparent;
    }
    
    .nav-menu li {
        margin-bottom: 0;
        margin-left: 2.5rem;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

