/* ══════════════════════════════════════════════════════════════
   ATAVUS — Cookie consent banner + detail panel
   Deep-forest palette · Brass accents · 12px minimum font
   ══════════════════════════════════════════════════════════════ */

/* ── Banner wrapper ─────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: var(--deepforest, #122620);
  border-top: 1px solid var(--brass, #A78237);
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 13px;
  line-height: 1.55;
  color: var(--cream, #F0E8D5);
}

#cookie-banner[hidden] { display: none; }

.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(1.5rem, 7vw, 7rem);
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1 1 300px;
}

.cookie-banner-title {
  font-family: var(--font-cormorant, 'Cormorant Garamond', serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream, #F0E8D5);
  margin: 0 0 4px;
}

.cookie-banner-desc {
  font-size: 12px;
  color: var(--stone, #8A8178);
  margin: 0;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Shared button base ─────────────────────────────────────── */
.cookie-btn-primary,
.cookie-btn-settings,
.cookie-btn-reject {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  letter-spacing: 0.08em;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: var(--brass, #A78237);
  color: var(--deepforest, #122620);
  padding: 10px 20px;
  font-weight: 400;
}

.cookie-btn-primary:hover,
.cookie-btn-primary:focus-visible {
  background: #C09840;
  outline: 2px solid var(--brass, #A78237);
  outline-offset: 2px;
}

.cookie-btn-settings {
  background: transparent;
  color: var(--cream, #F0E8D5);
  padding: 10px 16px;
  border: 1px solid rgba(167,130,55,0.4);
}

.cookie-btn-settings:hover,
.cookie-btn-settings:focus-visible {
  border-color: var(--brass, #A78237);
  outline: 2px solid var(--brass, #A78237);
  outline-offset: 2px;
}

.cookie-btn-reject {
  background: transparent;
  color: var(--stone, #8A8178);
  padding: 10px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-btn-reject:hover,
.cookie-btn-reject:focus-visible {
  color: var(--cream, #F0E8D5);
  outline: 2px solid var(--brass, #A78237);
  outline-offset: 2px;
}

.cookie-link {
  color: var(--brass, #A78237);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-link:hover { color: #C09840; }

/* ── Detail panel (slide-up modal) ──────────────────────────── */
#cookie-detail-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9995;
  background: var(--deepforest, #122620);
  border-top: 1px solid var(--brass, #A78237);
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#cookie-detail-panel[hidden] { display: none; }

/* Reduced-motion: disable transition on panel */
@media (prefers-reduced-motion: no-preference) {
  #cookie-detail-panel {
    animation: slide-up-panel 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes slide-up-panel {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-panel-inner {
  padding: 24px clamp(1.5rem, 7vw, 7rem) 32px;
  max-width: 860px;
}

.cookie-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cookie-panel-heading {
  font-family: var(--font-cormorant, 'Cormorant Garamond', serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream, #F0E8D5);
  margin: 0;
}

.cookie-panel-close {
  background: transparent;
  border: 1px solid rgba(167,130,55,0.3);
  color: var(--stone, #8A8178);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}

.cookie-panel-close:hover,
.cookie-panel-close:focus-visible {
  border-color: var(--brass, #A78237);
  color: var(--cream, #F0E8D5);
  outline: 2px solid var(--brass, #A78237);
  outline-offset: 2px;
}

/* ── Cookie categories ──────────────────────────────────────── */
.cookie-panel-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-category {
  border: 1px solid rgba(167,130,55,0.2);
  padding: 16px;
}

.cookie-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cookie-category-info { flex: 1; }

.cookie-category-name {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--brass, #A78237);
  text-transform: uppercase;
  margin: 0 0 4px;
}

.cookie-category-desc {
  font-size: 12px;
  color: var(--stone, #8A8178);
  margin: 0;
  line-height: 1.6;
}

/* ── Toggle switch ──────────────────────────────────────────── */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(138,129,120,0.3);
  border: 1px solid rgba(167,130,55,0.3);
  transition: background 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--brass, #A78237);
  border-color: var(--brass, #A78237);
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--cream, #F0E8D5);
  transition: transform 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
}

.cookie-toggle input:focus-visible + .cookie-toggle-slider {
  outline: 2px solid var(--brass, #A78237);
  outline-offset: 2px;
}

.cookie-toggle--disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Cookie table ───────────────────────────────────────────── */
.cookie-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--stone, #8A8178);
}

.cookie-table th {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream, #F0E8D5);
  text-align: left;
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid rgba(167,130,55,0.2);
  white-space: nowrap;
}

.cookie-table td {
  padding: 8px 12px 8px 0;
  vertical-align: top;
  border-bottom: 1px solid rgba(167,130,55,0.08);
  font-size: 12px;
  line-height: 1.5;
}

.cookie-table code {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  color: var(--brass, #A78237);
}

.cookie-table-empty {
  color: var(--stone, #8A8178);
  font-style: italic;
  padding: 10px 0;
}

/* ── Panel footer ───────────────────────────────────────────── */
.cookie-panel-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(167,130,55,0.2);
  flex-wrap: wrap;
}

/* ── Footer re-open link ────────────────────────────────────── */
.cookie-footer-link {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  color: var(--stone, #8A8178);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cookie-footer-link:hover,
.cookie-footer-link:focus-visible {
  color: var(--brass, #A78237);
  outline: 2px solid var(--brass, #A78237);
  outline-offset: 2px;
}

/* ── Footer legal nav ───────────────────────────────────────── */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.footer-legal a {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-weight: 300;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: rgba(138,129,120,0.6);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 6px 0;
  outline: none;
}

.footer-legal a:hover {
  color: var(--brass, #A78237);
}

.footer-legal a:focus-visible {
  color: var(--brass, #A78237);
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}

.footer-legal-sep {
  color: rgba(167,130,55,0.22);
  font-size: 9px;
  padding: 0 14px;
  font-family: var(--font-inter, 'Inter', sans-serif);
  user-select: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-btn-primary {
    width: 100%;
    text-align: center;
  }

  .cookie-panel-inner {
    padding: 20px 1.5rem 28px;
  }

  .cookie-category-header {
    flex-direction: column;
  }

  .cookie-panel-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-panel-footer .cookie-btn-primary,
  .cookie-panel-footer .cookie-btn-reject {
    width: 100%;
    text-align: center;
  }
}
