/* ============================================================
   #EUinfluencer social wall — visual system
   Palette + type lifted from znconsulting.com/euinfluencer-2026
   ============================================================ */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('./fonts/BricolageGrotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('./fonts/BricolageGrotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy:        #001545;
  --navy-deep:   #03103e;
  --navy-abyss:  #000d29;
  --navy-panel:  #0a2160;
  --line:        rgba(255, 255, 255, 0.12);
  --line-strong: #465a8e;

  --coral:   #ff595b;
  --magenta: #ef2988;
  --purple:  #9a45c2;
  --cyan:    #00c9ff;
  --mint:    #5dfed6;
  --green:   #93c437;
  --amber:   #ffb020;
  --cream:   #f8f0e6;

  --ink:       #ffffff;
  --ink-soft:  rgba(255, 255, 255, 0.74);
  --ink-faint: rgba(255, 255, 255, 0.48);

  /* tuned by wall.js from ?params, then written back here */
  --canvas-w: 5760px;
  --canvas-h: 640px;
  --card-w: 300px;
  --gap: 30px;
  --pad-x: 46px;
  --header-h: 84px;
  --scale: 1;
  --card-scale: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #001545;
  overflow: hidden;
}
/* ?transparent=1 — for embedding over a page that already has its own
   background (an <iframe>, a section of a site, OBS, …). */
html.is-transparent,
html.is-transparent body {
  background: transparent;
}

body {
  font-family: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- fixed-canvas scaling ---------- */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #001545;
}
html.is-transparent #viewport { background: transparent; }

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--canvas-w, 5760px);
  height: var(--canvas-h, 640px);
  overflow: hidden;
  background: #001545;
  transform: translate(-50%, -50%) scale(var(--scale));
  transform-origin: center center;
}
html.is-transparent #stage { background: transparent; }

/* ---------- top bar ---------- */
#topbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 var(--pad-x);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 5;
}
#stage[data-header="0"] #topbar { display: none; }
#stage[data-header="0"] #track { top: 0; }

#brand {
  height: 42px;
  width: auto;
  display: block;
}

#wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
  padding-left: 22px;
  margin-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
#wall-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
#wall-sub {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 4.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

#status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cream);
}
#status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 0 rgba(239, 41, 136, 0.55);
  animation: pulse 2.4s ease-out infinite;
}
#status.is-stale #status-dot { background: var(--amber); animation: none; }
#status.is-down  #status-dot { background: var(--coral); animation: none; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 41, 136, 0.5); }
  70%  { box-shadow: 0 0 0 18px rgba(239, 41, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 41, 136, 0); }
}

/* ---------- the single row ---------- */
#track {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  display: flex;
  align-items: stretch;
  gap: var(--gap);
  padding: 34px 0 40px var(--pad-x);
}

/* ---------- a post card ---------- */
.card {
  --accent: var(--cyan);
  position: relative;
  flex: 0 0 var(--card-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  padding:
    calc(26px * var(--card-scale))
    calc(26px * var(--card-scale))
    calc(22px * var(--card-scale));
  border: 1px solid var(--line);
  border-radius: calc(20px * var(--card-scale));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    var(--navy-panel);
  box-shadow: 0 28px 64px -22px rgba(0, 0, 0, 0.6);
  transition:
    margin-left 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.7s ease,
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease,
    filter 0.2s ease;
}
/* the whole card is the link to the post (when Walls.io gave us one) */
a.card:hover {
  border-color: var(--accent);
  filter: brightness(1.08);
}
.card::before { /* accent cap */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--accent);
}
.card::after { /* accent glow */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(220px * var(--card-scale));
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%);
  pointer-events: none;
}

.card.is-entering {
  margin-left: calc(-1 * (var(--card-w) + var(--gap)));
  opacity: 0;
  transform: scale(0.96);
}
.card.is-leaving {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* header */
.c-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(14px * var(--card-scale));
  flex: 0 0 auto;
}
.c-avatar {
  width: calc(62px * var(--card-scale));
  height: calc(62px * var(--card-scale));
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: var(--navy-deep);
}
.c-avatar--mono {
  display: grid;
  place-items: center;
  font-size: calc(24px * var(--card-scale));
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--navy-deep));
}
.c-who { min-width: 0; flex: 1 1 auto; }
.c-name {
  font-size: calc(22px * var(--card-scale));
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-handle {
  margin-top: 2px;
  font-size: calc(15px * var(--card-scale));
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-handle[hidden] { display: none; }
/* when there's no handle line, vertically centre the name against the avatar */
.c-who:has(.c-handle[hidden]) { display: flex; align-items: center; }
.c-net {
  /* decorative network mark — the whole card is the clickable link now */
  flex: none;
  display: block;
  width: calc(34px * var(--card-scale));
  height: calc(34px * var(--card-scale));
  color: var(--accent);
}
.c-net svg { width: 100%; height: 100%; display: block; fill: currentColor; }

/* icons supplied as SVG files in /assets — masked so they take the accent colour */
.c-net--img {
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.c-net--x         { -webkit-mask-image: url("./assets/x.svg");         mask-image: url("./assets/x.svg"); }
.c-net--facebook  { -webkit-mask-image: url("./assets/facebook.svg");  mask-image: url("./assets/facebook.svg"); }
.c-net--instagram { -webkit-mask-image: url("./assets/instagram.svg"); mask-image: url("./assets/instagram.svg"); }
.c-net--linkedin  { -webkit-mask-image: url("./assets/linkedin.svg");  mask-image: url("./assets/linkedin.svg"); }
.c-net--bluesky   { -webkit-mask-image: url("./assets/bluesky.svg");   mask-image: url("./assets/bluesky.svg"); }

/* media */
.c-media {
  position: relative;
  margin-top: calc(18px * var(--card-scale));
  flex: 1 1 auto;
  min-height: 0;
  max-height: 60%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy-deep);
}
.c-media img,
.c-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* text */
.c-text {
  margin-top: calc(18px * var(--card-scale));
  font-size: calc(25px * var(--card-scale));
  line-height: 1.36;
  color: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  /* -webkit-line-clamp alone doesn't reliably cap a flex item's own height
     (it can grow taller via flex-grow and let a stray extra line peek through
     before "…"), so pin the box to exactly 6 lines explicitly. */
  max-height: calc(6 * 1.36em);
  flex: 1 1 auto;
}
/* media cards: keep the text inline inside the -webkit-box so line-clamp works.
   text-only cards: block, so fitCard() can measure its wrapped height. */
.c-text__in { display: inline; }
.card.no-media .c-text__in { display: block; }
.c-text .hl { color: var(--accent); font-weight: 600; }

.card.no-media .c-media { display: none; }
.card.no-media .c-text {
  flex: 1 1 auto;
  margin-top: calc(22px * var(--card-scale));
  display: flex;
  align-items: center;
  font-size: calc(34px * var(--card-scale)); /* seed size; fitCard() grows/shrinks it to fit */
  font-weight: 500;
  line-height: 1.28;
  -webkit-line-clamp: unset;
  max-height: none;
}
.card.no-media .c-quote {
  position: absolute;
  top: calc(84px * var(--card-scale));
  right: calc(20px * var(--card-scale));
  font-size: calc(180px * var(--card-scale));
  font-weight: 800;
  line-height: 0.7;
  color: var(--accent);
  opacity: 0.16;
  pointer-events: none;
}

/* footer */
.c-foot {
  margin-top: calc(16px * var(--card-scale));
  display: flex;
  align-items: center;
  gap: calc(10px * var(--card-scale));
  flex: 0 0 auto;
  font-size: calc(14px * var(--card-scale));
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cream);
}
.c-time { font-weight: 700; }

/* ---------- edge fades so cards slip in / out softly ---------- */
#edge-fade {
  position: absolute;
  inset: var(--header-h) 0 0 0;
  pointer-events: none;
  z-index: 4;
}
/* the fades blend the row into the navy background — with no background
   there's nothing to blend into, so they'd just look like dark smudges */
html.is-transparent #edge-fade { display: none; }
#edge-fade::before,
#edge-fade::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
}
#edge-fade::before {
  left: 0;
  background: linear-gradient(90deg, var(--navy) 10%, transparent);
}
#edge-fade::after {
  right: 0;
  width: 180px;
  background: linear-gradient(270deg, var(--navy) 8%, transparent);
}

/* ---------- empty state ---------- */
#empty {
  position: absolute;
  inset: var(--header-h) 0 0 0;
  display: grid;
  place-items: center;
  z-index: 6;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(239, 41, 136, 0.18), transparent 60%),
    var(--navy);
  transition: opacity 0.45s ease;
}
html.is-transparent #empty { background: transparent; }
#empty.is-hidden { opacity: 0; pointer-events: none; }
#empty-inner { text-align: center; color: var(--ink-soft); }
.empty-tag {
  display: inline-block;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  padding: 10px 22px;
  border: 2px solid var(--magenta);
  border-radius: 6px;
}
#empty-inner p {
  margin: 22px 0 0;
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .card { transition-duration: 0.3s; }
  #status-dot { animation: none; }
}
