/**
 * Cookies page ("Zásady používania súborov cookie (EÚ)") — design layer.
 *
 * The page wears the legal shell (pages/legal.css) but its body is not editor
 * copy: Complianz renders the whole statement itself as #cmplz-document, and
 * ships its own stylesheet (complianz-gdpr/assets/css/document.css) written with
 * ID selectors and its own greys. This file is the only place the two meet — it
 * retints the plugin's markup to the design tokens without touching the plugin,
 * so a Complianz resync or update keeps rendering correctly.
 *
 * Everything is scoped under .legal-doc__body #cmplz-document, which outranks the
 * plugin's #cmplz-document rules by one class and needs no !important.
 * Structure is left alone (the cookie tables are the plugin's CSS grid, not a
 * <table>, so js/legal.js has nothing to wrap and is not enqueued here).
 */

/* ---- Document root ------------------------------------------------------- */
/* The plugin caps itself at 800px and drops to 14px; inside the .legal-doc card
   the card is already the measure and the legal body is already the type scale. */
.legal-doc__body #cmplz-document {
  max-width: none;
  margin: 0;
  font-size: inherit;
  color: inherit;
}
.legal-doc__body #cmplz-document > :first-child { margin-top: 0; }
.legal-doc__body #cmplz-document > :last-child { margin-bottom: 0; }

.legal-doc__body #cmplz-document p,
.legal-doc__body #cmplz-document li,
.legal-doc__body #cmplz-document td {
  font-size: inherit;
  margin-top: 0;
}
.legal-doc__body #cmplz-document p { margin-bottom: var(--space-4); }

/* ---- Headings — same rhythm as the other legal documents ----------------- */
.legal-doc__body #cmplz-document h2 {
  margin: var(--space-7) 0 var(--space-4);
  padding: var(--space-6) 0 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}
.legal-doc__body #cmplz-document h3 {
  margin: var(--space-6) 0 var(--space-3);
  padding: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  text-transform: none;
}
.legal-doc__body #cmplz-document h4 {
  margin: var(--space-4) 0 var(--space-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  text-transform: none;
}
.legal-doc__body #cmplz-document h5 {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: left;
  text-transform: uppercase;
}

/* ---- Links --------------------------------------------------------------- */
/* The plugin appends a base64 "external link" pixel after every target=_blank
   link and paints a black border on focus — neither belongs to this design. */
.legal-doc__body #cmplz-document a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-doc__body #cmplz-document a[target="_blank"]::after { content: none; margin: 0; }
.legal-doc__body #cmplz-document a:focus {
  border: 0;
  padding: 0;
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---- Lists — the site's eco-leaf bullet ---------------------------------- */
/* legal.css already draws the leaf; the plugin re-asserts disc + margin-left in
   longhand, which is all that has to be taken back. */
.legal-doc__body #cmplz-document ul {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding-left: 0;
}

/* ---- Service cards (<details class="cmplz-dropdown">) -------------------- */
/* One card per service, in the same shell language as the rest of the site:
   hairline border, card radius, teal-50 header. */
.legal-doc__body #cmplz-document #cmplz-cookies-overview { margin-bottom: var(--space-4); }

.legal-doc__body #cmplz-document .cmplz-dropdown {
  margin: 0 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg);
  overflow: hidden;
}
.legal-doc__body #cmplz-document .cmplz-dropdown[open] { padding-bottom: 0; }

.legal-doc__body #cmplz-document .cmplz-dropdown summary {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background-color: var(--teal-50);
  cursor: pointer;
}
.legal-doc__body #cmplz-document .cmplz-dropdown summary:hover { background-color: var(--line-soft); }
.legal-doc__body #cmplz-document .cmplz-dropdown summary h3 {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.legal-doc__body #cmplz-document .cmplz-dropdown summary p {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

/* Body of an opened card. */
.legal-doc__body #cmplz-document .cmplz-dropdown .cmplz-service-description,
.legal-doc__body #cmplz-document .cmplz-dropdown .cmplz-sharing-data {
  padding: var(--space-4);
}
.legal-doc__body #cmplz-document .cmplz-dropdown p,
.legal-doc__body #cmplz-document .cmplz-dropdown h4,
.legal-doc__body #cmplz-document .cmplz-dropdown ul {
  padding-left: 0;
  padding-right: 0;
}
.legal-doc__body #cmplz-document .cmplz-dropdown .cmplz-service-description p,
.legal-doc__body #cmplz-document .cmplz-dropdown .cmplz-sharing-data p {
  margin-bottom: 0;
  font-size: 14.5px;
}
.legal-doc__body #cmplz-document .cmplz-dropdown .cmplz-service-description h4,
.legal-doc__body #cmplz-document .cmplz-dropdown .cmplz-sharing-data h4 { margin-top: 0; }

/* ---- Cookie table (plugin CSS grid, not a <table>) ----------------------- */
/* The grid template stays the plugin's — only the paint changes, so the same
   look as the legal pages' tables comes out: teal-50 head, hairline grid. */
.legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose {
  margin: 0 var(--space-4) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--line);
  overflow: hidden;
  font-size: 14px;
}
.legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div {
  padding: var(--space-3);
  background-color: var(--bg);
  color: var(--ink-soft);
}
.legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .purpose {
  background-color: var(--teal-50);
}
.legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .purpose h4 {
  margin: 0;
  font-size: 14px;
}
.legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .name a { font-weight: 600; }

@media only screen and (min-width: 600px) {
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .name-header,
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .retention-header,
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .function-header {
    background-color: var(--teal-50);
  }
}
@media only screen and (max-width: 600px) {
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose {
    margin-left: var(--space-3);
    margin-right: var(--space-3);
  }
  /* Below 600px the plugin turns the table into label/value rows and zebra-stripes
     whole cookies (nth-child(12n+2…7)). Same rule, one paint instead: the label
     column is tinted and the values stay white, so the phone reads like the
     desktop head row rather than like alternating blocks. */
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div:nth-child(12n+2),
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div:nth-child(12n+3),
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div:nth-child(12n+4),
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div:nth-child(12n+5),
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div:nth-child(12n+6),
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose div:nth-child(12n+7) {
    background-color: var(--bg);
  }
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .name-header,
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .retention-header,
  .legal-doc__body #cmplz-document .cmplz-dropdown .cookies-per-purpose .function-header {
    background-color: var(--teal-50);
  }
}

/* ---- "Spravujte svoje nastavenia súhlasu" (section 7.1) ------------------ */
/* Hidden by the plugin until its JS fills it; only the filled state is styled. */
.legal-doc__body #cmplz-document #cmplz-manage-consent-container-nojavascript {
  margin-bottom: var(--space-4);
  color: var(--muted);
  font-size: 14px;
}
.legal-doc__body #cmplz-document #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories {
  margin-top: var(--space-3);
}
.legal-doc__body #cmplz-document #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg);
  overflow: hidden;
}
.legal-doc__body #cmplz-document #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category:not(:last-child) {
  margin-bottom: var(--space-3);
}
.legal-doc__body #cmplz-document #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header {
  padding: var(--space-3) var(--space-4);
  background-color: var(--teal-50);
}
.legal-doc__body #cmplz-document #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header h2 {
  margin: 0;
  padding: 0;
  border-top: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.legal-doc__body #cmplz-document #cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-description {
  padding: var(--space-4);
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 700px) {
  .legal-doc__body #cmplz-document h2 { font-size: 18px; }
  /* The service name and its category stack instead of fighting over one row. */
  .legal-doc__body #cmplz-document .cmplz-dropdown summary p { text-align: left; }
}
