/* ═══════════════════════════════════════════════════════════════════════════
   RALLY ATL — PUBLIC LAYOUT STYLESHEET (/public/layout.css)
   Mobile-First Layout: Base styles target mobile screens; media queries
   are placed sequentially at the end of the stylesheet in ascending order.
   ───────────────────────────────────────────────────────────────────────────
   Table of Contents:
   1. Main & Section Layout Containers
   2. Page Title / Hero Banner
   3. Site Header & Navigation
   4. Footer & App Tabbar
   5. Media Queries (481px+, 769px+, 1200px+)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Main Layout Container ── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: calc(100vh - 168px);
}

.section-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted, #7f8c8d);
  margin-bottom: 16px;
}

/* ── 2. Page Title / Hero Banner ── */
.page-title {
  background: linear-gradient(135deg, var(--navy, #1a2e44) 0%, var(--navy-l, #243b55) 60%, #1e5c3a 100%);
  color: var(--white, #ffffff);
  text-align: center;
  padding: 10px 16px;
}

.page-title h1 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.page-title h1 span {
  color: var(--green, #2ecc71);
}

.page-title p {
  display: none;
  font-size: 16px;
}

/* ── 3. Site Header & Navigation ── */
header {
  background: var(--navy, #1a2e44);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 50px;
  padding-right: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--green, #2ecc71);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  color: var(--white, #ffffff);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-text span {
  color: var(--green, #2ecc71);
}

/* Mobile Toggle Button */
.nav-toggle {
  display: flex;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white, #ffffff);
  font-size: 20px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.nav-toggle:hover,
.nav-toggle.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--green, #2ecc71);
}

/* Mobile Navigation Drawer */
#navMenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--navy, #1a2e44);
  padding: 12px;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 999;
}

#navMenu.open,
header nav.open {
  display: flex !important;
  flex-wrap: wrap;
}

#navMenu a {
  width: 40%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  background-color: gainsboro;
  color: black;
  padding: 10px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
}

#navMenu a:hover,
#navMenu a.active {
  background: gray;
  color: var(--white, #ffffff);
  border-color: var(--green, #2ecc71);
}

.btn-nav {
  background: var(--green, #2ecc71) !important;
  color: var(--white, #ffffff) !important;
  font-weight: 600;
  padding: 12px;
}

.btn-nav:hover {
  background: var(--green-d, #27ae60) !important;
}

.btn-nav-outline {
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  color: var(--white, #ffffff) !important;
}

.btn-nav-outline:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* ── 4. Footer & App Tabbar ── */
footer {
  background: var(--navy, #1a2e44);
  color: #8fa8c0;
  text-align: center;
  padding: 16px;
  font-size: 13px;
}

footer a {
  color: var(--green, #2ecc71);
  text-decoration: none;
}

.app-tabbar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--white, #ffffff);
  border-top: 1px solid #e2e8f0;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  gap: 3px;
  flex: 1;
  height: 100%;
  transition: color 0.2s ease;
}

.tabbar-item.active {
  color: #10b981;
}

.tabbar-icon {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.tabbar-item.active .tabbar-icon {
  transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. MEDIA QUERIES (Sequential Order by Breakpoint)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Breakpoint: 640px+ (Small Tablets / Large Phones) ── */
@media (min-width: 640px) {
  .page-title h1 {
    font-size: 22px;
  }

  .page-title p {
    display: block;
  }

  main {
    padding: 10px;
  }
}

/* ── Breakpoint: 769px+ (Tablets / Laptops / Desktops) ── */
@media (min-width: 769px) {
  header {
    padding: 0 32px;
  }

  main {
    min-height: calc(100vh - 198px);
  }

  .logo:hover {
    cursor: pointer;
    background-color: gray;
  }

  .nav-toggle {
    display: none;
  }

  .page-title {
    padding: 18px 16px;
  }

  #navMenu {
    display: flex !important;
    position: static;
    background: transparent;
    flex-direction: row;
    padding: 0;
    gap: 3px;
    box-shadow: none;
    border-top: none;
  }

  #navMenu a {
    width: auto;
    border-radius: 2px;
    font-size: 13px;
    border: none;
    color: black;
    background-color: gainsboro;
    text-align: center;
  }

  .app-tabbar {
    display: none;
  }
}

/* ── Breakpoint: 1200px+ (Large Desktop Screens) ── */
@media (min-width: 1200px) {
  main {
    max-width: 1400px;
  }
}