/* ═══════════════════════════════════════════════════════════════
   Variables & Reset
═══════════════════════════════════════════════════════════════ */

:root {
    --bg:          #f8f7f4;
    --surface:     #ffffff;
    --text:        #1a1814;
    --text-muted:  #7a7670;
    --accent:      #c8521a;
    --accent-soft: #f0e8e0;
    --border:      #e4e1da;
    --radius:      4px;
    --radius-lg:   10px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;

    --max-width:   1180px;
    --gap:         clamp(1.5rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background:  var(--bg);
    color:       var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    min-height:  100vh;
    display:     flex;
    flex-direction: column;
}

img { display: block; width: 100%; height: auto; object-fit: cover; }
a   { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   Layout
═══════════════════════════════════════════════════════════════ */

.container {
    width:   min(var(--max-width), 100%);
    margin:  0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.site-main {
    flex: 1;
    padding: clamp(2rem, 6vw, 5rem) 0;
}

/* ═══════════════════════════════════════════════════════════════
   Header & Navigation
═══════════════════════════════════════════════════════════════ */

.site-header {
    background:   var(--surface);
    border-bottom: 1px solid var(--border);
    position:     sticky;
    top:          0;
    z-index:      100;
    backdrop-filter: blur(8px);
}

.header-inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             1rem;
    padding:         1rem 0;
}

.site-logo {
    display:     flex;
    align-items: center;
    gap:         .5rem;
    font-family: var(--font-display);
    font-size:   1.2rem;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.logo-mark {
    color:     var(--accent);
    font-size: .9rem;
}

.site-nav {
    display: flex;
    gap:     2rem;
}

.site-nav a {
    font-size:      .875rem;
    font-weight:    400;
    letter-spacing: .03em;
    color:          var(--text-muted);
    transition:     color .2s;
    position:       relative;
}

.site-nav a::after {
    content:    '';
    position:   absolute;
    left:       0; bottom: -2px;
    width:      0; height: 1px;
    background: var(--accent);
    transition: width .25s;
}

.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { width: 100%; }

/* Hamburger */
.nav-toggle {
    display:        none;
    flex-direction: column;
    gap:            5px;
    background:     none;
    border:         none;
    cursor:         pointer;
    padding:        4px;
}

.nav-toggle span {
    display:      block;
    width:        22px;
    height:       1.5px;
    background:   var(--text);
    transition:   transform .25s, opacity .25s;
    transform-origin: center;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════════
   Page Hero
═══════════════════════════════════════════════════════════════ */

.page-hero {
    padding:       clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--border);
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.page-label {
    font-size:      .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color:          var(--accent);
    font-weight:    500;
    margin-bottom:  .75rem;
}

.page-title {
    font-family:  var(--font-display);
    font-size:    clamp(2rem, 5vw, 3.5rem);
    font-weight:  700;
    line-height:  1.15;
    max-width:    18ch;
}

/* ═══════════════════════════════════════════════════════════════
   Featured Article
═══════════════════════════════════════════════════════════════ */

.article-featured {
    display:       grid;
    grid-template-columns: 1fr 1fr;
    gap:           var(--gap);
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
    padding-bottom: clamp(2.5rem, 6vw, 4rem);
    border-bottom: 1px solid var(--border);
}

.featured-media {
    display:       block;
    overflow:      hidden;
    border-radius: var(--radius-lg);
    aspect-ratio:  4 / 3;
    background:    var(--accent-soft);
}

.featured-media img {
    height:     100%;
    transition: transform .5s ease;
}

.featured-media:hover img { transform: scale(1.03); }

.featured-content {
    display:        flex;
    flex-direction: column;
    justify-content: center;
    gap:            1rem;
}

/* ═══════════════════════════════════════════════════════════════
   Article Grid
═══════════════════════════════════════════════════════════════ */

.article-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap:                   var(--gap);
}

.article-card {
    background:    var(--surface);
    border-radius: var(--radius-lg);
    overflow:      hidden;
    border:        1px solid var(--border);
    transition:    box-shadow .25s, transform .25s;
    display:       flex;
    flex-direction: column;
}

.article-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,.08);
    transform:  translateY(-3px);
}

.card-media {
    display:     block;
    overflow:    hidden;
    aspect-ratio: 16 / 9;
    background:  var(--accent-soft);
}

.card-media img { height: 100%; transition: transform .4s; }
.article-card:hover .card-media img { transform: scale(1.04); }

.card-content {
    padding:        1.25rem 1.5rem 1.5rem;
    flex:           1;
    display:        flex;
    flex-direction: column;
    gap:            .75rem;
}

/* ═══════════════════════════════════════════════════════════════
   Shared Article Parts
═══════════════════════════════════════════════════════════════ */

.article-meta {
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         .5rem;
    font-size:   .78rem;
    color:       var(--text-muted);
    font-weight: 400;
}

.meta-sep { opacity: .4; }

.tag {
    background:    var(--accent-soft);
    color:         var(--accent);
    padding:       .15em .55em;
    border-radius: 99px;
    font-size:     .72rem;
    font-weight:   500;
    letter-spacing: .03em;
}

.article-title {
    font-family: var(--font-display);
    font-size:   clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
}

.article-title a { transition: color .2s; }
.article-title a:hover { color: var(--accent); }

.article-excerpt {
    color:     var(--text-muted);
    font-size: .95rem;
    line-height: 1.6;
}

.read-more {
    display:     inline-flex;
    align-items: center;
    gap:         .35rem;
    font-size:   .85rem;
    font-weight: 500;
    color:       var(--accent);
    margin-top:  auto;
    transition:  gap .2s;
}

.read-more:hover { gap: .6rem; }

.placeholder-image {
    width:           100%;
    height:          100%;
    background:      linear-gradient(135deg, var(--accent-soft) 0%, #e8ddd4 100%);
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-family:     var(--font-display);
    font-size:       3rem;
    color:           var(--accent);
    opacity:         .7;
}

/* ═══════════════════════════════════════════════════════════════
   Single Article
═══════════════════════════════════════════════════════════════ */

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size:     .85rem;
    color:         var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); transition: color .2s; }
.breadcrumb a:hover { color: var(--accent); }

.article-single { max-width: 72ch; margin: 0 auto; }

.article-header {
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-heading {
    font-family:  var(--font-display);
    font-size:    clamp(1.8rem, 5vw, 3rem);
    font-weight:  700;
    line-height:  1.2;
    margin-top:   .75rem;
}

.article-cover {
    border-radius: var(--radius-lg);
    overflow:      hidden;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    max-height:    520px;
}

/* Article Body Typography */
.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    font-family:  var(--font-display);
    line-height:  1.25;
    margin:       2em 0 .75em;
    font-weight:  700;
}

.article-body h1 { font-size: 1.9rem; }
.article-body h2 { font-size: 1.4rem; }
.article-body h3 { font-size: 1.15rem; }

.article-body p        { margin-bottom: 1.25em; }
.article-body a        { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body strong   { font-weight: 500; }
.article-body em       { font-style: italic; }
.article-body hr       { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

.article-body ul,
.article-body ol {
    padding-left: 1.5em;
    margin-bottom: 1.25em;
}

.article-body li        { margin-bottom: .4em; }
.article-body blockquote {
    border-left:  3px solid var(--accent);
    padding:      .75em 1.25em;
    margin:       1.5em 0;
    color:        var(--text-muted);
    font-style:   italic;
    background:   var(--accent-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body code {
    background:    var(--border);
    padding:       .15em .4em;
    border-radius: var(--radius);
    font-size:     .9em;
    font-family:   'Courier New', monospace;
}

/* Gallery */
.article-gallery {
    margin-top: clamp(2rem, 5vw, 3.5rem);
    padding-top: 2rem;
    border-top:  1px solid var(--border);
}

.gallery-title {
    font-family:   var(--font-display);
    font-size:     1.1rem;
    margin-bottom: 1.25rem;
    color:         var(--text-muted);
    font-weight:   400;
}

.gallery-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap:                   .75rem;
}

.gallery-item {
    border-radius: var(--radius);
    overflow:      hidden;
}

.gallery-item img {
    aspect-ratio: 1;
    transition:   transform .3s;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item figcaption {
    padding:   .4rem .5rem;
    font-size: .75rem;
    color:     var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   404 & Empty
═══════════════════════════════════════════════════════════════ */

.error-page, .empty-state {
    text-align: center;
    padding:    clamp(3rem, 8vw, 6rem) 1rem;
}

.error-code {
    font-family:   var(--font-display);
    font-size:     clamp(4rem, 12vw, 8rem);
    font-weight:   700;
    color:         var(--border);
    line-height:   1;
    margin-bottom: .25rem;
}

.error-page h1 {
    font-family:   var(--font-display);
    font-size:     clamp(1.5rem, 3vw, 2rem);
    margin-bottom: .75rem;
}

.error-page p { color: var(--text-muted); margin-bottom: 2rem; }

.btn {
    display:       inline-block;
    padding:       .7em 1.6em;
    background:    var(--accent);
    color:         #fff;
    border-radius: var(--radius);
    font-size:     .9rem;
    font-weight:   500;
    transition:    background .2s;
}

.btn:hover { background: #a83e0f; }

/* ═══════════════════════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════════════════════ */

.site-footer {
    border-top: 1px solid var(--border);
    padding:    1.75rem 0;
    margin-top: auto;
    background: var(--surface);
}

.footer-inner {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             1rem;
    flex-wrap:       wrap;
    font-size:       .8rem;
    color:           var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   Animations
═══════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.article-featured,
.article-card,
.article-single,
.page-hero {
    animation: fadeUp .45s ease both;
}

.article-grid .article-card:nth-child(2) { animation-delay: .06s; }
.article-grid .article-card:nth-child(3) { animation-delay: .12s; }
.article-grid .article-card:nth-child(4) { animation-delay: .18s; }
.article-grid .article-card:nth-child(5) { animation-delay: .24s; }
.article-grid .article-card:nth-child(6) { animation-delay: .30s; }

/* ═══════════════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .article-featured {
        grid-template-columns: 1fr;
    }

    .featured-media { aspect-ratio: 16 / 9; }

    .site-nav {
        display:        none;
        position:       absolute;
        top:            100%;
        left:           0;
        right:          0;
        background:     var(--surface);
        flex-direction: column;
        gap:            0;
        border-bottom:  1px solid var(--border);
        padding:        .5rem 0;
        box-shadow:     0 8px 24px rgba(0,0,0,.06);
    }

    .site-nav.open { display: flex; }

    .site-nav a {
        padding:     .85rem clamp(1rem, 4vw, 2rem);
        font-size:   1rem;
    }

    .site-nav a::after { display: none; }

    .nav-toggle { display: flex; }

    .site-header { position: relative; }
}

@media (max-width: 480px) {
    .article-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
