/* ==========================================================================
   country.css – Länderseite im "Kino"-Design (country.php, inc/country-page.php)
   Kopf: Farbschleier in den Flaggenfarben (--f1..--f3, aus der Flagge gelesen),
   darüber das unscharfe Foto der letzten Sichtung (assets/country.js).
   Fotos laden über assets/special.js (.sp-photo / .sp-ph / .sp-credit aus site.css).
   Heller Modus: Abschnitt unten.
   ========================================================================== */

/* ---------- Kopf ---------- */
.cx-hero { --f1: 57, 217, 245; --f2: 45, 224, 160; --f3: 23, 169, 208;
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: #050c17; color: #f3f7fb; }
.cx-hero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
  background: radial-gradient(38% 70% at 68% 25%, rgba(var(--f1), .75), transparent 70%),
              radial-gradient(30% 60% at 84% 55%, rgba(var(--f2), .6), transparent 70%),
              radial-gradient(34% 65% at 97% 85%, rgba(var(--f3), .75), transparent 70%); filter: blur(10px); }
.cx-bg { position: absolute; inset: -40px; z-index: 0; background-size: cover; background-position: center; filter: blur(34px) saturate(1.3); opacity: 0; transform: scale(1.1); transition: opacity .8s; }
.cx-bg.on { opacity: .45; }
.cx-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 12, 23, .96) 0%, rgba(5, 12, 23, .72) 45%, rgba(5, 12, 23, .2) 100%), linear-gradient(0deg, rgba(5, 12, 23, 1) 0%, transparent 40%); }
.cx-inner { position: relative; z-index: 2; max-width: 1380px; margin: 0 auto; padding: 44px 4vw 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 40px; align-items: center; }
.cx-crumbs { font-size: 13px; color: #8d9caf; margin-bottom: 18px; }
.cx-crumbs a { color: #b9c6d6; text-decoration: none; }
.cx-crumbs a:hover { color: #39d9f5; }
.cx-hero .eyebrow { color: #39d9f5; }
.cx-text { container-type: inline-size; min-width: 0; }
/* Schrift so gross, dass das längste Wort (--len Zeichen, aus PHP) plus Flagge in die Spalte passt */
.cx-hero h1 { --len: 8; display: flex; align-items: center; gap: .22em; font-size: clamp(36px, 6vw, 88px); font-size: clamp(30px, calc(100cqi / (var(--len) * .6 + 1)), 128px); line-height: .95; letter-spacing: -.055em; margin: 14px 0 12px; min-width: 0; }
.cx-hero h1 > span { color: transparent; background: linear-gradient(100deg, #fff 35%, #39d9f5); -webkit-background-clip: text; background-clip: text; overflow-wrap: break-word; min-width: 0; padding-bottom: .06em; }
.cx-hero h1 .cx-flag { width: .62em; height: auto; flex: none; border-radius: .08em; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .12); }
.cx-sub { font-size: clamp(18px, 2vw, 24px); font-weight: 600; margin: 0 0 22px; color: #dbe5f0; line-height: 1.3; }
.cx-sub span { color: #39d9f5; margin: 0 9px; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cx-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #f3f7fb;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); text-decoration: none; }
a.cx-chip:hover { border-color: #39d9f5; color: #fff; }
.cx-hero .seen-active { color: #2de0a0; border-color: rgba(45, 224, 160, .35); background: rgba(45, 224, 160, .1); }

.cx-photo { margin: 0; min-width: 0; }
.cx-photo > a { display: block; transform: perspective(1200px) rotateY(-8deg) rotateZ(1deg); }
.cx-photo-box { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #0f2036, #0a1626);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .12); }
.cx-photo-box .sp-ph { font-size: 64px; }
.cx-photo figcaption { font-size: 12px; color: #8d9caf; margin-top: 10px; text-align: right; }

/* Leiste "Latest sighting" */
.cx-strip { position: relative; z-index: 2; max-width: calc(1380px - 8vw); margin: 0 auto 32px; display: flex; align-items: center; gap: 22px; padding: 14px 16px 14px 22px;
  border-radius: 18px; background: rgba(13, 25, 41, .72); border: 1px solid rgba(57, 217, 245, .25); backdrop-filter: blur(10px); }
@media (max-width: 1380px) { .cx-strip { margin-left: 4vw; margin-right: 4vw; } }
.cx-tag { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: rgba(57, 217, 245, .15); color: #39d9f5; white-space: nowrap; }
.cx-reg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 17px; color: #fff; text-decoration: none; white-space: nowrap; }
.cx-reg:hover { color: #39d9f5; }
.cx-strip-msg { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; font-size: 14px; color: #c8d4e2; }
.cx-strip .live-dot { width: 10px; height: 10px; border-radius: 50%; background: #2de0a0; box-shadow: 0 0 0 5px rgba(45, 224, 160, .2); flex: none; animation: cxPulse 1.6s infinite; }
@keyframes cxPulse { 50% { opacity: .35; } }
.cx-strip dl { display: flex; gap: 22px; margin: 0; }
.cx-strip dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8d9caf; font-weight: 700; white-space: nowrap; }
.cx-strip dd { margin: 2px 0 0; font-weight: 800; font-size: 16px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-strip dd a { color: inherit; text-decoration: none; }
.cx-strip dd a:hover { color: #39d9f5; }
.cx-btn { display: inline-flex; gap: 6px; align-items: center; padding: 10px 16px; border-radius: 12px; background: linear-gradient(135deg, #39d9f5, #159bd0); color: #04121f; font-weight: 800; text-decoration: none; font-size: 14px; white-space: nowrap; }
.cx-btn:hover { color: #04121f; filter: brightness(1.08); }
.cx-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; }

/* ---------- Inhalt ---------- */
.cx-page { padding-top: 26px; }
.cx-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.cx-stats div { padding: 16px 18px; border-right: 1px solid var(--line); min-width: 0; }
.cx-stats div:last-child { border-right: 0; }
.cx-stats dt { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cx-stats dd { margin: 5px 0 0; font-size: 20px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-sec { margin-top: 22px; }
.cx-ops, .cx-abroad, .cx-bars, .cx-age, .cx-seen { padding: 20px 21px 22px; }
.cx-sec .panel-note { padding-top: 0; }
.cx-sec .panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Betreiber */
.cx-ops { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 14px; }
.cx-ops.few { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-op { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none; min-width: 0; transition: border-color .2s, transform .2s; }
.cx-op:hover { border-color: var(--cyan); transform: translateY(-2px); }
.cx-op-photo { position: relative; aspect-ratio: auto; width: 100%; height: 74px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #0f2036, #0a1626); }
.cx-op-photo .sp-ph { font-size: 20px; }
.cx-op-photo .sp-credit { display: none; }
.cx-op > div > b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-op > div > span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cx-op.big { grid-row: span 2; grid-template-columns: 1fr; align-content: start; }
.cx-ops.few .cx-op.big { grid-row: auto; }
.cx-op.big .cx-op-photo { height: 170px; }
.cx-op.big .cx-op-photo .sp-credit { display: block; }
.cx-op.big > div > b { font-size: 26px; }
.cx-share { height: 6px !important; border-radius: 6px; background: var(--line); margin-top: 9px !important; overflow: hidden; }
.cx-share i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--green)); }

.cx-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.cx-row.single { grid-template-columns: 1fr; }
.cx-abroad { list-style: none; margin: 0; padding-top: 8px; }
.cx-abroad li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.cx-abroad li .flag { flex: none; }
.cx-abroad a { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cx-abroad a:hover { color: var(--cyan); }
.cx-abroad small { flex: 1; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-abroad b { color: var(--cyan); font-variant-numeric: tabular-nums; }

.cx-bars { list-style: none; margin: 0; display: grid; gap: 10px; }
.cx-bars li { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 48px; gap: 12px; align-items: center; }
.cx-bars a { color: var(--text); text-decoration: none; min-width: 0; }
.cx-bars a:hover b { color: var(--cyan); }
.cx-bars a b { display: block; }
.cx-bars a span { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-bars i { height: 10px; border-radius: 6px; background: var(--line); position: relative; overflow: hidden; }
.cx-bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.cx-bars em { font-style: normal; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

/* Alter */
.cx-age { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 26px; align-items: end; }
.cx-dec { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; height: 210px; align-items: end; }
.cx-dec li { height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 700; min-width: 0; }
.cx-dec i { width: 100%; height: var(--h); border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--cyan), var(--cyan-2)); opacity: .55; }
.cx-dec li.peak i { opacity: 1; box-shadow: 0 0 24px rgba(57, 217, 245, .25); }
.cx-dec li.zero i { height: 3px; background: var(--line); opacity: 1; }
.cx-dec em { font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; }
.cx-dec span { white-space: nowrap; }
.cx-ends { display: grid; gap: 12px; }
.cx-end { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none; min-width: 0; }
.cx-end:hover { border-color: var(--cyan); }
.cx-end b { display: block; font-size: 24px; margin-top: 4px; }
.cx-end small { display: block; color: var(--muted); }

/* Zuletzt gesehen */
.cx-seen { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.cx-seen a { position: relative; display: block; min-width: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s; }
.cx-seen a:hover { border-color: var(--cyan); transform: translateY(-2px); }
.cx-seen-photo { position: relative; aspect-ratio: 3 / 2; background: linear-gradient(135deg, #0f2036, #0a1626); }
.cx-seen-photo .sp-ph { font-size: 22px; }
.cx-seen-photo .sp-credit { display: none; }
.cx-seen a > b { display: block; padding: 8px 10px 0; }
.cx-seen a > span { display: block; padding: 0 10px 10px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-seen time { position: absolute; top: 8px; left: 8px; z-index: 3; padding: 3px 8px; border-radius: 999px; background: rgba(5, 12, 23, .78); color: #2de0a0; font-size: 12px; font-weight: 800; }

/* Liste + Filter */
.cx-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cx-filter input[type=search] { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); min-width: 260px; font: inherit; font-size: 14px; }
.cx-filter button { padding: 9px 14px; border-radius: 12px; border: 0; background: var(--cyan); color: #04121f; font-weight: 800; cursor: pointer; font: inherit; font-weight: 800; font-size: 14px; }
.cx-filter a { font-size: 13px; color: var(--muted); }

/* ---------- Heller Modus ---------- */
:root[data-theme="light"] .cx-hero { background: #eef3f8; color: var(--text); }
:root[data-theme="light"] .cx-hero::after { opacity: .35; }
:root[data-theme="light"] .cx-bg.on { opacity: .35; filter: blur(34px) saturate(1.1); }
:root[data-theme="light"] .cx-hero::before { background: linear-gradient(90deg, rgba(243, 246, 250, .97) 0%, rgba(243, 246, 250, .8) 45%, rgba(243, 246, 250, .3) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
:root[data-theme="light"] .cx-crumbs { color: var(--muted); }
:root[data-theme="light"] .cx-crumbs a { color: var(--soft-text); }
:root[data-theme="light"] .cx-crumbs a:hover { color: var(--cyan); }
:root[data-theme="light"] .cx-hero .eyebrow, :root[data-theme="light"] .cx-sub span { color: var(--cyan); }
:root[data-theme="light"] .cx-hero h1 > span { background-image: linear-gradient(100deg, #0f1c2d 35%, #08739a); }
:root[data-theme="light"] .cx-hero h1 .cx-flag { box-shadow: 0 10px 26px rgba(16, 38, 66, .2), 0 0 0 1px rgba(16, 38, 66, .08); }
:root[data-theme="light"] .cx-sub { color: var(--soft-text); }
:root[data-theme="light"] .cx-chip { color: var(--text); background: rgba(255, 255, 255, .75); border-color: var(--line); }
:root[data-theme="light"] a.cx-chip:hover { color: var(--cyan); border-color: var(--cyan); }
:root[data-theme="light"] .cx-hero .seen-active { color: #0b7a55; border-color: #a9dfc9; background: #e3f6ef; }
:root[data-theme="light"] .cx-photo-box { background: linear-gradient(135deg, #dfe8f1, #eef3f8); box-shadow: 0 24px 60px rgba(16, 38, 66, .22), 0 0 0 1px rgba(16, 38, 66, .08); }
:root[data-theme="light"] .cx-photo figcaption { color: var(--muted); }
:root[data-theme="light"] .cx-strip { background: rgba(255, 255, 255, .85); border-color: var(--line); box-shadow: 0 10px 30px rgba(16, 38, 66, .08); }
:root[data-theme="light"] .cx-tag { background: #e1f0f6; color: var(--cyan); }
:root[data-theme="light"] .cx-reg, :root[data-theme="light"] .cx-strip dd { color: var(--text); }
:root[data-theme="light"] .cx-reg:hover, :root[data-theme="light"] .cx-strip dd a:hover { color: var(--cyan); }
:root[data-theme="light"] .cx-strip-msg, :root[data-theme="light"] .cx-strip dt { color: var(--muted); }
:root[data-theme="light"] .cx-strip .live-dot { background: #0b8a61; box-shadow: 0 0 0 5px rgba(11, 138, 97, .18); }
:root[data-theme="light"] .cx-btn, :root[data-theme="light"] .cx-filter button { background: linear-gradient(135deg, #08739a, #065f80); color: #fff; }
:root[data-theme="light"] .cx-op-photo, :root[data-theme="light"] .cx-seen-photo { background: linear-gradient(135deg, #dfe8f1, #eef3f8); }
:root[data-theme="light"] .cx-seen time { background: rgba(255, 255, 255, .92); color: #0b7a55; }
:root[data-theme="light"] .cx-dec li.peak i { box-shadow: 0 0 20px rgba(8, 115, 154, .2); }

@media (prefers-reduced-motion: reduce) {
  .cx-strip .live-dot { animation: none; }
  .cx-photo > a { transform: none; }
  .cx-op, .cx-seen a { transition: none; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .cx-seen { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cx-age { grid-template-columns: 1fr; }
}
@media (max-width: 1050px) {
  .cx-inner { grid-template-columns: 1fr; }
  .cx-photo { max-width: 520px; }
  .cx-photo > a { transform: none; }
  .cx-strip { flex-wrap: wrap; }
  .cx-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cx-stats div:nth-child(3n) { border-right: 0; }
  .cx-stats div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .cx-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-op.big { grid-row: auto; grid-column: 1 / -1; }
  .cx-row { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 650px) {
  .cx-inner { padding: 24px 16px 18px; gap: 22px; }
  .cx-hero h1 { font-size: clamp(30px, calc(100cqi / (var(--len) * .6 + 1)), 64px); }
  .cx-strip { margin: 0 16px 22px; gap: 12px; padding: 14px; }
  .cx-strip-msg { flex-basis: 100%; order: 3; }
  .cx-strip dl { order: 4; width: 100%; justify-content: space-between; }
  .cx-btn { order: 5; width: 100%; justify-content: center; }
  .cx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-stats div { border-bottom: 1px solid var(--line); }
  .cx-stats div:nth-child(3n) { border-right: 1px solid var(--line); }
  .cx-stats div:nth-child(2n) { border-right: 0; }
  .cx-stats div:nth-last-child(-n+2) { border-bottom: 0; }
  .cx-ops { grid-template-columns: 1fr; }
  .cx-op.big .cx-op-photo { height: 150px; }
  .cx-bars li { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 42px; gap: 10px; }
  .cx-dec { gap: 4px; height: 180px; }
  .cx-dec li { font-size: 10px; }
  .cx-dec em { font-size: 10px; }
  .cx-seen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-filter, .cx-filter input[type=search] { width: 100%; min-width: 0; }
  .cx-filter input[type=search] { flex: 1; }
}
