/* ============================================================================
   TenTwelve — Cookie Consent · STYLES
   ----------------------------------------------------------------------------
   Reusable across client sites. Everything is scoped under .ttc- so it never
   collides with the host site's own classes.

   THEMING — two ways, in order of preference:
   1. If the host site defines brand CSS custom properties (--paper, --forest,
      --clay, --ink, --t1, --t2, --bord, --surf ...), this file picks them up
      automatically via var(--token, fallback).
   2. If it doesn't, the hard-coded fallbacks below render the TenTwelve palette.
      >> PER CLIENT: change ONLY the four lines in the ":root .ttc-vars" block. <<

   No layout shift: the banner is position:fixed and injected after load, so it
   never participates in document flow. Mobile-first; stacks under 560px.
   ========================================================================== */

/* ---- PER-CLIENT COLOUR OVERRIDES (edit these four, nothing else) ---------- */
.ttc-root{
  --ttc-bg:      var(--surf,  #FCFAF7);   /* panel background        */
  --ttc-ink:     var(--t1,    #182722);   /* primary text            */
  --ttc-muted:   var(--t2,    #4C5E57);   /* secondary text          */
  --ttc-accent:  var(--clay,  #C59782);   /* primary button / toggle */
  /* Derived — usually leave alone */
  --ttc-accent-ink: var(--on-clay, #26150C);          /* text on accent btn   */
  --ttc-accent-hover: var(--clay-deep, #B07F69);      /* accent btn :hover    */
  --ttc-border:  var(--bord,  rgba(24,39,34,.13));     /* hairlines            */
  --ttc-shadow:  0 -8px 40px rgba(24,39,34,.14);
  --ttc-radius:  16px;
  --ttc-font:    var(--ff, 'Inter Tight', system-ui, sans-serif);
  --ttc-mono:    var(--mono, 'JetBrains Mono', ui-monospace, monospace);
}
[data-theme="dark"] .ttc-root{
  --ttc-shadow: 0 -8px 40px rgba(0,0,0,.5);
  --ttc-accent-hover: var(--clay-deep, #C08E77);
}

/* ---- Shared reset inside the widget --------------------------------------- */
.ttc-root, .ttc-root *{ box-sizing:border-box; }
.ttc-root{ font-family:var(--ttc-font); color:var(--ttc-ink); }
/* :where() keeps this normalize at single-class specificity (0,1,0) so the
   .ttc-btn-* variant rules below win and keep their fill / border.          */
.ttc-root :where(button){ font-family:inherit; cursor:pointer; border:none; background:none; }

/* ---- BANNER --------------------------------------------------------------- */
.ttc-banner{
  position:fixed; left:0; right:0; bottom:0; z-index:2147483646; /* above almost everything */
  display:flex; gap:20px; align-items:center; justify-content:space-between;
  flex-wrap:wrap;
  max-width:1100px; margin:0 auto 18px; left:18px; right:18px;
  background:var(--ttc-bg); color:var(--ttc-ink);
  border:1px solid var(--ttc-border); border-radius:var(--ttc-radius);
  box-shadow:var(--ttc-shadow);
  padding:18px 22px;
  transform:translateY(140%); opacity:0;
  transition:transform .5s cubic-bezier(.16,1,.3,1), opacity .4s ease;
}
.ttc-banner.ttc-show{ transform:translateY(0); opacity:1; }
.ttc-copy{ flex:1 1 320px; min-width:260px; }
.ttc-copy p{ margin:0; font-size:14px; line-height:1.55; color:var(--ttc-muted); font-weight:300; }
.ttc-copy a{ color:var(--ttc-accent); border-bottom:1px solid currentColor; text-decoration:none; }
.ttc-actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.ttc-btn-x{ position:absolute; top:8px; right:10px; width:30px; height:30px; line-height:1;
  font-size:22px; color:var(--ttc-muted); border-radius:50%; background:transparent; }
.ttc-btn-x:hover{ color:var(--ttc-ink); background:var(--ttc-border); }
@media (max-width:560px){ .ttc-btn-x{ top:6px; right:6px; } }

/* ---- BUTTONS -------------------------------------------------------------- */
.ttc-btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-size:13.5px; font-weight:500; letter-spacing:.01em;
  padding:11px 20px; min-height:44px; border-radius:100px; white-space:nowrap;
  transition:transform .2s cubic-bezier(.34,1.56,.64,1), background .2s, color .2s, border-color .2s;
}
.ttc-btn:active{ transform:scale(.97); }
.ttc-btn-primary{ background:var(--ttc-accent); color:var(--ttc-accent-ink); }
.ttc-btn-primary:hover{ background:var(--ttc-accent-hover); box-shadow:0 10px 32px rgba(197,151,130,.38); }
.ttc-btn-ghost{ background:transparent; color:var(--ttc-ink); border:1.5px solid var(--ttc-border); }
.ttc-btn-ghost:hover{ border-color:var(--ttc-ink); }
.ttc-btn-link{ background:transparent; color:var(--ttc-muted); padding:11px 8px; text-decoration:underline; text-underline-offset:3px; }
.ttc-btn-link:hover{ color:var(--ttc-ink); }

/* ---- PREFERENCES MODAL ---------------------------------------------------- */
.ttc-modal-scrim{
  position:fixed; inset:0; z-index:2147483647;
  background:rgba(16,23,21,.55); backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center; padding:18px;
  opacity:0; pointer-events:none; transition:opacity .3s ease;
}
.ttc-modal-scrim.ttc-show{ opacity:1; pointer-events:auto; }
.ttc-modal{
  width:100%; max-width:540px; max-height:88vh; overflow:auto;
  background:var(--ttc-bg); color:var(--ttc-ink);
  border:1px solid var(--ttc-border); border-radius:var(--ttc-radius);
  box-shadow:0 30px 80px rgba(0,0,0,.35);
  padding:28px;
  transform:translateY(12px) scale(.98); transition:transform .35s cubic-bezier(.16,1,.3,1);
}
.ttc-modal-scrim.ttc-show .ttc-modal{ transform:none; }
.ttc-eyebrow{ font-family:var(--ttc-mono); font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--ttc-accent); margin:0 0 8px; }
.ttc-modal h2{ font-size:22px; font-weight:500; margin:0 0 8px; line-height:1.2; }
.ttc-modal .ttc-intro{ font-size:14px; line-height:1.6; color:var(--ttc-muted); font-weight:300; margin:0 0 20px; }

/* Each category row */
.ttc-cat{ display:flex; gap:14px; align-items:flex-start; justify-content:space-between;
  padding:16px 0; border-top:1px solid var(--ttc-border); }
.ttc-cat-text h3{ font-size:15px; font-weight:500; margin:0 0 4px; }
.ttc-cat-text p{ font-size:13px; line-height:1.5; color:var(--ttc-muted); font-weight:300; margin:0; }

/* Toggle switch */
.ttc-switch{ position:relative; flex:0 0 auto; width:46px; height:27px; }
.ttc-switch input{ position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.ttc-track{ position:absolute; inset:0; border-radius:100px; background:var(--ttc-border); transition:background .2s; }
.ttc-track::after{ content:""; position:absolute; top:3px; left:3px; width:21px; height:21px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:transform .22s cubic-bezier(.34,1.56,.64,1); }
.ttc-switch input:checked + .ttc-track{ background:var(--ttc-accent); }
.ttc-switch input:checked + .ttc-track::after{ transform:translateX(19px); }
.ttc-switch input:disabled + .ttc-track{ opacity:.55; cursor:not-allowed; }
.ttc-switch input:focus-visible + .ttc-track{ outline:2px solid var(--ttc-accent); outline-offset:2px; }

.ttc-modal-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:22px; padding-top:18px; border-top:1px solid var(--ttc-border); }
.ttc-modal-actions .ttc-btn{ flex:1 1 auto; }

/* ---- Focus ring for keyboard users --------------------------------------- */
.ttc-root :focus-visible{ outline:2px solid var(--ttc-accent); outline-offset:3px; border-radius:6px; }

/* ---- Small screens -------------------------------------------------------- */
@media (max-width:560px){
  .ttc-banner{ left:10px; right:10px; margin-bottom:10px; padding:16px; flex-direction:column; align-items:stretch; }
  .ttc-actions{ width:100%; }
  .ttc-actions .ttc-btn{ flex:1 1 auto; }
  .ttc-btn-link{ flex-basis:100%; }
}

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  .ttc-banner, .ttc-modal, .ttc-modal-scrim, .ttc-track::after, .ttc-btn{ transition:none !important; }
  .ttc-banner{ transform:none; }
}
