/*
Theme Name: Fraction
Theme URI: https://fraction.media
Author: fraction.media
Description: Theme editorial independant pour fraction.media — journalisme urbain, typographie percutante, style StreetPress.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fraction
Tags: news, magazine, editorial, custom-colors, custom-logo, featured-images, full-width-template
*/

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

:root {
  --noir: #0a0a0a;
  --blanc: #f5f2ed;
  --rouge: #e8180c;
  --rouge-dk: #b80e06;
  --gris: #1a1a1a;
  --gris-mid: #2d2d2d;
  --gris-lt: #888;
  --beige: #f0ead8;

  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;

  --max-w: 1400px;
  --sp-xs: 0.5rem;
  --sp-sm: 1rem;
  --sp-md: 2rem;
  --sp-lg: 4rem;
  --tr: 200ms cubic-bezier(.25,.46,.45,.94);
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--blanc); color: var(--noir); line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); letter-spacing: .02em; line-height: .92; text-transform: uppercase; }
p { margin-bottom: 1.25em; }
a { color: inherit; text-decoration: none; transition: color var(--tr); }
img { max-width: 100%; height: auto; display: block; }

/* LAYOUT */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-md); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-md); }

/* SKIP LINK */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--rouge); color: var(--blanc); padding: .5rem 1rem; font-weight: 700; z-index: 9999; transition: top .3s; }
.skip-link:focus { top: 0; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── HEADER ─────────────────────────────────────── */
#masthead { background: var(--noir); border-bottom: 3px solid var(--rouge); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-md); }

.site-logo { font-family: var(--font-display); font-size: 2rem; letter-spacing: .1em; color: var(--blanc); }
.site-logo .dot { color: var(--rouge); }
.custom-logo-link img { height: 40px; width: auto; }

/* NAV */
.main-nav ul { display: flex; list-style: none; }
.main-nav ul li a { display: block; padding: 0 1.25rem; height: 60px; line-height: 60px; font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--blanc); border-right: 1px solid var(--gris-mid); transition: background var(--tr); }
.main-nav ul li a:hover, .main-nav ul li.current-menu-item > a { background: var(--rouge); }
.nav-cta > a { background: var(--rouge) !important; }
.nav-cta > a:hover { background: var(--rouge-dk) !important; }

/* HAMBURGER */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--blanc); transition: all var(--tr); }

/* TICKER */
.ticker-bar { background: var(--rouge); overflow: hidden; height: 34px; display: flex; align-items: center; }
.ticker-label { background: var(--noir); padding: 0 1.25rem; height: 100%; display: flex; align-items: center; font-family: var(--font-display); font-size: .8rem; letter-spacing: .15em; color: var(--blanc); white-space: nowrap; flex-shrink: 0; }
.ticker-overflow { overflow: hidden; flex: 1; }
.ticker-track { display: flex; white-space: nowrap; animation: ticker 30s linear infinite; }
.ticker-track span { padding: 0 2.5rem; font-size: .78rem; font-weight: 600; color: var(--blanc); }
.ticker-track a { color: var(--blanc); }
.ticker-track span::before { content: '▶ '; opacity: .6; }
@keyframes ticker { 0%{ transform:translateX(0) } 100%{ transform:translateX(-50%) } }

/* ── HERO ────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 2px; background: var(--gris-mid); }
.hero-main { position: relative; overflow: hidden; min-height: 580px; background: var(--gris); }
.hero-side { display: flex; flex-direction: column; gap: 2px; }
.hero-secondary { position: relative; overflow: hidden; min-height: 285px; background: var(--gris); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hero-main:hover .hero-img, .hero-secondary:hover .hero-img { transform: scale(1.04); }
.hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: var(--sp-md); background: linear-gradient(transparent, rgba(0,0,0,.92) 55%); }
.hero-content-sm { position: absolute; bottom: 0; left: 0; right: 0; padding: .85rem 1.25rem; background: linear-gradient(transparent, rgba(0,0,0,.88) 45%); }

/* TITLES */
.t-xl { font-family: var(--font-display); font-size: clamp(2.5rem,4.5vw,5rem); line-height: .88; text-transform: uppercase; color: var(--blanc); margin-bottom: .6rem; }
.t-lg { font-family: var(--font-display); font-size: clamp(1.5rem,2.5vw,2.4rem); line-height: .9; text-transform: uppercase; color: var(--blanc); margin-bottom: .4rem; }
.t-md { font-family: var(--font-display); font-size: clamp(1.1rem,1.8vw,1.65rem); line-height: .92; text-transform: uppercase; color: var(--blanc); margin-bottom: .35rem; }
.t-sm { font-family: var(--font-body); font-size: .95rem; font-weight: 700; line-height: 1.3; color: var(--noir); margin-bottom: .35rem; }
.t-xl a:hover, .t-lg a:hover, .t-md a:hover { color: var(--rouge); }

/* CAT TAG */
.cat-tag { display: inline-block; background: var(--rouge); color: var(--blanc); font-size: .62rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; padding: .2em .6em; margin-bottom: .45em; transition: background var(--tr); }
.cat-tag:hover { background: var(--rouge-dk); }
.cat-tag--outline { background: transparent; border: 1.5px solid var(--rouge); color: var(--rouge); }
.cat-tag--dark { background: var(--noir); }

/* META */
.meta { font-size: .7rem; color: var(--gris-lt); letter-spacing: .04em; }
.meta--light { color: rgba(255,255,255,.5); }

/* ── SECTION HEADER ──────────────────────────────── */
.sec-hd { display: flex; align-items: center; gap: .85rem; margin-bottom: var(--sp-md); padding-bottom: .6rem; border-bottom: 3px solid var(--noir); }
.sec-title { font-family: var(--font-display); font-size: 1.85rem; text-transform: uppercase; letter-spacing: .04em; }
.sec-line { flex: 1; height: 1px; background: #ddd; }
.sec-more { font-size: .68rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--rouge); border-bottom: 1.5px solid var(--rouge); white-space: nowrap; }
.sec-more:hover { color: var(--noir); border-color: var(--noir); }

/* ── CARDS ───────────────────────────────────────── */
.card { background: var(--blanc); }
.card-img { position: relative; overflow: hidden; aspect-ratio: 16/10; background: var(--gris-mid); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: .85rem .1rem .1rem; }

.card-dark { background: var(--gris); }
.card-dark .card-body { padding: .85rem 1.1rem 1.1rem; }
.card-dark .t-sm { color: var(--blanc); }
.card-dark .meta { color: rgba(255,255,255,.4); }

/* Horizontal card */
.card-h { display: grid; grid-template-columns: 120px 1fr; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid #e4dfda; }
.card-h .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--gris-mid); flex-shrink: 0; }
.card-h .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-h:hover .thumb img { transform: scale(1.06); }

/* ── MAIN LAYOUT ─────────────────────────────────── */
.site-main { min-height: 60vh; }
.content-wrap { padding: var(--sp-lg) 0; }
.with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: var(--sp-md); align-items: start; }

/* ── SIDEBAR ─────────────────────────────────────── */
.widget-area .widget { margin-bottom: var(--sp-md); border-top: 3px solid var(--noir); padding-top: .85rem; }
.widget-title { font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase; margin-bottom: .85rem; }
.most-read { list-style: none; }
.most-read li { display: flex; gap: .65rem; padding: .65rem 0; border-bottom: 1px solid #e4dfda; }
.most-read .num { font-family: var(--font-display); font-size: 1.85rem; line-height: 1; color: var(--rouge); flex-shrink: 0; width: 2rem; text-align: right; }
.most-read .title { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.widget-nl { background: var(--noir); color: var(--blanc); padding: 1.35rem; border-top: 3px solid var(--rouge) !important; }
.widget-nl .widget-title { color: var(--blanc); }
.widget-nl p { font-size: .82rem; color: rgba(255,255,255,.55); margin-bottom: .85rem; }
.nl-input { width: 100%; padding: .65rem .9rem; border: none; font-family: var(--font-body); font-size: .85rem; background: #2d2d2d; color: #fff; margin-bottom: .45rem; outline: none; }
.nl-btn { width: 100%; padding: .65rem; background: var(--rouge); color: #fff; border: none; font-family: var(--font-display); font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.nl-btn:hover { background: var(--rouge-dk); }

/* ── SINGLE ──────────────────────────────────────── */
.single-head { background: var(--noir); padding: var(--sp-lg) 0 var(--sp-md); }
.single-head .wrap { max-width: 920px; }
.single-title { font-family: var(--font-display); font-size: clamp(3rem,7vw,6.5rem); line-height: .88; text-transform: uppercase; color: var(--blanc); max-width: 18ch; }
.single-deck { font-family: var(--font-serif); font-size: 1.2rem; font-style: italic; color: rgba(255,255,255,.65); max-width: 55ch; margin-top: .85rem; line-height: 1.55; margin-bottom: 0; }
.single-meta-row { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.25rem; padding-top: .85rem; border-top: 1px solid rgba(255,255,255,.12); }
.single-meta-row .author-name { font-weight: 700; font-size: .875rem; color: var(--blanc); }
.share-btn { font-family: var(--font-display); font-size: .72rem; letter-spacing: .1em; padding: .32em .8em; background: rgba(255,255,255,.1); color: var(--blanc); border: none; cursor: pointer; transition: background var(--tr); }
.share-btn:hover { background: var(--rouge); }
.progress-bar { position: fixed; top: 60px; left: 0; height: 3px; background: var(--rouge); width: 0%; z-index: 999; pointer-events: none; transition: width .1s linear; }
.single-feat { width: 100%; max-height: 580px; object-fit: cover; }
.single-body { max-width: 70ch; margin: var(--sp-md) auto; padding: 0 var(--sp-md); }
.single-body p { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.8; color: #111; }
.single-body h2 { font-size: 2.4rem; margin: 1.85rem 0 .85rem; }
.single-body h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--rouge); margin: 1.35rem 0 .6rem; }
.single-body blockquote { border-left: 5px solid var(--rouge); padding: .4rem 0 .4rem 1.35rem; margin: 1.85rem 0; font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; line-height: 1.5; color: #333; }
.single-body a { color: var(--rouge); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.single-body img { width: 100%; margin: 1.85rem 0; }
.single-body figcaption { font-size: .78rem; color: var(--gris-lt); margin-top: -1.35rem; margin-bottom: 1.85rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: var(--sp-md) 0; }
.post-tags a { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid var(--gris-mid); padding: .28em .7em; }
.post-tags a:hover { background: var(--noir); color: var(--blanc); border-color: var(--noir); }
.author-box { display: flex; gap: 1.1rem; border-top: 3px solid var(--noir); border-bottom: 1px solid #e4dfda; padding: var(--sp-md) 0; margin: var(--sp-md) 0; }
.author-box img { width: 70px; height: 70px; border-radius: 50%; flex-shrink: 0; }
.author-box .name { font-family: var(--font-display); font-size: 1.45rem; text-transform: uppercase; margin-bottom: .2rem; }
.author-box .bio { font-size: .85rem; color: #444; line-height: 1.5; margin-bottom: 0; }
.author-link { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rouge); border-bottom: 1.5px solid var(--rouge); display: inline-block; margin-top: .45rem; }

/* ── BLOCK DARK ──────────────────────────────────── */
.block-dark { background: var(--noir); padding: var(--sp-lg) 0; }
.block-dark .sec-hd { border-color: var(--rouge); }
.block-dark .sec-title { color: var(--blanc); }
.block-dark .sec-line { background: rgba(255,255,255,.12); }

/* ── NEWSLETTER SECTION ──────────────────────────── */
.nl-section { background: var(--rouge); padding: var(--sp-lg) var(--sp-md); text-align: center; }
.nl-section h2 { font-size: clamp(2rem,5vw,4rem); color: var(--blanc); margin-bottom: .4em; }
.nl-section p { color: rgba(255,255,255,.82); margin-bottom: 1.35rem; }
.nl-form { display: flex; max-width: 460px; margin: 0 auto; }
.nl-form input[type=email] { flex: 1; padding: .82rem 1.1rem; border: none; font-family: var(--font-body); font-size: .88rem; background: var(--blanc); color: var(--noir); outline: none; }
.nl-form button { padding: .82rem 1.35rem; background: var(--noir); color: var(--blanc); border: none; font-family: var(--font-display); font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.nl-form button:hover { background: var(--gris-mid); }

/* ── ARCHIVE HEAD ────────────────────────────────── */
.archive-head { background: var(--noir); border-bottom: 3px solid var(--rouge); padding: var(--sp-md) 0; }
.archive-title { font-family: var(--font-display); font-size: clamp(2.5rem,6vw,5rem); text-transform: uppercase; color: var(--blanc); line-height: .9; }
.archive-desc { font-family: var(--font-serif); font-style: italic; color: rgba(255,255,255,.55); max-width: 55ch; margin-top: .65rem; line-height: 1.5; margin-bottom: 0; }
.archive-count { font-size: .75rem; color: rgba(255,255,255,.3); margin-top: .65rem; margin-bottom: 0; }

/* ── PAGINATION ──────────────────────────────────── */
.pagination { display: flex; gap: .3rem; justify-content: center; padding: var(--sp-md) 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: .875rem; font-weight: 700; border: 2px solid var(--noir); transition: all var(--tr); }
.pagination a:hover, .pagination .current { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }

/* ── SEARCH FORM ─────────────────────────────────── */
.search-form { display: flex; }
.search-field { flex: 1; padding: .72rem .95rem; border: 2px solid var(--noir); border-right: none; font-family: var(--font-body); font-size: .88rem; outline: none; background: var(--blanc); }
.search-submit { padding: .72rem 1.1rem; background: var(--noir); color: var(--blanc); border: 2px solid var(--noir); font-family: var(--font-display); font-size: .88rem; letter-spacing: .1em; cursor: pointer; }
.search-submit:hover { background: var(--rouge); border-color: var(--rouge); }

/* ── FOOTER ──────────────────────────────────────── */
#colophon { background: var(--noir); color: var(--blanc); border-top: 3px solid var(--rouge); padding: var(--sp-lg) 0 var(--sp-md); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.footer-logo { font-family: var(--font-display); font-size: 2.8rem; letter-spacing: .08em; color: var(--blanc); display: inline-block; margin-bottom: .85rem; }
.footer-logo .dot { color: var(--rouge); }
.footer-desc { font-size: .85rem; color: rgba(255,255,255,.45); line-height: 1.6; max-width: 28ch; margin-bottom: 0; }
.footer-socials { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.25rem; }
.footer-social-link { font-family: var(--font-display); font-size: .78rem; letter-spacing: .1em; color: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.12); padding: .3em .75em; transition: all var(--tr); }
.footer-social-link:hover { color: var(--blanc); border-color: rgba(255,255,255,.45); }
.footer-col-title { font-family: var(--font-display); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rouge); margin-bottom: 1.1rem; }
.footer-nav { list-style: none; }
.footer-nav li { margin-bottom: .55rem; }
.footer-nav a { font-size: .82rem; color: rgba(255,255,255,.55); transition: color var(--tr); }
.footer-nav a:hover { color: var(--blanc); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: var(--sp-sm); display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: rgba(255,255,255,.28); }

/* ── BTN ─────────────────────────────────────────── */
.btn { display: inline-block; padding: .82rem 2.25rem; font-family: var(--font-display); font-size: .95rem; letter-spacing: .15em; text-transform: uppercase; cursor: pointer; border: none; transition: background var(--tr); }
.btn-noir { background: var(--noir); color: var(--blanc); }
.btn-noir:hover { background: var(--rouge); color: var(--blanc); }
.btn-rouge { background: var(--rouge); color: var(--blanc); }
.btn-rouge:hover { background: var(--rouge-dk); }

/* ── RELATED ─────────────────────────────────────── */
.related-section { background: var(--beige); padding: var(--sp-lg) 0; }

/* ── 404 ─────────────────────────────────────────── */
.not-found-wrap { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--sp-lg) var(--sp-md); }
.not-found-num { font-family: var(--font-display); font-size: clamp(8rem,20vw,16rem); line-height: .85; color: var(--rouge); letter-spacing: -.02em; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 3fr 2fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  :root { --sp-md: 1.25rem; --sp-lg: 3rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { min-height: 380px; }
  .hero-secondary { min-height: 240px; }
  .hero-side { flex-direction: column; }
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
  .with-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nl-form { flex-direction: column; }
  .hamburger { display: flex; }
  .main-nav { position: fixed; top: 60px; left: 0; right: 0; background: var(--noir); border-top: 3px solid var(--rouge); transform: translateY(-110%); opacity: 0; pointer-events: none; transition: all .28s ease; z-index: 999; }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .main-nav ul { flex-direction: column; }
  .main-nav ul li a { border-right: none; border-bottom: 1px solid var(--gris-mid); }
  .single-title { font-size: clamp(2.5rem,10vw,4rem); }
}
