/* Cookie consent (js/consent.js): the banner, the settings dialog, and the cookie table on the privacy page.
   Colours come from the skin's tokens, so light, dark and the theme switch all work; the buttons invert the page
   colours (ink on background), which keeps their contrast in both themes. Accept and Reject are styled alike on purpose. */

.ols-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001;       /* above the chat widget's button (1999) */
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  max-width: 1120px; margin: 0 auto 1rem; padding: 1.1rem 1.4rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 44px rgba(0, 0, 0, .28);
  font-family: 'Montserrat', sans-serif;
}
.ols-consent[hidden] { display: none; }
.ols-consent-text { flex: 1 1 36rem; min-width: 0; }
.ols-consent-title { display: block; font-size: .95rem; font-weight: 800; margin-bottom: .3rem; }
.ols-consent p { margin: 0; font-size: .82rem; line-height: 1.6; color: var(--ink2); }
.ols-consent a, .ols-consent-dialog a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ols-consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.ols-btn {
  font: 800 .74rem/1 'Montserrat', sans-serif; letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
  padding: .8rem 1.3rem; border-radius: 4px; border: 2px solid var(--ink); background: var(--ink); color: var(--bg);
  transition: transform .15s, opacity .15s;
}
.ols-btn:hover { transform: translateY(-1px); opacity: .92; }
.ols-link {
  font: 700 .78rem/1 'Montserrat', sans-serif; cursor: pointer; padding: .8rem .5rem; background: none; border: 0;
  color: var(--link); text-decoration: underline; text-underline-offset: 3px;
}
.ols-btn:focus-visible, .ols-link:focus-visible, .ols-close:focus-visible, .ols-switch:focus-visible {
  outline: 3px solid var(--link); outline-offset: 2px;
}

.ols-consent-dialog {
  /* the site's reset zeroes margins, which would pin a modal dialog to the top left: centre it again */
  position: fixed; inset: 0; margin: auto; height: fit-content;
  width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; padding: 0;
  background: var(--bg); color: var(--ink); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4); font-family: 'Montserrat', sans-serif;
}
.ols-consent-dialog::backdrop { background: rgba(5, 15, 30, .62); }
.ols-dialog-body { padding: 1.4rem 1.6rem 1.5rem; margin: 0; }
.ols-dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ols-dialog-top h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.ols-close { font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--ink2); cursor: pointer; padding: .2rem .5rem; }
.ols-dialog-lede { margin: .7rem 0 1.1rem; font-size: .82rem; line-height: 1.6; color: var(--ink2); }
.ols-dialog-lede code { font-size: .78rem; }
.ols-cat { border-top: 1px solid var(--border); padding: .95rem 0; }
.ols-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ols-cat-head label { font-size: .88rem; font-weight: 800; }
.ols-cat p { margin: .4rem 0 0; font-size: .78rem; line-height: 1.6; color: var(--ink2); }
.ols-switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 2.6rem; height: 1.45rem; margin: 0; cursor: pointer;
  border-radius: 999px; background: var(--ink2); opacity: .55; transition: background .15s, opacity .15s;
}
.ols-switch::after {
  content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--bg); transition: transform .15s;
}
.ols-switch:checked { background: var(--link); opacity: 1; }
.ols-switch:checked::after { transform: translateX(1.15rem); }
.ols-switch:disabled { cursor: not-allowed; opacity: .45; }
.ols-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; border-top: 1px solid var(--border); padding-top: 1.1rem; }
.ols-btn-main { background: var(--link); border-color: var(--link); color: var(--bg); }

@media (max-width: 640px) {
  .ols-consent { margin: 0; border-radius: 12px 12px 0 0; padding: 1rem 1.1rem 1.1rem; }
  .ols-consent-actions { width: 100%; }
  .ols-consent-actions .ols-btn { flex: 1 1 8rem; text-align: center; }
  .ols-consent-actions .ols-link { flex: 1 1 100%; text-align: center; padding: .4rem; }
  .ols-dialog-actions .ols-btn { flex: 1 1 8rem; }
}
@media (prefers-reduced-motion: reduce) { .ols-btn, .ols-switch, .ols-switch::after { transition: none; } .ols-btn:hover { transform: none; } }

/* The cookie table on the privacy page */
.cookie-table { width: 100%; border-collapse: collapse; font-size: .84rem; margin: 1.2rem 0 .4rem; }
.cookie-table th, .cookie-table td { text-align: left; vertical-align: top; padding: .65rem .8rem; border-bottom: 1px solid var(--border); }
.cookie-table th { font-family: 'Montserrat', sans-serif; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.cookie-table code { font-size: .8rem; }
@media (max-width: 640px) { .cookie-wrap { overflow-x: auto; } .cookie-table { min-width: 560px; } }
