/* Allonia — policy pages (mentions légales, confidentialité), from the pertimm.com policy pages:
   document tabs, numbered long-form text with a sticky table of contents, the company plate.
   Components come from base.css; this file only composes them. */
/* ---------------------------------------------------------------- Hero */
.policy-hero { padding-bottom: 0; border-bottom: 0; }
.policy-hero::after {                     /* the hairline the active tab sits on */
  content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--line-2); pointer-events: none;
}
.policy-hero .page-hero__title { max-width: 15ch; }
.policy-hero .page-hero__lead { max-width: 52ch; }

.policy-facts { justify-self: stretch; width: 100%; max-width: 62rem; margin-top: var(--space-2xs); }
.policy-facts dd { overflow-wrap: anywhere; }
.policy-facts a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .22em; }
.policy-facts a:hover { text-decoration-color: var(--fg); }
.policy-facts .badge { margin-top: .1rem; }
.policy-facts .meta-list__row { align-content: start; }
@media (max-width: 639px) {
  .policy-facts { grid-template-columns: 1fr; }
  .policy-facts .meta-list__row { grid-template-columns: 7.25rem minmax(0, 1fr); gap: 1rem; padding: .6rem 0; }
  .policy-facts .meta-list__row:last-child { border-bottom: 1px solid var(--line); }
}


/* Document tabs (navigation between the three policies, not ARIA tabs) */
.policy-tabs { justify-self: stretch; margin-top: var(--space-l); position: relative; z-index: 1; }
.policy-tabs__list { display: flex; gap: .35rem; list-style: none; padding: 0; }
.policy-tab {
  --cut: 10px;
  position: relative; display: inline-flex; align-items: center; gap: .55rem;
  min-height: 3.1rem; padding: .85rem 1.3rem .8rem;
  font-size: var(--step--1); font-weight: 540; line-height: 1.2; color: var(--fg-2); text-decoration: none; white-space: nowrap;
  background: rgb(240 237 247 / .045);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: color var(--dur-1), background-color var(--dur-2) var(--ease-out);
}
.policy-tab::before {                     /* spectral edge: light only on the active document */
  content: ""; position: absolute; left: 0; top: 0; height: 1px; width: calc(100% - var(--cut));
  background: var(--spectrum); box-shadow: 0 0 12px var(--glow);
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur-3) var(--ease-out);
}
.policy-tab:hover { color: var(--fg); background: rgb(240 237 247 / .08); }
.policy-tab:hover::before { transform: scaleX(.35); }
.policy-tab[aria-current="page"] { color: #07102b; background: var(--paper); }
.policy-tab[aria-current="page"]::before { transform: none; box-shadow: none; }
.policy-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -5px; border-radius: 0; }
.policy-tab[aria-current="page"]:focus-visible { outline-color: var(--violet); }
/* When the document opens onto an ink section (privacy "At a glance"), the active tab is cut from
   ink. It must still read as the most prominent tab: the other tabs lose their fill (hairline
   outline only), the active one gets a lit outline, the full spectral edge and covers the hero
   hairline, so it opens into the section below. */
.policy-tabs--ink .policy-tab { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.policy-tabs--ink .policy-tab:hover { background: rgb(240 237 247 / .05); }
.policy-tabs--ink .policy-tab[aria-current="page"] {
  color: var(--fg); background: var(--ink);
  box-shadow: inset 1px 0 0 var(--line-3), inset -1px 0 0 var(--line-3);
}
.policy-tabs--ink .policy-tab[aria-current="page"]::before { height: 2px; box-shadow: 0 0 14px var(--glow), 0 0 3px rgb(240 237 247 / .5); }
.policy-tabs--ink .policy-tab[aria-current="page"]::after {   /* light falling from the edge into the tab */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgb(166 140 255 / .16), transparent 70%);
}
.policy-tabs--ink .policy-tab[aria-current="page"]:focus-visible { outline-color: var(--focus); }
.policy-tab__short { display: none; }
@media (max-width: 719px) {
  .policy-tabs__list { gap: .25rem; }
  .policy-tab { padding-inline: .85rem; min-height: 2.9rem; }
  .policy-tab__long { display: none; }
  .policy-tab__short { display: inline; }
}

/* ---------------------------------------------------------------- Body */
.policy-body { padding-top: clamp(2.5rem, 1.5rem + 4vw, 5.5rem); }
.policy-layout { align-items: start; }
@media (min-width: 1000px) {
  .policy-layout { grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); column-gap: clamp(3rem, 1rem + 5vw, 7.5rem); }
}

/* Table of contents: always visible on desktop, collapsible on small screens */
.policy-toc { --read: 0; }
.policy-toc__summary { display: none; }
.policy-toc .toc__list { position: relative; counter-reset: toc; }
.policy-toc .toc__list li { counter-increment: toc; }
.policy-toc .toc__list a { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); align-items: baseline; padding-block: .42rem; }
.policy-toc .toc__list a::before {
  content: counter(toc, decimal-leading-zero); content: counter(toc, decimal-leading-zero) / "";
  font-size: var(--step--2); font-stretch: 112%; color: var(--fg-3); letter-spacing: .02em;
}
.policy-toc .toc__list a[aria-current="true"]::before { color: var(--accent-text); }
/* the reading beam: light travels down the rail as the document is read */
.policy-toc .toc__list::before {
  content: ""; position: absolute; left: -1px; top: 0; width: 1px; height: 100%; pointer-events: none;
  background: linear-gradient(180deg, #a13fc4, #5b3fd6 55%, #1f6fb2);
  transform-origin: top; transform: scaleY(var(--read));
}
.policy-toc .toc__list::after {
  content: ""; position: absolute; left: -4px; top: calc(var(--read) * 100%); width: 7px; height: 8px; pointer-events: none;
  clip-path: var(--hex); background: var(--violet); translate: 0 -50%;
  opacity: clamp(0, calc(var(--read) * 40), 1);
  box-shadow: 0 0 0 4px rgb(91 63 214 / .18);
}
.policy-toc__related { margin-top: var(--space-l); padding-top: var(--space-m); border-top: 1px solid var(--line); }
.policy-toc__related .toc__title { margin-bottom: .35rem; }
.policy-toc__related ul { display: grid; gap: .1rem; }
.policy-toc__related a { display: inline-flex; align-items: center; gap: .4rem; min-height: 2rem; color: var(--fg-2); text-decoration: none; }
.policy-toc__related a:hover { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); }
.policy-toc__related svg { width: .85em; height: .85em; flex: none; }

@media (max-width: 999px) {
  .policy-toc { padding: 0; }
  .policy-toc > .toc__title, .policy-toc__related { display: none; }
  .policy-toc__summary {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 3.25rem; padding: .8rem 1.1rem; cursor: pointer; list-style: none;
    color: var(--fg); font-weight: 560;
  }
  .policy-toc__summary::-webkit-details-marker { display: none; }
  .policy-toc__summary::after {
    content: ""; flex: none; width: .55rem; height: .55rem; margin-right: .2rem;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: translateY(-25%) rotate(45deg); transition: transform var(--dur-2) var(--ease-out);
  }
  .policy-toc__details[open] > .policy-toc__summary::after { transform: translateY(20%) rotate(-135deg); }
  .policy-toc__summary:focus-visible { outline-offset: -3px; }
  .policy-toc__count { margin-left: auto; color: var(--fg-3); font-weight: 450; font-size: var(--step--1); }
  .policy-toc__details .toc__list { margin: 0 1.1rem 1rem; }
  .policy-toc .toc__list::before, .policy-toc .toc__list::after { display: none; }
}

/* ---------------------------------------------------------------- Hero visual (≥900px)
   The shared shell of the three panels (legal.css); each document fills it with its own content
   (legal: .legal-index below; privacy.css: .privacy-zero; accessibility.css: .a11y-visual).
   Decorative (aria-hidden): the same facts are in the document. */
@media (min-width: 900px) {
  .policy-hero.page-hero--visual .page-hero__inner > .policy-tabs { grid-column: 1 / -1; margin-top: var(--space-l); }
  /* the text column is narrower: size the three facts to their content (the long registered
     name / standard in the middle stays on one line) */
  .policy-hero.page-hero--visual .policy-facts { grid-template-columns: repeat(3, auto); }
}
/* 900–1199px: the text column is too narrow for three facts side by side (the registered name
   would break over three lines, the email address mid-word): list them as labelled rows */
@media (min-width: 900px) and (max-width: 1199px) {
  .policy-hero.page-hero--visual .policy-facts { grid-template-columns: 1fr; }
  .policy-hero.page-hero--visual .policy-facts .meta-list__row { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding: .55rem 0; }
  .policy-hero.page-hero--visual .policy-facts .meta-list__row:last-child { border-bottom: 1px solid var(--line); }
  .policy-hero.page-hero--visual .policy-facts dd { overflow-wrap: normal; }
}
/* below 900px the visual is hidden (--desktop), so the light keeps its mark (base.css hides the
   mark on every .page-hero--visual; candidate for base.css: only when the visual is shown) */
@media (max-width: 899px) {
  .policy-hero.page-hero--visual .prism-lite__mark { display: block; }
}
.policy-visual { align-content: stretch; gap: var(--space-s); color: var(--fg-2); font-size: var(--step--1); }
.policy-visual__head, .policy-visual__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1.25rem;
  margin: 0; font-size: var(--step--2); line-height: 1.4; letter-spacing: .02em; color: var(--fg-3);
}
.policy-visual__head > :first-child { color: var(--fg-2); }
.policy-visual__foot { padding-top: .85rem; border-top: 1px solid rgb(240 237 247 / .12); }
.policy-visual__foot > span:first-child { color: var(--fg-2); letter-spacing: .06em; }

/* Legal: typographic index of the document (mouse shortcut to the sections; keyboard and
   screen-reader users have the table of contents, so the links are out of the tab order) */
.legal-index { grid-template-rows: auto minmax(0, 1fr) auto; }
.legal-index__list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
  column-gap: clamp(.9rem, .2rem + 1.2vw, 1.75rem); list-style: none; margin: 0; padding: 0;
}
.legal-index__list li { min-height: 0; }
.legal-index__list a {
  position: relative; display: grid; align-content: start; gap: .3rem; height: 100%; padding-block: .6rem .35rem;
  border-top: 1px solid rgb(240 237 247 / .1); color: var(--fg-2); text-decoration: none;
}
.legal-index__list a::before {             /* the hairline lights up under the pointer */
  content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px;
  background: var(--spectrum); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-3) var(--ease-out);
}
.legal-index__num {
  width: fit-content; font-size: clamp(1.5rem, .3rem + 2.1vw, 2.55rem); font-weight: 250; font-stretch: 118%; line-height: 1; letter-spacing: -.02em;
  background: var(--text-spectrum); -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: filter var(--dur-2);
}
.legal-index__name { font-size: var(--step--1); line-height: 1.3; transition: color var(--dur-1); }
.legal-index__list a:hover .legal-index__name { color: var(--fg); }
.legal-index__list a:hover .legal-index__num { filter: drop-shadow(0 0 14px rgb(166 140 255 / .55)); }
.legal-index__list a:hover::before { transform: none; }
@media (max-width: 1199px) { .legal-index__name { font-size: var(--step--2); } }   /* two-line names keep clear of the next row */

/* Long-form text */
.policy-prose { counter-reset: sec; max-width: 72ch; }
.policy-prose > h2 { counter-increment: sec; padding-top: 1.35rem; border-top: 1px solid var(--line); margin-top: 2.1em; }
.policy-prose > h2::before {
  content: counter(sec, decimal-leading-zero); content: counter(sec, decimal-leading-zero) / "";
  display: block; width: fit-content; margin-bottom: .7rem;
  font-size: var(--step--1); font-weight: 400; font-stretch: 118%; letter-spacing: .04em; line-height: 1;
  background: var(--text-spectrum); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.policy-prose > .policy-meta + h2 { margin-top: 1.6rem; }
.policy-prose h3 { font-size: var(--step-1); letter-spacing: -.012em; }
.policy-prose ul li::marker { color: var(--accent); }
.policy-prose .meta-list { margin-top: 1.1em; }
.policy-prose .meta-list dd { overflow-wrap: anywhere; }
.policy-prose address { font-style: normal; }
.policy-prose .table-scroll { margin-top: 1.4em; }

/* Last-updated line + print */
.policy-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  font-size: var(--step--1); color: var(--fg-3);
}
.policy-meta p { display: inline-flex; align-items: center; gap: .55rem; }
.policy-meta p svg { width: 1rem; height: 1rem; color: var(--accent); }
.policy-meta time { color: var(--fg); font-weight: 540; }
.policy-print { font-size: var(--step--1); min-height: 2.25rem; }

/* Key-point callout inside the prose */
.policy-note {
  position: relative; padding: 1.1rem 1.25rem 1.1rem 1.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--fg-2);
}
.policy-note::before { content: ""; position: absolute; left: -1px; top: 1rem; bottom: 1rem; width: 2px; background: var(--spectrum-deep); }
.policy-note strong { color: var(--fg); }

/* Responsive tables: rows become labelled blocks on small screens */
.policy-table th[scope="row"] { color: var(--fg); font-weight: 560; }
.policy-table td, .policy-table th { font-size: var(--step--1); line-height: 1.55; }
.policy-table thead th { font-size: var(--step--2); color: var(--fg-3); font-weight: 540; letter-spacing: .02em; border-bottom-color: var(--line-2); }
.policy-table .nowrap { white-space: nowrap; }
@media (max-width: 719px) {
  .policy-table, .policy-table tbody, .policy-table tr, .policy-table th, .policy-table td { display: block; width: 100%; }
  .policy-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .policy-table tr { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .policy-table th, .policy-table td { padding: .2rem 0; border: 0; }
  .policy-table th[scope="row"] { font-size: var(--step-0); margin-bottom: .35rem; }
  .policy-table td[data-label]::before { content: attr(data-label) ": "; color: var(--fg-3); font-weight: 540; }
  .policy-table:lang(fr) td[data-label]::before { content: attr(data-label) "\a0: "; }
}

/* ---------------------------------------------------------------- Legal: company plate (signature) */
.id-plate { display: grid; gap: var(--space-m); margin-top: 1.6em !important; }
.id-plate__head { display: grid; gap: .55rem; }
.id-plate__name { font-size: var(--step-3); line-height: 1.02; letter-spacing: -.02em; font-weight: 560; font-stretch: 112%; color: var(--fg); overflow-wrap: anywhere; }
.id-plate__form { color: var(--fg-2); }
.id-plate__siren { display: grid; gap: .5rem; padding-block: var(--space-m); border-block: 1px solid var(--line-2); }
.id-plate__label { font-size: var(--step--1); color: var(--fg-3); }
.id-plate__row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.id-plate__num {
  font-size: clamp(2.3rem, 1.4rem + 3vw, 3.9rem); font-weight: 250; font-stretch: 118%; line-height: .95; letter-spacing: -.035em;
  background: var(--text-spectrum); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.id-plate__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); column-gap: 1.75rem; margin: 0; }
.id-plate__cell { display: grid; gap: .2rem; align-content: start; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.id-plate__cell dt { font-size: var(--step--1); color: var(--fg-3); }
.id-plate__cell dd { color: var(--fg); margin: 0; overflow-wrap: anywhere; }
.id-plate__cell dd .copy { margin-top: .4rem; }
.id-plate__cell--inline dd { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; }
.id-plate__cell--inline dd .copy { margin-top: 0; }
.id-plate a { color: var(--fg); }
.id-plate .copy { min-height: 2.25rem; padding-block: .25rem; }

/* ---------------------------------------------------------------- CTA band aside */
.policy-cta .cta-band__title { max-width: 16ch; }
.policy-cta .contact-line__value { font-size: var(--step-1); }

/* ---------------------------------------------------------------- Print: the document only */
@media print {
  .policy-tabs, .policy-toc, .policy-print, .policy-cta, .policy-hero::after, .breadcrumb { display: none !important; }
  .policy-hero { padding-top: 0 !important; }
  .prose-layout { display: block !important; }
  .policy-prose { max-width: none; }
  .policy-prose a[href^="http"]::after, .policy-prose a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  .slab { box-shadow: none; border: 1px solid #999; }
  .id-plate__num { color: #000 !important; background: none !important; }
}
