/*
 * apple.css — style « Apple » pour les nouvelles pages (territoires + 404).
 * Chargé APRÈS site.css, uniquement sur ces pages (body.apple).
 * Portée : <main> seulement — en-tête et pied de page restent ceux du site.
 * Principes (skill apple-design) : police système, tracking/leading selon la taille,
 * retour au pointer-down, pas de mouvement superflu, prefers-* respectés.
 */

.apple {
  --a-text: #1d1d1f;
  --a-text-2: #515154;
  --a-text-3: #6e6e73;
  --a-fill: #f5f5f7;
  --a-hair: #d2d2d7;
  --a-link: #0058c4;
  --a-radius: 1.125rem;
  --a-ease: cubic-bezier(.25, .1, .25, 1);
  --a-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --a-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base typographique (corps 17 px, interlignage confortable) ---------- */
.apple main {
  color: var(--a-text-2);
  font-family: var(--a-font);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -.003em;
}

.apple main h1,
.apple main h2,
.apple main h3,
.apple main summary,
.apple main strong,
.apple main .button {
  font-family: var(--a-font-display);
}

.apple main a:not(.button) {
  color: var(--a-link);
  text-decoration: none;
}

.apple main a:not(.button):hover {
  text-decoration: underline;
  text-underline-offset: .18em;
}

.apple main :focus-visible {
  outline: 3px solid rgba(0, 113, 227, .55);
  outline-offset: 3px;
  border-radius: .375rem;
}

/* ---------- Bandeau du haut ---------- */
.apple .page-hero {
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 6.5rem);
  text-align: center;
  background: linear-gradient(180deg, var(--blue-deep) 0%, var(--blue) 100%);
}

.apple .page-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.apple .breadcrumbs {
  justify-content: center;
  margin-bottom: 1.75rem;
  color: rgba(255, 255, 255, .72);
  font-size: .8125rem;
  letter-spacing: 0;
}

.apple main .breadcrumbs a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.apple .page-hero .eyebrow {
  margin-bottom: .875rem;
  color: rgba(255, 255, 255, .8);
  font-family: var(--a-font);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-transform: none;
}

.apple .page-hero .eyebrow::before {
  display: none;
}

/* Grand titre : interlignage serré, interlettrage négatif */
.apple .page-hero h1 {
  max-width: 18ch;
  margin-bottom: 1.25rem;
  color: #fff;
  font-size: clamp(2.375rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.028em;
}

.apple .page-hero .lead {
  max-width: 40ch;
  margin-inline: auto;
  color: var(--yellow);
  font-size: clamp(1.1875rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: -.012em;
  text-align: center;
}

.apple .page-hero .button-row {
  justify-content: center;
  margin-top: 2.25rem;
}

/* ---------- Boutons pilule : retour immédiat à l'appui ---------- */
.apple main .button {
  min-height: 2.875rem;
  padding: .75rem 1.5rem;
  border: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.01em;
  box-shadow: none;
  transition: background-color 200ms var(--a-ease), transform 100ms ease-out;
}

.apple main .button:hover {
  transform: none;
  box-shadow: none;
}

.apple main .button:active {
  transform: scale(.97);
}

/* ---------- Corps de page ---------- */
.apple .territory-content,
.apple main .legal {
  max-width: 47.5rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.apple .territory-content h2,
.apple main .legal h2 {
  margin: clamp(3.5rem, 7vw, 5rem) 0 1.25rem;
  color: var(--a-text);
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.022em;
}

.apple .territory-content > h2:first-child,
.apple main .legal > h2:first-child {
  margin-top: 0;
}

.apple .territory-content p {
  text-align: left;
}

/* Tuiles : fonds, plateformes, points de vigilance */
.apple .tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.apple .tiles li {
  margin: 0;
  padding: 1.375rem 1.5rem 1.5rem;
  border-radius: var(--a-radius);
  background: var(--a-fill);
}

.apple .tiles strong {
  display: block;
  margin-bottom: .375rem;
  color: var(--a-text);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.016em;
}

.apple .tiles span {
  display: block;
  color: var(--a-text-3);
  font-size: .9375rem;
  line-height: 1.47;
  letter-spacing: -.005em;
}

/* Phrases séparées par un filet fin : « qui gère les fonds » */
.apple .rules {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--a-hair);
}

.apple .rules li {
  margin: 0;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--a-hair);
}

.apple .rules strong {
  color: var(--a-text);
  font-weight: 600;
}

/* Étapes numérotées */
.apple .steps {
  margin: 1.75rem 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.apple .steps li {
  position: relative;
  margin: 0;
  padding: .875rem 0 .875rem 3.25rem;
  counter-increment: step;
}

.apple .steps li::before {
  position: absolute;
  top: .75rem;
  left: 0;
  display: grid;
  width: 2.125rem;
  height: 2.125rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  content: counter(step);
  font-family: var(--a-font-display);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1;
}

/* FAQ : accordéon épuré */
.apple .faq-list {
  display: block;
  margin-top: 1.5rem;
  border-top: 1px solid var(--a-hair);
}

.apple .faq-item {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--a-hair);
  border-radius: 0;
  background: none;
}

.apple .faq-item summary {
  position: relative;
  padding: 1.375rem 2.75rem 1.375rem 0;
  color: var(--a-text);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.016em;
  list-style: none;
  cursor: pointer;
}

.apple .faq-item summary::-webkit-details-marker {
  display: none;
}

.apple .faq-item summary::after {
  position: absolute;
  top: 50%;
  right: .25rem;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: -.75rem;
  color: var(--a-text-3);
  content: "+";
  font-size: 1.625rem;
  font-weight: 300;
  line-height: 1.5rem;
  text-align: center;
  transition: transform 250ms var(--a-ease);
}

.apple .faq-item[open] summary::after {
  transform: rotate(45deg);
}

.apple .faq-item p {
  margin: 0;
  padding: 0 2.75rem 1.5rem 0;
  color: var(--a-text-2);
}

.apple .territory-links {
  margin-top: 3rem;
  color: var(--a-text-3);
  font-size: .9375rem;
  text-align: center;
}

/* Bandeau final */
.apple .territories {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--a-fill);
}

.apple .territories__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  text-align: center;
}

.apple .territories h2 {
  margin: 0;
  color: var(--a-text);
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.022em;
}

/* Page 404 : liens en pastilles */
.apple main .legal {
  text-align: center;
}

.apple .pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apple .pills a:not(.button) {
  display: inline-block;
  padding: .625rem 1.125rem;
  border-radius: 999px;
  color: var(--a-text);
  background: var(--a-fill);
  font-size: .9375rem;
  font-weight: 500;
  transition: background-color 200ms var(--a-ease), transform 100ms ease-out;
}

.apple .pills a:not(.button):hover {
  background: #e8e8ed;
  text-decoration: none;
}

.apple .pills a:not(.button):active {
  transform: scale(.97);
}

/* ---------- Accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  .apple main .button,
  .apple .pills a,
  .apple .faq-item summary::after {
    transition: none;
  }

  .apple main .button:active,
  .apple .pills a:active {
    transform: none;
    opacity: .8;
  }
}

@media (prefers-contrast: more) {
  .apple {
    --a-text-2: #1d1d1f;
    --a-text-3: #3a3a3c;
    --a-hair: #8e8e93;
  }

  .apple .tiles li,
  .apple .pills a:not(.button) {
    border: 1px solid #8e8e93;
  }
}

@media (max-width: 700px) {
  .apple .territory-content,
  .apple main .legal {
    padding-top: 3rem;
  }

  .apple .faq-item p {
    padding-right: 0;
  }
}

/* Sources officielles citées en bas des pages territoire */
.apple .territory-sources {
  margin-top: 2.5rem;
  color: var(--a-text-3);
  font-size: .875rem;
  line-height: 1.55;
}

/* Accessibilité (05/12/2026) : les liens placés dans un paragraphe sont soulignés, pour ne pas dépendre de la seule couleur (WCAG 1.4.1) */
.apple main p a:not(.button),
.apple .tiles span a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
