/* ==========================================================================
   ARACNET — Système éditorial partagé
   ========================================================================== */

:root {
    --paper: #f5f2ea;
    --paper-2: #ebe7dc;
    --ink: #11110f;
    --muted: #68645d;
    --faint: #989187;
    --line: #d8d2c6;
    --line-dark: #2b2924;
    --yellow: #f1d400;
    --night: #11141b;
    --max: 1180px;
    --reading: 690px;
    --nav-h: 56px;
    --ease: 180ms ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Geist', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; fill: currentColor; }
p, h1, h2, h3, h4, figure, blockquote { margin: 0; }

.wrap { width: min(100%, var(--max)); margin-inline: auto; padding-inline: 26px; }
.micro-label { color: var(--faint); font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tag { color: var(--muted); font-size: .59rem; font-weight: 660; letter-spacing: .06em; text-transform: uppercase; }
.icon-button { border: 0; background: transparent; padding: 5px; display: inline-grid; place-items: center; cursor: pointer; }
.empty-state { padding: 34px 0; color: var(--muted); font-size: .76rem; border-top: 1px solid var(--line); }

/* --- Header ------------------------------------------------------------- */
.site-head { position: relative; z-index: 100; background: var(--paper); }
.nav {
    height: var(--nav-h);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    position: sticky;
    top: 0;
    z-index: 120;
    backdrop-filter: blur(12px);
}
.nav.scrolled { box-shadow: 0 5px 18px rgba(17,17,15,.04); }
.nav__inner {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(132px,1fr) auto minmax(220px,1fr);
    align-items: center;
    gap: 24px;
}
.nav__brand { justify-self: start; height: 34px; display: flex; align-items: center; min-width: 118px; }
.nav__brand img { max-width: 132px; max-height: 30px; object-fit: contain; }
.nav__brand span { display: none; font-size: .78rem; font-weight: 760; letter-spacing: .12em; }
.nav__brand img[src=""], .nav__brand img:not([src]) { display: none; }
.nav__brand img[src=""] + span, .nav__brand img:not([src]) + span { display: inline; }
.nav__links { height: 100%; display: flex; justify-content: center; align-items: center; gap: 24px; }
.nav__links a { height: 100%; display: flex; align-items: center; position: relative; color: #36332e; font-size: .64rem; font-weight: 590; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.nav__links a.active::after, .nav__links a:hover::after { background: var(--yellow); }
.nav__right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.nav__social, .footer__social, .mobile-menu__social { display: flex; align-items: center; gap: 5px; }
.nav__social a, .footer__social a, .mobile-menu__social a {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #55514a;
    transition: background var(--ease), color var(--ease);
}
.nav__social a:hover, .footer__social a:hover, .mobile-menu__social a:hover { background: var(--paper-2); color: var(--ink); }
.nav__social svg, .footer__social svg, .mobile-menu__social svg { width: 13px; height: 13px; }
.nav__contact { color: var(--muted); font-size: .6rem; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.nav__contact:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav__search { height: 31px; border: 0; background: transparent; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .61rem; cursor: pointer; padding: 0 4px; }
.nav__search:hover { color: var(--ink); }
.nav__search svg { width: 15px; height: 15px; }
.nav__menu { display: none; width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; }

.edition-bar { border-bottom: 1px solid var(--line); }
.edition-bar__inner { min-height: 29px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--faint); font-size: .56rem; }
.edition-bar__inner time { color: var(--muted); }
.edition-bar__inner span { letter-spacing: .03em; }

/* --- Search ------------------------------------------------------------- */
.search-panel { position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity var(--ease); }
.search-panel.open { pointer-events: auto; opacity: 1; }
.search-panel__backdrop { position: absolute; inset: 0; background: rgba(13,13,11,.42); backdrop-filter: blur(5px); }
.search-panel__sheet { position: relative; width: min(640px, calc(100% - 32px)); margin: 68px auto 0; background: rgba(245,242,234,.96); border: 1px solid var(--ink); border-radius: 14px; box-shadow: 0 25px 70px rgba(0,0,0,.14); padding: 22px; backdrop-filter: blur(14px); }
.search-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.search-panel__head h2 { margin-top: 4px; font-size: 1.16rem; font-weight: 620; letter-spacing: -.035em; }
.search-box { height: 44px; display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; border-block: 1px solid var(--ink); }
.search-box input { min-width: 0; border: 0; outline: 0; background: transparent; font-size: .88rem; }
.search-hints { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 18px; }
.search-hints button { border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 3px 0; color: var(--muted); font-size: .6rem; cursor: pointer; }
.search-results { max-height: min(56vh, 520px); overflow: auto; }
.search-result { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.search-result strong { font-size: .82rem; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
.search-result small { grid-column: 2; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.search-empty { color: var(--muted); font-size: .74rem; padding: 16px 0; }

/* --- Mobile menu -------------------------------------------------------- */
.mobile-menu { position: fixed; inset: 0; z-index: 1100; background: var(--paper); opacity: 0; pointer-events: none; transform: translateY(-7px); transition: opacity var(--ease), transform var(--ease); }
.mobile-menu.open { opacity: 1; pointer-events: auto; transform: none; }
.mobile-menu__head { height: 56px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); }
.mobile-menu__brand { display: flex; align-items: center; min-width: 116px; }
.mobile-menu__brand img { max-width: 118px; max-height: 28px; object-fit: contain; }
.mobile-menu__brand span { display: none; font-size: .76rem; font-weight: 760; letter-spacing: .12em; }
.mobile-menu__links { padding: 20px 18px 10px; display: grid; }
.mobile-menu__links a { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 590; letter-spacing: -.025em; }
.mobile-menu__meta { padding: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 11px 16px; color: var(--muted); font-size: .67rem; }
.mobile-menu__meta > a:last-child { width: 100%; color: var(--faint); }
.mobile-menu__social { width: 100%; margin-top: 6px; }

/* --- Footer ------------------------------------------------------------- */
.footer { margin-top: 72px; border-top: 1px solid var(--ink); background: rgba(255,255,255,.08); }
.footer__main { padding-block: 34px; display: grid; grid-template-columns: minmax(260px,.9fr) 1.6fr; gap: 70px; }
.footer__brand { min-height: 30px; display: flex; align-items: center; width: fit-content; }
.footer__brand img { max-width: 124px; max-height: 28px; object-fit: contain; }
.footer__brand span { display: none; font-size: .74rem; font-weight: 760; letter-spacing: .12em; }
.footer__brand-block p { max-width: 390px; margin-top: 12px; color: var(--muted); font-size: .68rem; line-height: 1.58; }
.footer__social { margin-top: 16px; }
.footer__links { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.footer__links > div { display: flex; flex-direction: column; gap: 7px; }
.footer__links span { margin-bottom: 5px; color: var(--faint); font-size: .55rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.footer__links a { width: fit-content; color: #4c4942; font-size: .66rem; }
.footer__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__bottom { padding-block: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--faint); font-size: .59rem; }

/* --- Pages de rubrique -------------------------------------------------- */
.category-hero { padding: 34px 0 20px; border-bottom: 1px solid var(--ink); }
.category-hero__eyebrow { color: var(--faint); font-size: .57rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.category-hero__title { margin-top: 5px; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1; font-weight: 620; letter-spacing: -.045em; }
.category-hero__sub { max-width: 650px; margin-top: 9px; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.category-feed { padding: 28px 0 58px; }
.category-empty { grid-column: 1 / -1; }
.category-grid { display: grid; grid-template-columns: repeat(12,1fr); column-gap: 22px; }
.category-card { grid-column: span 4; padding: 0 0 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.category-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 30px; align-items: center; padding-bottom: 26px; }
.category-card__visual { aspect-ratio: 3/2; margin-bottom: 11px; overflow: hidden; background: var(--paper-2); border-radius: 8px; }
.category-card__visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.category-card:hover img { transform: scale(1.012); }
.category-card:first-child .category-card__visual { margin-bottom: 0; max-height: 360px; border-radius: 10px; }
.category-card__title { margin-top: 6px; font-size: .86rem; font-weight: 610; line-height: 1.22; letter-spacing: -.022em; }
.category-card:first-child .category-card__title { font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.1; }
.category-card__excerpt { margin-top: 8px; color: var(--muted); font-size: .7rem; line-height: 1.52; }
.category-card:not(:first-child) .category-card__excerpt { display: none; }
.category-card__meta { margin-top: 8px; display: flex; gap: 6px; color: var(--faint); font-size: .56rem; }
.category-card:hover .category-card__title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

@media (max-width: 980px) {
    .nav__inner { grid-template-columns: 1fr auto; }
    .nav__links { display: none; }
    .nav__right { grid-column: 2; }
    .nav__menu { display: inline-grid; place-items: center; }
    .footer__main { grid-template-columns: 1fr; gap: 30px; }
    .category-card { grid-column: span 6; }
}

@media (max-width: 700px) {
    .wrap { padding-inline: 17px; }
    :root { --nav-h: 52px; }
    .nav__brand { min-width: 108px; }
    .nav__brand img { max-width: 112px; max-height: 26px; }
    .nav__social, .nav__contact { display: none; }
    .nav__search span { display: none; }
    .edition-bar__inner { min-height: 27px; }
    .edition-bar__inner span { display: none; }
    .footer { margin-top: 54px; }
    .footer__links { grid-template-columns: 1fr 1fr; }
    .footer__links > div:last-child { grid-column: 1 / -1; }
    .footer__bottom { flex-direction: column; gap: 6px; }
    .category-grid { display: block; }
    .category-card, .category-card:first-child { display: block; padding-bottom: 17px; margin-bottom: 20px; }
    .category-card:first-child .category-card__visual { margin-bottom: 11px; }
    .category-card__title, .category-card:first-child .category-card__title { font-size: .98rem; }
    .search-result { grid-template-columns: 1fr; }
    .search-result small { grid-column: 1; }
}

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