/* Minimal Canadian-lite theme */
:root{
  --ink: #1f2937;
  --muted-ink:#4b5563;
  --line:#e5e7eb;
  --panel:#ffffff;
  --page:#ffffff;
  --accent:#c62828;
  --accent-2:#ef5350;
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--ink);
  background:var(--page);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji','Segoe UI Emoji', sans-serif;
  line-height:1.45;
}

.site-header{
  display:grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand controls"
    "brand last";
  gap:8px 12px;
  align-items:center;
  padding:14px 16px; background:#fff;
  border-bottom:1px solid var(--line); position:sticky; top:0; z-index:10; box-shadow:var(--shadow);
}
.brand{grid-area:brand; display:flex;align-items:center;gap:12px}
.logo{width:36px;height:36px}
h1{margin:0; font-size:1.2rem; color:var(--accent); letter-spacing:0.2px}
.tagline{margin:2px 0 0 0; color:var(--muted-ink); font-size:0.95rem}

.controls{grid-area:controls; display:flex;align-items:center;gap:10px;flex-wrap:wrap; justify-self:end}
.controls label{display:flex;align-items:center;gap:8px; padding:6px 10px; background:#fafafa; border:1px solid var(--line); border-radius:10px}
select{border:1px solid var(--line); border-radius:8px; padding:6px 8px; background:#fff}
.refresh-btn{
  padding:6px 10px;
  background:var(--accent);
  color:#fff;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-size:0.9rem;
}
.refresh-btn:hover{ background:var(--accent-2); }
.last-refreshed{grid-area:last; justify-self:end; font-size:0.85rem; color:var(--muted-ink); margin-top:2px}

.crossings{display:grid; grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); gap:16px; padding:16px}
.card{
  background:var(--panel); border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:var(--shadow);
}
.card header{
  display:flex; align-items:center; justify-content:space-between; padding:10px 12px;
  background:linear-gradient(90deg, var(--accent), var(--accent-2)); color:#fff;
}
.card header .name{font-weight:700}
.direction-tabs{display:flex; gap:8px}
.direction-tabs button{
  border:1px solid #ffffffb3; border-radius:10px; padding:6px 10px; background:rgba(255,255,255,0.2); color:#fff; cursor:pointer;
}
.direction-tabs button.active{background:#fff; color:var(--accent); font-weight:700; border-color:#fff}

.cam-list{display:grid; grid-template-columns:1fr; gap:10px; padding:10px; background:#fafbfc}
.cam{
  position:relative; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#000;
  aspect-ratio:16/9;
}
.cam img{display:block; width:100%; height:auto}
.cam iframe{display:block; width:100%; height:100%; border:0}
.cam .meta{
  position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,0.55); color:#fff; padding:4px 6px; border-radius:8px; font-size:0.82rem
}

.site-footer{padding:22px 16px; text-align:center; color:#6b7280; border-top:1px solid var(--line); background:#fff}
.ad-box{
  border:1px dashed var(--line); border-radius:12px; padding:20px; margin:0 auto 12px; max-width:980px; color:#6b7280; background:#fff
}

@media(min-width:900px){
  .crossings{grid-template-columns:repeat(2,minmax(420px,1fr))}
}
@media(min-width:1320px){
  .crossings{grid-template-columns:repeat(3,minmax(420px,1fr))}
}

a {
  color: #6b7280; /* muted gray */
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent); /* red */
  text-decoration: underline;
}
