/* ======================================================
   WOODCRAFTER - MASTER STYLESHEET
   Version: Ultimate CMS Edition
====================================================== */

/* 1. VARIABLES & RESET
   (Dynamic colors/fonts are handled in header.php)
====================================================== */
:root {
    /* Fallback variables */
    --bg-dark: #1A1A1A;
    --bg-light: #F4F1EA;
    --text-main: #2C2C2C;
    --accent: #C07743;
    --border: rgba(0,0,0,0.1);
    --white: #FFFFFF;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* 2. LAYOUT & GRIDS
====================================================== */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 100px 40px;
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Blog Feed vs Sidebar */
    gap: 80px;
}

/* 3. HEADER
====================================================== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 20px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo-wrapper img {
    max-height: 80px; /* Constraint for large uploads */
    width: auto;
}

/* Desktop Navigation */
.nav-menu ul {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

/* 4. HERO SECTION
====================================================== */
.hero-section {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4); /* Dark Overlay */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    max-width: 900px;
    width: 100%;
}

.hero-btn {
    display: inline-block;
    padding: 15px 45px;
    background: var(--white);
    color: var(--text-main);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-top: 30px;
    border: 2px solid var(--white);
}

.hero-btn:hover {
    background: transparent;
    color: var(--white);
}

/* 5. BLOG CARDS
====================================================== */
.blog-card {
    margin-bottom: 80px;
}

.card-img {
    overflow: hidden;
    margin-bottom: 25px;
    display: block;
    border-radius: 4px;
    background: #e0e0e0;
}

.card-img img {
    transition: transform 0.6s ease;
    width: 100%;
}

.blog-card:hover .card-img img {
    transform: scale(1.05);
}

.card-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.card-title a:hover {
    color: var(--accent);
}

.card-excerpt {
    margin-bottom: 20px;
    opacity: 0.8;
}

.read-more {
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}

/* 6. SIDEBAR
====================================================== */
.sidebar-widget {
    margin-bottom: 50px;
    background: var(--white);
    padding: 40px;
    border: 1px solid var(--border);
}

.widget-header {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.author-img-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.category-list a:hover {
    color: var(--accent);
    padding-left: 10px;
}

/* 7. ABOUT & CONTACT PAGE MODULES
====================================================== */
/* About Stats Bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    background: var(--text-main);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}

.stat-item {
    flex: 1;
    min-width: 200px;
}

/* About Intro Grid */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1100px;
    margin: 80px auto;
    padding: 0 20px;
}

/* About Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
}

.value-card {
    background: var(--white);
    padding: 40px;
    border: 1px solid var(--border);
    text-align: center;
    transition: 0.3s;
}

.value-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Contact Grid */
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    max-width: 1100px;
    margin: 80px auto;
    padding: 0 20px;
}

.contact-box {
    flex: 1;
    min-width: 280px;
    background: var(--white);
    padding: 50px 30px;
    border: 1px solid var(--border);
    text-align: center;
}

/* 8. FOOTER
====================================================== */
.site-footer {
    background: var(--bg-dark);
    color: var(--white);
    padding: 80px 40px 40px;
    margin-top: 100px;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 80px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .footer-logo {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    display: block;
    margin-bottom: 20px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-col h4 {
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.footer-col a {
    display: block;
    color: #aaa;
    margin-bottom: 12px;
    font-size: 0.95rem;
    transition: 0.3s;
}

.footer-col a:hover {
    color: var(--white);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 9. ANIMATIONS
====================================================== */
/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-light);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-text {
    font-weight: 900;
    letter-spacing: 4px;
    font-size: 1.5rem;
    color: var(--text-main);
    animation: pulse 2s infinite;
}

@keyframes pulse { 0% { opacity:0.5; } 50% { opacity:1; } 100% { opacity:0.5; } }

/* Scroll Reveals */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.2, 1, 0.3, 1);
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 10. RESPONSIVE MEDIA QUERIES
====================================================== */
@media (max-width: 900px) {
    /* Layout Stacking */
    .container, 
    .footer-container, 
    .footer-links,
    .intro-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* Padding Adjustments */
    .container {
        padding: 60px 20px;
    }
    
    .site-header {
        padding: 15px 20px;
    }

    /* Mobile Menu Toggle */
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none; /* Controlled by JS in header.php */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 30px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .nav-menu.is-active {
        display: flex;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 20px;
    }

    /* Module Stacking */
    .blog-card-row {
        flex-direction: column;
    }
    
    .row-img {
        width: 100%;
        height: 250px;
    }
    
    /* Font Size scaling handled by header.php calc(), 
       but here are safety fallbacks */
    h1 { font-size: 2.5rem !important; }
    
    /* Footer Reordering */
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }
}
/* ======================================================
   11. UNIQUE JOURNAL GRID (NEW)
====================================================== */

/* CATEGORY STRIP */
.category-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.cat-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    flex-wrap: wrap;
}

.cat-nav a {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    background: #fff;
    transition: 0.3s;
}

.cat-nav a:hover, .cat-nav a.active {
    background: var(--hero-tag-color);
    color: #fff;
    border-color: var(--hero-tag-color);
}

/* GRID LAYOUT */
.journal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

/* CARD STYLES */
.journal-card {
    background: #fff;
    border: 1px solid var(--border);
    transition: 0.4s ease;
    display: flex;
    flex-direction: column;
}

.journal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.jc-img {
    position: relative;
    overflow: hidden;
    padding-top: 65%; /* 3:2 Aspect Ratio */
    display: block;
}

.jc-img img, .placeholder-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s;
}

.placeholder-img { background: #eee; }

.journal-card:hover .jc-img img {
    transform: scale(1.1);
}

/* FLOATING BADGE */
.jc-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--hero-tag-color);
    color: #fff;
    padding: 6px 12px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    border-radius: 2px;
}

.jc-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.jc-date {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.jc-title {
    font-family: var(--hero-title-font);
    font-size: 1.4rem;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.jc-excerpt {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* FEATURED CARD (First Post) */
.journal-card.featured {
    grid-column: 1 / -1; /* Spans full width */
    flex-direction: row;
    align-items: center;
    background: #2C1810; /* Dark highlight */
    color: #fff;
    border: none;
}

.journal-card.featured .jc-img {
    width: 60%;
    padding-top: 40%;
}

.journal-card.featured .jc-content {
    width: 40%;
    padding: 60px;
}

.journal-card.featured .jc-title a { color: #fff; }
.journal-card.featured .jc-excerpt { color: rgba(255,255,255,0.8); font-size: 1.1rem; }
.journal-card.featured .jc-date { color: var(--hero-tag-color); }
.journal-card.featured .jc-btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid #fff;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-top: 10px;
}

.journal-card.featured .jc-btn:hover {
    background: #fff;
    color: #000;
}

/* PAGINATION */
.pagination {
    margin-top: 60px;
    text-align: center;
    grid-column: 1 / -1;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid var(--border);
    margin: 0 5px;
    font-weight: 700;
}

.pagination .current {
    background: var(--hero-tag-color);
    color: #fff;
    border-color: var(--hero-tag-color);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .journal-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .journal-card.featured {
        flex-direction: column;
    }
    
    .journal-card.featured .jc-img, 
    .journal-card.featured .jc-content {
        width: 100%;
    }
    
    .journal-card.featured .jc-img {
        padding-top: 60%;
    }
    
    .journal-card.featured .jc-content {
        padding: 30px;
    }
}