/* ===========================
   assets/site.css
   =========================== */

/* CSS variables */
:root {
  --header-h: 70px;
  --max-width: 1100px;

  /* Dark theme palette */
  --bg: #0a0e13;
  --bg-elev: #0f141b;
  --text: #ffffff;
  --muted: #b7c0cf;
  --border: #1f2a3d;
  --accent: #79a7ff;
  --shadow: rgba(0,0,0,.25);
  --shadow-hover: rgba(0,0,0,.35);
}

/* Reset / base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--header-h);
}
a { color: var(--accent); }
a:hover { text-decoration: underline; }
img, svg, video, iframe { max-width: 100%; height: auto; }

/* Accessibility: focus outlines */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header / nav */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h); z-index: 1000;
  background: rgba(10,14,19,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 700; font-size: 1.25rem; color: #fff; text-decoration: none; }
.nav a { color: #fff; margin-left: 16px; text-decoration: none; opacity: .9; }
.nav a:hover, .nav a.active { opacity: 1; text-decoration: underline; }

/* Main wrapper */
.wrap, main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}
.muted { color: var(--muted); }

/* Footer */
.site-footer {
  padding: 24px 16px;
  background: #111;
  border-top: 1px solid var(--border);
  color: #aaa;
  text-align: center;
  font-size: 0.875rem;
}
.site-footer a { color: #aaa; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Legacy content helpers */
.legacy-content img { max-width: 100% !important; height: auto !important; display: block; margin: 12px auto; }
.legacy-content table {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.legacy-content iframe,
.legacy-content embed,
.legacy-content object,
.legacy-content video {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
}

/* Responsive video (16:9) */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
}
.video-container iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ===========================
   Generic Card List (Projects/Reviews/Coasters)
   =========================== */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
@media (min-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
.card {
  display: block;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 18px var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--shadow-hover);
  border-color: #2a3a55;
}
.card:visited { color: inherit; }

/* Optional: inline meta within card text */
.card .meta { color: var(--muted); }

/* ===========================
   Propagation Cards (HamQSL etc.)
   =========================== */
.prop-card {
  max-width: 1000px;
  margin: 1.5rem auto;
  border-radius: 14px;
  background: #fff;
  color: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
}
.prop-card__header {
  padding: 0.9rem 1.1rem;
  background: linear-gradient(180deg, #f7f7fb, #f1f1f6);
  border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.prop-card__title { font: 600 1.05rem/1.2 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; margin: 0; }
.prop-card__actions a { font: 500 .9rem/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; text-decoration: none; color: #2a5bd7; }
.prop-card__body { padding: 0; text-align: center; }

/* Responsive iframe/image wrapper for embeds inside prop-card (16:10 works well) */
.embed-wrap {
  position: relative; width: 100%; height: 0; padding-bottom: 62.5%; overflow: hidden;
}
.embed-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* Dark-mode adjustments for prop-card when the page is dark */
@media (prefers-color-scheme: dark) {
  .prop-card { background: #111; color: #eaeaea; border-color: rgba(255,255,255,.08); }
  .prop-card__header { background: linear-gradient(180deg, #171717, #141414); border-bottom-color: rgba(255,255,255,.08); }
  .prop-card__title { color: #eaeaea; }
  .prop-card__actions a { color: #79a7ff; }
}

/* ===========================
   Utility
   =========================== */
.center { text-align: center; }
.right { text-align: right; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

/* Optional: conditions grid (two-card layout) */
.conditions-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .conditions-grid { grid-template-columns: 1fr 1fr; } }

/* === Global Card List Layout (Reviews, Coasters, Projects etc.) === */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
@media (min-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  display: block;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid #1f2a3d;
  background: #0f141b;
  color: inherit;               /* no blue links */
  text-decoration: none;        /* remove underlines */
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  border-color: #2a3a55;
}
.card:visited { color: inherit; }

/* === Gallery Styling (filmstrip layout) === */
.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
}

.gallery-chip {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #1a1f27;
  border: 1px solid #232a33;
  color: #e9edf1;
  font-size: .8rem;
}

.gallery-muted {
  color: #9aa3ad;
}

/* Viewer */
.gallery-viewer {
  position: relative;
  background: #12151b;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 26px rgba(0,0,0,.35);
  padding-bottom: 1rem;
}

.gallery-hero {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  background: #0b0c0f;
}

.gallery-hero img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.gallery-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .75rem;
}

.gallery-title {
  font-weight: 600;
}

.gallery-counter {
  opacity: .75;
  font-variant-numeric: tabular-nums;
}

/* Controls */
.gallery-controls {
  display: flex;
  gap: .5rem;
  padding: .5rem .75rem;
}

.gallery-btn {
  appearance: none;
  border: 1px solid #2a313b;
  background: #1a1f27;
  color: #e9edf1;
  padding: .45rem .8rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.gallery-btn:hover {
  filter: brightness(1.15);
}

/* Filmstrip */
.gallery-filmstrip {
  margin-top: .75rem;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: 0 .75rem .5rem;
}

.gallery-thumb {
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0b0c0f;
  cursor: pointer;
}

.gallery-thumb img {
  display: block;
  width: 120px;
  height: 75px;
  object-fit: cover;
  background: #0e1218;
}

.gallery-thumb[aria-current="true"] {
  border-color: #6aa8ff;
}
#heroImg {
  transition: opacity 2s ease;
}

#heroImg.fade-out {
  opacity: 0;
}
.social-links { margin:2rem 0; text-align:center; }
.social-links h2 { font-size:1.25rem; margin-bottom:1rem; }
.social-links ul { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; justify-content:center; gap:1rem; }
.social-links li { }
.social-links a { 
  display:inline-block; 
  padding:.5rem .75rem; 
  border:1px solid #2b2f36; 
  border-radius:12px; 
  text-decoration:none; 
  color:#e8edf2; 
  transition:all .2s ease;
}
.social-links a:hover { background:#2b2f36; }
/* Power page layout */
.power-grid {
  display: grid;
  grid-template-columns: 1fr;   /* 1 col on phones */
  gap: 1rem;                    /* <-- space between cards */
  margin: 12px 0 20px;
}
@media (min-width: 720px)  { .power-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .power-grid { grid-template-columns: repeat(3, 1fr); } }

/* make sure cards themselves don't add extra margins */
.power-grid .card { margin: 0; }
/* === Power page grid with horizontal + vertical gaps === */
.power-grid,
.cards.cards--power {
  display: grid;
  grid-template-columns: 1fr;     /* phones */
  gap: 1rem;                      /* row + column gap */
  margin: 12px 0 20px;
}

/* 2 columns on tablets */
@media (min-width: 720px) {
  .power-grid,
  .cards.cards--power { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* 3 columns on desktops (for the top row) */
@media (min-width: 1060px) {
  .power-grid,
  .cards.cards--power.cards--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* Make sure cards themselves don't add extra margins */
.power-grid .card,
.cards.cards--power .card { margin: 0; }

/* Optional: a tiny inner side gutter so the first/last cards don't touch container edges */
.power-grid,
.cards.cards--power { padding-inline: 8px; }
@media (min-width: 1060px) {
  .power-grid,
  .cards.cards--power { gap: 1.25rem; padding-inline: 12px; }
}
/* spacing for both rows */
.power-grid { gap: 1.25rem; }

/* bottom row: always 2 columns on tablet/desktop, with gaps */
.power-grid--two {
  display: grid;
  grid-template-columns: 1fr;          /* phones */
  gap: 1.25rem;                        /* row + column spacing */
}
@media (min-width: 720px) {
  .power-grid--two { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* space between the top and bottom sections */
.power-grid + .power-grid { margin-top: 1.25rem; }

/* ensure cards themselves don't collapse the gap */
.power-grid .card { margin: 0; }

/* Clear, accessible focus for keyboard users */
:focus-visible {
  outline: 2px solid #9f7aea;
  outline-offset: 2px;
}

/* Optional: visible focus on links in the nav/footer */
a:focus-visible {
  text-decoration: underline;
}

/* National Highways widget — scoped so it won't affect other parts */
.nhx{
  font-family: inherit;
  color: #e6e6e6;           /* match your body text */
  font-size: 0.95rem;
  line-height: 1.45;
}
.nhx .nhx-card{
  max-width: 980px;
  margin: 0;
  background: #0e0e0e;      /* same dark as rest of site */
  border: 1px solid #2f2f2f;
  border-radius: 16px;
  padding: 12px;
}
.nhx h3{
  font-family: inherit;
  font-size: 1rem;          /* small section heading */
  font-weight: 700;
  margin: 0 0 8px 0;
}
.nhx form{
  margin: 6px 0 10px 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.nhx form input,
.nhx form button{
  font: inherit;
  font-size: .9rem;
  color: #e6e6e6;
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 6px 10px;
}
.nhx form button{ background:#1a1a1a; cursor:pointer; }

.nhx .nhx-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:10px;
}
.nhx .nhx-tile{
  background:#101010;
  border:1px solid #2a2a2a;
  border-radius:12px;
  padding:10px;
}
.nhx .nhx-road{ font-weight:600; margin-bottom:2px; }
.nhx .nhx-subtle{ opacity:.9; }
.nhx .nhx-muted{ opacity:.85; }
.nhx .nhx-meta{ font-size:.9rem; opacity:.9; margin-top:6px; }

.nhx a{ color:#9ecbff; text-decoration:none; }
.nhx a:hover{ text-decoration:underline; }

.nhx .nhx-source{ opacity:.65; margin-top:8px; font-size:.85rem; }
.nhx .nhx-err{ color:#ff8a8a; }
.nhx pre{
  white-space:pre-wrap;
  background:#0b0b0b;
  border:1px solid #2a2a2a;
  padding:8px; border-radius:10px;
  max-height:260px; overflow:auto;
}
/* Center the NH widget */
.nhx .nhx-card{
  max-width: 980px;
  margin: 0 auto;          /* <-- center horizontally */
  background: #0e0e0e;
  border: 1px solid #2f2f2f;
  border-radius: 16px;
  padding: 12px;
}

#latest .latest-card { transition: transform .15s ease, box-shadow .15s ease; }
#latest .latest-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.35); }
