/*
 * Auteur du code : Gaëtan BALICKI
 * Développeur WEB
 * Contact : contact@un-temps-demotion.fr
 * Site web : www.un-temps-demotion.fr
 */
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../assets/fonts/quicksand-300.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/quicksand-400.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/quicksand-500.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/quicksand-600.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/quicksand-700.ttf") format("truetype");
}

/*
 * Header autonome du site.
 * Cette feuille peut être chargée seule sur galeries.un-temps-demotion.fr :
 * elle ne modifie ni body, ni main, ni les titres, ni les paragraphes du site hôte.
 */
.site-header,
.main-navigation {
  --utde-header-brand: #c79970;
  --utde-header-brand-dark: #a7744c;
  --utde-header-line: #dedbd8;
  --utde-header-ink: #1f1f1f;
  --utde-header-font:
    "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --utde-header-width: 1500px;
  --utde-header-transition: 180ms ease;
  box-sizing: border-box;
  font-family: var(--utde-header-font);
  color: var(--utde-header-ink);
}

.site-header *,
.site-header *::before,
.site-header *::after,
.main-navigation *,
.main-navigation *::before,
.main-navigation *::after {
  box-sizing: border-box;
}

.site-header a,
.main-navigation a {
  color: inherit;
  text-decoration: none;
}
.site-header a:hover,
.main-navigation a:hover {
  color: var(--utde-header-brand-dark);
}
.site-header img,
.main-navigation img {
  display: block;
  max-width: 100%;
  height: auto;
}
.main-navigation button {
  color: inherit;
  font: inherit;
}

.site-header .shell,
.main-navigation .shell {
  width: min(calc(100% - 3rem), var(--utde-header-width));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 50;
  background: #fff;
}
.site-header .brand-row {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
}
.site-header .brand img {
  width: 125px;
  height: 125px;
  object-fit: contain;
}

.main-navigation {
  position: sticky;
  z-index: 60;
  top: 0;
  border-block: 1px solid var(--utde-header-line);
  background: #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.main-navigation .mobile-nav-bar {
  display: none;
}
.main-navigation .mobile-brand {
  display: none;
}
.main-navigation .nav-links {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 3vw, 3.2rem);
}
.main-navigation .nav-links a {
  position: relative;
  padding: 0.75rem 0;
  font-size: 16px;
  line-height: 1.7;
  white-space: nowrap;
}
.main-navigation .nav-links .photo-access-link {
  font-weight: 700;
}
.main-navigation .nav-links a::after {
  position: absolute;
  right: 0;
  bottom: 0.65rem;
  left: 0;
  height: 1px;
  content: "";
  transform: scaleX(0);
  background: var(--utde-header-brand);
  transition: transform var(--utde-header-transition);
}
.main-navigation .nav-links a:hover::after,
.main-navigation .nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}
.main-navigation .menu-toggle {
  display: none;
  border: 0;
  background: transparent;
}

/* Variante compacte : uniquement la barre sticky, comme après avoir scrollé. */
body.header-compact .site-header,
.header-compact .site-header {
  display: none;
}

/* Utilitaire nécessaire au libellé accessible du bouton hamburger. */
.main-navigation .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .site-header {
    display: none;
  }
  .main-navigation .shell {
    width: min(calc(100% - 3rem), var(--utde-header-width));
  }
  .main-navigation .mobile-nav-bar {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
  }
  .main-navigation .mobile-brand {
    display: block;
    flex: 0 0 auto;
  }
  .main-navigation .mobile-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }
  .main-navigation .menu-toggle {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 auto;
    align-content: center;
    justify-content: center;
    gap: 4px;
    padding: 0.5rem;
    cursor: pointer;
  }
  .main-navigation .menu-toggle span:not(.sr-only) {
    display: block;
    width: 22px;
    height: 1px;
    background: #111;
  }
  .main-navigation .nav-links {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    padding-block: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      max-height 320ms ease,
      padding 320ms ease,
      opacity 220ms ease,
      transform 320ms ease,
      visibility 0s linear 320ms;
    will-change: max-height, opacity, transform;
  }
  .main-navigation.is-open .nav-links {
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding-block: 1rem;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
  }
  .main-navigation .nav-links a {
    text-align: center;
  }
}

@media (max-width: 620px) {
  .main-navigation .shell {
    width: min(calc(100% - 2rem), var(--utde-header-width));
  }
  .main-navigation .mobile-nav-bar {
    min-height: 48px;
  }
  .main-navigation .mobile-brand img {
    width: 34px;
    height: 34px;
  }
  .main-navigation .menu-toggle span:not(.sr-only) {
    width: 20px;
  }
  .main-navigation.is-open .nav-links {
    max-height: calc(100vh - 48px);
  }
  .main-navigation .nav-links a {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-navigation *,
  .main-navigation *::before,
  .main-navigation *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Accessibilité — lien d’évitement masqué tant qu’il n’est pas utilisé au clavier. */
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  transform: translateY(-200%);
  padding: 0.7rem 1rem;
  color: #fff;
  background: #111;
}
.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.main-navigation,
.main-navigation .mobile-nav-bar {
  font-family: var(--utde-header-font);
}

.main-navigation .nav-links a {
  font-family: var(--utde-header-font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.main-navigation .nav-links .photo-access-link {
  font-weight: 700;
}
