/*
Theme Name: Immo Territoire Brest
Theme URI: https://cia-brest.fr
Author: CIA Brest
Description: Magazine local de l'investissement immobilier à Brest et dans le Finistère. Thème éditorial photo-led, palette sable-atlantique-terracotta, typographie Fraunces + Inter.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: immo-territoire-brest
Tags: block-themes, full-site-editing, magazine, editorial, blog
*/

/* Custom properties — palette sable / atlantique / terracotta + typo Fraunces / Inter */
:root {
  --itb-base: #F6F1E8;
  --itb-base-soft: #FBF7EF;
  --itb-base-deep: #EDE4D3;
  --itb-ink: #2C2620;
  --itb-ink-soft: #6B6155;
  --itb-muted: #6B6155;
  --itb-accent: #4F6F5E;
  --itb-accent-deep: #42604F;
  --itb-secondary: #C77B54;
  --itb-secondary-deep: #B96C46;

  --itb-atlantique-clair: #7C9885;
  --itb-terracotta-doux: #E4C0AC;
  --itb-ligne: #E2D8C6;

  --itb-font-title: 'Lora', Georgia, serif;
  --itb-font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --itb-font-accent: 'Lora', Georgia, serif;

  --itb-radius: 16px;
  --itb-radius-lg: 22px;
  --itb-radius-xl: 32px;
  --itb-shadow: 0 18px 40px -24px rgba(44, 38, 32, .35);
  --itb-shadow-soft: 0 10px 30px -20px rgba(44, 38, 32, .3);

  --itb-container-max: 1240px;
  --itb-container-narrow: 760px;
  --itb-space-section: clamp(56px, 8vw, 88px);
}

body {
  background: var(--itb-base);
  color: var(--itb-ink);
  font-family: var(--itb-font-body);
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--itb-accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--itb-secondary); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--itb-font-title);
  color: var(--itb-ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-optical-sizing: auto;
  text-wrap: balance;
}

h1 { font-size: clamp(38px, 5.4vw, 58px); line-height: 1.06; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; }
h3 { font-size: clamp(20px, 2.2vw, 26px); }

.itb-eyebrow {
  font-family: var(--itb-font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--itb-secondary);
  margin-bottom: 12px;
  display: inline-block;
}

.itb-italic-accent {
  font-family: var(--itb-font-accent);
  font-style: italic;
  font-weight: 400;
}

.itb-container { max-width: var(--itb-container-max); margin: 0 auto; padding: 0 40px; }
.itb-container--narrow { max-width: var(--itb-container-narrow); margin: 0 auto; padding: 0 24px; }

.itb-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.itb-btn-primary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 100px;
  font-family: var(--itb-font-body);
  font-size: 15.5px;
  font-weight: 500;
  transition: background .2s, transform .2s;
  cursor: pointer;
  border: none;
  background: var(--itb-secondary);
  color: #fff;
  text-decoration: none;
}
.itb-btn-primary:hover { background: var(--itb-secondary-deep); color: #fff; transform: translateY(-2px); }

.itb-btn-ghost {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 100px;
  font-family: var(--itb-font-body);
  font-size: 15px;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  background: transparent;
  color: var(--itb-ink);
  border: 1.5px solid var(--itb-ligne);
  text-decoration: none;
}
.itb-btn-ghost:hover { background: var(--itb-accent); color: var(--itb-base-soft); border-color: var(--itb-accent); }

/* Dégradé de repli partagé (miniatures manquantes) — jamais d'image cassée */
.itb-fallback {
  background: linear-gradient(135deg, var(--itb-accent) 0%, var(--itb-accent-deep) 45%, var(--itb-secondary) 100%);
}
.itb-fallback--soft {
  background: linear-gradient(135deg, var(--itb-atlantique-clair) 0%, var(--itb-accent) 55%, var(--itb-secondary-deep) 100%);
}

/* === HEADER === */
.itb-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 241, 232, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--itb-ligne);
}
.itb-header__inner { display: flex; align-items: center; justify-content: space-between; height: 82px; }
.itb-brand { display: flex; flex-direction: column; line-height: 1; }
.itb-brand__logo { font-family: var(--itb-font-title); font-size: 27px; font-weight: 600; letter-spacing: -.02em; color: var(--itb-ink); }
.itb-brand__logo b { color: var(--itb-secondary); font-weight: 600; }
.itb-brand__tag { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--itb-ink-soft); margin-top: 5px; }
.itb-nav { display: flex; gap: 34px; align-items: center; }
.itb-nav > a { font-size: 15px; font-weight: 500; color: var(--itb-ink); position: relative; padding: 6px 0; transition: color .2s; }
.itb-nav > a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--itb-secondary); transition: width .25s; }
.itb-nav > a:hover { color: var(--itb-secondary); }
.itb-nav > a:hover::after { width: 100%; }
.itb-nav__cta { background: var(--itb-accent); color: var(--itb-base-soft); padding: 11px 22px; border-radius: 100px; font-size: 14.5px; font-weight: 500; transition: background .2s, transform .2s; }
.itb-nav__cta::after { display: none; }
.itb-nav__cta:hover { background: var(--itb-accent-deep); color: var(--itb-base-soft); transform: translateY(-1px); }
/* Burger (mobile only) */
.itb-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; cursor: pointer; margin-left: auto; }
.itb-burger span { display: block; height: 2px; width: 24px; background: var(--itb-ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
@media (max-width: 880px) {
  .itb-burger { display: flex; }
  .itb-menu-toggle:checked ~ .itb-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .itb-menu-toggle:checked ~ .itb-burger span:nth-child(2) { opacity: 0; }
  .itb-menu-toggle:checked ~ .itb-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .itb-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--itb-base); border-top: 1px solid var(--itb-ligne);
    box-shadow: 0 18px 30px -20px rgba(44, 38, 32, .35);
    padding: 8px 24px 20px;
  }
  .itb-menu-toggle:checked ~ .itb-nav { display: flex; }
  .itb-nav > a { padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--itb-base-deep); }
  .itb-nav > a::after { display: none; }
  .itb-nav__cta { text-align: center; margin-top: 16px; padding: 14px 22px; border-bottom: none; }
}

/* === FOOTER === */
.itb-footer { background: var(--itb-ink); color: #d9cfbf; padding: 70px 0 34px; }
.itb-footer__grid {
  display: grid; grid-template-columns: 1.8fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(217, 207, 191, .18);
}
.itb-footer__brand-logo { font-family: var(--itb-font-title); font-size: 26px; color: #fff; font-weight: 600; }
.itb-footer__brand-logo b { color: var(--itb-terracotta-doux); }
.itb-footer__tagline { margin-top: 16px; font-size: 14.5px; max-width: 300px; line-height: 1.65; color: #c3b9a8; }
.itb-footer__heading { font-family: var(--itb-font-body); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: #a89c88; margin: 0 0 18px; font-weight: 600; }
.itb-footer__links { list-style: none; display: flex; flex-direction: column; gap: 11px; margin: 0; padding: 0; }
.itb-footer__links a { font-size: 14.5px; color: #d9cfbf; transition: color .2s; }
.itb-footer__links a:hover { color: #fff; }
.itb-footer__bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; font-size: 13px; color: #a89c88; flex-wrap: wrap; gap: 12px; }
.itb-footer__made { display: flex; align-items: center; gap: 7px; }
.itb-footer__made .itb-diamond { color: var(--itb-terracotta-doux); }
@media (max-width: 880px) { .itb-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 560px) { .itb-footer__grid { grid-template-columns: 1fr; } }

/* === ARCHIVE / INDEX GRID === */
.itb-archive-hero { padding-block: 60px 8px; text-align: left; }
.itb-archive-hero .wp-block-query-title,
.itb-archive-hero h1 { font-family: var(--itb-font-title); font-weight: 500; margin: 6px 0 0; }
.itb-archive-hero .wp-block-term-description { color: var(--itb-ink-soft); margin-top: 14px; font-size: 17px; }

.itb-archive-grid__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 28px;
}
.itb-archive-card {
  background: var(--itb-base-soft);
  border-radius: var(--itb-radius-lg);
  overflow: hidden;
  box-shadow: var(--itb-shadow-soft);
  transition: transform .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.itb-archive-card:hover { transform: translateY(-6px); box-shadow: 0 26px 46px -26px rgba(44, 38, 32, .4); }
.itb-archive-card .itb-archive-card__img { margin: 0; }
.itb-archive-card .itb-archive-card__img img { border-radius: 0; width: 100%; height: 220px; object-fit: cover; }
.itb-archive-card .wp-block-post-terms { padding: 20px 24px 0; }
.itb-archive-card .wp-block-post-terms a {
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--itb-secondary); text-decoration: none;
}
.itb-archive-card .itb-archive-card__title { padding: 8px 24px 0; }
.itb-archive-card .itb-archive-card__title a { font-family: var(--itb-font-title); font-size: 22px; font-weight: 500; color: var(--itb-ink); line-height: 1.2; }
.itb-archive-card .itb-archive-card__excerpt { padding: 10px 24px 0; color: var(--itb-ink-soft); font-size: 14.5px; }
.itb-archive-card .itb-archive-card__date { padding: 14px 24px 24px; color: var(--itb-muted); font-size: 13px; margin-top: auto; }
.itb-pagination { margin-top: 48px; display: flex; gap: 8px; justify-content: center; }
.itb-pagination a, .itb-pagination .current { color: var(--itb-ink); font-weight: 500; padding: 8px 14px; border-radius: 100px; }
.itb-pagination a:hover { background: var(--itb-base-deep); }
@media (max-width: 900px) { .itb-archive-grid__list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .itb-archive-grid__list { grid-template-columns: 1fr; } }

/* === SINGLE ARTICLE === */
.itb-single-hero { text-align: center; padding-block: 60px 32px; position: relative; }
.itb-single-hero__breadcrumb {
  font-family: var(--itb-font-body);
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--itb-muted); margin-bottom: 18px;
}
.itb-single-hero__breadcrumb a { color: var(--itb-muted); }
.itb-single-hero__breadcrumb a:hover { color: var(--itb-secondary); }
.itb-single-hero__sep { margin: 0 6px; opacity: .6; }
.itb-single-hero__title {
  font-family: var(--itb-font-title);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08; letter-spacing: -0.02em;
  color: var(--itb-ink); margin: 0 0 22px;
}
.itb-single-hero__byline { font-family: var(--itb-font-body); font-size: 14px; color: var(--itb-muted); }
.itb-byline__author strong { color: var(--itb-accent); font-weight: 600; }
.itb-byline__sep { margin: 0 8px; opacity: .6; }

.itb-single-body { padding-block: 32px 60px; }
.itb-single-body p { font-size: 17px; line-height: 1.75; margin-bottom: 22px; }
.itb-single-body h2 {
  margin-top: 56px; margin-bottom: 18px;
  font-family: var(--itb-font-title);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 500; letter-spacing: -0.01em;
}
/* Petit filet terracotta au-dessus des h2 */
.itb-single-body h2::before {
  content: ''; display: block;
  width: 44px; height: 2px;
  background: var(--itb-secondary);
  margin-bottom: 16px;
}
.itb-single-body h3 { margin-top: 36px; margin-bottom: 12px; font-size: 22px; }
/* Pull-quotes Fraunces italic vert */
.itb-single-body blockquote {
  border: 0; border-left: 3px solid var(--itb-accent);
  margin: 32px 0; padding: 4px 0 4px 24px;
  font-family: var(--itb-font-accent); font-style: italic;
  font-size: 23px; line-height: 1.5; color: var(--itb-accent);
}
.itb-single-body ul, .itb-single-body ol { margin: 18px 0 24px; padding-left: 24px; }
.itb-single-body li { margin-bottom: 8px; line-height: 1.75; }
.itb-single-body img { border-radius: var(--itb-radius); margin: 24px 0; }

/* Drop cap Fraunces terracotta — 1er paragraphe */
.itb-single-body > p:first-of-type::first-letter {
  font-family: var(--itb-font-accent);
  font-style: italic;
  font-size: 4.4em;
  line-height: 0.82;
  float: left;
  padding: 6px 12px 0 0;
  color: var(--itb-secondary);
  font-weight: 500;
}

/* Bouton « Copier le lien » (single.js) */
.itb-copy-link {
  margin-top: 20px;
  font-family: var(--itb-font-body); font-size: 13px; font-weight: 500;
  letter-spacing: .03em;
  color: var(--itb-accent);
  background: transparent;
  border: 1.5px solid var(--itb-ligne);
  border-radius: 100px; padding: 8px 18px; cursor: pointer;
  transition: all .2s;
}
.itb-copy-link:hover { border-color: var(--itb-accent); background: var(--itb-accent); color: var(--itb-base-soft); }
.itb-copy-link.is-copied { border-color: var(--itb-accent); color: var(--itb-accent); }

/* === CALLOUTS — 5 variantes (cohérence pool, DESIGN-DNA §3.7) === */
.wp-block-quote.itb-callout {
  border-left: none; margin: 32px 0; padding: 0;
  font-style: normal; font-family: inherit; font-size: inherit; position: relative;
}
.wp-block-quote.itb-callout p {
  font-family: inherit; font-style: normal; font-size: 16px; line-height: 1.65; margin: 0 0 12px;
}
.wp-block-quote.itb-callout p:last-child { margin-bottom: 0; }
.wp-block-quote.itb-callout p:first-child {
  font-family: var(--itb-font-title); font-weight: 500; font-size: 19px; line-height: 1.25; margin-bottom: 14px;
}
.itb-callout--avis { background: rgba(199, 123, 84, 0.10); border-radius: var(--itb-radius); padding: 24px 28px 24px 60px !important; }
.itb-callout--avis::before { content: '◆'; position: absolute; top: 24px; left: 24px; font-size: 18px; color: var(--itb-secondary); }
.itb-callout--vecu { border-right: 4px solid var(--itb-secondary); padding: 24px 28px !important; background: var(--itb-base-soft); border-radius: var(--itb-radius) 0 0 var(--itb-radius); }
.itb-callout--vecu p:first-child::before {
  content: 'Sur le terrain'; display: inline-block;
  background: var(--itb-secondary); color: #fff;
  font-family: var(--itb-font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.itb-callout--note { border-left: 3px solid var(--itb-accent); padding: 12px 0 12px 24px !important; }
.itb-callout--note p:first-child { font-size: 13px !important; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600 !important; color: var(--itb-accent-deep); font-family: var(--itb-font-body) !important; }
.itb-callout--alerte { background: rgba(185, 108, 70, 0.16); border-radius: var(--itb-radius); padding: 22px 28px 22px 56px !important; }
.itb-callout--alerte::before { content: '!'; position: absolute; top: 24px; left: 24px; width: 22px; height: 22px; border-radius: 50%; background: var(--itb-secondary-deep); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; font-family: var(--itb-font-body); }
.itb-callout--aparte { background: var(--itb-base-soft); border-radius: var(--itb-radius); padding: 18px 26px !important; font-style: italic; }
.itb-callout--aparte p { font-family: var(--itb-font-accent) !important; font-style: italic; }
.itb-callout--aparte p:first-child { font-style: italic; font-size: 13px !important; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500 !important; color: var(--itb-muted); font-family: var(--itb-font-body) !important; }

/* Badges catégorie (rotation de couleur — grille articles) */
.itb-cat { background: var(--itb-base-soft); color: var(--itb-ink); }
.itb-cat--vert { background: var(--itb-accent); color: var(--itb-base-soft); }
.itb-cat--terre { background: var(--itb-secondary); color: #fff; }
