/*!
 * GuardHound Privacy / Cookie Consent — ONE_ENGINE stylesheet
 * TASK: GUARDHOUND-GLOBAL-PRIVACY-CONSENT-V1  (colour pass: …-COLOR-TUNE-V1)
 * Brand: warm-white banner surface (UNCHANGED) + GuardHound production blue
 *        primary action, taken verbatim from the live homepage tokens
 *        --blue #006BD6 / --blue-hover #0059BE / --blue-mist #F0F4FA.
 *        Body ink stays the native warm-dark (higher contrast on the warm
 *        surface than the product --ink #1D1D1F, and not a button colour).
 * Append-only: every selector is namespaced .ghc-* so no existing page rule is
 * touched, matched or overridden.
 */

:root {
  /* banner surface — deliberately NOT changed by the colour pass */
  --ghc-surface:      #FFFDF9;
  --ghc-surface-2:    #F6EFE6;
  --ghc-border:       #E3D8CC;
  --ghc-ink:          #3E2E23;
  --ghc-ink-soft:     #6A5A4A;
  --ghc-ink-mute:     #8C7B6C;

  /* GuardHound production brand blue (same values the live CTA uses) */
  --ghc-brand:        #006BD6;
  --ghc-brand-hover:  #0059BE;
  --ghc-brand-mist:   #F0F4FA;
  --ghc-ink-2:        #6E6E73;

  /* accent aliases kept so every existing rule keeps resolving */
  --ghc-accent:       #006BD6;
  --ghc-accent-deep:  #0059BE;
  --ghc-focus:        #006BD6;

  --ghc-radius:       10px;
  --ghc-shadow:       0 -6px 32px rgba(15, 21, 35, .13), 0 2px 8px rgba(15, 21, 35, .06);
  --ghc-shadow-modal: 0 24px 64px rgba(15, 21, 35, .26), 0 4px 12px rgba(15, 21, 35, .10);
  --ghc-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ghc-z-banner:  999990;
  --ghc-z-settings: 999985;
  --ghc-z-modal:   999995;
}

/* ---------------------------------------------------------------- *
 * Shared primitives
 * ---------------------------------------------------------------- */
.ghc-root, .ghc-overlay, .ghc-settings-btn {
  font-family: var(--ghc-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  box-sizing: border-box;
}
.ghc-root *, .ghc-overlay *, .ghc-settings-btn * { box-sizing: border-box; }

.ghc-root :focus-visible,
.ghc-overlay :focus-visible,
.ghc-settings-btn:focus-visible {
  outline: 2px solid var(--ghc-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.ghc-link {
  color: var(--ghc-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.ghc-link:hover { color: var(--ghc-brand-hover); }

/* ---------------------------------------------------------------- *
 * Buttons — Accept All and Reject Non-essential share one size and
 * one weight tier so neither is more findable than the other.
 * ---------------------------------------------------------------- */
.ghc-btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
  padding: 11px 20px;
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, box-shadow .18s ease;
}
.ghc-btn-solid {
  /* GuardHound production brand blue, taken from the live homepage CTA
     (`a.btn.btn-blue` -> rgb(0,107,214) = --blue #006BD6).
     White on #006BD6 measures 5.48:1 and white on the #0059BE hover measures
     6.60:1 — both WCAG AA, so the brand colour is safe for the primary action. */
  background: #006BD6;
  border: 1px solid #006BD6;
  color: #FFFFFF;
}
.ghc-btn-solid:hover {
  background: #0059BE;
  border-color: #0059BE;
}

.ghc-btn-outline {
  background: #FFFFFF;
  /* blue-grey border, brand-blue text — visibly a real, equal-weight choice,
     but never a second solid blue button */
  border: 1px solid #C3CCD9;
  color: #0059BE;
}
.ghc-btn-outline:hover { border-color: #006BD6; background: var(--ghc-brand-mist); }

.ghc-btn-soft {
  background: #FFFFFF;
  border: 1px solid #C3CCD9;
  color: #0059BE;
}
.ghc-btn-soft:hover { border-color: #006BD6; background: var(--ghc-brand-mist); }

.ghc-btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  /* Manage Preferences stays a lightweight ghost action (no solid fill) */
  color: #6E6E73;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.ghc-btn-ghost:hover { color: #0059BE; }
.ghc-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------------- *
 * Layer 1 — the banner
 * Desktop: full-bleed bar whose CONTENT is a centred, width-capped
 *          two-column block (text left / one action group right), so the
 *          copy never runs the width of a 1920 screen and the three actions
 *          read as a single consent control rather than loose floating widgets.
 * Mobile:  bottom sheet, stacked actions.
 *
 * LAYOUT_POLISH pass: spacing / padding / max-width / alignment / typography
 * scale / responsive structure only. Colours are untouched.
 * ---------------------------------------------------------------- */
.ghc-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--ghc-z-banner);
  background: var(--ghc-surface);
  /* hairline separation from the hero + a very restrained lift (no card/popup feel) */
  border-top: 1px solid var(--ghc-border);
  box-shadow: 0 -4px 20px rgba(15, 21, 35, .04);
  padding: 18px 32px;
  /* the centred content column becomes the flex row */
  max-width: 1500px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 96px;
  max-height: 45vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  animation: ghc-rise .32s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes ghc-rise {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ghc-banner { animation: none; }
}

/* ---- left column: title + body + policy links as one information block ---- */
/* `flex: 0 1 auto` + a max-width lets this column collapse first when space is
   tight, long before the action group (which must stay whole, on one line). */
.ghc-banner-text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 820px;
}

.ghc-banner-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ghc-ink);
  letter-spacing: .005em;
}
.ghc-banner-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.62;
  color: var(--ghc-ink-soft);
  /* keeps JA / DE / RU / FR copy in a comfortable measure instead of one
     very long line across a wide desktop screen */
  max-width: 780px;
}

/* ---- right column: ONE action group, vertically centred on one baseline ---- */
.ghc-banner-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
/* compact, non-tentpole buttons: 40-42px tall with 18-22px side padding */
.ghc-banner-actions .ghc-btn { min-height: 42px; padding: 10px 20px; }
/* the ghost Manage action sits on the same baseline as the two buttons and
   stays close to them, so all three read as one group */
.ghc-banner-actions .ghc-btn-ghost { padding: 10px 4px; min-height: 0; }

/* Desktop reading order: [ Manage Preferences | Accept All | Reject Non-essential ]
   DOM order stays Reject, Accept, Manage (the mobile stack order), so the row is
   reversed visually. `flex-direction` rather than `order` keeps grid row
   assignment intact on the mobile sheet. */
@media (min-width: 901px) {
  .ghc-banner-actions { flex-direction: row-reverse; }
}
.ghc-rtl .ghc-banner-actions { flex-direction: row; }

/* On mid-size desktops tighten the gaps before the copy column gets too narrow */
@media (min-width: 901px) and (max-width: 1280px) {
  .ghc-banner { gap: 22px; padding: 16px 24px; }
  .ghc-banner-actions { gap: 9px; }
  .ghc-banner-actions .ghc-btn { padding: 9px 14px; }
  .ghc-banner-text { max-width: 640px; }
}

/* ---------------------------------------------------------------- *
 * Mobile — bottom sheet
 * ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .ghc-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px 18px 20px;
    max-height: 62vh;
    border-radius: 14px 14px 0 0;
    border-top: none;
    /* the sheet is a full-width panel, not the capped desktop column */
    max-width: 100vw;
    margin-inline: 0;
    min-height: 0;
  }
  .ghc-banner-text { max-width: none; }
  .ghc-banner-body { max-width: none; }
  .ghc-banner-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .ghc-banner-actions .ghc-btn {
    width: 100%;
    min-height: 46px;
    padding: 12px 18px;
    font-size: 14px;
    /* Touch targets stack Reject -> Accept -> Manage, least destructive first. */
  }
  .ghc-banner-actions .ghc-btn-ghost { min-height: 44px; padding: 12px 18px; }
}

@media (max-width: 380px) {
  .ghc-banner { padding: 16px 14px 18px; }
  .ghc-banner-body { font-size: 12.5px; }
}

/* ---------------------------------------------------------------- *
 * Always-available re-entry point (withdrawal / re-open preferences)
 * Small, out of the way, bottom corner. Never covers a primary CTA.
 * ---------------------------------------------------------------- */
.ghc-settings-btn {
  position: fixed;
  bottom: 16px;
  inset-inline-start: 16px;
  z-index: var(--ghc-z-settings);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ghc-ink-soft);
  background: rgba(255, 253, 249, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ghc-border);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(62, 46, 35, .10);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ghc-settings-btn::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ghc-brand);
  flex: 0 0 auto;
}
.ghc-settings-btn:hover {
  color: var(--ghc-ink);
  border-color: var(--ghc-ink-mute);
  box-shadow: 0 4px 16px rgba(62, 46, 35, .16);
}

/* When the banner is up, lift the re-entry pill above it if the sheet is tall. */
@media (max-width: 900px) {
  .ghc-settings-btn { bottom: 12px; inset-inline-start: 12px; font-size: 11.5px; padding: 7px 12px; }
}

/* ---------------------------------------------------------------- *
 * Layer 2 — Preference Center
 * ---------------------------------------------------------------- */
.ghc-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--ghc-z-modal);
  background: rgba(38, 27, 20, .46);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ghc-dialog {
  background: var(--ghc-surface);
  border: 1px solid var(--ghc-border);
  border-radius: 14px;
  box-shadow: var(--ghc-shadow-modal);
  width: 100%;
  max-width: 620px;
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ghc-pop .24s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes ghc-pop {
  from { transform: translateY(10px) scale(.995); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .ghc-dialog { animation: none; } }

.ghc-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--ghc-border);
  flex: 0 0 auto;
}
.ghc-dialog-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ghc-ink);
  letter-spacing: -.005em;
}
.ghc-close {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ghc-ink-mute);
  font-size: 24px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, background-color .15s ease;
}
.ghc-close:hover { color: var(--ghc-ink); background: var(--ghc-surface-2); }

.ghc-dialog-body {
  padding: 18px 24px 4px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.ghc-prefs-intro {
  margin: 0 0 18px 0;
  font-size: 13px;
  line-height: 1.62;
  color: var(--ghc-ink-soft);
}

.ghc-cats { display: flex; flex-direction: column; }

.ghc-cat {
  padding: 15px 0;
  border-top: 1px solid var(--ghc-border);
}
.ghc-cat:first-child { border-top: none; padding-top: 4px; }

.ghc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ghc-cat-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ghc-ink);
}
.ghc-cat-desc {
  margin: 6px 0 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ghc-ink-mute);
  max-width: 60ch;
}

.ghc-badge {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ghc-ink-mute);
  background: var(--ghc-surface-2);
  border: 1px solid var(--ghc-border);
  border-radius: 999px;
  padding: 4px 10px;
}

/* Switch */
.ghc-switch { position: relative; display: inline-flex; flex: 0 0 auto; cursor: pointer; }
.ghc-switch input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  cursor: pointer;
}
.ghc-switch-track {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #D9CCC0;
  border: 1px solid #CDBEB0;
  display: block;
  position: relative;
  transition: background-color .2s ease, border-color .2s ease;
  /* decorative only: must never swallow the click meant for the checkbox */
  pointer-events: none;
}
.ghc-switch-thumb {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(62,46,35,.28);
  transition: transform .2s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
}
.ghc-switch input:checked + .ghc-switch-track {
  background: var(--ghc-brand);
  border-color: var(--ghc-brand);
}
.ghc-switch input:checked + .ghc-switch-track .ghc-switch-thumb {
  transform: translateX(18px);
}
.ghc-rtl .ghc-switch input:checked + .ghc-switch-track .ghc-switch-thumb {
  transform: translateX(-18px);
}
.ghc-switch input:focus-visible + .ghc-switch-track {
  outline: 2px solid var(--ghc-focus);
  outline-offset: 2px;
}

.ghc-prefs-note,
.ghc-prefs-retention {
  margin: 16px 0 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ghc-ink-mute);
}
.ghc-prefs-retention { margin-top: 8px; padding-bottom: 14px; }

.ghc-dialog-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--ghc-border);
  background: var(--ghc-surface-2);
}
.ghc-foot-right { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- *
 * Modal on small screens — full-width sheet
 * ---------------------------------------------------------------- */
@media (max-width: 620px) {
  .ghc-overlay { padding: 0; align-items: flex-end; }
  .ghc-dialog {
    max-width: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    border-bottom: none;
  }
  .ghc-dialog-head { padding: 18px 18px 12px; }
  .ghc-dialog-body { padding: 16px 18px 4px; }
  .ghc-dialog-foot {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 9px;
    padding: 14px 18px 18px;
  }
  .ghc-foot-right { flex-direction: column; gap: 9px; }
  .ghc-dialog-foot .ghc-btn { width: 100%; min-height: 46px; font-size: 14px; }
  .ghc-cat-desc { max-width: none; }
}

/* ---------------------------------------------------------------- *
 * RTL (Arabic) — mirror layout only.
 * Logo, icons, e-mail addresses, URLs, the GuardHound wordmark and all
 * technical strings are NOT mirrored (no transform on those elements).
 * ---------------------------------------------------------------- */
.ghc-rtl .ghc-banner-actions { flex-direction: row-reverse; }
.ghc-rtl .ghc-dialog-head { flex-direction: row-reverse; }
.ghc-rtl .ghc-cat-head { flex-direction: row-reverse; }
.ghc-rtl .ghc-dialog-foot { flex-direction: row-reverse; }
.ghc-rtl .ghc-foot-right { flex-direction: row-reverse; }
.ghc-rtl .ghc-banner-body,
.ghc-rtl .ghc-cat-desc,
.ghc-rtl .ghc-prefs-intro,
.ghc-rtl .ghc-prefs-note,
.ghc-rtl .ghc-prefs-retention { text-align: right; }

@media (max-width: 900px) {
  .ghc-rtl .ghc-banner-actions { flex-direction: column; }
}
@media (max-width: 620px) {
  .ghc-rtl .ghc-dialog-foot,
  .ghc-rtl .ghc-foot-right { flex-direction: column; }
}

/* Arabic typographic stack (kept off the mirrored-transform list) */
.ghc-rtl, .ghc-rtl .ghc-btn, .ghc-rtl .ghc-dialog-title,
.ghc-rtl .ghc-cat-name, .ghc-rtl .ghc-banner-title, .ghc-rtl .ghc-banner-body {
  font-family: 'Segoe UI', Tahoma, 'Noto Naskh Arabic', 'Geeza Pro', system-ui, sans-serif;
}

/* CJK weight compensation for the same visual weight as Latin */
html[lang="ja"] .ghc-root, html[lang="ja"] .ghc-overlay, html[lang="ja"] .ghc-settings-btn,
html[lang="ko"] .ghc-root, html[lang="ko"] .ghc-overlay, html[lang="ko"] .ghc-settings-btn {
  font-family: 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'Malgun Gothic',
               'Noto Sans JP', 'Noto Sans KR', system-ui, sans-serif;
}

/* ---------------------------------------------------------------- *
 * Third-party embed gate (placeholder shown until consent)
 * ---------------------------------------------------------------- */
.ghc-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: var(--ghc-surface-2);
  border: 1px dashed var(--ghc-border);
  border-radius: var(--ghc-radius);
  color: var(--ghc-ink-soft);
  font-family: var(--ghc-font);
  font-size: 13px;
  line-height: 1.6;
  padding: 28px 20px;
  min-height: 180px;
}
.ghc-placeholder .ghc-btn { margin-top: 4px; }
.ghc-placeholder iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------------------------------------------------------------- *
 * Print / no-JS safety
 * ---------------------------------------------------------------- */
@media print {
  .ghc-banner, .ghc-overlay, .ghc-settings-btn { display: none !important; }
}
html.ghc-modal-open { overflow: hidden; }
