/* =============================================================
   DudesNude Cookie Consent — portable styles.
   Hand-rolled, no framework, no CSS vars required so it drops
   into Discourse / Laravel / Statamic alike. Follows the DN
   palette ($blue1 #00283A, $blue2 #003A51, $brownA #B0A99F).
   Uses html { font-size: 62.5% } if present (1rem = 10px), but
   falls back gracefully to default 16px-base browsers because
   sizes are reasonable in either scale.
   ============================================================= */

/* ----- Bottom banner ----- */
.dn-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483000;          /* above almost everything */
  background: #003A51;          /* $blue2 */
  color: #fff;
  border-top: 0.1rem solid #00283A;
  box-shadow: 0 -0.4rem 1.6rem rgba(0, 40, 58, 0.35);
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.dn-cookie-banner[hidden] { display: none; }

.dn-cookie-banner-inner {
  max-width: 120rem;
  margin: 0 auto;
  padding: 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.6rem 3.2rem;
  align-items: center;
}
@media (max-width: 720px) {
  .dn-cookie-banner-inner {
    grid-template-columns: 1fr;
    padding: 1.6rem;
  }
}

.dn-cookie-banner h2 {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.dn-cookie-banner p {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}
.dn-cookie-banner a {
  color: #B0A99F;               /* $brownA */
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.dn-cookie-banner a:hover { color: #fff; }

.dn-cookie-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .dn-cookie-actions { justify-content: stretch; }
  .dn-cookie-actions button { flex: 1 1 auto; }
}

/* ----- Buttons (banner + modal) ----- */
.dn-cookie-banner button,
.dn-cookie-modal button {
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.9rem 1.6rem;
  border-radius: 0.4rem;
  border: 0.1rem solid currentColor;
  cursor: pointer;
  background: transparent;
  color: #fff;
  min-height: 3.6rem;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.dn-cookie-banner button:hover,
.dn-cookie-modal button:hover {
  background: rgba(255, 255, 255, 0.1);
}
.dn-cookie-banner button.primary,
.dn-cookie-modal button.primary {
  background: #B0A99F;          /* $brownA — high contrast against blue */
  color: #00283A;
  border-color: #B0A99F;
}
.dn-cookie-banner button.primary:hover,
.dn-cookie-modal button.primary:hover {
  background: #fff;
  border-color: #fff;
  color: #00283A;
}

/* ----- Modal ----- */
.dn-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.dn-cookie-modal[hidden] { display: none; }

.dn-cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 58, 0.65);
  backdrop-filter: blur(0.2rem);
  -webkit-backdrop-filter: blur(0.2rem);
}

.dn-cookie-modal-card {
  position: relative;
  max-width: 56rem;
  margin: 4vh auto;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #00283A;
  border-radius: 0.6rem;
  box-shadow: 0 1.6rem 4.8rem rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
@media (max-width: 540px) {
  .dn-cookie-modal-card { margin: 0; max-height: 100vh; border-radius: 0; }
}

.dn-cookie-modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.4rem;
  border-bottom: 0.1rem solid #ECEAE6;
}
.dn-cookie-modal-card header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.dn-cookie-modal-card header button[data-dn-cookie="modal-close"] {
  font-size: 2.4rem;
  line-height: 1;
  padding: 0.4rem 1rem;
  min-height: auto;
  border: 0;
  color: #00283A;
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
}
.dn-cookie-modal-card header button[data-dn-cookie="modal-close"]:hover {
  background: #ECEAE6;
  border-radius: 0.4rem;
}

.dn-cookie-categories {
  padding: 1.6rem 2.4rem;
  overflow-y: auto;
}
.dn-cookie-category {
  display: block;
  padding: 1.6rem 0;
  border-bottom: 0.1rem solid #ECEAE6;
  cursor: default;             /* not the whole row — only the toggle */
}
.dn-cookie-category:last-child { border-bottom: 0; }

.dn-cookie-category .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 0.6rem;
}
.dn-cookie-category .title strong {
  font-size: 1.5rem;
  font-weight: 700;
}
.dn-cookie-category .badge {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 0.3rem;
  background: #ECEAE6;
  color: #00283A;
}
.dn-cookie-category p {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.55;
  color: #495E6B;              /* readable secondary on white */
}
.dn-cookie-category .cookies {
  margin: 0.8rem 0 0;
  font-size: 1.15rem;
  color: #6B7C86;
  font-style: italic;
}

/* ----- Toggle switch (replaces checkbox) ----- */
.dn-cookie-category input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 4.4rem;
  height: 2.4rem;
  border-radius: 1.2rem;
  background: #C9C7C2;
  position: relative;
  cursor: pointer;
  transition: background 160ms;
  flex-shrink: 0;
  margin: 0;
}
.dn-cookie-category input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.2);
}
.dn-cookie-category input[type="checkbox"]:checked {
  background: #003A51;          /* $blue2 — on */
}
.dn-cookie-category input[type="checkbox"]:checked::after {
  transform: translateX(2rem);
}
.dn-cookie-category input[type="checkbox"]:focus-visible {
  outline: 0.2rem solid #003A51;
  outline-offset: 0.2rem;
}

.dn-cookie-modal-card footer {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  padding: 1.6rem 2.4rem;
  border-top: 0.1rem solid #ECEAE6;
  background: #FAFAF9;
}
.dn-cookie-modal-card footer button {
  color: #003A51;
}
.dn-cookie-modal-card footer button:hover {
  background: #ECEAE6;
}
.dn-cookie-modal-card footer button.primary {
  color: #fff;
  background: #003A51;
  border-color: #003A51;
}
.dn-cookie-modal-card footer button.primary:hover {
  background: #00283A;
  border-color: #00283A;
  color: #fff;
}
@media (max-width: 540px) {
  .dn-cookie-modal-card footer { flex-direction: column; }
  .dn-cookie-modal-card footer button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .dn-cookie-banner button,
  .dn-cookie-modal button,
  .dn-cookie-category input[type="checkbox"],
  .dn-cookie-category input[type="checkbox"]::after {
    transition: none;
  }
}
