/* ==========================================================================
   The Free Slave - Responsive Cokelat & Krem (Engineered Floors Palette)
   ========================================================================== */

:root {
    /* Engineered Floors Palette Tokens */
    --tfs-bg-main: #EAE7DD;
    --tfs-bg-card: #FFFFFF;
    --tfs-bg-surface: #F5F3EC;
    
    /* Brand Colors */
    --tfs-color-sorrell: #99775C;
    --tfs-color-sorrell-dark: #7c5f47;
    --tfs-color-sorrell-light: #f3eee8;
    
    /* Text & Icon Colors */
    --tfs-text-dark: #2D3748;
    --tfs-text-secondary: #4A5568;
    --tfs-text-muted: #718096;
    --tfs-border-hairline: rgba(153, 119, 92, 0.18);

    /* Typography & Boundaries */
    --tfs-font-base: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --tfs-column-reading: 68ch;
    --tfs-container-wide: 1120px;
}

/* Universal Overflow & Box-Sizing Safeguards */
*, *::before, *::after {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--tfs-bg-main);
    color: var(--tfs-text-dark);
    font-family: var(--tfs-font-base);
    font-weight: 300;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--tfs-bg-main);
    color: var(--tfs-text-dark);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6, p, span, div, article, section, header, main, footer {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Abstract Decorative Banner Header */
.header-banner-section {
    background: linear-gradient(rgba(28, 20, 15, 0.72), rgba(28, 20, 15, 0.78)), 
                url('../images/header-bg.png') center/cover no-repeat;
    padding: 64px 20px 56px;
    text-align: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--tfs-border-hairline);
}

.header-banner-title {
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 10px;
    text-decoration: none;
    display: inline-block;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-banner-title:hover {
    color: #EAE7DD;
}

.header-banner-tagline {
    font-size: 0.95rem;
    color: rgba(234, 231, 221, 0.92);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    font-weight: 300;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* Centered Navigation Bar Below Banner */
.header-nav-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--tfs-border-hairline);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.header-nav-inner {
    max-width: var(--tfs-container-wide);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.journal-nav-centered {
    display: flex;
    gap: 36px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.journal-nav-centered a {
    color: var(--tfs-text-dark);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.2s ease;
    padding: 4px 0;
    position: relative;
}

.journal-nav-centered a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--tfs-color-sorrell);
    transition: width 0.25s ease;
}

.journal-nav-centered a:hover {
    color: var(--tfs-color-sorrell);
}

.journal-nav-centered a:hover::after {
    width: 100%;
}

/* Mobile Hamburger Trigger & Menu Drawer (No SVG/Emoji) */
.mobile-menu-toggle {
    display: none;
    background: #ffffff;
    border: 1px solid var(--tfs-border-hairline);
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    margin: 0 auto;
}

.hamburger-box {
    width: 22px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--tfs-text-dark);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 768px) {
    .header-banner-section {
        padding: 44px 16px 38px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }

    .journal-nav-centered {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
        gap: 16px;
    }

    .journal-nav-centered.active {
        max-height: 400px;
        opacity: 1;
        padding: 18px 0 8px;
    }

    .journal-nav-centered a {
        font-size: 0.9rem;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

/* Book Hero Responsive Grid */
.book-hero-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 48px;
    align-items: center;
}

@media (max-width: 820px) {
    .book-hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Book Cover Mockup Container Format */
.book-cover-frame {
    width: 100%;
    height: 230px;
    background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
    border-radius: 8px;
    box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.16);
    border-left: 5px solid var(--tfs-color-sorrell);
    margin-bottom: 20px;
    padding: 24px 20px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.book-cover-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.book-cover-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--tfs-color-sorrell);
    font-weight: 700;
}

.book-cover-title {
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.25;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* Article Thumbnail Frame Format */
.article-thumb-frame {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #F5F3EC 0%, #EAE7DD 100%);
    border-radius: 8px;
    border: 1px solid var(--tfs-border-hairline);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-thumb-placeholder-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tfs-text-muted);
    font-weight: 600;
}

/* Featured Hero Section & Article Hero Grid */
.landing-hero-section {
    padding: 50px 16px 40px;
    text-align: center;
    background: linear-gradient(180deg, #F5F3EC 0%, var(--tfs-bg-main) 100%);
    border-bottom: 1px solid var(--tfs-border-hairline);
    width: 100%;
}

.hero-essay-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: start;
}

.article-hero-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .article-hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .hero-essay-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.essay-left-meta {
    font-size: 0.85rem;
    color: var(--tfs-text-muted);
    line-height: 1.6;
}

.essay-topic-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tfs-color-sorrell);
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-block;
}

.hero-essay-title {
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--tfs-text-dark);
}

.hero-essay-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-essay-title a:hover {
    color: var(--tfs-color-sorrell);
}

.hero-essay-excerpt {
    font-size: 1.05rem;
    color: var(--tfs-text-secondary);
    line-height: 1.7;
    font-weight: 300;
}

/* Layered Article Cards System */
.article-card-item {
    background: #ffffff;
    border: 1px solid var(--tfs-border-hairline);
    border-radius: 12px;
    padding: 28px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.article-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(153, 119, 92, 0.14);
    border-color: var(--tfs-color-sorrell);
}

.article-filter-btn {
    padding: 10px 22px;
    background: #ffffff;
    border: 1px solid var(--tfs-border-hairline);
    border-radius: 9999px;
    font-size: 0.88rem;
    color: var(--tfs-text-dark);
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.article-filter-btn.active,
.article-filter-btn:hover {
    background: var(--tfs-color-sorrell);
    color: #ffffff;
    border-color: var(--tfs-color-sorrell);
    box-shadow: 0 4px 12px rgba(153, 119, 92, 0.2);
}

/* Asymmetrical Stream Layout */
.editorial-stream {
    max-width: var(--tfs-container-wide);
    margin: 40px auto 60px;
    padding: 0 16px;
    width: 100%;
}

.asymmetrical-article-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 36px;
    padding: 32px 0;
    border-bottom: 1px solid var(--tfs-border-hairline);
}

@media (max-width: 768px) {
    .asymmetrical-article-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 24px 0;
    }
}

.article-row-meta {
    font-size: 0.85rem;
    color: var(--tfs-text-muted);
    line-height: 1.6;
}

.article-row-title {
    font-size: clamp(1.3rem, 3.5vw, 1.6rem);
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin-bottom: 10px;
}

.article-row-title a {
    color: var(--tfs-text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-row-title a:hover {
    color: var(--tfs-color-sorrell);
}

.article-row-excerpt {
    font-size: 0.98rem;
    color: var(--tfs-text-secondary);
    line-height: 1.7;
    font-weight: 300;
}

/* Single Reading View & Inner Pages */
.single-reading-wrapper {
    max-width: var(--tfs-column-reading);
    width: 100%;
    margin: 40px auto 80px;
    padding: 0 16px;
    box-sizing: border-box;
}

.single-header {
    text-align: left;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tfs-border-hairline);
}

.single-title {
    font-size: clamp(1.6rem, 4.5vw, 3rem);
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 12px 0 16px;
    color: var(--tfs-text-dark);
    overflow-wrap: break-word;
    word-break: break-word;
}

.single-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--tfs-text-dark);
    font-weight: 300;
    overflow-wrap: break-word;
    word-break: break-word;
}

.single-content p {
    margin-bottom: 1.6em;
}

.single-content p:first-of-type::first-letter {
    font-size: 3em;
    float: left;
    line-height: 0.8;
    margin-right: 0.12em;
    color: var(--tfs-color-sorrell);
    font-weight: 400;
}

@media (max-width: 600px) {
    .single-content p:first-of-type::first-letter {
        font-size: 2.2em;
        float: none;
        margin-right: 0;
    }
}

blockquote {
    margin: 2em 0;
    padding-left: 16px;
    border-left: 3px solid var(--tfs-color-sorrell);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--tfs-text-secondary);
    line-height: 1.65;
}

/* Responsive Footer */
.journal-footer {
    border-top: 1px solid var(--tfs-border-hairline);
    padding: 40px 16px;
    background-color: var(--tfs-bg-main);
    width: 100%;
}

.journal-footer-inner {
    max-width: var(--tfs-container-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .journal-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

.footer-text {
    font-size: 0.85rem;
    color: var(--tfs-text-muted);
    font-weight: 300;
}
