/* ============================================================
   Balkan TET 2026 — adventure dark theme
   ============================================================ */
:root {
  --bg: #0e1116;
  --bg-2: #161b22;
  --bg-3: #1f2630;
  --line: #2a323d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #f4b400;          /* dirt-bike yellow */
  --accent-2: #ff7a00;        /* TET orange */
  --christian: #E53935;
  --tony:      #F57C00;
  --claus:     #FBC02D;
  --van:       #607D8B;
  --tet:       #FFD54F;
  --good: #2ea043;
  --warn: #d29922;
  --bad:  #f85149;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin:0; padding:0; color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-text-size-adjust: 100%;
       background-color: var(--bg);
       background-size: cover; background-position: center center;
       background-attachment: fixed; background-repeat: no-repeat; }

/* ===== Faded ADV background per page ============================
   Layered: dark gradient (top) + the ADV image (below). The gradient
   opacity controls how much of the image bleeds through. */
body.page-itinerary, body.page-variants, body.page-gpx {
  background-image: linear-gradient(180deg, rgba(14,17,22,0.78) 0%, rgba(14,17,22,0.88) 100%),
                    url("/assets/img/bg-mountain.jpg");
}
body.page-riders, body.page-contact {
  background-image: linear-gradient(180deg, rgba(14,17,22,0.78) 0%, rgba(14,17,22,0.88) 100%),
                    url("/assets/img/bg-coast.jpg");
}
body.page-videos, body.page-day {
  background-image: linear-gradient(180deg, rgba(14,17,22,0.78) 0%, rgba(14,17,22,0.88) 100%),
                    url("/assets/img/bg-forest.jpg");
}
/* page-home keeps its hero; page-map is full-screen map (no body bg). */
h1, h2, h3, .display { font-family: 'Bebas Neue', 'Inter', sans-serif; letter-spacing: 1px; font-weight: 400; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin: 1em 0 .4em; color: var(--accent); }
h3 { font-size: 1.2rem; margin: .8em 0 .4em; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
small { color: var(--muted); }
hr { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* ===== Header ===== */
.site-hdr {
  position: sticky; top:0; z-index: 500;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem;
  background: linear-gradient(180deg, #0e1116ee, #0e1116cc);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.brand img { display: block; }
.brand-txt strong { font-family:'Bebas Neue'; font-size: 1.4rem; letter-spacing: 1px; line-height: 1; display: block; }
.brand-txt strong span { color: var(--accent); }
.brand-txt small { color: var(--muted); font-size: .72rem; }

.primary-nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.primary-nav a {
  color: var(--text); padding: .5rem .85rem; border-radius: 6px;
  font-weight: 600; font-size: .92rem; opacity: .8;
}
.primary-nav a:hover, .primary-nav a.on {
  background: var(--bg-3); color: var(--accent); opacity: 1;
}
.nav-toggle { display: none; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: .4rem .7rem; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 720px) {
  .primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-2); flex-direction: column; padding: .5rem; border-bottom: 1px solid var(--line); }
  .primary-nav.open { display: flex; }
  .nav-toggle { display: inline-block; margin-left: auto; }
  /* Wide data tables scroll horizontally within themselves instead of
     forcing the whole page wider than the mobile viewport. */
  table.tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

.site-main { padding: 1.5rem; max-width: 1300px; margin: 0 auto; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 64vh;
  background-image:
    linear-gradient(180deg, rgba(14,17,22,0.55) 0%, rgba(14,17,22,0.85) 100%),
    url("/assets/img/hero-adv.jpg");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("/assets/img/topo.svg");
  background-size: cover; opacity: .06; pointer-events: none;
}
.hero h1 { color: var(--accent); text-shadow: 0 2px 12px rgba(0,0,0,.7); position: relative; z-index: 1; }
.hero h1 .sub { display: block; color: #fff; font-size: .55em; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.hero .lede { color: #e8e8e8; max-width: 60ch; font-size: 1.1rem; text-shadow: 0 1px 6px rgba(0,0,0,.8); position: relative; z-index: 1; }
.hero .cta-row { position: relative; z-index: 1; }
.hero .cta-row { margin-top: 1.5rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: .75rem 1.2rem; border-radius: 8px; font-weight: 700;
  background: var(--accent); color: #111; border: none; cursor: pointer; font-size: 1rem;
}
.btn:hover { background: var(--accent-2); color: #111; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--bad); color: white; }

/* ===== Stat strip ===== */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; text-align: center; }
.stat .n { font-family: 'Bebas Neue'; font-size: 2rem; line-height: 1; color: var(--accent); }
.stat .l { color: var(--muted); font-size: .85rem; margin-top: .3rem; text-transform: uppercase; letter-spacing: 1px; }

/* ===== Cards / grids ===== */
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.2rem; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin-top: 0; }
.card .meta { color: var(--muted); font-size: .85rem; }
.card .pill { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.pill.tet  { background: rgba(255,213,79,.15); color: var(--tet); border: 1px solid rgba(255,213,79,.4); }
.pill.van  { background: rgba(96,125,139,.18); color: #b0bec5; border: 1px solid rgba(96,125,139,.4); }
.pill.transit { background: rgba(38,198,218,.15); color: #4dd0e1; border: 1px solid rgba(38,198,218,.4); }

/* ===== Day list / itinerary ===== */
.day-list { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.day-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center;
  padding: 1rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  border-left: 5px solid var(--accent);
  text-decoration: none; color: var(--text);
}
.day-row:hover { background: var(--bg-3); border-color: var(--accent); }
.day-row .num { font-family: 'Bebas Neue'; font-size: 2.2rem; line-height: 1; color: var(--accent); text-align: center; }
.day-row .num small { display: block; font-size: .7rem; color: var(--muted); letter-spacing: 1px; }
.day-row .title { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.day-row .meta  { color: var(--muted); font-size: .85rem; }
.day-row .right { text-align: right; }

/* ===== Day detail ===== */
.day-hero {
  padding: 1.5rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  border-top: 5px solid var(--accent); margin-bottom: 1rem;
}
.day-hero h1 { margin: 0 0 .3rem; }
.day-hero .meta { color: var(--muted); }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: .8rem; margin: 1rem 0; }
.kv { background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: .7rem; }
.kv .l { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; }
.kv .v { font-weight: 700; font-size: 1.05rem; }

/* ===== Riders ===== */
.rider-card {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem;
  display: grid; grid-template-columns: 110px 1fr; gap: 1rem;
  border-left: 6px solid var(--rider-color, var(--accent));
}
.rider-card.bike-cfmoto { --rider-color: var(--christian); }
.rider-card.bike-ktm    { --rider-color: var(--tony); }
.rider-card.bike-suzuki { --rider-color: var(--claus); }
.rider-card .avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--rider-color, var(--accent));
}
.rider-card .avatar svg { width: 70px; height: 70px; }
.rider-card h3 { margin: 0 0 .2rem; color: var(--rider-color, var(--accent)); }
.rider-card .bike { font-weight: 700; font-size: .95rem; margin-bottom: .3rem; }
.rider-card .addr { color: var(--muted); font-size: .85rem; }
.rider-card .notes { margin-top: .5rem; font-size: .9rem; }

/* ===== Map ===== */
.map-wrap { position: relative; height: calc(100vh - 80px); margin: -1.5rem; border-radius: 0; }
#trip-map { height: 100%; }
.live-pill {
  position: absolute; top: 1rem; left: 1rem; z-index: 600;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem 1rem; font-size: .85rem; display: flex; gap: .5rem; align-items: center;
}
.live-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: pulse 1.5s infinite; }
.live-pill.online .dot { background: var(--good); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ===== Forms ===== */
form.up-form { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin: 1rem 0; }
form.up-form label { display: block; font-weight: 600; margin: .5rem 0 .2rem; }
form.up-form input[type=text], form.up-form select, form.up-form textarea {
  width: 100%; background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: .6rem; font-size: .95rem;
}
form.up-form input[type=file] { color: var(--text); padding: .4rem 0; }
.dropzone {
  border: 2px dashed var(--line); border-radius: 10px; padding: 2rem; text-align: center; color: var(--muted);
  background: var(--bg-3); transition: border-color .2s, color .2s;
}
.dropzone.over { border-color: var(--accent); color: var(--accent); }

/* ===== Video grid ===== */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.video-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.video-card video { width: 100%; display: block; background: black; }
.video-card .vmeta { padding: .7rem 1rem; }
.video-card .vmeta small { display: block; color: var(--muted); }
/* Video poster wrapper + duration badge (gallery + day pages) */
.vthumb { position: relative; line-height: 0; }
.vthumb .vdur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8);
  color: #fff; font-size: .72rem; font-weight: 600; padding: .1rem .4rem; border-radius: 4px;
  line-height: 1.4; pointer-events: none; }

/* Reactions + comments widget */
.social-widget { margin: 1.2rem 0; }
.social-widget[data-mode="compact"] { margin: .5rem 0 0; }
.rx-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; }
.rx { display: inline-flex; align-items: center; gap: .25rem; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 999px; padding: .2rem .6rem; cursor: pointer; color: var(--text); font-size: .95rem; line-height: 1; transition: border-color .15s, background .15s; }
.rx:hover { border-color: var(--accent); }
.rx.on { background: rgba(255,206,58,.15); border-color: var(--accent); }
.rx .rx-n { font-size: .8rem; font-weight: 700; color: var(--muted); }
.rx.on .rx-n { color: var(--accent); }
.cm-wrap { margin-top: .8rem; }
.cm-form { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.cm-form input, .cm-form textarea { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; font: inherit; }
.cm-actions { display: flex; align-items: center; gap: .7rem; }
.cm-form button { background: var(--accent); color: #111; border: 0; border-radius: 8px; padding: .5rem 1rem; font-weight: 700; cursor: pointer; }
.cm-msg { font-size: .85rem; color: var(--muted); }
.cm-list { display: flex; flex-direction: column; gap: .6rem; }
.cm { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.cm.pinned { border-color: var(--accent); }
.cm-head { display: flex; gap: .5rem; align-items: baseline; font-size: .85rem; }
.cm-head time { color: var(--muted); font-size: .78rem; }
.cm-body { margin-top: .25rem; font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.cm-empty { color: var(--muted); font-size: .9rem; }

/* Weather chip (hidden until JS fills it, so failed/empty fetches show nothing) */
.weather-widget { display: none; }
.weather-widget.on { display: inline-flex; align-items: center; gap: .45rem; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; vertical-align: middle; }
.weather-widget .wx-i { font-size: 1.15rem; line-height: 1; }
.weather-widget .wx-t { color: var(--muted); }
.weather-widget .wx-t strong { color: var(--text); }

/* ===== Footer ===== */
.site-ftr {
  margin-top: 3rem; padding: 1.5rem; background: var(--bg-2); border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: var(--muted); font-size: .9rem;
}

/* ===== Tables ===== */
table.tbl { width: 100%; border-collapse: collapse; background: var(--bg-2); border-radius: 8px; overflow: hidden; margin: 1rem 0; }
table.tbl th, table.tbl td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
table.tbl th { background: var(--bg-3); color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-size: .75rem; }
table.tbl tr:last-child td { border-bottom: none; }

/* ===== Utility ===== */
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.ctr { text-align: center; }
.tag { display: inline-block; background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .5rem; font-size: .75rem; margin-right: .25rem; }
.flag { font-size: 1.2em; }

/* Rider media moderation controls (social.js) */
.media-mod { margin-top: .4rem; }
.media-mod .media-modkey { background: transparent; border: 0; color: var(--muted); opacity: .45;
  cursor: pointer; font-size: .9rem; padding: .1rem .25rem; line-height: 1; border-radius: 5px; }
.media-mod .media-modkey:hover { opacity: 1; background: var(--bg-3); }
.media-mod .media-del { background: transparent; border: 1px solid var(--bad); color: var(--bad);
  cursor: pointer; font-size: .72rem; padding: .2rem .5rem; border-radius: 6px; }
.media-mod .media-del:hover { background: var(--bad); color: #fff; }
