/* ==========================================================================
   Cookie banner / notice / settings dialog + footer "Cookie settings" (2026-09-16)

   Ported value for value from the main site's
   frontend-src/src/components/CookieConsent/CookieConsent.module.css
   (class names prefixed ac-cc-). Markup: inc/ac-tracking.php. Behaviour:
   assets/js/ac-tracking.js.

   Accepted difference, as everywhere else in this theme: the font family. The
   blog cannot load Nexa, so the theme's Instrument Sans is used.

   Everything here is position:fixed and starts [hidden], so it never moves page
   content (no layout shift). Sizes are px, as on the main site.
   ========================================================================== */

.ac-cc-banner[hidden],
.ac-cc-backdrop[hidden] {
  display: none !important;
}

.ac-cc-banner,
.ac-cc-dialog {
  --ac-cc-font: var(--font-secondary, "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
  font-family: var(--ac-cc-font);
  -webkit-font-smoothing: antialiased;
}

.ac-cc-banner {
  position: fixed;
  z-index: 1050;
  left: 24px;
  bottom: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #edf6ff 0%, #ffffff 55%);
  border: 1px solid rgba(13, 80, 181, 0.12);
  box-shadow: 0 18px 48px rgba(14, 20, 23, 0.16);
  color: #14171a;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  animation: ac-cc-rise 0.35s ease-out both;
}

.ac-cc-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 380px;
  padding: 16px 16px 14px;
}

.ac-cc-notice-body {
  flex: 1;
  min-width: 0;
}

@keyframes ac-cc-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.ac-cc-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ac-cc-art {
  flex: none;
  display: inline-block;
  width: 52px;
  height: 52px;
}

.ac-cc-art svg {
  display: block;
}

.ac-cc-art-small {
  width: 40px;
  height: 40px;
}

.ac-cc-banner .ac-cc-title,
.ac-cc-banner .ac-cc-notice-title,
.ac-cc-dialog .ac-cc-dialog-title {
  margin: 0;
  font-family: var(--ac-cc-font);
  font-weight: 700;
  color: #14171a;
  letter-spacing: -0.01em;
  text-transform: none;
}

.ac-cc-banner .ac-cc-title {
  font-size: 20px;
  line-height: 1.2;
}

.ac-cc-banner .ac-cc-notice-title {
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 4px;
}

.ac-cc-banner .ac-cc-text {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: #33383d;
}

.ac-cc-notice .ac-cc-text {
  font-size: 14px;
  margin-bottom: 12px;
}

.ac-cc-banner .ac-cc-inline-link,
.ac-cc-dialog .ac-cc-inline-link {
  color: #0d50b5;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ac-cc-banner .ac-cc-inline-link:hover,
.ac-cc-dialog .ac-cc-inline-link:hover {
  color: #093d8c;
}

.ac-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ac-cc-banner .ac-cc-primary,
.ac-cc-banner .ac-cc-secondary,
.ac-cc-banner .ac-cc-ghost,
.ac-cc-dialog .ac-cc-primary,
.ac-cc-dialog .ac-cc-secondary {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--ac-cc-font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.ac-cc-banner .ac-cc-primary,
.ac-cc-dialog .ac-cc-primary {
  border: 2px solid #0d50b5;
  background: #0d50b5;
  color: #ffffff;
}

.ac-cc-banner .ac-cc-primary:hover,
.ac-cc-dialog .ac-cc-primary:hover {
  background: #093d8c;
  border-color: #093d8c;
}

.ac-cc-banner .ac-cc-secondary,
.ac-cc-dialog .ac-cc-secondary {
  border: 2px solid #0d50b5;
  background: #ffffff;
  color: #0d50b5;
}

.ac-cc-banner .ac-cc-secondary:hover,
.ac-cc-dialog .ac-cc-secondary:hover {
  background: #edf6ff;
}

.ac-cc-banner .ac-cc-ghost {
  border: 2px solid transparent;
  background: transparent;
  color: #0d50b5;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 10px;
  padding-right: 10px;
}

.ac-cc-banner .ac-cc-ghost:hover {
  background: #edf6ff;
}

.ac-cc-banner .ac-cc-primary:focus-visible,
.ac-cc-banner .ac-cc-secondary:focus-visible,
.ac-cc-banner .ac-cc-ghost:focus-visible,
.ac-cc-banner .ac-cc-inline-link:focus-visible,
.ac-cc-dialog .ac-cc-primary:focus-visible,
.ac-cc-dialog .ac-cc-secondary:focus-visible,
.ac-cc-dialog .ac-cc-close:focus-visible,
.ac-cc-dialog .ac-cc-inline-link:focus-visible {
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #14171a;
}

.ac-cc-notice .ac-cc-primary,
.ac-cc-notice .ac-cc-ghost {
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .ac-cc-banner,
  .ac-cc-backdrop {
    animation: none;
  }
}

/* Phones: a full-width sheet with comfortable buttons. */
@media (max-width: 575.98px) {
  .ac-cc-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    padding: 16px;
    border-radius: 20px;
  }

  .ac-cc-notice {
    padding: 14px;
  }

  .ac-cc-banner-head {
    gap: 10px;
    margin-bottom: 6px;
  }

  .ac-cc-art {
    width: 40px;
    height: 40px;
  }

  .ac-cc-banner .ac-cc-title {
    font-size: 18px;
  }

  .ac-cc-banner .ac-cc-text {
    font-size: 14px;
    margin-bottom: 12px;
  }

  /* One row of three buttons on phones keeps the card short. */
  .ac-cc-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .ac-cc-actions .ac-cc-primary,
  .ac-cc-actions .ac-cc-secondary,
  .ac-cc-actions .ac-cc-ghost {
    flex: 1 1 auto;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .ac-cc-actions .ac-cc-ghost {
    flex: 0 1 auto;
  }

  .ac-cc-notice .ac-cc-actions .ac-cc-primary,
  .ac-cc-notice .ac-cc-actions .ac-cc-ghost {
    flex: 1 1 50%;
  }

  .ac-cc-notice .ac-cc-art {
    width: 36px;
    height: 36px;
  }
}

/* --- Dialog ---------------------------------------------------------------- */
.ac-cc-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(14, 20, 23, 0.45);
  animation: ac-cc-fade 0.2s ease-out both;
}

@keyframes ac-cc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ac-cc-dialog {
  position: relative;
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #edf6ff 0%, #ffffff 140px);
  box-shadow: 0 24px 64px rgba(14, 20, 23, 0.25);
  color: #14171a;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.ac-cc-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 40px 10px 0;
}

.ac-cc-dialog .ac-cc-dialog-title {
  font-size: 22px;
  line-height: 1.2;
}

.ac-cc-dialog .ac-cc-dialog-title:focus {
  outline: none;
}

.ac-cc-dialog .ac-cc-dialog-intro {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #33383d;
}

.ac-cc-dialog .ac-cc-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #14171a;
  box-shadow: 0 2px 8px rgba(14, 20, 23, 0.12);
  cursor: pointer;
}

.ac-cc-dialog .ac-cc-close:hover {
  background: #edf6ff;
}

.ac-cc-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.ac-cc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(13, 80, 181, 0.14);
  background: #ffffff;
}

.ac-cc-toggle-row-locked {
  background: #f5f8fc;
}

.ac-cc-toggle-text {
  min-width: 0;
}

.ac-cc-dialog .ac-cc-toggle-label {
  display: block;
  margin: 0 0 2px;
  font-family: var(--ac-cc-font);
  font-size: 16px;
  font-weight: 700;
  color: #14171a;
  cursor: pointer;
}

.ac-cc-toggle-row-locked .ac-cc-toggle-label {
  cursor: default;
}

.ac-cc-dialog .ac-cc-toggle-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #4a5057;
}

.ac-cc-switch {
  position: relative;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* The real checkbox sits on top of the drawn switch, so clicks, keyboard and
   screen readers all use the native control. */
.ac-cc-switch-input {
  position: absolute;
  top: 0;
  left: 50%;
  width: 52px;
  height: 30px;
  margin: 0 0 0 -26px;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.ac-cc-switch-input:disabled {
  cursor: default;
}

.ac-cc-switch-track {
  position: relative;
  display: block;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #c7cacf;
  transition: background-color 0.2s;
}

.ac-cc-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(14, 20, 23, 0.3);
  transition: transform 0.2s;
}

.ac-cc-switch-input:checked + .ac-cc-switch-track {
  background: #0d50b5;
}

.ac-cc-switch-input:checked + .ac-cc-switch-track .ac-cc-switch-thumb {
  transform: translateX(22px);
}

.ac-cc-switch-input:disabled + .ac-cc-switch-track {
  background: #6f94cf;
}

.ac-cc-switch-input:focus-visible + .ac-cc-switch-track {
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #14171a;
}

.ac-cc-switch-state {
  font-size: 12px;
  font-weight: 600;
  color: #4a5057;
  white-space: nowrap;
}

.ac-cc-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ac-cc-dialog-actions .ac-cc-primary {
  flex: 1 1 100%;
}

.ac-cc-dialog-actions .ac-cc-secondary {
  flex: 1 1 calc(50% - 4px);
}

@media (prefers-reduced-motion: reduce) {
  .ac-cc-switch-track,
  .ac-cc-switch-thumb {
    transition: none;
  }
}

@media (max-width: 575.98px) {
  .ac-cc-dialog {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .ac-cc-dialog .ac-cc-dialog-title {
    font-size: 20px;
  }

  .ac-cc-toggle-row {
    padding: 12px;
  }
}

/* --- Footer: "Cookie settings" next to Privacy / Terms ---------------------
   A <button> (it opens a dialog, it does not navigate), dressed exactly like
   the two legal links beside it (blog-modern.css .ac-footer-link-legal). */
.ac-footer button.ac-cookie-settings-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--new-v2-font-1sm);
  font-weight: 400;
  line-height: 1;
  color: var(--new-white);
  text-decoration: underline;
  cursor: pointer;
  transition: var(--new-transition-all);
}

.ac-footer button.ac-cookie-settings-link:hover,
.ac-footer button.ac-cookie-settings-link:focus-visible {
  color: var(--new-yellow);
}
