/*
 * CCPartner Blog — shared stylesheet.
 *
 * Replaces the per-page <style> blocks that used to be duplicated (and had
 * silently drifted apart) across every HTML file. Visual identity is unchanged:
 * same blue, same grey, same Montserrat / Allura pairing as the original design.
 */

/* ---------------------------------------------------------------- tokens -- */

:root {
  /* Darkened from the original #647bb3, which measured 4.18:1 on white — below
     WCAG AA both as text (region names, links) and as a button fill under white
     labels. Same hue, 4 % less lightness. */
  --blue: #566fac;
  --blue-dark: #485d92;

  /* --grey is the hairline colour only. Body copy uses --text, which is darker:
     #818285 measured 3.84:1 on white, below the 4.5:1 WCAG AA floor for normal
     text. --text is 5.82:1. Darkening --grey itself would also darken every
     dashed rule, which is meant to stay light. */
  --grey: #818285;
  --text: #646569;
  --grey-dark: #5c5d60;
  --grey-light: #d8d9db;
  --paper: #fff;

  --font-body: "Montserrat", -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Allura", cursive;

  /* Vertical rhythm: every spacing below is a multiple of this step, which is
     what keeps sections aligned once the page is scaled down on mobile. */
  --step: 8px;
  --gutter: clamp(20px, 4vw, 48px);
  --measure: 1600px;

  --radius: 4px;
  --transition: 160ms ease;
}

/* ----------------------------------------------------------------- base -- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  scroll-snap-type: y proximity;
  /* The original design relied on a hairline dashed rule everywhere; keeping it
     as a custom property means one place to change its colour. */
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* <picture> is inline by default, which would leave a baseline gap under the
   image and break the width rules that target the wrapper. */
picture {
  display: block;
}

a {
  color: var(--blue);
}

h1,
h2,
h3 {
  font-weight: 500;
  color: var(--grey-dark);
  letter-spacing: 0.08em;
  margin: 0;
}

/* Visible keyboard focus — the original markup had none at all. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* -------------------------------------------------------------- layout -- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  scroll-snap-align: start;
  padding-bottom: calc(var(--step) * 6);
}

.page--top {
  align-items: flex-start;
  justify-content: flex-start;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- hero -- */

.hero {
  display: flex;
  width: 100%;
  align-items: center;
}

.hero__media {
  flex: 3;
}

.hero__aside {
  flex: 2;
  padding: var(--gutter);
}

.logo {
  max-width: 250px;
  margin: 0 auto calc(var(--step) * 4);
}

/* The handwritten pull quote signed by the director. */
.quote {
  max-width: 380px;
  margin: 0 auto;
  font-family: var(--font-hand);
  font-size: clamp(21px, 2.2vw, 25px);
  line-height: 1.5;
}

.quote p {
  margin: 0 0 calc(var(--step) * 2);
}

.signature {
  text-align: right;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: calc(var(--step) * 5);
}

.signature strong {
  display: block;
  font-weight: 600;
  color: var(--grey-dark);
}

/* ------------------------------------------------------------ buttons -- */

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--step) * 1.5);
  justify-content: center;
  margin-top: calc(var(--step) * 4);
  padding: 0 var(--gutter);
}

.btn {
  display: inline-block;
  padding: calc(var(--step) * 1.5) calc(var(--step) * 3);
  background-color: var(--blue);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.btn:hover {
  background-color: var(--blue-dark);
  color: var(--paper);
}

.btn:active {
  transform: translateY(1px);
}

.btn--block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ------------------------------------------------- commitments (home) -- */

/* Grid rather than flex so the five commitments share row heights: the lead of
   the first one wraps onto two lines, which pushed its body text out of line
   with the other four when each column laid itself out independently. */
.commitments {
  display: grid;
  grid-template-columns: 0.7fr repeat(5, 1fr);
  column-gap: calc(var(--step) * 4);
  width: 100%;
  max-width: var(--measure);
  margin: calc(var(--step) * 6) auto 0;
  padding: 0 var(--gutter);
  position: relative;
}

/* subgrid makes each commitment inherit the three shared rows (number, lead,
   body). Where it is unsupported the columns simply fall back to their own
   heights — the previous behaviour, not a broken layout. */
.commitment {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}

/* The heading + badge block has only two children and spans the same rows. */
.commitment:first-child {
  display: block;
  grid-row: span 3;
}

/* The dashed rule that ties the five numbered commitments together. It starts
   at the second column, which is why the offset is a quarter of the row. */
.commitments::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--gutter) + (100% - var(--gutter) * 2) * 0.7 / 5.7 + var(--step) * 4);
  right: var(--gutter);
  border-top: 1px dashed var(--grey);
}

.commitment__heading {
  font-size: 18px;
  margin-bottom: calc(var(--step) * 4);
}

/* No max-width: the badge takes its column. A fixed width truncated the longest
   word ("CONFIDENTIALITÉ") once letter-spacing was applied. */
.badge {
  background-color: var(--blue);
  color: var(--paper);
  padding: calc(var(--step) * 2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.04em;
  overflow-wrap: break-word;
  border-radius: var(--radius);
}

.commitment__number {
  align-self: start;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--grey-dark);
  margin: 0 0 calc(var(--step) * 2);
  padding-top: calc(var(--step) * 4);
  position: relative;
}

/* Short dashed drop line hanging from the horizontal rule down to the number. */
.commitment__number::before {
  position: absolute;
  content: "";
  top: 0;
  height: 25px;
  left: 50%;
  border-right: 1px dashed var(--grey);
}

/* align-self:end keeps the dashed underline on the shared baseline whether the
   lead runs to one line or two. */
.commitment__lead {
  align-self: end;
  border-bottom: 1px dashed var(--grey);
  font-size: 13px;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--grey-dark);
  margin: 0 0 calc(var(--step) * 2);
  padding-bottom: calc(var(--step) * 1.5);
  text-align: center;
}

.commitment__body {
  align-self: start;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

/* --------------------------------------------------- listing (transaction) -- */

.split {
  display: flex;
  width: 100%;
  gap: var(--gutter);
}

.split__col {
  flex: 1;
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 4);
  font-size: clamp(18px, 2vw, 22px);
  margin: calc(var(--step) * 4) 0 calc(var(--step) * 5);
}

/* Fills whatever horizontal space the title leaves, so the rule always starts
   right after the last word instead of at a hard-coded percentage. */
.section-title::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--grey);
}

/* Regions and their camping sites. auto-fit lets the columns collapse on their
   own instead of needing a media query per breakpoint. */
.regions {
  columns: 4 200px;
  column-gap: var(--gutter);
  width: 100%;
  margin: calc(var(--step) * 5) 0;
}

/* Keeps a region and its sites together instead of splitting them across a
   column break. */
.region {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: calc(var(--step) * 4);
}

.site {
  font-size: 11px;
  line-height: 1.5;
  margin: 0 0 calc(var(--step) * 1.5);
  text-align: center;
}

/* Named explicitly rather than as `.region p` so that it carries the same
   specificity as .site and wins on source order alone — no !important needed. */
.region__name {
  font-size: 16px;
  font-weight: 600;
  margin: calc(var(--step) * 4) 0 calc(var(--step) * 1.5);
  color: var(--blue);
  letter-spacing: 0.06em;
  text-align: center;
}

.region__name:first-child {
  margin-top: 0;
}

.site__stars {
  color: var(--blue);
  white-space: nowrap;
}

/* ------------------------------------------------------ prose (valeurs) -- */

.prose {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--gutter);
}

.prose p {
  font-size: 15px;
  line-height: 1.8;
}

.prose h1,
.prose h2 {
  position: relative;
  padding-bottom: calc(var(--step) * 2.5);
  margin-bottom: calc(var(--step) * 3);
  font-size: clamp(18px, 2vw, 22px);
}

.prose h1::after,
.prose h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-bottom: 1px dashed var(--grey);
}

.prose .signature {
  font-size: 16px;
  color: var(--grey-dark);
  margin-bottom: calc(var(--step) * 2.5);
}

.signature__mark {
  max-width: 200px;
  margin-left: auto;
  margin-top: calc(var(--step) * 2);
}

.split--middle {
  align-items: center;
}

/* Image teaser linking to the contact page. Capped and centred in its column:
   at 54 % of a full-viewport column it ran off the right edge. */
.teaser {
  position: relative;
  display: block;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  text-decoration: none;
  color: inherit;
}

.teaser__label {
  position: absolute;
  top: 50%;
  left: 20%;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  transition: color var(--transition);
}

.teaser:hover .teaser__label {
  color: var(--blue);
}

.banner {
  width: 100%;
  margin-bottom: calc(var(--step) * 6);
}

.banner img {
  width: 100%;
}

/* ---------------------------------------------------------------- form -- */

.form {
  max-width: 380px;
  margin: 0 auto;
}

.form h1 {
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--grey-dark);
  margin-bottom: calc(var(--step) * 3);
}

.field {
  margin-bottom: calc(var(--step) * 2);
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: calc(var(--step) * 0.5);
  color: var(--grey-dark);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"] {
  width: 100%;
  padding: calc(var(--step) * 1.5);
  font-family: inherit;
  font-size: 15px;
  color: var(--grey-dark);
  background: var(--paper);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.field input:focus {
  border-color: var(--blue);
}

.choices {
  border: 0;
  padding: 0;
  margin: calc(var(--step) * 3) 0;
}

.choices legend {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--grey-dark);
  padding: 0;
  margin-bottom: calc(var(--step) * 1.5);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--step) * 1.5);
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: calc(var(--step) * 1.5);
  cursor: pointer;
}

.choice input {
  margin: 3px 0 0;
  accent-color: var(--blue);
  flex-shrink: 0;
}

/* ---------------------------------------------------------- responsive -- */

@media only screen and (max-width: 900px) {
  .split {
    flex-direction: column;
  }
}

@media only screen and (max-width: 769px) {
  .hero {
    flex-direction: column-reverse;
  }

  .hero__media,
  .hero__aside {
    flex: unset;
    width: 100%;
  }

  .commitments {
    grid-template-columns: 1fr;
  }

  .commitment,
  .commitment:first-child {
    display: block;
    grid-row: auto;
    padding: calc(var(--step) * 2.5) 0;
    margin: 0;
  }

  .commitments::before,
  .commitment__number::before {
    display: none;
  }

  .badge {
    max-width: none;
  }

  .teaser,
  .nomobile {
    display: none;
  }

  .page {
    padding-bottom: calc(var(--step) * 4);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  body {
    scroll-snap-type: none;
  }
}
