/* ==========================================================================
   Soy Almería — composants partagés : header, footer, décors, photos
   ========================================================================== */

/* --- Logotype -------------------------------------------------------------- */

.brand {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand em {
  font-style: normal;
  color: var(--terra);
}

.on-dark .brand,
.site-footer .brand {
  color: var(--on-navy);
}

.site-footer__main .brand {
  font-size: clamp(2.2rem, 1.5rem + 2.2vw, 3.4rem);
}

.on-dark .brand em,
.site-footer .brand em {
  color: var(--terra-light);
}

/* --- En-tête ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--chalk);
  transition: box-shadow 250ms var(--ease-out);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -18px rgb(28 39 51 / 0.35);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 5.5rem;
}

.site-nav {
  margin-inline: auto;
}

.site-nav__list {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2.75rem);
}

.site-nav__link {
  font-size: var(--text-sm);
  font-weight: 480;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 180ms var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link[aria-current='page'] {
  color: var(--ink);
}

.site-nav__link[aria-current='page'] {
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--terra);
  padding-bottom: 0.2em;
}

.lang-switch {
  display: flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lang-switch a,
.lang-switch strong {
  padding: 0.35em 0.4em;
  text-decoration: none;
  color: var(--ink-mute);
}

.lang-switch strong {
  color: var(--ink);
}

.lang-switch a:hover {
  color: var(--terra);
}

.lang-switch__sep {
  color: var(--copper);
}

.on-dark .lang-switch strong,
.site-footer .lang-switch strong {
  color: var(--terra-light);
}

.on-dark .lang-switch a,
.site-footer .lang-switch a {
  color: var(--on-navy-mute);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0.55rem;
}

.nav-toggle span {
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 250ms var(--ease-out), opacity 200ms var(--ease-out);
}

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 62rem) {
  .site-header__bar {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding-block: 0.9rem;
    min-height: 0;
  }

  .site-header .btn {
    display: none;
  }

  .nav-toggle {
    display: flex;
    order: 3;
    margin-left: auto;
  }

  .lang-switch {
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 4;
    flex-basis: 100%;
    margin: 0;
  }

  .js .site-nav {
    display: none;
  }

  .js .site-nav.is-open {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    gap: 0;
    padding-block: 0.5rem 1rem;
    border-top: 1px solid var(--paper-deep);
  }

  .site-nav__link {
    display: block;
    padding: 0.7rem 0.2rem;
    font-size: var(--text-base);
  }
}

/* --- Décors vectoriels ------------------------------------------------------
   Technique : background-color + mask => le SVG prend la couleur courante. */

.deco {
  background-color: currentColor;
  -webkit-mask: var(--deco-src) center / 100% 100% no-repeat;
  mask: var(--deco-src) center / 100% 100% no-repeat;
}

.deco--topo {
  --deco-src: url('../vectors/decorative/topographic-wave.svg');
  aspect-ratio: 1600 / 180;
}

.deco--topo-single {
  --deco-src: url('../vectors/decorative/topographic-single.svg');
  aspect-ratio: 1600 / 120;
}

.deco--film {
  --deco-src: url('../vectors/decorative/film-strip-wave.svg');
  aspect-ratio: 1600 / 130;
}

.deco--strings {
  --deco-src: url('../vectors/decorative/guitar-strings.svg');
  aspect-ratio: 1600 / 180;
}

.deco--landscape {
  --deco-src: url('../vectors/decorative/practical-landscape.svg');
  aspect-ratio: 1600 / 260;
}

.deco--icon {
  width: 3.4rem;
  aspect-ratio: 1;
}

.deco--icon-walk { --deco-src: url('../vectors/icons/walk.svg'); }
.deco--icon-tapas { --deco-src: url('../vectors/icons/tapas.svg'); }
.deco--icon-cinema { --deco-src: url('../vectors/icons/cinema.svg'); }

/* Bord déchiré : à placer entre deux strates. La couleur est celle de la
   strate qui « déborde » sur la suivante. */

.torn {
  height: clamp(2.5rem, 6vw, 4.5rem);
  background-color: currentColor;
  -webkit-mask: url('../vectors/decorative/paper-torn-edge.svg') center / 100% 100% no-repeat;
  mask: url('../vectors/decorative/paper-torn-edge.svg') center / 100% 100% no-repeat;
}

.torn--flip {
  transform: scaleY(-1);
}

/* Déchirure profonde : la strate marine s'ouvre largement sur le papier. */
.torn--deep {
  height: clamp(5rem, 10vw, 8.5rem);
}

/* Crête de vague pour les strates marines. */

.wave {
  height: clamp(2.5rem, 7vw, 5.5rem);
  background-color: currentColor;
  -webkit-mask: url('../vectors/decorative/wave-crest.svg') center / 100% 100% no-repeat;
  mask: url('../vectors/decorative/wave-crest.svg') center / 100% 100% no-repeat;
}

.wave--flip {
  transform: scaleY(-1);
}

/* --- Débordements pleine largeur ---------------------------------------------
   À utiliser sur un enfant direct ou profond de .shell pour amener une photo
   jusqu'au bord du viewport, comme dans les maquettes. */

.bleed-right {
  margin-right: calc(-1 * max((100vw - var(--shell)) / 2, var(--shell-pad)));
}

.bleed-left {
  margin-left: calc(-1 * max((100vw - var(--shell)) / 2, var(--shell-pad)));
}

/* --- Grain de papier -------------------------------------------------------- */

.grain {
  position: relative;
  isolation: isolate;
}

.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.24 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Photos ----------------------------------------------------------------- */

.photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-photo);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo--band { aspect-ratio: 3 / 1; }
.photo--pano { aspect-ratio: 21 / 9; }
.photo--wide { aspect-ratio: 16 / 9; }
.photo--land { aspect-ratio: 3 / 2; }
.photo--portrait { aspect-ratio: 4 / 5; }
.photo--square { aspect-ratio: 1; }

@media (max-width: 40rem) {
  .photo--band,
  .photo--pano {
    aspect-ratio: 2 / 1;
  }
}

/* --- Fil d'Ariane ------------------------------------------------------------ */

.breadcrumb {
  padding-block: 1.1rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  font-stretch: 84%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  list-style: none;
  padding: 0;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--terra);
  text-decoration: underline;
}

.breadcrumb li:not(:last-child)::after {
  content: '·';
  margin-left: 0.4em;
  color: var(--copper);
}

.breadcrumb [aria-current] {
  color: var(--ink-soft);
}

/* --- Pied de page ------------------------------------------------------------ */

.site-footer {
  background: var(--navy-ink);
  color: var(--on-navy-mute);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(16rem, 1.2fr) 2fr auto;
  gap: var(--gap);
  align-items: start;
  padding-block: clamp(3rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
}

.site-footer__tagline {
  margin-top: 1.1rem;
  max-width: 24em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 440;
  font-size: 1.05rem;
  line-height: 1.6;
}

.site-footer__tagline::before {
  content: '';
  display: block;
  width: 2.2rem;
  height: 2px;
  margin-bottom: 1rem;
  background: var(--terra-bright);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.75rem;
  justify-content: center;
  padding-top: 0.6rem;
}

.site-footer__nav a {
  font-size: var(--text-sm);
  color: var(--on-navy);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--copper-soft);
  text-decoration: underline;
}

.site-footer__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  padding-top: 0.35rem;
  border-left: 1px solid rgb(243 237 221 / 0.14);
  padding-left: clamp(1.5rem, 3vw, 3rem);
}

.site-footer__note {
  border-top: 1px solid rgb(243 237 221 / 0.14);
  padding-block: 1.4rem;
  text-align: center;
  font-size: var(--text-xs);
}

.site-footer__note .deco {
  width: min(30rem, 70%);
  margin: 0 auto 1.1rem;
  color: var(--copper-soft);
  opacity: 0.7;
}

/* Grain clair pour les strates marines. */

.grain--dark::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.93 0 0 0 0 0.88 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (max-width: 62rem) {
  .site-footer__main {
    grid-template-columns: 1fr;
  }

  .site-footer__nav {
    justify-content: flex-start;
  }

  .site-footer__aside {
    border-left: 0;
    padding-left: 0;
    align-items: flex-start;
  }
}
