/* ============================================================================
   ADAPT FUN*RUN — modern reskin layer  (adapt-modern.css)
   Loads LAST, on top of Bootstrap 3 + adapt.css. CSS-only: no markup required.
   Concept: "Run · Walk · Roll" — athletic energy + radical legibility.
   Signature: lane-line dividers, Atkinson Hyperlegible body, Archivo display,
   coral reserved for the single most important action, forward-nudge motion.
   Remove this one <link> to fully revert.
   ========================================================================== */

/* Fonts (Archivo + Atkinson Hyperlegible) are loaded via <link> in the page
   head — see layout.html — so this file has no render-blocking @import. */

:root {
  --paper:      #FBF8F2;  /* warm off-white page */
  --surface:    #FFFFFF;  /* cards */
  --ink:        #14223D;  /* near-navy text (~13:1 on paper) */
  --ink-soft:   #46546E;  /* muted text */
  --blue:       #1A53D8;  /* primary brand (heritage blue, modernized) */
  --blue-deep:  #0E3AA6;  /* hover / pressed */
  --blue-soft:  #E9F0FF;  /* tints, section fills */
  --coral:      #FF5630;  /* energy accent (the asterisk, highlights) */
  --coral-cta:  #EF4A23;  /* coral as a button bg (white text passes AA-large) */
  --coral-deep: #D63B16;
  --green:      #0F9D58;  /* money / success / "go" */
  --green-deep: #0B7C45;
  --line:       rgba(20,34,61,.14);

  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(20,34,61,.06), 0 8px 24px rgba(20,34,61,.08);
  --shadow-lg:  0 12px 40px rgba(20,34,61,.16);
  --ring:       0 0 0 3px rgba(26,83,216,.45);
  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
}

/* The lane line — the running-lane / road-marking motif used throughout */
.adapt-lane,
section#main hr,
#footer { --lane: repeating-linear-gradient(90deg, var(--coral) 0 26px, transparent 26px 46px); }

/* ---- Base ------------------------------------------------------------------ */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body) !important;
  font-size: 20px;           /* large, accessible base for low-vision readers */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
/* override adapt.css global Roboto + bootswatch Open Sans */
* { font-family: inherit; }
p, li, td, dd { font-size: 1.05em; }

h1,h2,h3,h4,h5,.main-site-title {
  font-family: var(--display) !important;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.12;
}
h1 { font-weight: 900; font-size: clamp(2.6rem, 6vw, 4rem); }
h2 { font-weight: 800; font-size: clamp(2.1rem, 4.2vw, 2.9rem); }
h3 { font-weight: 800; font-size: 1.9rem; }
h4 { font-weight: 700; font-size: 1.9rem; margin: 1.7rem 0 .85rem; }
h5 { font-weight: 700; font-size: 1.3rem; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); text-decoration: underline; }
/* in-content text links underlined for clarity (not nav/buttons) */
section#main p a, section#main li a { text-decoration: underline; }

/* Eyebrow / label utility (uppercase, tracked) */
.eyebrow {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; font-size: 1rem; color: var(--coral);
}

/* Accessibility floor: large, high-contrast keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
  box-shadow: var(--ring); border-radius: var(--radius-sm);
}

/* ---- Navbar ---------------------------------------------------------------- */
.navbar.navbar-inverse { background: transparent; border: 0; box-shadow: none; margin-bottom: 0; }
.navbar-inverse .navbar-inner,
.navbar .navbar-inner {
  background: var(--ink);
  border: 0; border-radius: 0;
  box-shadow: 0 2px 0 var(--coral), var(--shadow);
  padding: 10px 0;
}
.navbar .container { position: relative; }

.main-site-title {
  color: #fff !important; text-shadow: none !important;
  font-weight: 900 !important; font-size: 2rem; letter-spacing: -.02em;
}
.main-site-subtitle { color: #9fb2d6 !important; font-weight: 600; font-size: 1.5rem; }
/* turn the * in "FUN*RUN" energy — handled in markup via .star if present */
.main-site-title .star { color: var(--coral); }

.header-block { margin: 3px 2px; }            /* spacing so targets don't crowd */
.header-block > a,
.navbar .nav > li > a {
  display: inline-flex; align-items: center; min-height: 48px;   /* tap target */
  color: #dce6fb !important;
  font-family: var(--display); font-weight: 600; font-size: 1.1rem !important;
  text-decoration: none !important;
  padding: 11px 18px !important; border-radius: 999px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.header-block > a:hover,
.navbar .nav > li > a:hover { background: rgba(255,255,255,.10); color: #fff !important; }

/* primary nav buttons (Register / Sponsor / My Dashboard / Admin) */
.navbutton.btn,
.btn.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;                            /* generous motor-friendly target */
  background: var(--blue) !important; background-image: none !important;
  border: 0 !important; color: #fff !important;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem !important;
  border-radius: 999px !important; padding: 13px 26px !important;
  box-shadow: 0 2px 0 var(--blue-deep);
  text-shadow: none !important;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.navbutton.btn:hover,
.btn.btn-primary:hover { background: var(--blue-deep) !important; transform: translateY(-1px); }
.navbutton.btn:active,
.btn.btn-primary:active { transform: translateY(1px); box-shadow: none; }

/* Donate: the standout giving action — green, distinct from the blue buttons */
.navbar .navbutton.donate-btn, .nav-drawer .navbutton.donate-btn {
  background: var(--green) !important; box-shadow: 0 2px 0 var(--green-deep);
}
.navbar .navbutton.donate-btn:hover, .nav-drawer .navbutton.donate-btn:hover {
  background: var(--green-deep) !important; }

.spanish-link {
  background: rgba(255,255,255,.12) !important; color: #fff !important;
  border: 1px solid rgba(255,255,255,.3) !important; font-weight: 600;
  text-decoration: none !important;
}

/* Auth dropdown — keep it ABOVE page content and not clipped.
   adapt.css sets `.container{overflow-y:hidden}` which clips the menu, and the
   navbar needs a stacking context above the main container below it. */
.navbar { position: relative; z-index: 1030; }
.navbar .navbar-inner { overflow: visible; }
.navbar .container { overflow: visible; }
#auth_navbar_wrapper { z-index: 1040; }
#auth_navbar .dropdown-menu { z-index: 1050; border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
#auth_navbar .dropdown-menu > li > a { border-radius: var(--radius-sm); padding: 12px 16px; color: var(--ink); font-size: 1.05rem; min-height: 44px; display: flex; align-items: center; }
#auth_navbar .dropdown-menu > li > a:hover { background: var(--blue-soft); }

/* Menu icons carry BOTH legacy BS2 sprite classes (.icon-*) and BS3 font
   classes (.glyphicon), so the sprite image renders behind the font glyph
   (doubled/odd). Drop the sprite where a glyphicon is also present. */
[class*=" icon-"].glyphicon, [class^="icon-"].glyphicon {
  background-image: none !important; width: auto; height: auto; margin-top: 0; margin-right: 10px;
}

/* ---- Layout & dividers ----------------------------------------------------- */
/* adapt.css sets `.container{overflow-y:hidden}`; per spec that forces
   overflow-x to `auto`, causing a stray horizontal scrollbar. Reset to visible
   (the page's html{overflow-x:hidden} still catches any real overflow). */
.container { max-width: 1120px; overflow: visible; }
section#main, .main { padding: 28px 14px 8px; }

section#main hr, hr.adapt-lane {
  border: 0; height: 6px; margin: 34px 0;
  background: repeating-linear-gradient(90deg, var(--line) 0 22px, transparent 22px 40px);
  border-radius: 6px;
}

/* a colored lane accent you can drop above a section heading */
.lane-accent { height: 6px; width: 120px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, var(--coral) 0 18px, transparent 18px 30px); margin-bottom: 14px; }

/* ---- Hero (home save-the-date image) -------------------------------------- */
.save-the-date img {
  width: 100%; max-width: 680px; height: auto; display: block; margin: 0 auto;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.save-the-date { margin: 6px 0 4px; text-align: center; }

/* ---- Fun-run listing: tables become card rows ----------------------------- */
#local_funrun_table { border: 0 !important; background: transparent; border-collapse: separate; border-spacing: 0 12px; }
#local_funrun_table tr {
  background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease;
  display: table-row;
}
#local_funrun_table tr:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
#local_funrun_table td {
  border: 0 !important; vertical-align: middle !important; padding: 18px 16px !important;
  background: transparent !important;
}
#local_funrun_table td:first-child { border-radius: var(--radius) 0 0 var(--radius); font-family: var(--display); font-weight: 700; font-size: 1.45rem; }
#local_funrun_table td:first-child a { color: var(--ink); }
#local_funrun_table td:last-child  { border-radius: 0 var(--radius) var(--radius) 0; text-align: right; }
#local_funrun_table td strong { display:inline-block; background: var(--blue-soft); color: var(--blue-deep);
  padding: 7px 15px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
#local_funrun_table span { color: var(--green-deep); font-weight: 700; }

/* THE conversion action: Register is coral (the one place coral is a button) */
#local_funrun_table .btn.btn-primary,
a.btn.btn-register {
  background: var(--coral-cta) !important; box-shadow: 0 2px 0 var(--coral-deep);
}
#local_funrun_table .btn.btn-primary:hover,
a.btn.btn-register:hover { background: var(--coral-deep) !important; }

.table.table-bordered, .table-striped { border-radius: var(--radius); overflow: hidden; }
.table thead th, .table th { font-family: var(--display); background: var(--ink); color:#fff; border:0; }

/* ---- Forms (SQLFORM register / sponsor) ----------------------------------- */
form label { font-family: var(--display) !important; font-weight: 700 !important; color: var(--ink); font-size: 1.2rem !important; }
form td { padding: 13px 8px !important; }                 /* more room between fields */
.form-control,
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=file], select, textarea {
  border: 2px solid var(--line) !important; border-radius: var(--radius-sm) !important;
  padding: 15px 16px !important; min-height: 56px; height: auto !important;
  font-size: 1.15rem; color: var(--ink);
  box-shadow: none !important; background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
input:focus, select:focus, textarea:focus { border-color: var(--blue) !important; box-shadow: var(--ring) !important; }

/* form submit = primary blue button, big tap target */
input[type=submit], button[type=submit], .btn.btn-default {
  background: var(--blue) !important; color:#fff !important; border:0 !important;
  font-family: var(--display); font-weight: 700; font-size: 1.2rem !important;
  border-radius: 999px !important; min-height: 56px;
  padding: 15px 32px !important; box-shadow: 0 2px 0 var(--blue-deep); cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
input[type=submit]:hover, button[type=submit]:hover, .btn.btn-default:hover { background: var(--blue-deep) !important; transform: translateY(-1px); }

/* the green "donate/money" emphasis already in adapt.css */
.greenmoney { color: var(--green-deep); }
#thankyou { background: var(--blue-soft); border: 0; border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }

/* ---- Horizontal-overflow guard -------------------------------------------- */
/* Belt-and-suspenders: nothing should ever push the page wider than the screen. */
html, body { overflow-x: hidden; max-width: 100%; }
img, iframe, video, embed, object { max-width: 100%; }

/* ---- Videos / generic cards ----------------------------------------------- */
#videos { width: 100%; table-layout: fixed; }   /* fixed layout = cells can't force width */
#videos td { padding: 14px !important; }
#videos iframe, #videos video { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16/9;
  border-radius: var(--radius-sm); box-shadow: var(--shadow); }
@media (max-width: 820px) {                       /* stack the 3-up videos on small screens */
  #videos, #videos tbody, #videos tr, #videos td { display: block; width: 100%; }
}

/* ---- Footer --------------------------------------------------------------- */
/* The app uses .span12 (no BS3 column padding), so .row negative margins push
   content off-screen horizontally — and overflow-x:hidden hides the scroll.
   Nothing here uses the BS3 grid, so neutralize the row margins. */
.container .row { margin-left: 0; margin-right: 0; }

#footer.footer { margin-top: 40px; padding: 22px 0; width: auto; float: none;
  height: auto;                 /* undo web2py sticky-footer fixed 6em height */
  border-top: 6px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--line) 0 22px, transparent 22px 40px) 6; }
/* undo web2py.css .footer-content {position:relative; bottom:-4em} which pushed
   the copyright down off the page */
#footer .footer-content { position: static; bottom: auto; }
#footer .copyright, #footer a { color: var(--ink-soft); }
#footer a { font-weight: 700; }
#footer .copyright.pull-left { float: none; }   /* keep footer text on-page */

/* ---- Responsive / a11y ----------------------------------------------------- */
@media (max-width: 768px) {
  #local_funrun_table, #local_funrun_table tbody, #local_funrun_table tr, #local_funrun_table td { display:block; width:100%; }
  #local_funrun_table tr { padding: 6px 4px; }
  #local_funrun_table td { text-align: left !important; padding: 8px 16px !important; }
  #local_funrun_table td:last-child { text-align: left; }
  .header-block { display:block; }
  #auth_navbar_wrapper { position: static; }
}
/* ---- Mobile nav drawer (hamburger) ---------------------------------------- */
/* Desktop: hidden — the existing inline nav is unchanged. */
.nav-toggle, .nav-close, .nav-backdrop { display: none; }

@media (max-width: 900px) {
  .navbar .container { padding-right: 64px; }   /* keep title clear of the button */

  /* stack the subtitle below the title on phones */
  .main-site-title { cursor: pointer; display: flex; flex-direction: column; margin-left: 10px; }

  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    position: absolute; top: 14px; right: 14px; z-index: 1101;
    width: 50px; height: 50px; padding: 0 12px;
    background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.28);
    border-radius: 12px; cursor: pointer;
  }
  .nav-toggle-bar { display: block; height: 3px; width: 100%; background: #fff; border-radius: 3px;
    transition: transform .2s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 330px);
    background: var(--ink); box-shadow: -10px 0 50px rgba(0,0,0,.45);
    transform: translateX(105%); transition: transform .25s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    z-index: 1100; padding: 70px 18px 28px; display: block;
  }
  .nav-drawer.open { transform: translateX(0); }

  .nav-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 14px; width: 46px; height: 46px;
    font-size: 2rem; line-height: 1; background: transparent; color: #fff;
    border: 0; cursor: pointer; border-radius: 10px;
  }
  .nav-close:hover { background: rgba(255,255,255,.10); }

  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 1090; background: rgba(8,14,28,.55); }
  .nav-backdrop[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-toggle { display: none; }   /* drawer's own ✕ handles closing — no overlap */

  /* stacked, full-width, left-aligned drawer items */
  .nav-drawer .header-block { display: block; margin: 8px 0; }
  .nav-drawer .header-block > a,
  .nav-drawer .navbutton.btn,
  .nav-drawer .btn.btn-primary { display: flex; width: 100%; justify-content: flex-start; text-align: left; }
  .nav-drawer .spanish-link { position: static; display: inline-flex; margin-top: 14px; }

  /* auth dropdown rendered inline inside the dark drawer */
  #auth_navbar_wrapper { position: static; }
  .nav-drawer #auth_navbar > li > a { color: #dce6fb !important; padding: 11px 16px; }
  .nav-drawer #auth_navbar .dropdown-menu { position: static; float: none; width: 100%;
    background: rgba(255,255,255,.06); box-shadow: none; margin: 4px 0; }
  .nav-drawer #auth_navbar .dropdown-menu > li > a { color: #dce6fb; }
  .nav-drawer #auth_navbar .dropdown-menu > li > a:hover { background: rgba(255,255,255,.10); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
