/* Coeur de ville — feuille de style publique */
@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  --red: #b90000;
  --red-dark: #8a0000;
  --red-soft: #fbeceb;
  --ink: #1e1916;
  --muted: #6b605a;
  --line: #e7ddd5;
  --bg: #faf6f1;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 20, 10, .06), 0 6px 20px rgba(60, 20, 10, .06);
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid #f2a33a; outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* En-tête */
.site-header { background: var(--red); color: #fff; position: relative; z-index: 51; }
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 26px; height: 26px; fill: var(--red); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.brand-tag { font-size: 13px; color: #fff; opacity: .9; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search { margin-left: auto; display: flex; background: #fff; border-radius: 999px; overflow: hidden; width: min(360px, 40vw); }
.header-search input { flex: 1; border: 0; padding: 9px 14px; font: inherit; font-size: 15px; min-width: 0; color: var(--ink); }
.header-search input:focus { outline: none; }
.header-search button { border: 0; background: transparent; padding: 0 12px; cursor: pointer; }
.header-search svg { width: 20px; height: 20px; fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; }
.menu-toggle { display: none; }

/* Navigation */
.main-nav { background: var(--bg); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.nav-top { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 0 auto; padding-top: 8px; position: relative; }
.nav-item { position: static; }
.nav-btn { display: flex; align-items: center; gap: 6px; padding: 16px 16px 14px; color: #b90000; background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .01em; cursor: pointer; text-decoration: none; }
.nav-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .2s; }
.nav-btn:hover, .nav-item.open > .nav-btn { color: #b90000; border-bottom-color: #b90000; }
.nav-item.open > .nav-btn svg { transform: rotate(180deg); }
.mega { display: none; position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 1px); background: #fff; color: var(--ink); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 18px 40px rgba(40,10,5,.22); min-width: 300px; z-index: 60; }
.nav-item.open .mega { display: block; }
.mega-inner { padding: 16px 20px 20px; }
.mega-all { display: inline-block; font-weight: 700; margin-bottom: 10px; text-decoration: none; }
.mega-cols { list-style: none; margin: 0; padding: 0; columns: 220px 3; column-gap: 28px; width: max-content; max-width: min(900px, 90vw); }
.mega-cols > li { break-inside: avoid; padding: 3px 0; }
.mega-cols a { color: var(--ink); text-decoration: none; display: inline-block; padding: 3px 0; }
.mega-cols a:hover { color: var(--red); text-decoration: underline; }
.mega-group { margin: 4px 0 10px; }
.mega-group > a { font-weight: 700; color: var(--red); }
.mega-group ul { list-style: none; margin: 2px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--red-soft); }
.mega-group ul a { font-size: 15.5px; }

/* Accueil */
.hero { background: linear-gradient(160deg, #fff 0%, var(--red-soft) 100%); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; padding-top: 52px; padding-bottom: 50px; align-items: stretch; }
.hero h1 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; margin: 0 0 10px; color: #b90000; }
.hero-intro { color: #557064; font-size: clamp(18px, 1.6vw, 20px); font-weight: 400; line-height: 1.55; }
.hero-intro p { margin: 0 0 10px; }
/* le texte peut avoir été mis en liste dans l'éditeur : pas de puces ici */
.hero-intro ul, .hero-intro ol { list-style: none; margin: 0; padding: 0; }
.hero-intro li { margin: 0 0 10px; }
.hero-intro li:last-child { margin-bottom: 0; }
.hero-intro p:last-child { margin-bottom: 0; }
.hero-search, .big-search { display: flex; gap: 8px; margin-top: 18px; max-width: 620px; }
.hero-search input, .big-search input { flex: 1; min-width: 0; font: inherit; padding: 13px 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.hero-search input:focus, .big-search input:focus { border-color: var(--red); outline: none; }
.hero-search button, .big-search button { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 0 20px; background: var(--red); color: #fff; cursor: pointer; }
.hero-search button:hover, .big-search button:hover { background: var(--red-dark); }
.hero-inner > * { min-width: 0; }

.hero-side { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.hero-inner.no-side { grid-template-columns: minmax(0, 1fr); }
.hero-side > :first-child { margin-top: 0; }
.hero-side img { max-width: 100%; height: auto; border-radius: 8px; }
.page-contact .contact-title { font-size: clamp(24px, 3vw, 30px); color: var(--red-dark); }
.page-contact .contact-icon { width: 32px; height: 32px; }
.contact-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 21px; color: var(--ink); }
.contact-icon { width: 28px; height: 28px; flex: none; fill: none; stroke: #b90000; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.contact-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px 26px; align-items: start; }
.cf-main, .cf-side { display: grid; gap: 10px; min-width: 0; }
.cf-side { padding-left: 26px; border-left: 1px solid var(--line); }
.contact-form .f-note { grid-column: 1 / -1; }
.f-row.f-row-3 { grid-template-columns: 1fr 1fr 1.3fr; }
.cf-side .f-types { flex-direction: column; gap: 6px; }
.cf-side button { justify-self: stretch; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-field { display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 700; margin: 0; min-width: 0; }
.f-field b { color: var(--red); }
.f-field input, .f-field textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.f-field textarea { resize: vertical; min-height: 96px; }
.f-field input:focus, .f-field textarea:focus { border-color: var(--red); outline: none; }
.f-field [aria-invalid="true"], .f-types[aria-invalid="true"] { border-color: var(--red); }
.f-types { border: 0; padding: 0; }
.f-types legend { padding: 0; margin-bottom: 4px; }
.f-types { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.f-types legend { width: 100%; }
.f-radio { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 16px; cursor: pointer; }
.f-radio input { width: 18px; height: 18px; accent-color: var(--red); }
.f-captcha span { font-weight: 400; }
.f-err { color: var(--red); font-weight: 400; font-size: 14px; width: 100%; }
.f-alert { background: var(--red-soft); color: var(--red-dark); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; font-size: 15px; }
.f-ok { background: #edf7ef; color: #1d5b2c; border-radius: 10px; padding: 14px 16px; }
.f-ok p { margin: 6px 0 0; }
.f-intro { margin: -4px 0 12px; color: var(--muted); font-size: 15px; }
.f-note { margin: 0; color: var(--muted); font-size: 13px; }
.f-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form button { justify-self: start; font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 11px 26px; background: var(--red); color: #fff; cursor: pointer; }
.contact-form button:hover { background: var(--red-dark); }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 18px; }
.pager a { background: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-weight: 700; }
.pager a:hover { color: var(--red); }
.pager small { display: block; color: var(--muted); font-weight: 400; }
.pager .next { text-align: right; }
.pager .up { text-align: center; font-weight: 400; font-size: 15px; }
.tiles-section { padding-top: 30px; padding-bottom: 48px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.tiles-heading { font-size: 22px; color: var(--red-dark); margin: 0 0 16px; }
.page .tiles-section { margin-top: 36px; padding-top: 28px; padding-bottom: 0; border-top: 1px solid var(--line); }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.tile-media { display: block; aspect-ratio: 16 / 8; background: var(--red-soft); overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tile:hover .tile-media img { transform: scale(1.04); }
.tile-body { padding: 14px 18px 18px; }
.tile-media-red { display: flex; align-items: center; justify-content: center; background: #b90000; padding: 16px; }
.tile-red-title { margin: 0; color: #fff; font-size: 24px; line-height: 1.2; text-align: center; }
.tile-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 19px; }
.tile-title a { color: var(--ink); text-decoration: none; }
.tile-title a:hover { color: var(--red); }
.tile-icon { position: relative; z-index: 2; width: 34px; height: 34px; object-fit: contain; flex: none; margin-top: -32px; background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.15); width: 44px; height: 44px; }
/* petit cœur rouge sur fond blanc, en pastille comme les pictos des autres blocs */
.tile-icon-heart { display: flex; align-items: center; justify-content: center; margin-bottom: 6px; padding: 9px; }
.tile-icon-heart svg { width: 100%; height: 100%; fill: #b90000; }
.tile-links, .tile-links ul { list-style: none; margin: 0; padding: 0; }
.tile-links li { border-top: 1px solid var(--line); }
.tile-links li:first-child { border-top: 0; }
.tile-links a { display: flex; justify-content: space-between; padding: 7px 2px; color: var(--ink); text-decoration: none; }
.tile-links a::after { content: "›"; color: var(--red); font-weight: 700; }
.tile-links a:hover { color: var(--red); }
.tile-links p { margin: 0; }
.tile-excerpt { color: var(--muted); margin: 0; }

/* Pages */
.page { padding-top: 20px; padding-bottom: 56px; }
.crumbs { font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; color: var(--red-dark); }
.page-head .who { display: block; font-size: .55em; color: var(--muted); font-weight: 400; margin-top: 6px; }
.page-icon { width: 56px; height: 56px; object-fit: contain; }
.cat-desc { background: #fff; border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 24px; }
.cat-desc img[style*="float"], .cat-desc img { max-height: 110px; width: auto; }
.list-head { font-size: 17px; color: var(--muted); font-weight: 400; margin: 26px 0 12px; }

.subcats { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.subcats a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border: 2px solid transparent; height: 100%; }
.subcats a:hover { border-color: var(--red); }
.subcats img { grid-row: span 2; width: 40px; height: 40px; object-fit: contain; }
.subcats span { font-weight: 700; }
.subcats small { color: var(--muted); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.card a { position: relative; display: block; background: #fff; border-radius: 12px; padding: 14px 44px 14px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border-left: 4px solid var(--red); height: 100%; }
.card a:hover { background: var(--red-soft); }
.card-title { display: block; font-weight: 700; }
.card-who { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }
.card-arrow { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--red); font-weight: 700; }
.empty { color: var(--muted); }

/* Contenu des articles */
.article { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px clamp(16px, 4vw, 40px) 18px; }
.prose { overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: var(--red-dark); margin: 1.2em 0 .5em; line-height: 1.3; }
.prose h2 { font-size: 24px; }
.prose h3, .prose h4 { font-size: 20px; }
.prose h5 { font-size: 17px; }
.prose h6 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.prose > :first-child { margin-top: 0; }
.prose .espace { height: 1.4em; }
.prose .espace-grand { height: 3em; }
.prose pre { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; background: var(--bg); padding: 10px 14px; border-radius: 8px; }
.prose h4:first-child { margin-top: 0; }
.prose h4 img { vertical-align: middle; margin: 0 8px 6px 0; max-height: 90px; width: auto; }
.prose p { margin: 0 0 .45em; }
.prose .hl { color: var(--red); }
.prose img { vertical-align: middle; }
.prose p img[width="25"], .prose p img[width="20"], .prose p img[height="25"] { width: 22px; height: 22px; }
.prose iframe { width: 100%; max-width: 100%; height: 320px; border: 0; border-radius: 12px; margin: 14px 0; background: var(--red-soft); }
.prose table { border-collapse: collapse; width: 100%; margin: 10px 0; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.prose a[href^="tel:"] { font-weight: 700; white-space: nowrap; }
.prose a[href^="mailto:"] { word-break: break-all; }

/* Recherche */
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.results li { background: #fff; border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); }
.results a { font-weight: 700; font-size: 18px; }
.result-cat { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.results p { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; }

/* Pied de page */
.site-footer { background: #2a1a17; color: #e9dcd6; padding-top: 32px; font-size: 15.5px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }
.footer-brand { font-weight: 700; font-size: 20px; color: #fff; margin: 0 0 8px; }
.site-footer a { color: #fff; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-bottom { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.12); margin-top: 26px; padding-top: 14px; padding-bottom: 18px; color: #b9a8a1; }

/* Mobile */
@media (max-width: 860px) {
  body { font-size: 16.5px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding-top: 34px; padding-bottom: 32px; gap: 20px; }
  .header-search { display: none; }
  .brand-name { font-size: 20px; }
  .menu-toggle { display: block; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); position: relative; cursor: pointer; }
  .menu-toggle span:first-child, .menu-toggle span:first-child::before, .menu-toggle span:first-child::after { position: absolute; left: 11px; width: 22px; height: 2.5px; background: #fff; border-radius: 2px; content: ""; transition: .2s; }
  .menu-toggle span:first-child { top: 21px; }
  .menu-toggle span:first-child::before { left: 0; top: -7px; }
  .menu-toggle span:first-child::after { left: 0; top: 7px; }
  .menu-toggle[aria-expanded="true"] span:first-child { background: transparent; }
  .menu-toggle[aria-expanded="true"] span:first-child::before { top: 0; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:first-child::after { top: 0; transform: rotate(-45deg); }
  .site-header { position: sticky; top: 0; z-index: 60; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
  .main-nav { display: none; box-shadow: none; }
  .main-nav.open { display: block; position: fixed; top: var(--header-h, 68px); left: 0; right: 0; max-height: calc(100vh - var(--header-h, 68px)); overflow-y: auto; z-index: 59; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .up { grid-column: 1 / -1; grid-row: 1; }
  .nav-top { flex-direction: column; padding: 0 0 14px; }
  .nav-btn { width: 100%; justify-content: space-between; padding: 13px 16px; font-size: 18px; border-bottom: 1px solid var(--line); }
  .nav-btn:hover, .nav-item.open > .nav-btn { border-bottom-color: var(--line); background: var(--red-soft); }
  .mega { position: static; transform: none; border-radius: 10px; box-shadow: none; margin: 8px; min-width: 0; border: 1px solid var(--line); }
  .mega-cols { columns: 1; width: auto; max-width: none; }
  .mega-cols a { padding: 6px 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .f-row, .f-row.f-row-3 { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: minmax(0, 1fr); }
  .cf-side { padding-left: 0; border-left: 0; }
  .contact-box { padding: 18px 16px; }
  .prose iframe { height: 260px; }
}

/* Impression (pratique pour les travailleurs sociaux) */
@media print {
  .site-header, .banner, .main-nav, .pager, .site-footer, .crumbs, .tiles-section, .hero-search, .prose iframe { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .article, .cat-desc, .card a { box-shadow: none; }
  .prose a::after { content: ""; }
}

/* Bannière graphique (illustration de Toulouse ou photo) */
.banner { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fdf4ee 0%, #f7ddd0 70%, #ecc0ae 70%, #e3ab96 86%, #dcb2a2 86%, #dcb2a2 87.5%, #e9c6b7 87.5%, #e9c6b7 100%); }
.banner-link { position: relative; display: block; height: 208px; color: inherit; text-decoration: none; }
/* calé à gauche sur le contenu, à droite sur le bord de l'écran : le pont sort du cadre */
.banner-art { position: absolute; top: 0; right: 0; width: calc(100% - max(0px, (100% - 1212px) / 2)); height: 100%; object-fit: contain; object-position: right bottom; }
/* voile clair à gauche pour la lisibilité du texte */
.banner-link::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(253,244,238,.97) 0%, rgba(253,244,238,.92) 31%, rgba(253,244,238,.5) 36%, rgba(253,244,238,0) 41%); }
.banner-photo .banner-link { background: var(--banner-img) center / cover no-repeat; }
.banner-photo .banner-link::before { background: linear-gradient(90deg, rgba(253,244,238,.95) 0%, rgba(253,244,238,.8) 38%, rgba(253,244,238,0) 70%); }
.banner-inner { position: relative; z-index: 2; display: flex; align-items: center; height: 100%; }
.banner-text { display: flex; flex-direction: column; gap: 6px; }
.banner-place { display: inline-flex; align-items: center; gap: 6px; color: #b90000; font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.banner-place svg { width: 18px; height: 18px; fill: none; stroke: #b90000; stroke-width: 2.2; }
.banner-title { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.15; font-weight: 700; color: #2a1a17; letter-spacing: -.01em; }
.banner-link:hover .banner-title { color: #b90000; }
@media (max-width: 860px) {
  .banner-link { height: 156px; }
  .banner-art { object-fit: cover; object-position: right bottom; }
  .banner-link::before { background: linear-gradient(90deg, rgba(253,244,238,.95) 0%, rgba(253,244,238,.82) 55%, rgba(253,244,238,.1) 100%); }
  .banner-title { font-size: 20px; }
  .banner-place { font-size: 12px; }
}
