/*
Theme Name: Odyssey Mosaic
Theme URI: https://odysseycharterschool.net
Author: Odyssey Charter School
Description: The "Mosaic" design system for Odyssey Charter School — warm paper background, Georgia serif headlines, and a signature multicolor stripe sampled from the tiger-mosaic logo. ADA/WCAG 2.1 AA color contrast, mobile-friendly accessible navigation, and a header translate button. Works with the site's existing pages and menus.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: odyssey-mosaic
*/

:root {
  --navy: #14243e;
  --navy-2: #1d3357;
  --crimson: #a32638;
  --gold: #e9a71d;
  --m-red: #d33a2f; --m-gold: #f3b229; --m-green: #35924a;
  --m-blue: #1f78c1; --m-pink: #e2668c; --m-orange: #ef7622;
  --paper: #faf7f2;
  --surface: #ffffff;
  --ink: #23272f;
  --ink-soft: #565048;
  --line: #e3ddd2;
  --link: #12508b;
  --wash: #f1ece3;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --mosaic: repeating-linear-gradient(90deg,
      var(--m-red) 0 44px, var(--m-gold) 44px 88px, var(--m-green) 88px 132px,
      var(--m-blue) 132px 176px, var(--m-pink) 176px 220px, var(--m-orange) 220px 264px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
}
::selection { background: var(--gold); color: var(--navy); }
img { max-width: 100%; height: auto; }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--navy); font-weight: 700;
  padding: .8rem 1.4rem; border-radius: 0 0 .6rem 0; text-decoration: none;
}
.skip-link:focus { left: 0; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--crimson); }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px;
}
.screen-reader-text {
  position: absolute !important; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden;
}

/* Header */
.site-header { background: var(--navy); color: #fff; }
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 1.05rem 1.25rem;
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
}
.site-brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: #fff; }
.site-brand img, .site-brand .custom-logo { width: auto; height: 64px; }
.site-title {
  font-family: var(--serif); font-weight: 700; font-size: 1.6rem;
  letter-spacing: .045em; line-height: 1.12; margin: 0; color: #fff;
}
.site-title a { color: #fff; text-decoration: none; }
.site-tagline { font-size: .9rem; color: #dfe6f2; margin: .1rem 0 0; letter-spacing: .02em; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.translate-box {
  background: #fff; border-radius: 999px; padding: .4rem .9rem;
  color: var(--navy); display: flex; align-items: center; gap: .55rem;
}
.translate-box .t-label {
  font-weight: 700; font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; white-space: nowrap;
}
.goog-te-gadget { font-size: 0 !important; }
.goog-te-gadget .goog-te-combo { margin: 0 !important; font-size: .95rem; padding: .25rem; }

/* Primary navigation — navy bar with the mosaic signature stripe */
.main-nav { background: var(--navy-2); border-bottom: 6px solid; border-image: var(--mosaic) 1; }
.nav-inner { max-width: 1200px; margin: 0 auto; position: relative; }
.menu-toggle {
  display: none; width: 100%; background: var(--navy-2); color: #fff; border: 0;
  font: 700 1.05rem var(--sans); padding: .85rem 1.25rem; text-align: left; cursor: pointer;
}
.main-nav ul.menu, .main-nav ul.sub-menu { list-style: none; margin: 0; padding: 0; }
.main-nav ul.menu { display: flex; flex-wrap: wrap; }
.main-nav li { position: relative; }
.main-nav ul.menu > li > a, .submenu-toggle {
  display: inline-block; color: #fff; background: none; border: 0; cursor: pointer;
  font: 600 .98rem var(--sans); padding: .9rem 1.05rem; text-decoration: none;
}
.main-nav ul.menu > li > a:hover, .main-nav ul.menu > li > a:focus,
.submenu-toggle[aria-expanded="true"], .submenu-toggle:hover {
  background: var(--crimson); color: #fff;
}
.main-nav ul.menu > li.menu-item-has-children > a { padding-right: .35rem; }
.submenu-toggle { padding: .9rem .7rem .9rem .35rem; }
.submenu-toggle .chev { font-size: .75em; }
.main-nav ul.sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50;
  background: var(--surface); min-width: 18rem; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 14px 34px rgba(20, 26, 40, .16);
  padding: .7rem .7rem .8rem;
}
.main-nav li.submenu-open > ul.sub-menu { display: block; }
.main-nav ul.sub-menu a {
  display: block; padding: .45rem .55rem; border-radius: 8px;
  text-decoration: none; color: var(--link); border: 0;
}
.main-nav ul.sub-menu a:hover, .main-nav ul.sub-menu a:focus { background: var(--wash); color: var(--crimson); }
.main-nav ul.sub-menu li.menu-item-has-children > a {
  font: 700 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--navy); border-bottom: 2px solid var(--gold); border-radius: 0;
  margin-top: .55rem; padding-bottom: .3rem;
}
.main-nav ul.sub-menu ul.sub-menu {
  display: block; position: static; box-shadow: none; border: 0; padding: 0; min-width: 0;
}

/* Content — white card on warm paper */
.site-main { max-width: 940px; margin: 0 auto; padding: 2rem 1.25rem 3.5rem; }
.site-main > article, .site-main > .page-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.4rem 2.75rem 2.6rem;
}
.breadcrumb {
  margin: 0 0 .8rem; font-size: .82rem; color: var(--ink-soft);
  letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
}
h1, .entry-title {
  font-family: var(--serif); color: var(--navy);
  font-size: clamp(1.9rem, 3.6vw, 2.5rem); line-height: 1.18;
  margin: .2rem 0 1.1rem; letter-spacing: .005em;
}
.entry-content h2, h2 {
  font-family: var(--serif); color: var(--navy-2); font-size: 1.45rem;
  margin: 2rem 0 .6rem; padding-bottom: .35rem;
  border-bottom: 2px solid var(--gold);
}
.entry-content h3, h3 { color: var(--navy-2); font-size: 1.12rem; }
.entry-content p, .entry-content li { max-width: 72ch; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .6rem .75rem; text-align: left; }
.entry-content th { background: var(--wash); color: var(--navy); font-family: var(--sans); }
.entry-content tbody tr:nth-child(even) { background: #fbf9f5; }
::marker { color: var(--crimson); }
.entry-content a.doc-download::before, .entry-content a[href$=".pdf"]::before {
  content: "PDF"; font: 700 .66rem var(--sans); letter-spacing: .08em;
  background: var(--navy); color: #fff; border-radius: 4px;
  padding: .18rem .4rem; margin-right: .5rem;
}

/* Buttons — pill, navy to crimson */
.btn, .entry-content .wp-block-button__link {
  display: inline-block; background: var(--navy); color: #fff; text-decoration: none;
  font: 600 1rem var(--sans); padding: .72rem 1.35rem; border-radius: 999px;
}
.btn:hover, .entry-content .wp-block-button__link:hover { background: var(--crimson); color: #fff; }
.btn-outline {
  display: inline-block; background: transparent; color: var(--navy);
  border: 2px solid var(--navy); text-decoration: none;
  font: 600 1rem var(--sans); padding: .62rem 1.3rem; border-radius: 999px;
}
.btn-outline:hover { border-color: var(--crimson); color: var(--crimson); }

/* Front-page hero */
.kicker {
  font: 700 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--crimson); margin: 0 0 .4rem;
}
.lede {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.6;
  color: var(--ink); max-width: 62ch; margin: 0 0 1.3rem;
}
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin: 0 0 1.8rem; }
.hero, .hero-photo img { width: 100%; height: auto; border-radius: var(--radius); margin: 0 0 1.6rem; }

/* Footer — navy with mosaic stripe */
.site-footer { background: var(--navy); color: #fff; margin-top: 2.5rem; border-top: 6px solid; border-image: var(--mosaic) 1; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 2.4rem 1.25rem;
  display: flex; gap: 3rem; flex-wrap: wrap;
}
.site-footer .widget-title, .site-footer h2 {
  font: 700 .78rem var(--sans); letter-spacing: .13em; text-transform: uppercase;
  color: var(--gold); border: 0; margin: 0 0 .6rem; padding: 0; display: block;
}
.site-footer a { color: #cfe0f5; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.foot-note { background: #0e1b30; text-align: center; padding: .85rem 1rem; font-size: .88rem; color: #c9d4e4; }

/* Mobile */
@media (max-width: 860px) {
  .main-nav { position: sticky; top: 0; z-index: 60; box-shadow: 0 2px 10px rgba(15, 22, 38, .35); }
  .menu-toggle { display: block; min-height: 48px; }
  .main-nav ul.menu { display: none; flex-direction: column; flex-wrap: nowrap; max-height: 75vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .main-nav.nav-open ul.menu { display: flex; }
  .main-nav ul.menu > li > a, .submenu-toggle {
    display: block; width: 100%; text-align: left; min-height: 48px;
    padding: .95rem 1.25rem; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .main-nav ul.menu > li.menu-item-has-children { display: flex; flex-wrap: wrap; }
  .main-nav ul.menu > li.menu-item-has-children > a { flex: 1; }
  .submenu-toggle { width: auto; min-width: 56px; text-align: center; }
  .main-nav ul.sub-menu { position: static; min-width: 0; box-shadow: none; border-radius: 0; border: 0; width: 100%; }
  .main-nav ul.sub-menu a { min-height: 44px; display: flex; align-items: center; font-size: 1.02rem; }
  .header-inner { justify-content: center; text-align: center; padding: .9rem .8rem; }
  .site-brand { flex-direction: column; gap: .45rem; }
  .site-brand img, .site-brand .custom-logo { height: 72px; }
  .site-title { font-size: 1.3rem; }
  .site-tagline { font-size: .84rem; }
  .header-tools { margin-left: 0; width: 100%; justify-content: center; }
  .translate-box { width: 100%; justify-content: center; min-height: 44px; border-radius: 12px; }
  .site-main { padding: 1rem .7rem 2.25rem; }
  .site-main > article, .site-main > .page-card { padding: 1.5rem 1.15rem; border-radius: 10px; }
  h1, .entry-title { font-size: 1.65rem; }
  .entry-content h2, h2 { font-size: 1.3rem; }
  .cta-row { flex-direction: column; }
  .btn, .btn-outline { text-align: center; }
  .entry-content table { display: block; overflow-x: auto; }
  .footer-inner { flex-direction: column; gap: 1.6rem; }
  .site-footer a { display: inline-block; padding: .2rem 0; min-height: 32px; }
}
@media (max-width: 400px) {
  .site-title { font-size: 1.15rem; }
  body { font-size: 1rem; }
}

/* ============================================================
   LEGACY PAGE-BUILDER NORMALIZATION  (added v1.1)
   Older pages were built with WPBakery / BoldGrid / nd_options.
   That markup hardcodes pixel side-margins (e.g. margin-left:50px,
   margin:0 100px) and Bootstrap grid widths that don't adapt to
   this theme, so on phones text collapses into a 1-word-per-line
   column and the page scrolls sideways. These rules neutralize the
   legacy spacing so content flows full-width and wraps on every
   screen, without touching the theme's own header/footer/hero.
   ============================================================ */

/* Kill the builder's hardcoded horizontal margins/padding that push
   content off-screen (the vc_custom_* classes carry them inline-generated). */
.entry-content [class*="vc_custom_"],
.entry-content .vc_column-inner,
.entry-content .wpb_text_column,
.entry-content .wpb_wrapper,
.entry-content .boldgrid-section {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Bootstrap rows/containers from the old builder add negative side
   margins and fixed widths -> horizontal scroll. Normalize them. */
.entry-content .vc_row,
.entry-content .wpb_row,
.entry-content .vc_row-fluid,
.entry-content .row,
.entry-content .boldgrid-section > .container {
  width: auto !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Long unbreakable strings (URLs, emails) must wrap, never overflow. */
.entry-content { overflow-wrap: break-word; word-break: break-word; }
.entry-content img,
.entry-content iframe,
.entry-content video,
.entry-content table { max-width: 100% !important; height: auto; }

/* Belt-and-suspenders: no sideways scrolling anywhere. */
html, body { max-width: 100%; overflow-x: hidden; }

/* On phones/tablets, force every legacy column to stack full-width. */
@media (max-width: 782px) {
  .entry-content .wpb_column,
  .entry-content .vc_column_container,
  .entry-content .vc_column-inner,
  .entry-content [class*="vc_col-"],
  .entry-content [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

