@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/anton-latin.woff2) format('woff2');
}

:root {
  --green: #2bba95;
  --green-dark: #1f8f72;
  --grey: #514f4f;
  --text: #1d1d1d;
  --muted: #6b6b6b;
  --red: #d42b2b;
  --panel: rgba(255, 255, 255, 0.88);
  --container: 980px;
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Same width with or without a scrollbar: the page doesn't shift between pages. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  color: var(--text);
  font: 300 17px/1.6 var(--body);
  /* The photo is washed out with white, as on the Wix site. */
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)) fixed,
    #e9e7e3 var(--fond, url(/static/img/fond-bouchons.webp)) center / cover fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video, iframe { max-width: 100%; }
a { color: var(--green-dark); }
strong, b { font-weight: 700; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* Header ------------------------------------------------------------------ */

.site-header {
  /* light "brushed metal" texture of the Wix theme, redrawn in CSS */
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.018) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.015) 0 1px, transparent 1px 4px),
    #f3f3f1;
  padding: 22px 0 18px;
}
.site-title { display: inline-block; text-decoration: none; color: #030303; }
.site-title__name { display: block; font: 400 clamp(40px, 8.5vw, 84px) / 1.05 var(--display); letter-spacing: 0.01em; }
.site-title__sub { display: block; font-size: clamp(26px, 4.8vw, 52px); font-weight: 300; line-height: 1.25; }

.site-nav { background: var(--green); position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
/* Items share the full width, like the Wix menu, and line up exactly with the
   edges of the white panel below (no side padding, unlike other containers). */
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; padding: 0; margin: 0 auto; }
.site-nav li { flex: 1 1 auto; }
.site-nav a {
  display: block;
  padding: 13px 12px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.15); }
.site-nav a[aria-current='page'] { color: var(--grey); background: rgba(255, 255, 255, 0.4); }

/* Page transitions -------------------------------------------------------- */
/* Header and menu stay put while the page content fades in. Chrome, Edge and
   Safari do it natively; other browsers (Firefox) get the same effect from
   site.js through the .page-fade / .is-leaving classes. */

@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
.site-nav { view-transition-name: site-nav; }
/* Only the text moves: the white panel itself stays still. */
.page-content { view-transition-name: page; }
::view-transition-old(page) { animation: 150ms ease-in both page-out; }
::view-transition-new(page) { animation: 300ms ease-out 50ms both page-in; }
.page-fade .page-content { animation: 300ms ease-out both page-in; }
.page-fade.is-leaving .page-content { animation: 150ms ease-in both page-out; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* Main panel ---------------------------------------------------------------- */

/* The white panel always has the same width and reaches down to the footer. */
.site-main { flex: 1; display: flex; flex-direction: column; padding: 0 0 48px; }
.panel {
  flex: 1;
  background: var(--panel);
  padding: 36px clamp(16px, 6vw, 64px) 48px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
}

.page-title { font: 400 clamp(30px, 5vw, 42px) / 1.15 var(--display); margin: 0 0 20px; color: #030303; }
.page-title--center, .center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 20px; }
.back { margin: 0 0 16px; }
.back a { text-decoration: none; }

/* Rich text content (also used inside the editor) */
.content { overflow-wrap: anywhere; }
.content > :first-child { margin-top: 0; }
.content h1, .content h2 { font: 400 clamp(26px, 4.5vw, 36px) / 1.2 var(--display); margin: 1.4em 0 0.5em; color: #030303; }
.content h3 { font-size: 21px; font-weight: 700; margin: 1.3em 0 0.4em; }
.content p { margin: 0; }
.content ul, .content ol { margin: 0 0 1em; padding-left: 1.4em; }
.content li { margin: 0.15em 0; }
.content blockquote { margin: 1em 0; padding: 0.4em 1em; border-left: 4px solid var(--green); font-style: italic; }
.content img { display: block; height: auto; max-width: min(100%, 680px); margin: 1em auto; border-radius: 3px; cursor: zoom-in; }
.content video, .content iframe.ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; margin: 1em auto; border: 0; background: #000; }
.content .ql-align-center { text-align: center; }
.content .ql-align-right { text-align: right; }
.content .ql-align-justify { text-align: justify; }
.content .ql-size-small { font-size: 0.85em; }
.content .ql-size-large { font-size: 1.3em; }
.content .ql-size-huge { font-size: 1.8em; }
/* Links that do something get a look of their own, wherever they are typed:
   documents = red button, phone and e-mail = pill with an icon. */
.content a[href$='.pdf'], .content a[href$='.doc'], .content a[href$='.docx'], .content a[href$='.odt'] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 10px 18px 10px 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(212, 43, 43, 0.3);
  transition: background-color 0.15s, transform 0.15s;
}
.content a[href$='.pdf']:hover, .content a[href$='.doc']:hover, .content a[href$='.docx']:hover, .content a[href$='.odt']:hover {
  background: #b51f1f;
  transform: translateY(-1px);
}
.content a[href$='.pdf']::before, .content a[href$='.doc']::before, .content a[href$='.docx']::before, .content a[href$='.odt']::before {
  content: '';
  width: 22px;
  height: 26px;
  flex: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 26'%3E%3Cpath d='M2 0h12l8 8v16a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z' fill='white'/%3E%3Cpath d='M14 0l8 8h-6a2 2 0 0 1-2-2z' fill='%23f6b4b4'/%3E%3Cpath d='M6 15h10M6 18.5h10M6 22h6' stroke='%23d42b2b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.content a[href^='tel:'], .content a[href^='mailto:'] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 1px 12px 1px 9px;
  border: 1px solid #b7e4d6;
  border-radius: 999px;
  background: #effaf6;
  color: var(--green-dark);
  font-weight: 400;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.content a[href^='tel:'] { white-space: nowrap; }
.content a[href^='tel:']:hover, .content a[href^='mailto:']:hover { background: #d9f3ea; border-color: var(--green); }
.content a[href^='tel:']::before, .content a[href^='mailto:']::before {
  content: '';
  width: 15px;
  height: 15px;
  flex: none;
  background: no-repeat center / contain var(--icon);
}
.content a[href^='tel:'] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231f8f72' d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25c1.1.37 2.3.57 3.6.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
}
.content a[href^='mailto:'] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231f8f72' d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E");
}
/* Other websites: small arrow, they open in a new tab. */
.content a[target='_blank']::after { content: '\2197'; display: inline-block; margin-left: 3px; font-size: 0.8em; text-decoration: none; }
.content ol li[data-list='bullet'] { list-style-type: disc; }

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid #c9c9c9;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: 400 16px/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: #999; }
.btn--primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn--big { font-size: 19px; padding: 12px 26px; }
.btn--small { font-size: 14px; padding: 5px 10px; }
.btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn--danger-light { color: var(--red); border-color: #e7b3b3; }

/* News cards ------------------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.card { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); transition: transform 0.15s, box-shadow 0.15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); }
.card--draft { opacity: 0.7; outline: 2px dashed #e0a800; }
.card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card__image { aspect-ratio: 4 / 3; background: #ddd; overflow: hidden; }
/* Top of the picture: posters keep their title and date visible. */
.card__image img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.card__placeholder { display: block; height: 100%; background: var(--green) url(/static/img/favicon.svg) center / 30% no-repeat; opacity: 0.4; }
.card__body { padding: 16px 18px 20px; }
.card__title { font: 400 23px/1.2 var(--display); margin: 0 0 6px; }
.card__date { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.card__excerpt { margin: 0; font-size: 15px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }

.post__title { font: 400 clamp(30px, 5vw, 44px) / 1.15 var(--display); margin: 0 0 4px; }
.post__date { color: var(--muted); margin: 0 0 24px; }
.badge { display: inline-block; background: #fff3c4; color: #6b5200; border-radius: 4px; padding: 2px 8px; font-size: 14px; font-weight: 700; }

/* Collection points ------------------------------------------------------- */

.collecte-search { max-width: 460px; margin: 24px auto 28px; }
.collecte-search label { display: block; font-weight: 700; margin-bottom: 6px; }
.collecte-search input, .collecte-toolbar input { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid #bbb; border-radius: 6px; }
.collecte { columns: 3 240px; column-gap: 36px; text-align: center; }
.commune { break-inside: avoid; margin: 0 0 20px; }
.commune h2 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
.commune__cp {
  display: inline-block;
  margin: 2px 0 4px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(43, 186, 149, 0.14);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.commune ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }

/* Map (carte.js) */
.carte-wrap { margin: 0 0 32px; }
.carte { height: clamp(320px, 55vh, 520px); border-radius: 8px; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); background: #e8eef3; z-index: 0; }
.carte-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.carte-legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende-commune { width: 18px; height: 12px; border: 1.5px solid #2f6fd6; background: rgba(47, 111, 214, 0.25); border-radius: 2px; }
.legende-pin { width: 12px; height: 12px; background: #1f8f72; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 0 0 1px #1f8f72; }
.map-pin { background: none; border: 0; }
.map-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.leaflet-container { font: 14px/1.4 var(--body); }
.leaflet-popup-content { margin: 10px 14px; }
.leaflet-popup-content ul { margin: 6px 0 0; padding-left: 18px; }

/* Forms (login, admin) ----------------------------------------------------- */

.form { display: grid; gap: 16px; }
.form-narrow { max-width: 480px; }
.form label { display: grid; gap: 6px; font-weight: 700; }
.form input:not([type='checkbox']), .form textarea {
  font: 300 17px/1.4 var(--body);
  padding: 10px 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  width: 100%;
}
.form input:focus, .form textarea:focus { outline: 3px solid rgba(43, 186, 149, 0.4); border-color: var(--green); }

.flash { padding: 12px 16px; border-radius: 6px; margin: 0 0 20px; font-weight: 400; }
.flash--success { background: #dff5ee; color: #135c49; border: 1px solid #a8e2d2; }
.flash--error { background: #fde8e8; color: #8a1c1c; border: 1px solid #f3b7b7; }

/* Footer ---------------------------------------------------------------- */

.site-footer { background: var(--green); color: #fff; font-size: 14px; }
.site-footer .container { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.site-footer p { margin: 0; flex: 1; }
.facebook { color: #111; display: inline-flex; }
.footer-login { color: rgba(255, 255, 255, 0.85); font-size: 13px; }

@media (max-width: 900px) {
  .site-nav a { padding: 11px 8px; font-size: 17px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; background-attachment: scroll; }
  .site-nav { position: static; }
  .site-nav ul { padding: 0; }
  .site-nav a { padding: 10px 8px; font-size: 16px; }
  .panel { padding-top: 24px; }
  .collecte { columns: 1; }
}

/* Photo enlarged on click (site.js) */
.lightbox { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.82); }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; width: auto; height: auto; margin: 0 auto; border-radius: 4px; cursor: zoom-out; }
.lightbox button {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
