/* ============================================================
   Cookie consent banner + preferences dialog (assets/js/consent.js).
   Reject and Accept are styled with equal weight on purpose.
   ============================================================ */

.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  max-width: 1040px;
  margin: 0 auto;
  background: var(--dts-forest-900);
  color: var(--fg-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.consent-banner-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
}
.consent-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(250, 247, 240, 0.9);
}
.consent-banner strong { color: var(--fg-on-dark); }
.consent-banner a,
.consent-dialog a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.consent-banner a { color: var(--dts-bone-50); }

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}
.consent-btn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 18px;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.consent-btn:focus-visible,
.consent-close:focus-visible,
.consent-toggle input:focus-visible + .consent-switch {
  outline: 3px solid var(--dts-rust-500);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .consent-banner .consent-btn:hover { background: var(--dts-bone-50); color: var(--dts-forest-900); border-color: var(--dts-bone-50); }
  .consent-dialog .consent-btn:hover { background: var(--dts-forest-900); color: var(--dts-bone-50); border-color: var(--dts-forest-900); }
}

@media (max-width: 760px) {
  .consent-banner { left: 12px; right: 12px; bottom: 12px; }
  .consent-banner-inner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .consent-banner p { font-size: 13.5px; }
  .consent-banner .consent-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .consent-banner .consent-btn { padding: 10px 6px; font-size: 13px; letter-spacing: 0.05em; }
}

/* --- Preferences dialog --- */
.consent-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--dts-bone-50);
  color: var(--fg-1);
  box-shadow: var(--shadow-lg);
}
.consent-dialog::backdrop { background: rgba(10, 20, 14, 0.6); }
.consent-dialog form { position: relative; padding: 28px; }
.consent-dialog h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 26px;
  letter-spacing: 0.02em;
  margin: 0 40px 10px 0;
  color: var(--fg-1);
}
.consent-intro,
.consent-note { font-size: 14px; line-height: 1.55; color: var(--fg-2); margin: 0 0 16px; }
.consent-note { background: var(--dts-bone-100); padding: 10px 12px; border-radius: var(--radius-md); }
.consent-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--fg-2);
  cursor: pointer;
}

.consent-row { border-top: 1px solid var(--border-subtle); padding: 14px 0; }
.consent-row p { margin: 6px 0 0 58px; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.consent-toggle { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.consent-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent-switch {
  position: relative;
  flex: 0 0 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--dts-bark-200);
  transition: background var(--dur-fast);
}
.consent-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast);
}
.consent-toggle input:checked + .consent-switch { background: var(--brand-primary); }
.consent-toggle input:checked + .consent-switch::after { transform: translateX(18px); }
.consent-toggle input:disabled + .consent-switch { opacity: 0.6; }
.consent-toggle input:disabled ~ .consent-row-title { cursor: default; }
.consent-row-title { font-weight: 700; font-size: 15px; }
.consent-row-title em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--fg-3); margin-left: 6px; }

.consent-dialog .consent-actions { border-top: 1px solid var(--border-subtle); padding-top: 18px; margin-top: 4px; justify-content: flex-end; }
.consent-dialog .consent-btn { color: var(--dts-forest-900); }
@media (max-width: 480px) {
  .consent-dialog form { padding: 22px 18px; }
  .consent-dialog .consent-actions { display: grid; grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .consent-switch, .consent-switch::after { transition: none; }
}
.consent-dialog h2:focus { outline: none; }

/* --- Video placeholder (inc/consent.php dts_video_consent) ---------------
   Covers a consent-gated YouTube iframe until videos are allowed. */
.story-item .shot { position: relative; }
.equipment-image .badge,
.editorial-image .tag { z-index: 2; }
.video-consent {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--dts-forest-900);
  border-radius: inherit;
}
.video-consent[hidden] { display: none; }
.video-consent > img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover;
  border-radius: 0 !important;
}
.video-consent::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 14, 0.25), rgba(10, 20, 14, 0.7));
}
.video-consent-box {
  position: relative;
  z-index: 1;
  max-width: 320px;
  padding: 12px 16px;
  text-align: center;
  color: var(--fg-on-dark);
}
.video-consent-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px 10px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--dts-rust-600);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.video-consent-btn:focus-visible { outline: 3px solid var(--dts-bone-50); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .video-consent-btn:hover { background: var(--dts-rust-500); }
}
.vc-play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vc-play::before {
  content: "";
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.video-consent-box p {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(250, 247, 240, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.video-consent-box a { color: inherit; text-decoration: underline; }
@media (max-width: 480px) {
  .video-consent-box p { font-size: 11px; }
  .video-consent-btn { font-size: 13px; }
}
/* site.css forces `.equipment-image > div > div` to fill the frame. */
.equipment-image .video-consent > .video-consent-box {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
}

/* --- "Watch the full walkthrough" button + pop-up player ------------------
   Button sits bottom left of the GT-200 frame (the rating card overlaps the
   bottom right on desktop). Hidden while the consent placeholder shows. */
.video-full {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--dts-rust-600);
  color: var(--fg-on-dark, #faf7f0);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.video-full .vf-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent currentColor;
  flex: none;
}
.video-full .vf-label-short { display: none; }
.video-full:focus-visible { outline: 2px solid var(--fg-on-dark, #faf7f0); outline-offset: 3px; }
.video-consent:not([hidden]) ~ .video-full { display: none; }
@media (hover: hover) and (pointer: fine) {
  .video-full:hover { background: var(--dts-rust-500); }
}
@media (max-width: 600px) {
  .video-full { left: 12px; bottom: 12px; padding: 9px 14px 9px 12px; font-size: 12px; gap: 8px; }
  .video-full .vf-label { display: none; }
  .video-full .vf-label-short { display: inline; }
}

.video-modal {
  /* Fits the viewport either way, so a landscape phone sees the whole video. */
  width: min(1100px, calc(100vw - 32px), calc((100vh - 140px) * 16 / 9));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.video-modal::backdrop { background: rgba(6, 12, 9, 0.88); }
.video-modal-inner { position: relative; }
.video-modal-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(250, 247, 240, 0.4);
  border-radius: 50%;
  background: rgba(10, 20, 14, 0.6);
  color: var(--fg-on-dark, #faf7f0);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.video-modal-close:focus-visible { outline: 2px solid var(--dts-rust-500); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .video-modal-close:hover { background: rgba(10, 20, 14, 0.9); border-color: rgba(250, 247, 240, 0.7); }
}
