/* Dashboard-layouts (gedeeld tussen player en dashboard-editor). Maten in cqmin (korte zijde van het scherm), zodat
   liggend en staand dezelfde verhoudingen krijgen; de indeling schakelt op staande schermen om (zie onderaan). */
@font-face { font-family: "SG Jost"; src: url("/shared/fonts/jost.woff2") format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "SG Oswald"; src: url("/shared/fonts/oswald.woff2") format("woff2"); font-weight: 200 700; font-display: block; }

.lay {
  position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column;
  background: var(--l-bg); color: var(--l-text);
  --gap: 2.2cqmin; --pad: 3.4cqmin; --radius: 0.5cqmin;
  font-family: "SG Jost", "Futura", "Century Gothic", sans-serif;
  padding: var(--pad) calc(var(--pad) * 1.15);
  gap: var(--gap);
}
.lay.head-oswald .lay-title, .lay.head-oswald .lay-label, .lay.head-oswald .lay-hclock b,
.lay.head-oswald .clk b, .lay.head-oswald .wx-now b, .lay.head-oswald .cd b, .lay.head-oswald .lay-ticker .lab {
  font-family: "SG Oswald", "Oswald", "Bebas Neue", "Arial Narrow", sans-serif; text-transform: uppercase;
}
.lay.head-jost .lay-title, .lay.head-jost .lay-label { font-family: "SG Jost", sans-serif; }

/* achtergrondfoto */
.lay-bgimg { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.lay-bgimg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--dim, 0)); }
.lay-placed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: center; display: block; }

/* diagonale vlakken zoals op carre1749.com */
.lay-decor { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.lay-decor i { position: absolute; background: var(--l-accent); }
.lay-decor .d1 { left: 0; bottom: 0; width: 38cqw; height: 46cqh; clip-path: polygon(0 18%, 100% 100%, 0 100%); opacity: .22; }
.lay-decor .d2 { right: 0; top: 0; width: 30cqw; height: 40cqh; clip-path: polygon(0 0, 100% 0, 100% 70%); opacity: .14; }
.lay > *:not(.lay-decor, .lay-bgimg) { position: relative; z-index: 1; }

/* header */
.lay-head { display: flex; align-items: center; justify-content: space-between; flex: none; padding-bottom: 1.6cqmin; border-bottom: 0.18cqmin solid color-mix(in srgb, var(--l-accent) 55%, transparent); }
.lay-brand { display: flex; align-items: center; gap: 2cqmin; }
.lay-brand img { height: 7.5cqmin; width: auto; object-fit: contain; }
.lay-title { font-size: 5.6cqmin; line-height: 1; font-weight: 500; letter-spacing: .04em; color: var(--l-accent); }
.lay-sub { font-size: 2.3cqmin; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-top: .6cqmin; }
.lay-hclock { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.lay-hclock b { font-size: 5.2cqmin; line-height: 1; font-weight: 500; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.lay-hclock span { display: block; font-size: 2cqmin; opacity: .8; margin-top: .5cqmin; }
.lay-hclock span::first-letter, .clk span::first-letter, .wx-days span::first-letter { text-transform: uppercase; }

/* body-templates */
.lay-body { flex: 1; min-height: 0; display: flex; gap: var(--gap); }
.tpl-side .lay-main { flex: 1 1 auto; }
.tpl-side .lay-tiles { flex: 0 0 29cqw; display: flex; flex-direction: column; gap: var(--gap); }
.tpl-bottom .lay-body { flex-direction: column; }
.tpl-bottom .lay-main { flex: 1 1 auto; }
.tpl-bottom .lay-tiles { flex: 0 0 27cqmin; display: flex; gap: var(--gap); }
.tpl-bottom .lay-tile { flex-basis: 0; }
.tpl-tiles > .lay-body { display: block; }
.tpl-tiles > .lay-body > .lay-tiles { height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: var(--gap); }
.tpl-tiles .lay-tile { grid-row: span var(--span, 1); }
.tpl-full { padding: 0; }
.tpl-full .lay-main { position: absolute; inset: 0; border-radius: 0; }
.tpl-full .lay-body { position: absolute; inset: 0; pointer-events: none; }
.tpl-full .lay-tiles { position: absolute; right: 3cqmin; top: 3cqmin; bottom: 3cqmin; width: 27cqw; display: flex; flex-direction: column; justify-content: flex-end; gap: 2cqmin; }
.tpl-full .lay-tile { flex: 0 1 auto !important; min-height: 13cqmin; background: color-mix(in srgb, var(--l-surface) 88%, transparent); backdrop-filter: blur(8px); }
.tpl-full.has-ticker .lay-tiles { bottom: 10cqmin; }
.tpl-full .lay-ticker { position: absolute; left: 0; right: 0; bottom: 0; }

/* twee vakken boven elkaar met een rij widgets eronder (bedoeld voor staande schermen) */
.tpl-duo .lay-body { flex-direction: column; }
.tpl-duo .lay-main { flex: 1.25 1 0; min-height: 0; }
.tpl-duo .lay-main.second, .tpl-duo .lay-panel { flex: 1 1 0; min-height: 0; }
.lay-panel { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--l-surface); color: var(--l-stext);
  border-radius: var(--radius); border-top: 0.5cqmin solid var(--l-accent); padding: 2.6cqmin 3.2cqmin; box-shadow: 0 .8cqmin 2.4cqmin rgba(0, 0, 0, .16); }
.lay-panel .txt { flex: 1 1 auto; min-height: 0; overflow: hidden; font-size: calc(4.2cqmin * var(--fit, 1)); line-height: 1.35; }
/* rij widgets: allemaal even breed, het aantal bepaalt de breedte */
.tpl-duo .lay-tiles { flex: 0 0 22cqh; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr); gap: var(--gap); }

/* weer in een smalle tegel (rij widgets): compacter, dagen als kolommetjes (dag / icoon / temp) */
.tpl-duo .t-weather .wx-now { gap: 1.4cqmin; }
.tpl-duo .t-weather .wx-now i { width: calc(6cqmin * var(--ts, 1)); height: calc(6cqmin * var(--ts, 1)); }
.tpl-duo .t-weather .wx-now b { font-size: calc(6cqmin * var(--ts, 1)); }
.tpl-duo .t-weather .wx-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.tpl-duo .t-weather .wx-days > div { grid-template-columns: 1fr; justify-items: center; row-gap: .4cqmin; }
.tpl-duo .t-weather .wx-days span, .tpl-duo .t-weather .wx-days svg, .tpl-duo .t-weather .wx-days b { grid-column: 1; grid-row: auto; }
.tpl-duo .t-weather .wx-days svg { width: calc(3.2cqmin * var(--ts, 1)); height: calc(3.2cqmin * var(--ts, 1)); }

/* staand: drie foto's boven elkaar */
.tpl-stack .lay-body { flex-direction: column; }
.lay-slot { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; border-radius: var(--radius); background: #000;
  box-shadow: 0 1.2cqmin 3cqmin rgba(0, 0, 0, .28); }
.lay-slot.empty { background: color-mix(in srgb, var(--l-text) 8%, transparent); box-shadow: none; outline: .25cqmin dashed color-mix(in srgb, var(--l-text) 30%, transparent); outline-offset: -.25cqmin; }
.lay-slot > .lay-vph { position: absolute; inset: 0; }

/* hoofdzone */
.lay-main { position: relative; overflow: hidden; border-radius: var(--radius); background: #000; min-width: 0; box-shadow: 0 1.2cqmin 3cqmin rgba(0, 0, 0, .28); }
.lay-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
.lay-slide.on { opacity: 1; }
.lay-slide > img, .lay-slide > video { width: 100%; height: 100%; object-fit: var(--fit, cover); display: block; }
.lay-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: color-mix(in srgb, var(--l-bg) 80%, #000); }
.lay-placeholder .lay-title { font-size: 9cqmin; }
.lay-vph { width: 100%; height: 100%; background: repeating-linear-gradient(135deg, #1d2a38 0 2cqmin, #22303f 2cqmin 4cqmin); }

/* beeld-in-beeld */
.lay-pip { position: absolute; width: var(--pip, 32%); aspect-ratio: 16 / 9; z-index: 4; background: #000; overflow: hidden;
  border: 0.45cqmin solid var(--l-accent); border-radius: var(--radius); box-shadow: 0 1cqmin 3cqmin rgba(0, 0, 0, .45); }
.lay-pip > img, .lay-pip > video, .lay-pip > .lay-vph { width: 100%; height: 100%; object-fit: cover; display: block; }
.lay-pip.pos-br { right: 2.5cqmin; bottom: 2.5cqmin; }
.lay-pip.pos-bl { left: 2.5cqmin; bottom: 2.5cqmin; }
.lay-pip.pos-tr { right: 2.5cqmin; top: 2.5cqmin; }
.lay-pip.pos-tl { left: 2.5cqmin; top: 2.5cqmin; }
.lay-pip-label { position: absolute; left: 1cqmin; top: 1cqmin; background: var(--l-accent); color: var(--l-bg); font-size: 1.6cqmin; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: .3cqmin 1cqmin; }

/* tegels */
.lay-tile { position: relative; min-height: 0; min-width: 0; flex: 1 1 0; overflow: hidden; display: flex; flex-direction: column;
  background: var(--l-surface); color: var(--l-stext); border-radius: var(--radius); padding: 1.9cqmin 2.4cqmin;
  border-top: 0.5cqmin solid var(--l-accent); box-shadow: 0 .8cqmin 2.4cqmin rgba(0, 0, 0, .16); }
.lay-label { font-size: 1.9cqmin; letter-spacing: .16em; font-weight: 500; color: color-mix(in srgb, var(--l-accent) 70%, var(--l-stext)); margin-bottom: 0.9cqmin; flex: none; }
.lay-tile.media { padding: 0; border-top: 0; }
.lay-tile.media > img, .lay-tile.media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lay-tile.media .lay-label { position: absolute; left: 0; bottom: 0; margin: 0; padding: .8cqmin 1.6cqmin; background: var(--l-accent); color: var(--l-bg); z-index: 1; }

.clk { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.clk b { font-size: calc(9cqmin * var(--ts, 1)); line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.clk span { display: block; font-size: calc(2.4cqmin * var(--ts, 1)); opacity: .8; }

.txt { flex: 1 1 auto; min-height: 0; font-size: calc(2.3cqmin * var(--ts, 1) * var(--fit, 1)); line-height: 1.35; overflow: hidden; }
.txt ul { margin: .4cqmin 0; padding-left: 2.4cqmin; }
.txt strong { color: color-mix(in srgb, var(--l-accent) 55%, var(--l-stext)); }

.cd { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cd b { font-size: calc(7.5cqmin * var(--ts, 1)); line-height: 1; font-weight: 500; }
.cd span { font-size: calc(2.3cqmin * var(--ts, 1)); opacity: .8; margin-top: .8cqmin; }

.wx { flex: 1; display: flex; flex-direction: column; justify-content: safe center; gap: 1.6cqmin; min-height: 0; }
.wx-desc { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-now { display: flex; align-items: center; gap: 2cqmin; }
.wx-now i { width: calc(7.5cqmin * var(--ts, 1)); height: calc(7.5cqmin * var(--ts, 1)); color: color-mix(in srgb, var(--l-accent) 70%, var(--l-stext)); flex: none; }
.wx-now i svg { width: 100%; height: 100%; }
.wx-now > div { min-width: 0; } /* omschrijving mag inkorten i.p.v. buiten de tegel te lopen */
.wx-now b { display: block; font-size: calc(6.8cqmin * var(--ts, 1)); line-height: 1; font-weight: 500; }
.wx-desc { font-size: calc(2.1cqmin * var(--ts, 1)); opacity: .8; }
.wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1cqmin; border-top: .15cqmin solid color-mix(in srgb, var(--l-stext) 15%, transparent); padding-top: 1.2cqmin; }
.wx-days > div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 1cqmin; align-items: center; font-size: calc(2cqmin * var(--ts, 1)); }
.wx-days span { display: block; grid-column: 1 / 3; opacity: .7; font-size: calc(1.8cqmin * var(--ts, 1)); }
.wx-days svg { width: calc(3.6cqmin * var(--ts, 1)); height: calc(3.6cqmin * var(--ts, 1)); grid-row: 2; }
.wx-days b { font-weight: 600; grid-row: 2; }
.wx-days em { display: none; }

.nw { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-height: 0; }
.nw-item { flex: 1 1 auto; min-height: 0; opacity: 0; transform: translateY(1cqmin); transition: opacity .35s, transform .35s; overflow: hidden; }
.nw-item.on { opacity: 1; transform: none; }
.nw-item b { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: calc(3cqmin * var(--ts, 1) * var(--fit, 1)); line-height: 1.25; font-weight: 600; }
.nw-item p { font-size: calc(2.2cqmin * var(--ts, 1) * var(--fit, 1)); line-height: 1.4; margin: 1.2cqmin 0 0; opacity: .8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.nw-dots { display: flex; gap: .8cqmin; margin-top: 1cqmin; }
.nw-dots i { width: 1cqmin; height: 1cqmin; border-radius: 50%; background: color-mix(in srgb, var(--l-stext) 22%, transparent); }
.nw-dots i.on { background: var(--l-accent); }

/* lichtkrant */
.lay-ticker { flex: none; display: flex; align-items: stretch; height: 6.2cqmin; background: var(--l-surface); color: var(--l-stext); border-radius: var(--radius); overflow: hidden; }
.lay-ticker .lab { flex: none; display: flex; align-items: center; padding: 0 2.4cqmin; background: var(--l-accent); color: var(--l-bg); font-size: 2.4cqmin; letter-spacing: .14em; font-weight: 500; }
.lay-ticker .win { flex: 1; overflow: hidden; display: flex; align-items: center; }
.lay-ticker .track { white-space: nowrap; font-size: 2.7cqmin; padding-left: 100%; animation: lay-ticker 40s linear infinite; }
@keyframes lay-ticker { to { transform: translateX(-100%); } }

/* ---- staand scherm: tegels onder het hoofdbeeld in twee kolommen i.p.v. een smalle zijbalk ---- */
@container (orientation: portrait) {
  /* zijbalk en balk onder: hoofdbeeld boven, één rij even grote widgets onderin */
  .tpl-side .lay-body { flex-direction: column; }
  .tpl-side .lay-main, .tpl-bottom .lay-main { flex: 1 1 0; min-height: 0; }
  .tpl-side .lay-tiles, .tpl-bottom .lay-tiles {
    flex: 0 0 22cqh; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr); gap: var(--gap);
  }
  .tpl-tiles > .lay-body > .lay-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-full .lay-tiles { left: 3cqmin; right: 3cqmin; top: auto; bottom: 3cqmin; width: auto; height: 22cqh;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .tpl-full.has-ticker .lay-tiles { bottom: 9cqmin; }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-now { gap: 1.4cqmin; }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-now i { width: calc(6cqmin * var(--ts, 1)); height: calc(6cqmin * var(--ts, 1)); }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-now b { font-size: calc(6cqmin * var(--ts, 1)); }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-days > div { grid-template-columns: 1fr; justify-items: center; row-gap: .4cqmin; }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-days :is(span, svg, b) { grid-column: 1; grid-row: auto; }
  :is(.tpl-side, .tpl-bottom, .tpl-full) .t-weather .wx-days svg { width: calc(3.2cqmin * var(--ts, 1)); height: calc(3.2cqmin * var(--ts, 1)); }
  .lay-head { flex-wrap: wrap; gap: 1.5cqmin; }
  .lay-pip { width: calc(var(--pip, 32%) * 1.6); }
  .lay-decor .d1 { width: 60cqw; height: 30cqh; }
  .lay-decor .d2 { width: 50cqw; height: 26cqh; }
}
