/* ============================================================
   BANNER CROP GUIDE — STYLES
   
   KEY CONCEPT: The .banner__frame element contains both the
   image AND the guide overlays. It always maintains the image's
   native aspect ratio (8:3) and is scaled to "cover" the
   .banner viewport — exactly like object-fit:cover, but as a
   real DOM element so guides stay pixel-aligned with the photo.
   ============================================================ */

:root {
  /* Kleuren voor de guide overlays */
  --color-safe: rgba(46, 204, 113, 0.3);
  --color-safe-border: rgba(46, 204, 113, 0.9);
  --color-tablet: rgba(52, 152, 219, 0.22);
  --color-tablet-border: rgba(52, 152, 219, 0.8);
  --color-desktop: rgba(155, 89, 182, 0.18);
  --color-desktop-border: rgba(155, 89, 182, 0.7);
  --color-text-zone: rgba(231, 76, 60, 0.28);
  --color-text-zone-border: rgba(231, 76, 60, 0.85);

  /* UI kleuren */
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-accent: #0071e3;
  --color-border: #d2d2d7;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  display: block;
  max-width: none;
}

/* ============================================================
   INTRO HEADER
   ============================================================ */
.intro {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: var(--spacing-xl) var(--spacing-md);
}

.intro__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.intro h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.02em;
}

.intro__subtitle {
  font-size: 1.15rem;
  opacity: 0.8;
  margin-bottom: var(--spacing-lg);
}

/* Legenda */
.intro__legend {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.intro__legend h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: var(--spacing-sm);
}

.legend-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
}

@media (max-width: 600px) {
  .legend-items {
    grid-template-columns: 1fr;
  }
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-xs);
  font-size: 0.9rem;
  line-height: 1.4;
}

.legend-swatch {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-top: 2px;
}

.legend-swatch--safe {
  background: var(--color-safe);
  border: 2px solid var(--color-safe-border);
}

.legend-swatch--tablet {
  background: var(--color-tablet);
  border: 2px solid var(--color-tablet-border);
}

.legend-swatch--desktop {
  background: var(--color-desktop);
  border: 2px solid var(--color-desktop-border);
}

.legend-swatch--text {
  background: var(--color-text-zone);
  border: 2px solid var(--color-text-zone-border);
}

/* Instructies */
.intro__instructions {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: var(--spacing-md);
}

.intro__instructions h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: var(--spacing-sm);
}

.intro__instructions ol {
  padding-left: 1.2em;
  font-size: 0.95rem;
}

.intro__instructions li {
  margin-bottom: var(--spacing-xs);
}

.intro__instructions li:last-child {
  margin-bottom: 0;
}

/* ============================================================
   DEVICE SIMULATION BAR
   ============================================================ */
.device-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-md);
}

.device-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.device-bar__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.device-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.device-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.device-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.device-btn svg {
  flex-shrink: 0;
}

/* ============================================================
   TOGGLE BAR
   ============================================================ */
.toggle-bar {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

/* ── Ratio controls ─────────────────────────────────────── */
.ratio-bar {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.ratio-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.ratio-bar__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ratio-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ratio-control__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.ratio-control__formula {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: ui-monospace, monospace;
}

.ratio-input {
  width: 56px;
  padding: 4px 6px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  color: var(--color-text);
  background: #fff;
  text-align: center;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  -moz-appearance: textfield;
}

.ratio-input::-webkit-outer-spin-button,
.ratio-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.ratio-input:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.toggle-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-accent);
}

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

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================================
   EXAMPLE SECTIONS
   ============================================================ */
.example-section {
  padding: var(--spacing-lg) var(--spacing-md);
}

.example-header {
  max-width: 1200px;
  margin: 0 auto var(--spacing-md);
}

.example-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.example-header p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* ============================================================
   BANNER CONTAINER (device simulation wrapper)
   ============================================================ */
.banner-container {
  max-width: 1200px;
  margin: 0 auto;
  transition: max-width 0.4s ease;
  background: #e8e8ed;
  border-radius: 16px;
  padding: 4px;
}

.banner-container.device-desktop {
  max-width: 1440px;
}

.banner-container.device-tablet {
  max-width: 768px;
}

.banner-container.device-mobile {
  max-width: 375px;
}

.banner-container.device-tablet,
.banner-container.device-mobile,
.banner-container.device-desktop {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   BANNER COMPONENT — THE VIEWPORT
   This is the visible "window" that changes aspect ratio
   per breakpoint. It clips the frame inside.
   ============================================================ */
.banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  background: #222;
}

/* Breakpoint classes set by JS based on actual container width
   (works for both real resize AND device simulation buttons) */
.banner.is-tablet {
  aspect-ratio: 16 / 11;
}

.banner.is-mobile {
  aspect-ratio: 1 / 1;
}

/* ── Cropped zone: zones die op dit formaat niet zichtbaar zijn ──
   In plaats van verbergen: toon als donkere "gecropped" overlay  
   zodat duidelijk is welk deel van de foto verloren gaat.         */
.banner.is-tablet .guide--desktop,
.banner.is-mobile .guide--desktop,
.banner.is-mobile .guide--tablet {
  background: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.55) 0px,
    rgba(0, 0, 0, 0.55) 5px,
    rgba(0, 0, 0, 0.3) 5px,
    rgba(0, 0, 0, 0.3) 12px
  );
  border-color: rgba(255, 255, 255, 0.25);
}

/* Override the colored backgrounds when in cropped state */
.banner.is-tablet .guide--desktop.guide--left,
.banner.is-tablet .guide--desktop.guide--right,
.banner.is-mobile .guide--desktop.guide--left,
.banner.is-mobile .guide--desktop.guide--right {
  background: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.55) 0px,
    rgba(0, 0, 0, 0.55) 5px,
    rgba(0, 0, 0, 0.3) 5px,
    rgba(0, 0, 0, 0.3) 12px
  );
}

.banner.is-mobile .guide--tablet.guide--left,
.banner.is-mobile .guide--tablet.guide--right {
  background: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.55) 0px,
    rgba(0, 0, 0, 0.55) 5px,
    rgba(0, 0, 0, 0.3) 5px,
    rgba(0, 0, 0, 0.3) 12px
  );
}

/* On tablet view: stretch tablet zone to touch the edge (desktop crosshatch sits on top via z-index) */
.banner.is-tablet .guide--tablet.guide--left,
.banner.is-mobile .guide--tablet.guide--left {
  left: 0;
  width: 18%;
  justify-content: flex-end;
  padding-right: 4px;
}

.banner.is-tablet .guide--tablet.guide--right,
.banner.is-mobile .guide--tablet.guide--right {
  right: 0;
  width: 18%;
  justify-content: flex-start;
  padding-left: 4px;
}

/* Switch label to "gecropped" text */
.banner.is-tablet .guide--desktop .guide__label--normal,
.banner.is-mobile .guide--desktop .guide__label--normal,
.banner.is-mobile .guide--tablet .guide__label--normal {
  display: none;
}

.guide__label--cropped {
  display: none;
  writing-mode: vertical-lr;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

.guide__label--cropped.labels-hidden {
  opacity: 0;
}

.banner.is-tablet .guide--desktop .guide__label--cropped,
.banner.is-mobile .guide--desktop .guide__label--cropped,
.banner.is-mobile .guide--tablet .guide__label--cropped {
  display: block;
}

/* Aspect ratio for intermediate sizes */
@media (max-width: 1024px) {
  .banner:not(.is-tablet):not(.is-mobile) {
    aspect-ratio: 16 / 9;
  }
}

/* ============================================================
   BANNER FRAME — THE IMAGE COORDINATE SPACE
   
   Contains both the image AND guides+text in the same 
   coordinate system. Always matches the image's native 
   aspect ratio. Sized by JS to "cover" the banner viewport.
   ============================================================ */
.banner__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Fallback: fill viewport until JS calculates exact cover size */
  width: 100%;
  height: 100%;
}

.banner__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================
   GUIDE OVERLAYS
   All % values are relative to .banner__frame (= the full
   image). They never change — the frame itself moves/scales.
   ============================================================ */
.banner__guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.banner__guides.hidden {
  opacity: 0;
}

.guide {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop guide sits above tablet guide so crosshatch renders on top */
.guide--desktop {
  z-index: 2;
}
.guide--tablet {
  z-index: 1;
}

.guide__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  padding: 6px 4px;
  border-radius: 4px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.guide__label.labels-hidden {
  opacity: 0;
}

/* ─── Desktop-only zones: 0–10% and 90–100% ─────────────── */
.guide--desktop {
  background: var(--color-desktop);
  border-style: solid;
  border-color: var(--color-desktop-border);
  border-width: 0;
}

.guide--desktop.guide--left {
  left: 0;
  width: 10%;
  border-right-width: 2px;
}

.guide--desktop.guide--right {
  right: 0;
  width: 10%;
  border-left-width: 2px;
}

.guide--desktop .guide__label {
  background: rgba(155, 89, 182, 0.6);
}

/* ─── Tablet zones: 10–18% and 82–90% ───────────────────── */
.guide--tablet {
  background: var(--color-tablet);
  border-style: solid;
  border-color: var(--color-tablet-border);
  border-width: 0;
}

.guide--tablet.guide--left {
  left: 10%;
  width: 8%;
  border-right-width: 2px;
}

.guide--tablet.guide--right {
  right: 10%;
  width: 8%;
  border-left-width: 2px;
}

.guide--tablet .guide__label {
  background: rgba(52, 152, 219, 0.6);
}

/* ─── Safe area: center 64% (18%–82%) ────────────────────── */
.guide--safe {
  left: 18%;
  right: 18%;
  top: 0;
  bottom: 0;
  border: 3px dashed var(--color-safe-border);
  border-radius: 4px;
  background: transparent;
}

.guide__label--safe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  writing-mode: horizontal-tb;
  background: rgba(39, 174, 96, 0.9);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Tekst zones (fixed position on image) ──────────────── */
.guide--text {
  background: var(--color-text-zone);
  border: 2px dashed var(--color-text-zone-border);
  border-radius: 4px;
  z-index: 3;
}

.guide--text-right {
  right: 18%;
  width: 25%;
  top: 10%;
  bottom: 10%;
}

.guide--text-center {
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  top: 10%;
  bottom: 10%;
}

.guide--text-left {
  left: 18%;
  width: 25%;
  top: 10%;
  bottom: 10%;
}

.guide__label--text {
  writing-mode: horizontal-tb;
  background: rgba(231, 76, 60, 0.75);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.65rem;
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;
}

/* ============================================================
   BANNER CONTENT (voorbeeld tekst overlay)
   Also inside .banner__frame → same coordinate space.
   ============================================================ */
.banner__content {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  z-index: 4;
  padding: 2rem;
}

.banner__content--right {
  right: 18%;
  width: 25%;
  justify-content: flex-start;
}

.banner__content--center {
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  justify-content: center;
  text-align: center;
}

.banner__content--left {
  left: 18%;
  width: 25%;
  justify-content: flex-start;
}

.banner__title {
  font-size: clamp(0.8rem, 2vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  line-height: 1.15;
}

/* ============================================================
   SPECS SECTION
   ============================================================ */
.specs-section {
  background: var(--color-surface);
  padding: var(--spacing-xl) var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.specs-section__inner {
  max-width: 900px;
  margin: 0 auto;
}

.specs-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

@media (max-width: 600px) {
  .specs-grid {
    grid-template-columns: 1fr;
  }
}

.spec-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--spacing-md);
  text-align: center;
}

.spec-card__icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-xs);
}

.spec-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.spec-card p {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.specs-photo {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--spacing-md);
}

.specs-photo h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table td:first-child {
  color: var(--color-text-secondary);
  width: 50%;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-md);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}
