/* LearnWithExamples – site header (.lwh) and footer (.lwf) */
:root {
  --lw-ink: #0A0F2C;
  --lw-ink2: #141B41;
  --lw-blue: #3857F1;
  --lw-blue-d: #2038C9;
  --lw-lime: #C6E82F;
  --lw-line: #E6EAF5;
  --lw-muted: #5B6690;
  --lw-soft: #EEF1FF;
  --lw-wash: #F6F7FC;
  --lw-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --lw-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --lw-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --lw-admin: var(--wp-admin--admin-bar--height, 0px);
}
.lwh *, .lwh-layer *, .lwf * { box-sizing: border-box; }
.lwh svg, .lwh-layer svg, .lwf svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.lwh ul, .lwh-layer ul, .lwf ul { list-style: none; margin: 0; padding: 0; }
.lwh a, .lwh-layer a, .lwf a { text-decoration: none; }
.lw-wordmark { font-family: var(--lw-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--lw-ink); white-space: nowrap; }
.lw-wordmark b { color: #8DB300; font-weight: 600; margin: 0 1px; }

.lwh-skip { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--lw-ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.lwh-skip:focus { left: 12px; top: calc(var(--lw-admin) + 12px); }

/* ================= HEADER ================= */
.lwh {
  position: sticky; top: var(--lw-admin); z-index: 999;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: var(--lw-ui);
}
.lwh.is-scrolled { border-bottom-color: var(--lw-line); box-shadow: 0 6px 24px -18px rgba(10, 15, 44, .35); background: rgba(255,255,255,.9); }
@media screen and (max-width: 600px) { .lwh { top: 0; } } /* WP admin bar isn't fixed on phones */

.lwh__bar { max-width: 1240px; margin: 0 auto; height: 68px; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.lwh__logo { display: flex; align-items: center; flex: 0 0 auto; margin-right: 8px; position: relative; z-index: 1; }
.lwh__logo-img { height: 32px; width: auto; max-width: 200px; display: block; object-fit: contain; }

.lwh__nav { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.lwh__menu { flex-wrap: nowrap; }
/* "More" holds whatever doesn't fit, so the menu never overlaps the logo or buttons */
.lwh__more[hidden] { display: none !important; }
.lwh__more-btn { width: auto !important; height: auto !important; margin: 0 !important; padding: 9px 10px 9px 12px !important; gap: 4px; display: inline-flex !important; align-items: center; border-radius: 10px !important; font: 500 15px var(--lw-display) !important; color: var(--lw-ink) !important; }
.lwh__more-btn:hover, .lwh__more.is-open .lwh__more-btn { background: var(--lw-wash) !important; }
.lwh__more .lwh__drop { left: auto; right: 0; transform: translate(0, 6px); min-width: 230px; max-height: 70vh; overflow-y: auto; }
.lwh__more:hover > .lwh__drop, .lwh__more.is-open > .lwh__drop { transform: translate(0, 0); }
.lwh__more .lwh__sub a.is-top { font-weight: 600; }
.lwh__more .lwh__sub a.is-child { padding-left: 24px; font-weight: 400; color: var(--lw-muted) !important; }
.lwh__more .lwh__sub li:has(> a.is-top):not(:first-child) { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--lw-line); }
.lwh__menu { display: flex; align-items: center; gap: 2px; }
.lwh__item { position: relative; display: flex; align-items: center; }
.lwh__link {
  display: block; padding: 9px 12px; border-radius: 10px; white-space: nowrap;
  font-family: var(--lw-display); font-weight: 500; font-size: 15px; color: var(--lw-ink) !important; transition: background .15s, color .15s;
}
.lwh__item.has-sub .lwh__link { padding-right: 4px; }
.lwh__link:hover, .lwh__item:focus-within > .lwh__link, .lwh__item.is-open > .lwh__link { background: var(--lw-wash); }
.lwh__link[aria-current="page"] { color: var(--lw-blue) !important; }
.lwh__caret { display: grid; place-items: center; width: 22px; height: 30px; padding: 0; margin-right: 4px; border: 0; background: none; cursor: pointer; color: var(--lw-muted); border-radius: 6px; font-size: 15px; }
.lwh__caret svg { transition: transform .2s; }
.lwh__item:hover .lwh__caret svg, .lwh__item.is-open .lwh__caret svg { transform: rotate(180deg); }

/* dropdown */
.lwh__drop {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, 6px);
  min-width: 240px; padding: 10px; border-radius: 18px; background: #fff;
  border: 1px solid var(--lw-line); box-shadow: 0 24px 60px -20px rgba(10, 15, 44, .35);
  opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
}
.lwh__drop::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* hover bridge */
.lwh__item:hover > .lwh__drop, .lwh__item.is-open > .lwh__drop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.lwh__drop.is-rich { display: grid; grid-template-columns: 250px 230px; gap: 10px; }
.lwh__sub a { display: block; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--lw-ink) !important; transition: background .15s, color .15s; }
.lwh__sub a:hover { background: var(--lw-wash); color: var(--lw-blue) !important; }
.lwh__sub ul a { padding-left: 24px; font-weight: 400; color: var(--lw-muted) !important; }

.lwh__promo { --c: var(--lw-blue); --cs: var(--lw-soft); padding: 16px; border-radius: 12px; background: var(--cs); display: flex; flex-direction: column; gap: 6px; }
.lwh__promo--math { --c: #7C3AED; --cs: #F3EEFF; }
.lwh__promo--business { --c: #0E9F6E; --cs: #E6F8F0; }
.lwh__promo--science { --c: #EA580C; --cs: #FFF0E6; }
.lwh__promo--arts { --c: #DB2777; --cs: #FDECF4; }
.lwh__promo-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--c); margin-bottom: 4px; }
.lwh__promo-icon svg { width: 20px; height: 20px; }
.lwh__promo-title { margin: 0; font-family: var(--lw-display); font-weight: 700; font-size: 16px; color: var(--lw-ink); }
.lwh__promo-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--lw-muted); }
.lwh__promo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.lwh__promo-all { font-size: 13px; font-weight: 600; color: var(--c) !important; }
.lwh__promo-ask { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--lw-ink); color: var(--lw-lime) !important; }

/* actions */
.lwh__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.lwh__icon {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--lw-line); background: #fff; color: var(--lw-ink); font-size: 17px; transition: border-color .15s;
}
.lwh__icon:hover { border-color: var(--lw-ink); }
.lwh__kbd { font-family: var(--lw-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--lw-line); color: var(--lw-muted); }
.lwh__cta {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 12px;
  background: var(--lw-ink); color: #fff !important; font-family: var(--lw-display); font-weight: 600; font-size: 15px; transition: transform .15s, background .15s;
}
.lwh__cta svg { color: var(--lw-lime); fill: var(--lw-lime); stroke: none; font-size: 16px; }
.lwh__cta:hover { background: var(--lw-blue-d); transform: translateY(-1px); }
.lwh__burger { display: none; width: 42px; height: 40px; border-radius: 12px; border: 1px solid var(--lw-line); background: #fff; cursor: pointer; position: relative; padding: 0; }
.lwh__burger span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--lw-ink); transition: transform .2s, top .2s; }
.lwh__burger span:first-child { top: 15px; }
.lwh__burger span:last-child { top: 23px; }
.lwh__burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.lwh__burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* drawer (mobile) */
.lwh-layer { font-family: var(--lw-ui); }
.lwh__drawer { z-index: 998; position: fixed; inset: calc(var(--lw-admin) + 68px) 0 0 0; background: #fff; overflow-y: auto; padding: 16px 20px 40px; border-top: 1px solid var(--lw-line); animation: lwh-in .2s ease; }
@media screen and (max-width: 600px) { .lwh__drawer { inset: 68px 0 0 0; } }
@keyframes lwh-in { from { opacity: 0; transform: translateY(-6px); } }
.lwh__dsearch { display: flex; gap: 8px; margin-bottom: 18px; }
.lwh__dsearch input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--lw-line); font: 16px var(--lw-ui); background: var(--lw-wash); }
.lwh__dsearch button { height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--lw-ink); color: var(--lw-lime); font: 600 15px var(--lw-display); cursor: pointer; }
.lwh__dmenu > li { border-bottom: 1px solid var(--lw-line); }
.lwh__dmenu > li > a, .lwh__dmenu summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 2px; font: 600 18px var(--lw-display); color: var(--lw-ink) !important; cursor: pointer; list-style: none; }
.lwh__dmenu summary::-webkit-details-marker { display: none; }
.lwh__dmenu details[open] summary svg { transform: rotate(180deg); }
.lwh__dmenu details ul { padding: 0 0 12px 4px; }
.lwh__dmenu details a { display: block; padding: 9px 10px; border-radius: 10px; color: var(--lw-ink2) !important; font-size: 16px; }
.lwh__dmenu details a:hover { background: var(--lw-wash); }

/* search dialog */
.lwh__search { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: calc(var(--lw-admin) + 12vh) 16px 16px; background: rgba(10, 15, 44, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: lwh-fade .15s ease; }
.lwh__search[hidden], .lwh__drawer[hidden] { display: none; }
@keyframes lwh-fade { from { opacity: 0; } }
.lwh__search-box { width: 100%; max-width: 640px; background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); animation: lwh-in .2s ease; }
.lwh__search-title { margin: 0 0 12px; font: 600 13px var(--lw-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lw-muted); }
.lwh__search-row { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--lw-line); transition: border-color .15s; }
.lwh__search-row:focus-within { border-color: var(--lw-blue); }
.lwh__search-row svg { font-size: 20px; color: var(--lw-muted); }
.lwh__search-row input { flex: 1; min-width: 0; height: 56px; border: 0 !important; outline: 0; background: none !important; box-shadow: none !important; font: 500 19px var(--lw-display) !important; color: var(--lw-ink); padding: 0 !important; }
.lwh__search-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lwh__search-btns button { flex: 1 1 200px; height: 48px; border-radius: 12px; cursor: pointer; font: 600 15px var(--lw-display); border: 1px solid var(--lw-line); background: #fff; color: var(--lw-ink); }
.lwh__search-btns .is-ask { background: var(--lw-lime); border-color: var(--lw-lime); }
.lwh__search-btns button:hover { filter: brightness(.97); }
.lwh__search-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--lw-muted); }
.lwh__search-hint kbd { font-family: var(--lw-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--lw-line); background: var(--lw-wash); }
.lwh__search-close { position: absolute; top: calc(var(--lw-admin) + 16px); right: 20px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

.lwh button:focus-visible, .lwh a:focus-visible, .lwh-layer button:focus-visible, .lwh-layer a:focus-visible, .lwh-layer summary:focus-visible { outline: 2px solid var(--lw-blue); outline-offset: 2px; }

@media (max-width: 960px) {
  .lwh__nav { display: none; }
  .lwh__burger { display: inline-block; }
}
@media (max-width: 520px) {
  .lwh__bar { gap: 10px; padding: 0 14px; height: 62px; }
  .lwh__logo-img { height: 26px; }
  .lwh__kbd { display: none; }
  .lwh__icon { padding: 0 11px; }
  .lwh__cta { padding: 0 12px; }
  .lwh__drawer { top: 62px; }
}
@media (max-width: 380px) { .lwh__cta span { display: none; } }

/* ================= FOOTER ================= */
.lwf { background: var(--lw-ink); color: rgba(255,255,255,.72); font-family: var(--lw-ui); font-size: 15px; line-height: 1.6; padding: 0 0 28px; position: relative; overflow: hidden; }
.lwf::before { content: ''; position: absolute; width: 640px; height: 640px; border-radius: 50%; background: radial-gradient(closest-side, rgba(56,87,241,.35), transparent); top: -320px; right: -160px; pointer-events: none; }
.lwf__wrap { position: relative; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.lwf__cta {
  display: grid; gap: 24px; align-items: center; padding: 40px; margin: 0 0 64px; transform: translateY(0);
  border-radius: 0 0 28px 28px; background: linear-gradient(135deg, #1A2366, var(--lw-ink2)); border: 1px solid rgba(255,255,255,.08); border-top: 0;
}
@media (min-width: 900px) { .lwf__cta { grid-template-columns: 1fr 1.1fr; padding: 48px 56px; } }
.lwf__eyebrow { margin: 0 0 10px; font: 500 12px var(--lw-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lw-lime); }
.lwf__cta h2 { margin: 0 0 8px; font-family: var(--lw-display); font-weight: 700; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.08; letter-spacing: -.025em; color: #fff; }
.lwf__cta h2 span { color: var(--lw-lime); }
.lwf__cta p { margin: 0; }
.lwf__ask { display: flex; gap: 8px; padding: 8px; border-radius: 16px; background: #fff; }
.lwf__ask input { flex: 1; min-width: 0; height: 52px; border: 0 !important; outline: 0; padding: 0 12px !important; font: 500 17px var(--lw-display) !important; color: var(--lw-ink) !important; background: none !important; box-shadow: none !important; }
.lwf__ask button { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--lw-lime); color: var(--lw-ink); font: 700 16px var(--lw-display); cursor: pointer; white-space: nowrap; }
.lwf__ask button:hover { background: #d3f04a; }

.lwf__grid { display: grid; gap: 36px; grid-template-columns: 1fr 1fr; padding-bottom: 48px; }
@media (min-width: 900px) { .lwf__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; } }
.lwf__brand { grid-column: 1 / -1; }
@media (min-width: 900px) { .lwf__brand { grid-column: auto; } }
.lwf__logo .lw-wordmark { color: #fff; font-size: 24px; }
.lwf__logo .lw-wordmark b { color: var(--lw-lime); }
.lwf__motto { margin: 14px 0 8px; font-family: 'Lora', Georgia, serif; font-style: italic; font-size: 17px; color: #fff; }
.lwf__desc { margin: 0; max-width: 40ch; }
.lwf__h { margin: 0 0 14px; font: 500 12px var(--lw-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.lwf__col li + li { margin-top: 8px; }
.lwf__col a { color: rgba(255,255,255,.85) !important; display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.lwf__col a:hover { color: var(--lw-lime) !important; }
.lwf__col a span { font: 11px var(--lw-mono); padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.55); }

.lwf__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13.5px; }
.lwf__bottom p { margin: 0; }
.lwf__top { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.85) !important; }
.lwf__top:hover { color: var(--lw-lime) !important; }
.lwf a:focus-visible, .lwf button:focus-visible, .lwf input:focus-visible { outline: 2px solid var(--lw-lime); outline-offset: 2px; }

@media (max-width: 520px) {
  .lwf__cta { padding: 28px 20px; border-radius: 0 0 22px 22px; margin-bottom: 44px; }
  .lwf__ask { flex-direction: column; }
  .lwf__ask button { justify-content: center; }
}

/* reading progress (article pages) */
.lwh__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.lwh__progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--lw-blue), var(--lw-lime)); transform: scaleX(0); transform-origin: left; transition: transform .1s linear; }

/* ================= Theme touch-ups on other pages ================= */
/* Your theme's custom CSS adds a 10px red bar (body{border-top:10px solid red}) – hidden here; delete it in Customize → Additional CSS. */
body.lwe-chrome { border-top: 0 !important; }
body.lwe-chrome .page-header { background: var(--lw-wash) !important; border: 0 !important; }
body.lwe-chrome .page-header .page-title, body.lwe-chrome .si-page-header-title h1 { font-family: var(--lw-display); letter-spacing: -.02em; color: var(--lw-ink); }
body.lwe-chrome .si-breadcrumbs, body.lwe-chrome .si-breadcrumbs a { font-family: var(--lw-mono); font-size: 12px; }
body.lwe-chrome #sinatra-scroll-top { display: none !important; } /* footer has its own "Back to top" */
