/* ==========================================================================
   BeThom – portfolio de Thomas, graphiste
   Feuille de style unique, écrite « mobile first » :
   - styles de base       : mobile (jusqu’à 767 px)
   - @media (min-width: 768px)  : tablette
   - @media (min-width: 1024px) : desktop (maquette de référence : 1440 px)
   ========================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  /* Couleurs de la maquette */
  --c-ink: #21243d;          /* textes et titres */
  --c-black: #000;
  --c-white: #fff;
  --c-sky: #edf7fa;          /* fond de la section articles */
  --c-navy: #142850;         /* pastilles d’année */
  --c-field: #f7f7f7;        /* fond des champs */
  --c-rule: #efefef;         /* filets de séparation */
  --c-shadow: rgba(171, 190, 209, .4);

  /* Couleurs ajustées pour atteindre un contraste AA (4,5:1) */
  --c-coral: #d63f3f;        /* maquette : #ff6464 (2,9:1 avec le texte blanc) */
  --c-teal: #00788f;         /* maquette : #00a8cc (2,6:1 sur le fond bleuté) */
  --c-muted: #6b7785;        /* maquette : #8695a4 (3,2:1 sur blanc) */
  --c-placeholder: #707070;

  --ff-base: "Heebo", "Poppins", Arial, sans-serif;
  --ff-alt: "Poppins", "Heebo", Arial, sans-serif;
  --ff-serif: "Playfair Display", Georgia, serif;

  --container: 1184px;
  --gutter: 18px;
  --header-h: 72px;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h); /* les ancres ne passent pas sous le menu fixe */
}

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--ff-base);
  font-size: 16px;
  line-height: 24px;
  color: var(--c-ink);
  background: var(--c-white);
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--c-teal);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- 3. Utilitaires ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  color: var(--c-white);
  background: var(--c-ink);
}
.skip-link:focus { top: 8px; }

.section-title {
  font-size: 18px;
  font-weight: 400;
  line-height: 30px;
  text-align: center;
}

/* ---------- 4. Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease;
}

.btn--primary {
  height: 47px;
  padding: 0 14px;
  font-size: 20px;
  line-height: 1;
  color: var(--c-white);
  background: var(--c-coral);
}
.btn--primary:hover { background: #b83030; }

.btn--dark {
  width: 100%;
  height: 56px;
  font-size: 22px;
  font-weight: 400;
  color: var(--c-white);
  background: var(--c-black);
}
.btn--dark:hover { background: var(--c-ink); }

/* ---------- 5. En-tête fixe et menu ---------- */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  background: var(--c-white);
}
.site-header.is-scrolled { box-shadow: 0 2px 12px rgba(33, 36, 61, .08); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 34px;
}

.logo {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-black);
  text-decoration: none;
  margin-top: 2px;
}

/* Bouton « burger » (mobile et tablette) */
.menu-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  margin: -14px -7px 0 0;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
  position: absolute;
  left: 7px;
  width: 30px;
  height: 2px;
  background: var(--c-ink);
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle__bar { top: 21px; }
.menu-toggle__bar::before,
.menu-toggle__bar::after { content: ""; left: 0; }
.menu-toggle__bar::before { top: -9px; }
.menu-toggle__bar::after { top: 9px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bar { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::before { transform: translateY(9px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::after { transform: translateY(-9px) rotate(-45deg); }

.main-nav {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: none;
  background: var(--c-white);
  box-shadow: 0 12px 16px rgba(33, 36, 61, .08);
}
.main-nav.is-open { display: block; }

.main-nav__list a {
  display: block;
  padding: 14px 34px;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  color: var(--c-black);
  text-decoration: none;
}
.main-nav__list a:hover { color: var(--c-coral); }

/* ---------- 6. Présentation (hero) ---------- */
.hero { padding: 11px 0 43px; }

.hero__inner {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  text-align: center;
}

.hero h1 {
  margin-top: 38px;
  font-size: 30px;
  font-weight: 700;
  line-height: 40px;
}

.hero__intro {
  max-width: 330px;
  margin: 35px auto 21px;
}

/* Portrait avec son halo bleuté décalé */
.hero__photo {
  position: relative;
  width: 176px;
  height: 176px;
}
.hero__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c-sky);
}
.hero__photo img {
  position: absolute;
  top: 0;
  right: 0;
  width: 167px;
  height: 167px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- 7. Articles récents ---------- */
.posts {
  padding: 17px 0 49px;
  background: var(--c-sky);
}
.posts .container { padding: 0 11px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 9px;
}
.section-head__link {
  display: none;
  font-size: 16px;
  color: var(--c-teal);
  text-decoration: none;
}
.section-head__link:hover { text-decoration: underline; }

.posts__grid {
  display: grid;
  gap: 20px;
}

.post-card {
  padding: 15px 20px 37px;
  background: var(--c-white);
  box-shadow: 0 4px 10px var(--c-shadow);
}

.post-card__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 30px;
}

.post-card__meta {
  display: flex;
  align-items: center;
  margin: 9px 0 18px;
  font-size: 16px;
  line-height: 28px;
}
.post-card__meta > * { white-space: nowrap; }
.post-card__sep {
  width: 1px;
  height: 20px;
  margin: 0 23px;
  background: var(--c-ink);
}

/* ---------- 8. Travaux en vedette ---------- */
.works { padding: 14px 0 22px; }

.works__heading { margin-bottom: 16px; }

.work {
  padding-bottom: 18px;
  margin-bottom: 38px;
  border-bottom: 2px solid var(--c-rule);
}

.work__media img {
  width: 100%;
  border-radius: 6px;
}

.work__title {
  margin-top: 17px;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.work__tags {
  display: flex;
  align-items: center;
  margin: 14px 0 25px;
}

/* Mobile uniquement : largeur de texte et rythme repris de la maquette 375 px */
@media (max-width: 767px) {
  .work__desc { margin-right: -4px; }
  .work:nth-of-type(2) { padding-bottom: 40px; margin-bottom: 64px; }
  .work:nth-of-type(2) .work__title { margin-top: 22px; }
  .work:nth-of-type(2) .work__tags { margin-top: 12px; }
}

.badge {
  display: inline-block;
  padding: 0 11px;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--c-white);
  background: var(--c-navy);
  border-radius: 16px;
}

.work__category {
  margin-left: 23px;
  font-size: 16px;
  color: var(--c-muted);
}

/* ---------- 9. Contact ---------- */
.contact { padding: 22px 0 56px; }
.contact .container { padding: 0 20px; }

.contact__heading {
  margin-bottom: 33px;
  font-size: 22px;
  text-align: left;
}

/* Sur mobile, la maquette ne montre que le formulaire */
.contact__info { display: none; }

.contact__title {
  font-size: 40px;
  font-weight: 800;
  line-height: 48px;
  color: var(--c-black);
}
.contact__lead {
  margin: 18px 0 52px;
  font-size: 20px;
  line-height: 29px;
  color: var(--c-black);
}
.contact__subtitle {
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
  color: var(--c-black);
}
.contact__subtitle--serif { font-family: var(--ff-serif); }
.contact__email {
  margin: 20px 0 52px;
  color: var(--c-black);
}
.contact__email a { text-decoration: none; }
.contact__email a:hover { text-decoration: underline; }
.contact__socials { margin-top: 22px; }
.contact__socials li + li { margin-top: 20px; }
.contact__socials a { color: var(--c-black); }
.contact__socials a:hover { color: var(--c-coral); }

.field { margin-bottom: 29px; }

.field label {
  display: block;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 20px;
  color: var(--c-black);
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 15px;
  font-size: 14px;
  background: var(--c-field);
  border: 1px solid var(--c-field);
  border-radius: 0;
  appearance: none;
}
.field textarea {
  height: 165px;
  padding: 12px 15px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--c-ink);
  outline: none;
}

/* Liste déroulante : chevron dessiné en CSS */
.field select {
  padding-right: 48px;
  font-weight: 300;
  color: var(--c-ink);
  background-image: linear-gradient(45deg, transparent 50%, #222 50%), linear-gradient(135deg, #222 50%, transparent 50%);
  background-position: calc(100% - 44px) 21px, calc(100% - 40px) 21px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}
/* tant qu’aucune option n’est choisie, le texte prend la couleur d’un placeholder */
.field select.is-empty { color: var(--c-placeholder); }
.field select option { color: var(--c-ink); }

.contact-form .btn--dark { margin-top: -1px; }

/* ---------- 10. Pied de page ---------- */
.site-footer {
  padding: 0 0 55px;
  text-align: center;
}

.site-footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}
.site-footer__social a {
  display: block;
  padding: 4px;
  color: var(--c-ink);
  transition: color .2s ease;
}
.site-footer__social a:hover { color: var(--c-coral); }
.site-footer__social svg { fill: currentColor; }

.site-footer__copy {
  margin-top: 19px;
  font-size: 14px;
  line-height: 20px;
}

/* ==========================================================================
   Tablette (768 px et plus)
   ========================================================================== */
@media (min-width: 768px) {
  :root { --gutter: 40px; }

  .site-header__inner { padding: 0 var(--gutter); }
  .main-nav__list a { padding: 14px var(--gutter); }

  .hero { padding: 48px 0 72px; }
  .hero__inner {
    flex-direction: row;
    justify-content: space-between;
    gap: 40px;
    text-align: left;
  }
  .hero h1 {
    margin-top: 0;
    font-size: 38px;
    line-height: 52px;
  }
  .hero__intro { max-width: 610px; margin: 24px 0 32px; }
  .hero__photo { flex-shrink: 0; width: 220px; height: 220px; }
  .hero__photo img { width: 209px; height: 209px; }

  .posts .container { padding: 0 var(--gutter); }
  .section-head { justify-content: space-between; }
  .section-head__link { display: inline; }
  .posts__grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  .section-title { font-size: 20px; text-align: left; }
  .contact .container { padding: 0 var(--gutter); }
  .btn--dark { font-family: var(--ff-alt); font-size: 20px; font-weight: 500; }

  .work {
    display: grid;
    grid-template-columns: 220px 1fr;
    column-gap: 40px;
    align-items: start;
  }
  .work__title { margin-top: -4px; }

  .contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .contact__info { display: block; padding-top: 60px; }
  .contact__title { font-size: 34px; line-height: 42px; }
  .contact__lead { font-size: 18px; line-height: 27px; }
}

/* ==========================================================================
   Desktop (1024 px et plus) – valeurs relevées sur la maquette 1440 px
   ========================================================================== */
@media (min-width: 1024px) {
  :root { --header-h: 80px; }

  /* Menu horizontal : le burger disparaît */
  .site-header__inner { padding: 0 var(--gutter); }
  .logo { margin-top: 0; }
  .menu-toggle { display: none; }
  .main-nav,
  .main-nav.is-open {
    position: static;
    display: block;
    background: none;
    box-shadow: none;
  }
  .main-nav__list { display: flex; }
  .main-nav { margin-top: 6px; }
  .main-nav__list a { padding: 0; line-height: 30px; letter-spacing: .3px; }
  /* espacements des liens repris de la maquette */
  .main-nav__list li + li { margin-left: 72px; }
  .main-nav__list li:nth-child(2) { margin-left: 93px; }
  .main-nav__list li:nth-child(4) { margin-left: 56px; }

  .hero { padding: 141px 0 93px; }
  .hero__inner { align-items: flex-start; }
  .hero h1 {
    margin-top: 0;
    font-size: 44px;
    line-height: 60px;
  }
  .hero__intro { margin: 24px 0 32px; }
  .hero__photo { width: 256px; height: 256px; margin-top: -17px; }
  .hero__photo img { width: 243px; height: 243px; }

  .posts { padding: 20px 0 32px; }
  .section-title { font-size: 22px; line-height: 32px; }
  /* la maquette décale la zone articles de 6 px vers la gauche */
  .section-head,
  .posts__grid { margin-left: -6px; }
  .section-head { margin-bottom: 15px; }
  .section-head__link { margin-right: 7px; font-size: 15px; }
  .posts__grid { gap: 104px; }
  .post-card { padding: 25px 23px 47px; min-height: 295px; }
  .post-card__title { font-size: 26px; line-height: 38px; max-width: 400px; }
  .post-card__meta { margin: 25px 0 18px; font-size: 18px; }
  .post-card__sep { margin: 0 46px 0 54px; }
  .post-card__excerpt { max-width: 460px; }

  .works { padding: 52px 0 6px; }
  .works__heading { margin-bottom: 36px; }
  .work {
    grid-template-columns: 246px 1fr;
    column-gap: 90px;
    padding-bottom: 16px;
    margin-bottom: 30px;
    border-bottom: 0;
    position: relative;
  }
  /* filet plus court que la ligne, comme sur la maquette */
  .work::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 858px;
    max-width: 100%;
    height: 2px;
    background: var(--c-rule);
  }
  .work:nth-of-type(2) { padding-bottom: 36px; }
  .work:nth-of-type(3) { padding-bottom: 31px; }
  .work__media img { width: 246px; height: 180px; object-fit: cover; }
  .work__title { margin-top: -11px; font-size: 30px; line-height: 44px; }
  .work__tags { margin: 20px 0 23px; }
  .work__category { margin-left: 50px; font-size: 20px; }
  .work__desc { max-width: 830px; }
  /* retours à la ligne identiques à la maquette */
  .work:nth-of-type(2) .work__desc { max-width: 760px; }
  .work:nth-of-type(3) .work__desc { max-width: 795px; padding-left: 3px; }
  /* rythme vertical propre à chaque projet sur la maquette */
  .work:nth-of-type(2) .work__title { margin-top: -2px; }
  .work:nth-of-type(3) .work__title { margin-top: 0; }
  .work:nth-of-type(2) .work__tags { margin: 15px 0 24px; }
  .work:nth-of-type(3) .work__tags { margin: 12px 0 39px; }
  .work:nth-of-type(3) .work__media img { height: 183px; }

  .contact { padding: 12px 0 107px; }
  .contact__heading { margin-bottom: 50px; padding-left: 12px; }
  .contact__grid {
    grid-template-columns: 1fr 572px;
    gap: 30px;
    padding-right: 20px;
  }
  .contact__info { padding: 99px 0 0 5px; }
  .contact__title { font-size: 37px; line-height: 48px; }
  .contact__lead { max-width: 540px; margin: 21px 0 58px; font-size: 20px; line-height: 29px; }
  .contact__email { margin: 23px 0 54px; }
  .contact__socials { margin-top: 21px; }
  .contact-form .field { padding-left: 10px; margin-bottom: 29px; }
  .field label { margin-bottom: 15px; }
  .contact-form .btn--dark { margin-top: -1px; }

  .site-footer { padding-bottom: 50px; }
  .site-footer__copy { margin-top: 19px; }
}
