/*
 * The <style> of client/src/pages/privacy-policy.astro, every selector prefixed with the page body class (plan §8.3).
 * Layout: below 75em the table of contents is a box above the text; above it a sticky sidebar next to the text
 * (hairline + turquoise markers), so the reader of the ~30 000 px long text sees where they are and can jump.
 * The body text is 64ch (~75 characters per line): the global .prose 72ch is a long line for legal text.
 */
.page-privacy-policy .pp__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

/* min-width: 0 – as a grid item the wide table must not stretch the column; the .table-scroll scrolls. */
.page-privacy-policy .pp__body,
.page-privacy-policy .pp__toc {
  min-width: 0;
  max-width: 64ch;
}

.page-privacy-policy .pp__body > :first-child {
  margin-top: 0;
}

/* Table of contents: hairline box, one column (with 7 items a two-column grid mixed up the chapter order and the
   uneven line heights left holes). */
.page-privacy-policy .pp__toc {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-mist);
}

.page-privacy-policy .pp__toc-title {
  margin: 0 0 var(--space-3);
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: var(--fs-1);
  color: var(--c-text);
}

.page-privacy-policy .pp__toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem 2rem;
}

@media (min-width: 40em) {
  .page-privacy-policy .pp__toc {
    padding: var(--space-5) var(--space-6);
  }
}

.page-privacy-policy .pp__toc li {
  position: relative;
  padding-left: 1.1rem;
  font-size: var(--fs-1);
  line-height: 1.45;
}

.page-privacy-policy .pp__toc li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.5rem;
  height: 2px;
  background: var(--c-turq);
}

.page-privacy-policy .pp__toc a {
  text-decoration: none;
}

.page-privacy-policy .pp__toc a:hover {
  text-decoration: underline;
}

@media (min-width: 75em) {
  .page-privacy-policy .pp__layout {
    --container: 72rem;
    grid-template-columns: 15rem minmax(0, 64ch);
    column-gap: var(--space-8);
    align-items: start;
  }

  .page-privacy-policy .pp__toc {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    max-height: calc(100vh - var(--header-h) - 3rem);
    overflow-y: auto;
    max-width: none;
    padding: 0.25rem 0 0.25rem var(--space-4);
    border: 0;
    border-left: 1px solid var(--c-line);
    border-radius: 0;
    background: transparent;
  }

  .page-privacy-policy .pp__toc ol {
    gap: 0.6rem;
  }

  .page-privacy-policy .pp__toc li {
    font-size: 0.9375rem;
    line-height: 1.4;
  }

  /* The chapter being read (js/privacy-toc.js marks it with aria-current). */
  .page-privacy-policy .pp__toc a[aria-current] {
    color: var(--c-text);
    font-weight: 700;
  }

  .page-privacy-policy .pp__toc li:has(a[aria-current])::before {
    width: 0.75rem;
  }
}

/* Chapter headings: a hairline separates them; the introduction has none. */
.page-privacy-policy .pp__chapter {
  padding-top: var(--space-6);
  border-top: 1px solid var(--c-line);
}

/* On narrow screens the global h2 { hyphens: auto } split the chapter titles ("Adatfeldol-gozók"); a title needs no
   hyphenation, overflow-wrap: anywhere keeps it from overflowing. */
.page-privacy-policy .pp h2 {
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* The h4 titles of 3.1/3.2 and of the data subject rights: one step above the h5 and the body text. */
.page-privacy-policy .pp h4 {
  font-size: var(--fs-2);
}

/* The 3.2.x sub-points of chapter IV – .prose does not style h5. */
.page-privacy-policy .pp h5 {
  font-family: var(--ff-body);
  font-size: var(--fs-1);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: 0;
  margin: 1.25rem 0 0.5em;
  color: inherit;
}

/* Data sheets in the running text. */
.page-privacy-policy .pp__datalist {
  margin: var(--space-4) 0 var(--space-5);
}

/* In a one-column data sheet a label–value pair stays together, with air between the pairs. */
@media (max-width: 39.99em) {
  .page-privacy-policy .pp__datalist {
    row-gap: 0.15rem;
  }

  .page-privacy-policy .pp__datalist dd + dt {
    margin-top: var(--space-4);
  }
}

/* Tables: on a narrow screen the .table-scroll scrolls instead of squeezing the cells; in the 64ch column (~37rem)
   it still fits without scrolling. */
.page-privacy-policy .pp__table {
  min-width: 36rem;
}

.page-privacy-policy .pp__table code {
  white-space: nowrap;
}

/* Lettered sub-points – the "a)" style the legal text uses. */
.page-privacy-policy .pp__alpha {
  list-style: lower-alpha;
  padding-left: 2rem;
}

.page-privacy-policy .pp__alpha > li {
  padding-left: 0.35rem;
}

.page-privacy-policy .pp__alpha > li::marker {
  content: counter(list-item, lower-alpha) ') ';
  color: var(--c-text-2);
}

/* The short list of the data subject rights jumps to the detailed points. */
.page-privacy-policy .pp__rights a {
  text-decoration: none;
}

.page-privacy-policy .pp__rights a:hover {
  text-decoration: underline;
}

/* "A részletes szabályokat a Rendelet … cikke tartalmazza." – a quieter reference. */
.page-privacy-policy .pp__ref {
  font-size: 0.9375rem;
  color: var(--c-text-2);
}

.page-privacy-policy .pp code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-s);
  background: var(--c-mist);
  border: 1px solid var(--c-line);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
