/* Shared layout styles for about.html and contact.html */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: url('../static/background/banff.avif') center center / cover no-repeat fixed;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
}
.card {
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  max-width: 680px; width: 100%; overflow: hidden; position: relative;
}
.card-header {
  background: linear-gradient(135deg, #003580, #0055a5);
  padding: 28px 40px 22px; text-align: center; color: #fff; position: relative;
}
.back-btn {
  position: absolute; top: 18px; left: 18px;
  color: rgba(255,255,255,.85); text-decoration: none;
  font-size: .85rem; font-weight: 600;
  background: rgba(255,255,255,.15); border-radius: 8px; padding: 6px 12px;
  transition: background .15s;
}
.back-btn:hover { background: rgba(255,255,255,.25); }
.burger-btn {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.15); border: none; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column;
  gap: 5px; align-items: center; transition: background .15s;
}
.burger-btn:hover { background: rgba(255,255,255,.25); }
.burger-btn span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
.logo { font-size: 38px; margin-bottom: 6px; }
.card-header h1 { font-size: 1.5rem; font-weight: 700; }
.card-header p  { font-size: .88rem; opacity: .85; margin-top: 4px; }
.flag-bar { display: flex; height: 6px; }
.flag-bar span { flex: 1; }
.f-red   { background: #cc0001; }
.f-white { background: #fff; }
.f-blue  { background: #003580; }
.card-body { padding: 28px 36px 36px; }
.section { margin-bottom: 28px; }
.section:last-child { margin-bottom: 0; }
.section h2 {
  font-size: 1rem; font-weight: 700; color: #003580;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #eef2f8;
}

/* Nav drawer */
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; }
.nav-overlay.open { display: block; }
.nav-drawer {
  position: fixed; top: 0; right: -280px; width: 260px; height: 100%;
  background: #fff; z-index: 201; box-shadow: -4px 0 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; transition: right .25s ease;
}
.nav-drawer.open { right: 0; }
.nav-drawer-head {
  background: linear-gradient(135deg, #003580, #0055a5);
  padding: 22px 20px 18px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-drawer-head span { font-size: 1rem; font-weight: 700; }
.nav-close {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  border-radius: 8px; width: 32px; height: 32px; font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.nav-close:hover { background: rgba(255,255,255,.25); }
.nav-links { padding: 12px 0; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 22px; text-decoration: none;
  font-size: .95rem; color: #222; font-weight: 500; transition: background .12s;
}
.nav-link:hover { background: #f4f7fb; }
.nav-link.active { color: #003580; background: #eef4ff; }
.nav-link .nl-ico { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-sep { height: 1px; background: #eee; margin: 6px 0; }

@media (max-width: 480px) {
  body { padding: 10px; padding-top: max(10px, env(safe-area-inset-top)); }
  .card-body { padding: 18px 16px 26px; }
  .card-header { padding: 22px 16px 16px; }
  /* Flashcard mobile fixes */
  .fc-wrap { padding: 8px; }
  .flashcard { height: 250px; }
  .flashcard-front,
  .flashcard-back { height: 250px; padding: 12px 14px; }
  .flashcard-front img { max-height: 80px; }
  .fc-question { font-size: .9rem; }
  .fc-controls button { min-height: 44px; padding: 10px 12px; }
  .fc-btns button { min-height: 44px; }
  .fc-filter-btn { padding: 8px 9px; min-height: 36px; }
}

/* ── Flashcard styles ─────────────────────────────────────── */
.fc-wrap { max-width: 600px; margin: 0 auto; padding: 16px; }
.fc-controls { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.fc-controls button { background:#003580; color:#fff; border:none; border-radius:8px; padding:8px 16px; cursor:pointer; font-size:.85rem; font-weight:600; }
.fc-counter { font-size:.9rem; color:#555; font-weight:700; }
.flashcard-container { perspective: 1000px; margin-bottom:16px; }
.flashcard {
  height: 300px; position: relative; transform-style: preserve-3d;
  transition: transform 0.45s; cursor: pointer;
  transform: perspective(1000px) rotateY(0deg);
}
.flashcard.flipped { transform: perspective(1000px) rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; width: 100%; height: 300px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 14px; padding: 20px 24px; border: 2px solid #dde3ed;
  background: #fff; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  box-sizing: border-box; overflow: hidden;
}
.flashcard-front img { max-height: 130px; max-width: 200px; width:auto; object-fit:contain; flex-shrink:0; margin-bottom:8px; }
.flashcard-back { transform: rotateY(180deg); background: #f0fbf4; border-color: #1a8a3c; }
.fc-question { font-size: 1rem; font-weight: 600; color: #1a1a2e; text-align:center; }
.fc-hint { font-size:.75rem; color:#aaa; text-align:center; margin-top:8px; }
.fc-correct-label { font-size:.8rem; color:#1a7a3c; font-weight:700; }
.fc-correct-text { font-size:1rem; font-weight:600; color:#1a1a2e; }
.fc-explanation { font-size:.8rem; color:#666; margin-top:8px; }
.fc-btns { display:flex; gap:10px; margin-bottom:10px; position:relative; z-index:2; }
.fc-btns button { flex:1; padding:10px; border-radius:8px; border:none; cursor:pointer; font-weight:700; font-size:.85rem; }
#fc-got-it { background:#d1f0dc; color:#1a7a3c; }
#fc-review  { background:#fde8e8; color:#cc0001; }
.fc-progress-bar-wrap { height:5px; background:#e8eaf0; border-radius:3px; margin-bottom:10px; padding-top:10px; }
.fc-progress-bar { height:5px; background:#003580; border-radius:3px; transition:width .3s; }
.fc-filter { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; position:relative; z-index:2; }
.fc-filter-btn { background:#f0f4fa; border:1px solid #dde3ed; border-radius:6px; padding:4px 10px; font-size:.75rem; cursor:pointer; }
.fc-filter-btn.active { background:#003580; color:#fff; border-color:#003580; }

.fc-seo-section { background:#fff; border-radius:16px; box-shadow:0 4px 20px rgba(0,0,0,.15); width:100%; padding-top:16px; }

/* ── Progress page styles ─────────────────────────────────── */
.prog-card { background:#fff; border-radius:12px; border:1px solid #e8eaf0; padding:16px 20px; margin-bottom:16px; }
.prog-card h2 { font-size:.95rem; font-weight:700; color:#1a1a2e; margin-bottom:12px; }
.prog-bar-wrap { height:10px; background:#e8eaf0; border-radius:5px; margin:8px 0; }
.prog-bar { height:10px; background:linear-gradient(90deg,#003580,#1a7a3c); border-radius:5px; transition:width .5s; }
.prog-table { width:100%; border-collapse:collapse; font-size:.82rem; }
.prog-table th { text-align:left; padding:6px 8px; font-size:.72rem; color:#888; text-transform:uppercase; border-bottom:2px solid #e8eaf0; }
.prog-table td { padding:6px 8px; border-bottom:1px solid #f0f2f7; }
.cat-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; font-size:.8rem; }
.cat-name { width:160px; flex-shrink:0; color:#444; }
.cat-bar-wrap { flex:1; height:7px; background:#e8eaf0; border-radius:4px; }
.cat-bar { height:7px; border-radius:4px; transition:width .4s; }
.cat-pct { width:36px; text-align:right; font-weight:700; font-size:.76rem; color:#555; }
#prog-clear { margin-top:16px; background:#fde8e8; color:#cc0001; border:none; border-radius:8px; padding:10px 20px; cursor:pointer; font-size:.85rem; font-weight:700; }

/* ── Study Guide / Road Signs content pages ────────────────── */
.page-content { padding: 24px 0; }
.page-content h1 { font-size: 1.3rem; color: #003580; margin-bottom: 12px; font-weight: 700; }
.page-content h2 { font-size: 1.05rem; color: #1a1a2e; margin: 20px 0 8px; font-weight: 700; }
.page-content h3 { font-size: .92rem; color: #333; margin: 14px 0 6px; font-weight: 600; }
.page-content p { font-size: .88rem; color: #444; line-height: 1.65; margin-bottom: 10px; }
.page-content ul, .page-content ol { font-size: .88rem; color: #444; line-height: 1.7; padding-left: 20px; margin-bottom: 10px; }
.page-content li { margin-bottom: 4px; }
.page-content a { color: #003580; }
.cta-box { background: linear-gradient(135deg,#003580,#0055a5); color: #fff; border-radius: 12px; padding: 20px; text-align: center; margin: 24px 0; }
.cta-box a { display: inline-block; background: #cc0001; color: #fff; padding: 12px 28px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: .95rem; margin-top: 10px; }
.sign-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.sign-card { background: #f4f7fb; border-radius: 10px; padding: 12px 8px; text-align: center; border: 1px solid #dde3ed; }
.sign-card img { max-width: 80px; max-height: 80px; object-fit: contain; margin-bottom: 6px; }
.sign-card strong { display: block; font-size: .78rem; color: #1a1a2e; }
.sign-card span { display: block; font-size: .72rem; color: #666; margin-top: 3px; }
.sitemap-section { margin-bottom: 20px; }
.sitemap-section h2 { font-size: .9rem; font-weight: 700; color: #003580; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.sitemap-section ul { list-style: none; padding: 0; }
.sitemap-section li { padding: 5px 0; border-bottom: 1px solid #f0f2f7; }
.sitemap-section a { color: #1a1a2e; text-decoration: none; font-size: .9rem; }
.sitemap-section a:hover { color: #003580; text-decoration: underline; }
.legal-section { margin-bottom: 18px; }
.legal-section h2 { font-size: .92rem; color: #003580; font-weight: 700; margin-bottom: 6px; }
.legal-section p { font-size: .85rem; color: #444; line-height: 1.6; }
.faq-section { margin: 24px 0; }
.faq-section h2 { font-size: 1rem; font-weight: 700; color: #003580; margin-bottom: 12px; }
.faq-section details { border: 1px solid #dde3ed; border-radius: 8px; margin-bottom: 8px; background: #f8fafd; }
.faq-section summary { padding: 12px 16px; font-size: .9rem; font-weight: 600; color: #1a1a2e; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::before { content: '▶'; font-size: .7rem; color: #003580; flex-shrink: 0; transition: transform .2s; }
.faq-section details[open] summary::before { transform: rotate(90deg); }
.faq-section details p { padding: 0 16px 14px; font-size: .86rem; color: #444; line-height: 1.65; margin: 0; }

.fc-btns button:focus-visible    { outline: 3px solid #0055a5; outline-offset: 2px; }
.fc-filter-btn:focus-visible     { outline: 3px solid #0055a5; outline-offset: 2px; }
.fc-controls button:focus-visible { outline: 3px solid #0055a5; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .flashcard { transition: none; }
}
