/*
Theme Name: Noir Magazine
Theme URI: https://example.com/noir-magazine
Author: Lovable
Author URI: https://lovable.dev
Description: A cinematic, editorial WordPress magazine theme inspired by Nowness. Switchable light/dark mode, custom front page (4×2 article grid + Potins & Mode + cinematic Series & Game GIF sections + linkable Books & Poetry quotes), polished category pages, parallax & peekaboo animations, fully responsive. No page builder required.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: noir-magazine
Tags: blog, magazine, editorial, cinematic, dark-mode, custom-front-page, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Tokens — light & dark via [data-noir-mode]
   ========================================================================== */
:root {
    --bg: #ffffff;
    --bg-alt: #f5f4f0;
    --ink: #0a0a0a;
    --ink-soft: #555;
    --ink-mute: #8a8a85;
    --rule: rgba(10,10,10,.12);
    --header-bg: rgba(255,255,255,.85);
    --cinema-overlay: radial-gradient(ellipse at center, rgba(0,0,0,.25) 0%, rgba(0,0,0,.8) 80%);
}
:root[data-noir-mode="dark"] {
    --bg: #0a0a0a;
    --bg-alt: #141414;
    --ink: #f5f4f0;
    --ink-soft: #b8b8b3;
    --ink-mute: #7a7a75;
    --rule: rgba(245,244,240,.14);
    --header-bg: rgba(10,10,10,.78);
    --cinema-overlay: radial-gradient(ellipse at center, rgba(0,0,0,.15) 0%, rgba(0,0,0,.85) 80%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background .35s ease, color .35s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: opacity .3s ease; }
a:hover { opacity: .65; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .25em;
    color: var(--ink-mute);
    margin-bottom: 1.25rem;
    display: inline-block;
}

/* ==========================================================================
   2. Header
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.1rem 2rem;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rule);
    transition: background .35s ease, border-color .35s ease;
}
.site-header__inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem;
}
.site-branding a {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--ink);
}
.main-nav ul {
    list-style: none;
    display: flex; gap: 2rem;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .2em;
}
.menu-toggle { display: none; background: none; border: none; color: var(--ink); cursor: pointer; font-size: 1.25rem; }

.mode-toggle {
    background: none; border: 1px solid var(--rule);
    color: var(--ink); width: 38px; height: 38px;
    border-radius: 999px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; line-height: 1;
    transition: border-color .25s ease, background .25s ease;
}
.mode-toggle:hover { border-color: var(--ink); }
.mode-toggle__icon { display: none; }
:root[data-noir-mode="light"] .mode-toggle__icon--moon,
:root:not([data-noir-mode="dark"]) .mode-toggle__icon--moon { display: inline; }
:root[data-noir-mode="dark"] .mode-toggle__icon--sun { display: inline; }

/* ==========================================================================
   3. Hero
   ========================================================================== */
.hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    display: flex; align-items: flex-end;
    color: #fff;
}
.hero__bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    will-change: transform;
}
.hero__bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,.25) 100%);
}
.hero__content {
    position: relative; z-index: 2;
    padding: 0 2rem 6rem;
    max-width: 1400px; margin: 0 auto; width: 100%;
}
.hero .eyebrow { color: rgba(255,255,255,.85); }
.hero__title { font-size: clamp(2.5rem, 7vw, 6rem); max-width: 14ch; margin-bottom: 1rem; }
.hero__meta { font-size: .85rem; color: rgba(255,255,255,.8); letter-spacing: .15em; text-transform: uppercase; }

/* ==========================================================================
   4. Section base
   ========================================================================== */
.section { padding: 7rem 0; position: relative; }
.section--alt { background: var(--bg-alt); }
.section__header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 3.5rem; flex-wrap: wrap; gap: 1rem; }
.section__title { font-size: clamp(1.8rem, 3.4vw, 3rem); }
.section__link { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 4px; }

/* ==========================================================================
   5. Articles grid — 4 × 2 (smaller cards)
   ========================================================================== */
.articles-grid { display: grid; gap: 3rem 1.75rem; }
.articles-grid--four { grid-template-columns: repeat(4, 1fr); }

.article-card { display: flex; flex-direction: column; }
.article-card__media {
    aspect-ratio: 4/5;
    overflow: hidden;
    background: var(--bg-alt);
    margin-bottom: 1rem;
}
.article-card__media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.article-card:hover .article-card__media img { transform: scale(1.05); }
.article-card__cat { font-size: .65rem; text-transform: uppercase; letter-spacing: .25em; color: var(--ink-mute); }
.article-card__title {
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    margin: .35rem 0;
    line-height: 1.25;
    color: var(--ink);
}
.article-card__excerpt { color: var(--ink-soft); font-size: .85rem; margin-top: .25rem; }
.article-card__meta { color: var(--ink-mute); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; margin-top: .5rem; }

/* ==========================================================================
   6. Cinematic media sections (Series, Game)
   ========================================================================== */
.cinema {
    position: relative;
    min-height: 90vh;
    overflow: hidden;
    display: flex; align-items: center;
    padding: 8rem 0;
    color: #fff;
}
.cinema__bg {
    position: absolute; inset: -10% 0;
    background-size: cover; background-position: center;
    will-change: transform;
}
.cinema__bg::after {
    content: ''; position: absolute; inset: 0;
    background: var(--cinema-overlay);
}
.cinema__inner { position: relative; z-index: 2; max-width: 1400px; margin: 0 auto; padding: 0 2rem; width: 100%; }
.cinema__content { max-width: 640px; }
.cinema .eyebrow { color: rgba(255,255,255,.85); }
.cinema__title { font-size: clamp(2.25rem, 4.5vw, 4rem); margin-bottom: 1.25rem; }
.cinema__excerpt { font-size: 1.05rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; max-width: 50ch; }
.cinema__cta {
    display: inline-block; padding: .9rem 2.25rem;
    border: 1px solid rgba(255,255,255,.5);
    text-transform: uppercase; letter-spacing: .25em; font-size: .75rem;
    color: #fff;
    transition: all .3s ease;
}
.cinema__cta:hover { background: #fff; color: #0a0a0a; opacity: 1; }
.cinema--right .cinema__content { margin-left: auto; }

/* ==========================================================================
   7. Quotes (Books & Poetry)
   ========================================================================== */
.quotes-section { background: var(--bg-alt); color: var(--ink); }
.quotes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
.quote {
    padding: 3rem 2rem;
    border-top: 1px solid var(--ink);
    position: relative;
}
.quote::before {
    content: '\201C';
    font-family: 'Playfair Display', serif;
    font-size: 5rem; line-height: 1;
    position: absolute; top: -.5rem; left: -.5rem;
    color: var(--ink-mute);
}
.quote__text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem; line-height: 1.4;
    margin-bottom: 1.5rem; font-style: italic;
}
.quote__author { font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; }
.quote__source { font-size: .72rem; color: var(--ink-soft); margin-top: .25rem; }
.quote__cta { display: inline-block; margin-top: 1.25rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .25em; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.quote--linked .quote__link { display: block; color: inherit; }
.quote--linked:hover .quote__cta { opacity: .65; }

/* ==========================================================================
   8. Footer
   ========================================================================== */
.site-footer {
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--rule);
    text-align: center;
    color: var(--ink-mute);
    font-size: .8rem;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.site-footer p { margin: .5rem 0; }

/* ==========================================================================
   9. Peekaboo / reveal
   ========================================================================== */
.peekaboo { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.2,.8,.2,1), transform 1s cubic-bezier(.2,.8,.2,1); }
.peekaboo.is-visible { opacity: 1; transform: translateY(0); }
.peekaboo--delay-1 { transition-delay: .15s; }
.peekaboo--delay-2 { transition-delay: .3s; }
.peekaboo--delay-3 { transition-delay: .45s; }

/* ==========================================================================
   10. Single / page content
   ========================================================================== */
.entry-header { padding: 9rem 0 3rem; text-align: center; }
.entry-title { font-size: clamp(2rem, 5vw, 4rem); max-width: 24ch; margin: 0 auto 1rem; }
.entry-meta { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute); }
.entry-thumbnail { max-width: 1100px; margin: 0 auto 4rem; }
.entry-content {
    max-width: 720px; margin: 0 auto;
    padding: 0 2rem 6rem;
    font-size: 1.08rem; line-height: 1.75;
}
.entry-content > * { margin-bottom: 1.5rem; }
.entry-content h2 { font-size: 2rem; margin: 3rem 0 1rem; }
.entry-content h3 { font-size: 1.5rem; margin: 2.25rem 0 .75rem; }
.entry-content blockquote { border-left: 3px solid var(--ink-mute); padding-left: 1.5rem; font-style: italic; color: var(--ink-soft); }
.entry-content img, .entry-content figure { margin: 2rem auto; }
.entry-content a { border-bottom: 1px solid var(--ink-mute); }

/* ==========================================================================
   11. Archive / category pages
   ========================================================================== */
.archive-hero {
    padding: 9rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid var(--rule);
}
.archive-hero__title {
    font-size: clamp(2.25rem, 5vw, 4rem);
    margin-bottom: 1rem;
}
.archive-hero__title .archive-title-prefix { color: var(--ink-mute); font-size: .8em; }
.archive-hero__desc { color: var(--ink-soft); max-width: 60ch; margin: 0 auto; font-size: 1rem; }
.archive-pagination { margin-top: 4rem; text-align: center; font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; }
.archive-pagination .nav-links { display: inline-flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.archive-pagination .page-numbers { padding: .5rem .9rem; border: 1px solid var(--rule); }
.archive-pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.archive-empty { text-align: center; color: var(--ink-soft); padding: 3rem 0; }

/* ==========================================================================
   12. Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .articles-grid--four { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .main-nav { display: none; order: 4; flex-basis: 100%; }
    .main-nav.is-open { display: block; padding-top: 1rem; }
    .main-nav.is-open ul { flex-direction: column; gap: 1.25rem; }
    .articles-grid--four { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
    .quotes-grid { grid-template-columns: 1fr; gap: 1rem; }
    .section { padding: 4.5rem 0; }
    .hero__content { padding-bottom: 3rem; }
    .cinema { min-height: 70vh; padding: 5rem 0; }
    .cinema--right .cinema__content { margin-left: 0; }
    .entry-header { padding-top: 7rem; }
    .archive-hero { padding-top: 7rem; }
}
@media (max-width: 520px) {
    .articles-grid--four { grid-template-columns: 1fr; }
    .container { padding: 0 1.25rem; }
    .site-header { padding: .9rem 1rem; }
    .site-branding a { font-size: 1.15rem; }
}
