/* ===== RodgersAlgo global styles (light) ===== */
:root{
  /* Palette */
  --bg: #f5f6f8;          /* page background */
  --bg-elev: #ffffff;     /* cards / menus / nav */
  --text: #1a1a1a;        /* primary text */
  --muted: #555;          /* secondary text */
  --brand-blue: #0056b3;  /* main brand/title blue */
  --accent: #00bcd4;      /* cyan accent */
  --accent-hover: #008bb0;/* darker cyan on hover */
  --heading-dark: #3a3f45;/* section headings */
  --nav-border: #e0e0e0;  /* borders */
  --footer-bg: #f0f1f3;   /* footer background */
  --shadow: rgba(0,0,0,0.08);
  --hero-grad-top:#eef2f7;
  --hero-grad-bot:#f5f6f8;
}

/* ===== Base reset ===== */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a{
  color: var(--accent);
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease;
}
a:hover{ color: var(--accent-hover); }
img{ max-width:100%; height:auto; display:block; }

/* ===== Layout helpers ===== */
.container{ max-width:1100px; margin:0 auto; padding:40px 20px; }
.section{ margin-bottom:50px; }
.section h2{
  color: var(--heading-dark);
  margin-bottom: 10px;
  font-size: 1.6rem;
}
.section p, .section ul{ color: var(--muted); }
.section ul{ padding-left: 20px; margin-top:10px; }
.section ul li{ margin-bottom:6px; }

/* ===== Header / Nav ===== */
.site-header{
  background: var(--bg-elev);
  border-bottom: 1px solid var(--nav-border);
  position: sticky; top:0; z-index:1000;
  box-shadow: 0 1px 4px var(--shadow);
}
.nav-wrap{
  max-width:1200px; margin:0 auto;
  display:flex; align-items:center; gap:16px;
  /* height set again below to keep header constant height */
  padding: 0 20px;
}

.brand{ display:inline-flex; align-items:center; gap:10px; }
.brand-logo{ height:40px; width:auto; display:block; }

.primary-nav{
  display:flex; align-items:center; gap:18px;
  margin-left:16px; list-style:none;
}
.primary-nav > li{ position:relative; list-style:none; }
.primary-nav > li > a{
  font-size:1rem; font-weight:500; color:var(--text); opacity:.9;
}
.primary-nav > li > a:hover{ opacity:1; color:var(--accent); }

/* Dropdown (tier-2) */
.dropdown{
  position:absolute; top:calc(100% + 8px); left:0;
  background: var(--bg-elev);
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  min-width: 220px;
  padding: 8px 0;
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.primary-nav > li:hover > .dropdown,
.primary-nav > li:focus-within > .dropdown{
  visibility: visible; opacity: 1; transform: translateY(0);
}
.dropdown li{ list-style:none; position:relative; }
.dropdown a{
  display:block; padding:10px 14px; color:var(--text);
}
.dropdown a:hover{ background:#f6f7f9; color: var(--accent); }

/* Tier-3 submenu (cascade right) */
.submenu{ top:0; left:100%; margin-left:6px; }
.dropdown li:hover > .submenu,
.dropdown li:focus-within > .submenu{
  visibility: visible; opacity: 1; transform: translateY(0);
}

/* ===== Hero ===== */
.hero{
  padding:80px 20px 40px;
  text-align:center;
  background: linear-gradient(to bottom, var(--hero-grad-top), var(--hero-grad-bot));
}
.hero h1{
  font-size:3rem; margin-bottom:15px; color:var(--brand-blue);
}
.hero p{ font-size:1.2rem; color:var(--muted); }

/* ===== Footer ===== */
footer{
  background: var(--footer-bg);
  text-align:center; padding:25px;
  color:#666; font-size:.9rem;
  border-top:1px solid var(--nav-border);
  margin-top: 20px;
}

/* ===== Prevent horizontal overflow (mobile grey strip fix) ===== */
html, body { width:100%; overflow-x:hidden; }

/* ===== Keep header constant height even with bigger logo ===== */
.nav-wrap{ height:56px; }  /* matches overlay inset in drawer CSS */

/* ===== Small phones ===== */
@media (max-width:600px){
  .hero h1{ font-size:2.2rem; }
}
@media (max-width:420px){
  .brand-logo{ height:34px; }
}

/* ===== HAMBURGER + DRAWER ===== */

/* === Hamburger button === */
.hamburger-btn{
  margin-left:auto;
  border:1px solid var(--nav-border);
  background: var(--bg-elev);
  color: var(--text);
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  line-height:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.hamburger-btn:hover{ color: var(--accent); }

/* FIXED: draw 3 bars properly inside the button */
.hamburger-bars{
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
  /* middle bar */
  background: linear-gradient(currentColor, currentColor) center 50% / 100% 2px no-repeat;
}
.hamburger-bars::before,
.hamburger-bars::after{
  content:"";
  position:absolute;
  left:0;
  width:100%;
  height:2px;
  background: currentColor;
  border-radius:2px;
}
.hamburger-bars::before{ top:0; }
.hamburger-bars::after{ bottom:0; }

/* === Drawer overlay (site map) === */
.drawer-overlay[hidden]{ display:none; }
.drawer-overlay{
  position: fixed; inset: 56px 0 0 0;  /* below sticky header */
  background: rgba(0,0,0,.25);
  z-index: 1200;
}
.drawer-panel{
  position: absolute; right:0; top:0; bottom:0;
  width: min(92vw, 420px);
  background: var(--bg-elev);
  border-left: 1px solid var(--nav-border);
  box-shadow: -8px 0 24px rgba(0,0,0,.12);
  padding: 14px;
  overflow-y: auto;
}
.drawer-close{
  border: none; background: transparent; font-size: 1.6rem; line-height:1;
  cursor:pointer; color: var(--muted);
  position: absolute; right: 10px; top: 8px;
}

/* Accordion in drawer */
.m-list{ list-style:none; padding: 30px 8px 12px; }
.m-list > li{ margin: 8px 0; }
.m-list a{ display:block; padding:10px 10px; border-radius:6px; color: var(--text); }
.m-list a:hover{ background:#f6f7f9; color: var(--accent); }

.m-acc{
  width:100%; text-align:left; background:transparent;
  border:1px solid var(--nav-border);
  color:var(--text); padding:10px 10px; border-radius:6px; cursor:pointer; font-size:1rem;
}
.m-acc[aria-expanded="true"]{ background:#f6f7f9; }
.m-sub{ list-style:none; padding-left:14px; margin-top:6px; display:none; }
.m-sub.open{ display:block; }

/* Lock background scroll when drawer open */
body.menu-open{ overflow:hidden; }