/* MontrealTraffic.ca - shared responsive stylesheet (2026-10) */
:root {
  --brown: #504634;
  --brown-dark: #3b3326;
  --tan: #d9d1bc;
  --bg: #f4f0e6;
  --card: #ffffff;
  --text: #2b2620;
  --muted: #6b6152;
  --accent: #800000;
  --link: #7a1f00;
  --border: #d9d1bc;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1a16;
    --card: #2a261f;
    --text: #ece6d8;
    --muted: #b4aa98;
    --accent: #e0a39a;
    --link: #f0b08a;
    --border: #3f382d;
    --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--link); }
img, video { max-width: 100%; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: #fff; color: #000; padding: 6px 10px; }

/* Header + navigation */
.site-header { background: var(--brown); color: #fff; }
.site-header .wrap { padding-top: 10px; padding-bottom: 8px; }
.brand { color: #fff; text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.6rem; line-height: 1.1; display: inline-block; margin-bottom: 8px; }
.brand span { display: block; font: 400 .8rem/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--tan); letter-spacing: .02em; }
.site-nav ul { list-style: none; margin: 0; padding: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.site-nav a { display: block; padding: 6px 11px; border-radius: 999px; color: #fff; text-decoration: none; font-size: .9rem; white-space: nowrap; background: rgba(255, 255, 255, .1); }
.site-nav a:hover, .site-nav a:focus-visible { background: rgba(255, 255, 255, .25); }
.site-nav a[aria-current="page"] { background: var(--tan); color: var(--brown-dark); font-weight: 600; }
/* On phones the route list becomes one row you can swipe sideways */
@media (max-width: 699px) {
  .site-nav { margin: 0 -16px; }
  .site-nav ul { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-nav ul::-webkit-scrollbar { display: none; }
}

.wrap { max-width: 1240px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* Page intro */
main { padding-top: 18px; padding-bottom: 28px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.breadcrumb a { color: var(--muted); }
h1 { font-family: Georgia, "Times New Roman", serif; color: var(--accent); font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 10px; }
.lead { font-size: 1.05rem; max-width: 70ch; margin: 0 0 8px; }
.note { font-size: .9rem; color: var(--muted); margin: 0 0 16px; }
.note b { color: var(--text); }

/* Camera grid */
.cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; margin: 0; padding: 0; }
.cams > h2 { grid-column: 1 / -1; margin: 14px 0 -4px; font-size: 1.2rem; color: var(--accent); border-bottom: 2px solid var(--border); padding-bottom: 4px; }
.cams > h2 a { color: inherit; }
.cam { margin: 0; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.cam figcaption { padding: 9px 12px 11px; font-size: .95rem; }
.cam figcaption strong { display: block; }
.cam figcaption span { color: var(--muted); font-size: .85rem; }
.cams .ad { grid-column: 1 / -1; }

/* Live video box (Quebec 511 clips are 352 x 240) */
.vid { position: relative; background: #111; aspect-ratio: 352 / 240; }
.vid video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vid .msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; color: #cfc6b4; font-size: .85rem; pointer-events: none; }
.vid.on .msg { display: none; }
.vid .live { position: absolute; top: 8px; right: 8px; background: #b00020; color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; display: none; }
.vid.on .live { display: block; }

/* Ads */
.ad { margin: 16px 0; min-height: 90px; text-align: center; }

/* Home page cards */
.routes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; margin: 0 0 20px; padding: 0; list-style: none; }
.routes > li > a { display: flex; flex-direction: column; height: 100%; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.routes > li > a:hover h3, .routes > li > a:focus-visible h3 { text-decoration: underline; }
.routes h3 { font-size: 1.1rem; margin: 10px 12px 2px; color: var(--accent); }
.routes p { margin: 0 12px 12px; font-size: .9rem; color: var(--muted); }
.section-title { font-size: 1.35rem; color: var(--accent); margin: 22px 0 10px; border-bottom: 2px solid var(--border); padding-bottom: 4px; }

/* Text sections */
.about { max-width: 75ch; margin-top: 24px; }
.about h2 { font-size: 1.2rem; color: var(--accent); margin: 18px 0 6px; }
.about p, .about li { margin: 0 0 10px; }
.related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: block; padding: 6px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; font-size: .92rem; }

/* Footer */
.site-footer { background: var(--brown-dark); color: #e9e2d0; font-size: .88rem; padding: 20px 0 26px; }
.site-footer a { color: #fff; }
.site-footer h2 { font-size: .95rem; margin: 0 0 6px; color: var(--tan); }
.site-footer ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer p { margin: 0 0 6px; }

/* No ad above the cameras. Camera pages: the first ad follows the first full row -
   after 2 cameras on 1-2 column screens (.ad-n2), after 3 on 3-column desktops (.ad-n3). */
.ad-n3 { display: none; }
@media (min-width: 1104px) {
  .ad-n2 { display: none; }
  .ad-n3 { display: block; }
}
/* Home page: phones get the ad after the second card, wider screens between the first two sections */
.ad-phone { display: none; }
.routes .ad-phone { grid-column: 1 / -1; }
.routes .ad-phone .ad { margin: 0; }
@media (max-width: 699px) {
  .ad-phone { display: block; }
  .ad-wide { display: none; }
}
