/*
Theme Name: Mairie Figma
Theme URI: https://mairie.apdu.lan/
Author: Mairie
Description: Thème sur mesure adapté de la maquette Figma Mairie.
Version: 1.0.0
Text Domain: mairie-figma
*/

:root {
  --paper: #f3f0e9;
  --contrast: #eee7df;
  --ink: #111;
  --blue: #4967b4;
  --yellow: #f4d35e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Poppins", Arial, sans-serif;
}
body.admin-bar .site-header { top: 32px; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.site-shell { width: 100%; overflow: visible; background: var(--paper); }
.site-header {
  min-height: 86px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 0 16px 0 20px;
  background: var(--contrast); position: relative; z-index: 20;
}
.site-brand { flex: 0 0 auto; }
.brand-logo { width: 47px; height: 52px; object-fit: contain; }
.site-title {
  min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: clamp(14px, 4.2vw, 21px);
  line-height: 1.15; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap;
}
.menu-toggle {
  width: 62px; height: 51px; border: 0; padding: 8px 9px; background: transparent;
  cursor: pointer; display: grid; align-content: center; gap: 4px;
}
.menu-toggle span { display: block; height: 8px; background: #767072; }
.site-nav {
  display: none; position: absolute; top: 86px; right: 0; width: min(290px, 86vw);
  max-height: calc(100vh - 86px); overflow-y: auto; padding: 15px 20px; background: var(--contrast); box-shadow: 0 9px 20px rgba(0,0,0,.18);
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav a { display: block; padding: 10px 34px 10px 4px; text-decoration: none; font-weight: 600; }
.site-nav .sub-menu { display: none; padding-left: 14px; border-left: 2px solid rgba(73,103,180,.25); }
.site-nav .submenu-open > .sub-menu { display: block; }
.site-nav .sub-menu a { padding-block: 7px; font-size: 12px; font-weight: 400; }
.submenu-toggle {
  position: absolute; top: 6px; right: 0; width: 30px; height: 30px; padding: 0; border: 0;
  background: transparent; color: #575153; font-size: 22px; line-height: 1; cursor: pointer; transition: transform .2s ease;
}
.submenu-open > .submenu-toggle { transform: rotate(90deg); }

.hero { height: 217px; position: relative; background: #777 center/cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.12); }
.hero-actions {
  position: absolute; right: 0; top: 103px; z-index: 2; display: flex; align-items: stretch;
  height: 36px; font-size: 12px; text-transform: uppercase;
}
.hero-actions a { min-width: 92px; padding: 10px 13px; text-align: center; text-decoration: none; }
.hero-actions .request { background: var(--yellow); color: #111; }
.hero-actions .contact { background: #335ce7; color: #fff; }

.section { padding: 0 14px; }
.section-title { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 600; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.slider-controls { display: flex; gap: 5px; }
.slider-controls button {
  width: 27px; height: 27px; padding: 0 0 2px; border: 1px solid #c9c1b8; border-radius: 50%;
  background: rgba(255,255,255,.5); color: #4f4a4b; font: 600 20px/1 "Poppins", sans-serif; cursor: pointer;
}
.slider-controls button:hover, .slider-controls button:focus-visible { background: #fff; outline: 2px solid #4967b4; }
.horizontal-slider { scroll-behavior: smooth; scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; }
.horizontal-slider > article { scroll-snap-align: start; }
.horizontal-slider::-webkit-scrollbar { height: 5px; }
.horizontal-slider::-webkit-scrollbar-thumb { background: #bdb5ac; border-radius: 9px; }
.empty-section { flex: 0 0 100%; font-size: 12px; }
.news { padding-top: 9px; padding-bottom: 36px; }
.news-grid { display: flex; gap: 31px; padding: 0 5px 8px; overflow-x: auto; }
.news-card {
  flex: 0 0 calc((100% - 31px) / 2); min-width: 0; height: 162px; overflow: hidden; border-radius: 5px; background: var(--contrast);
  box-shadow: 1px 1px 3px rgba(0,0,0,.25); text-decoration: none;
}
.news-card > a { display: block; height: 100%; color: inherit; text-decoration: none; }
.news-card img { width: 100%; height: 112px; object-fit: cover; }
.news-card h3 { margin: 5px 7px 0; font-size: 12px; line-height: 1.15; font-weight: 600; }
.news-card p { margin: 2px 6px; font-size: 10px; line-height: 1.2; }
.more { display: block; margin: 0 6px 3px auto; width: max-content; font-size: 6px; text-transform: uppercase; }

.publications { background: var(--contrast); padding-top: 7px; padding-bottom: 23px; }
.publication-grid { display: flex; gap: 72px; padding: 0 37px 10px; overflow-x: auto; }
.publication-card { flex: 0 0 116px; }
.publication-card a { display: block; text-decoration: none; }
.publication-card img { width: 116px; height: 183px; object-fit: cover; box-shadow: 4px 4px 8px rgba(0,0,0,.25); }
.publication-card h3 { margin: 9px 0 0; font-size: 10px; line-height: 1.25; text-align: center; }

.agenda { padding-top: 16px; padding-bottom: 16px; }
.agenda-strip { display: flex; gap: 13px; overflow-x: auto; padding: 8px 21px 6px; scrollbar-width: thin; }
.day-card { flex: 0 0 135px; min-height: 155px; padding: 16px; border-radius: 8px; background: var(--contrast); text-align: center; }
.day-card a { display: block; color: inherit; text-decoration: none; }
.day-number {
  width: 51px; height: 51px; margin: 0 auto; border-radius: 50%; background: #e4ddd3;
  display: grid; place-items: center; font-size: 20px; font-weight: 600;
}
.day-month { margin: 0; font-size: 13px; line-height: 1; font-weight: 600; text-transform: uppercase; }
.day-card h3 { margin: 7px 0 0; font-size: 10px; line-height: 1.2; }
.day-copy { margin: 5px 0 0; font-size: 8px; line-height: 1.25; text-align: left; }

.childhood { background: var(--contrast); padding-top: 10px; padding-bottom: 11px; }
.service-grid { display: grid; grid-template-columns: 1fr 1fr; row-gap: 24px; padding: 0 28px; }
.service { min-height: 81px; text-align: center; }
.service a { display: block; height: 100%; padding: 2px; color: inherit; text-decoration: none; border-radius: 6px; }
.service a:hover, .service a:focus-visible { background: rgba(255,255,255,.55); outline: 2px solid #4967b4; }
.service-icon {
  width: 17px; height: 17px; margin: 0 auto 2px; border: 2px solid #111; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; line-height: 1;
}
.service h3 { margin: 0; font-size: 13px; line-height: 1.3; font-weight: 600; }
.service p { margin: 1px 0; font-size: 10px; line-height: 1.3; }
.childhood-more { display: block; margin-left: auto; font-size: 9px; font-weight: 200; text-decoration: none; }

.associations { padding-top: 10px; padding-bottom: 50px; }
.association-grid { display: flex; gap: 11px; padding: 0 8px 8px; overflow-x: auto; }
.association-card { flex: 0 0 calc((100% - 11px) / 2); min-width: 0; height: 113px; padding: 7px 0 0; border-radius: 4px; overflow: hidden; background: var(--contrast); text-align: center; }
.association-card a { display: block; color: inherit; text-decoration: none; }
.association-card img { width: 131px; height: 63px; margin: 0 auto; object-fit: cover; }
.association-card h3 { margin: 1px 0 0; font-size: 12px; line-height: 1.35; }
.association-card p { margin: 0; font-size: 9px; line-height: 1.2; }

.site-footer { min-height: 310px; padding: 16px 22px 12px; background: var(--footer-background, var(--blue)); color: var(--footer-color, #f5f5f5); font-size: 10px; }
.footer-top { display: grid; grid-template-columns: 1fr 112px; gap: 20px; align-items: start; }
.contact-list { display: grid; gap: 19px; padding-top: 24px; }
.contact-item { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 8px; }
.contact-item .icon { font-size: 16px; text-align: center; }
.mayor img { width: 104px; height: 154px; object-fit: cover; margin: 0 auto; }
.mayor p { margin: 8px 0 0; text-align: center; text-transform: uppercase; }
.footer-links { margin-top: 20px; padding-top: 16px; border-top: 1px solid currentColor; }
.footer-links > ul { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 17px 28px; width: 100%; margin: 0; padding: 0; list-style: none; }
.footer-links a { font-size: 9px; }

@media (min-width: 900px) {
  .site-shell { max-width: 1100px; margin: 0 auto; box-shadow: 0 0 36px rgba(0,0,0,.08); }
  .site-header { grid-template-columns: auto minmax(170px, 1fr) auto; gap: 28px; padding-inline: 42px; }
  .site-title { font-size: clamp(18px, 2.2vw, 27px); }
  .menu-toggle { display: none; }
  .site-nav {
    display: block; position: static; width: auto; max-height: none; overflow: visible;
    padding: 0; background: none; box-shadow: none;
  }
  .site-nav > ul { display: flex; gap: clamp(16px, 2.4vw, 28px); align-items: center; }
  .site-nav > ul > li > a { padding: 14px 2px; font-size: 13px; }
  .site-nav .submenu-toggle { display: none; }
  .site-nav .sub-menu {
    display: none; position: absolute; z-index: 50; top: 100%; left: 0; min-width: 245px;
    padding: 8px 0; border: 0; border-radius: 5px; background: var(--contrast); box-shadow: 0 9px 22px rgba(0,0,0,.2);
  }
  .site-nav > ul > li:last-child > .sub-menu { right: 0; left: auto; }
  .site-nav .sub-menu .sub-menu { top: -8px; left: 100%; }
  .site-nav > ul > li:nth-last-child(-n + 2) .sub-menu .sub-menu { right: 100%; left: auto; }
  .site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }
  .site-nav .sub-menu a { padding: 8px 14px; white-space: normal; }
  .site-nav .menu-item-has-children > a::after { content: " ▾"; color: #686265; }
  .site-nav .sub-menu .menu-item-has-children > a::after { content: " ›"; }
  .hero { height: 380px; }
  .hero-actions { top: auto; bottom: 64px; }
  .section { padding-inline: 42px; }
  .news, .agenda, .associations { padding-top: 30px; padding-bottom: 40px; }
  .news-grid { gap: 28px; }
  .news-card { flex-basis: calc((100% - 56px) / 3); height: 290px; }
  .news-card img { height: 215px; }
  .news-card h3 { font-size: 16px; }
  .publication-grid { gap: 55px; }
  .publication-card { flex-basis: 180px; }
  .publication-card img { width: 180px; height: 284px; }
  .service-grid { grid-template-columns: repeat(4, 1fr); }
  .association-grid { gap: 28px; }
  .association-card { flex-basis: calc((100% - 56px) / 3); height: 180px; }
  .association-card img { width: 86%; height: 116px; }
  .footer-top { grid-template-columns: 1fr 150px; }
}

@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

.article-page { min-height: 65vh; padding: 42px 20px 70px; }
.article-page article { max-width: 760px; margin: 0 auto; }
.article-category, .article-date { color: #6c6663; font-size: 12px; }
.article-page h1 { margin: 7px 0; font-size: clamp(28px, 7vw, 52px); line-height: 1.1; }
.article-image { margin: 30px 0; overflow: hidden; border-radius: 8px; }
.article-image img { width: 100%; max-height: 520px; object-fit: cover; }
.article-content { font-size: 16px; line-height: 1.7; }
.compact-footer { min-height: 130px; padding-top: 30px; }
