/*
Theme Name: eSchoolApp
Theme URI: https://eschoolapp.com
Author: eSchoolApp
Description: Bright Campus — custom block theme for eschoolapp.com. Native Gutenberg, zero builder lock-in. Indigo/coral/sun palette with three rotating tint grounds, Plus Jakarta Sans display over Public Sans body.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eschoolapp
*/

/* Minimal global refinements; all tokens live in theme.json */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Balanced headings, readable measure */
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Focus visibility on brand */
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--wp--preset--color--indigo);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Tables scroll instead of breaking layout */
.wp-block-table { overflow-x: auto; }

/* ============================================================
   HERO — product dashboard + lead form + module facts
   ============================================================ */
.esa-hero { position: relative; }
.esa-hero .esa-form-card {
  border: 1px solid var(--wp--preset--color--line);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.esa-hero .esa-form-card:focus-within {
  box-shadow: var(--wp--preset--shadow--lift);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .esa-hero .esa-form-card, .esa-hero .esa-form-card:focus-within { transform: none; transition: none; }
}

/* facts line under the headline */
.esa-hero-facts { font-size: .82rem; color: var(--wp--preset--color--muted); }
.esa-hero-facts strong { color: var(--wp--preset--color--ink); font-weight: 700; }

/* form card header ribbon */
.esa-formhead {
  background: var(--wp--preset--color--indigo); color: #fff;
  margin: calc(-1 * var(--wp--preset--spacing--40)) calc(-1 * var(--wp--preset--spacing--40)) var(--wp--preset--spacing--30);
  padding: 15px 20px; border-radius: 16px 16px 0 0;
}
.esa-formhead h4 { color: #fff; margin: 0; font-size: 1.1rem; }
.esa-formhead p { margin: 4px 0 0; font-size: .76rem; opacity: .85; }

/* ---- hero layout: wider, better balanced ---- */
.esa-hero > .wp-block-columns { align-items: center; }
.esa-hero .wp-block-column { min-width: 0; }
.esa-hero h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.06; }
.esa-hero .wp-block-buttons { margin-top: var(--wp--preset--spacing--30); }
@media (max-width: 1200px) {
  /* dashboard drops below the copy; form holds the right rail */
  .esa-hero > .wp-block-columns { flex-wrap: wrap !important; }
  .esa-hero > .wp-block-columns > .wp-block-column:nth-child(1) { flex-basis: 58% !important; }
  .esa-hero > .wp-block-columns > .wp-block-column:nth-child(3) { flex-basis: 38% !important; }
  .esa-hero > .wp-block-columns > .wp-block-column:nth-child(2) { flex-basis: 100% !important; order: 3; margin-top: var(--wp--preset--spacing--40); }
}
@media (max-width: 781px) {
  .esa-hero > .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
  .esa-hero > .wp-block-columns > .wp-block-column:nth-child(2) { order: 0; margin-top: 0; }
}

/* ---- product dashboard mock (inline HTML block) ---- */
.esa-dash {
  background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 16px;
  box-shadow: 0 30px 60px -34px rgba(45,61,168,.45); overflow: hidden;
}
@media (max-width: 600px) {
  .esa-dash__tiles { grid-template-columns: repeat(2,1fr); }
  .esa-dash__grid { grid-template-columns: 1fr; }
}
.esa-dash__top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #F7F8FC; border-bottom: 1px solid var(--wp--preset--color--line); }
.esa-dash__top i { width: 8px; height: 8px; border-radius: 50%; background: #D6DAEA; }
.esa-dash__top b { margin-left: 8px; font-family: var(--wp--preset--font-family--display); font-size: .72rem; color: var(--wp--preset--color--muted); font-weight: 600; }
.esa-dash__body { padding: 14px; }
.esa-dash__tiles { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-bottom: 12px; }
.esa-dash__tile { border-radius: 10px; padding: 10px; background: var(--wp--preset--color--tint-indigo); }
.esa-dash__tile.c { background: var(--wp--preset--color--tint-coral); }
.esa-dash__tile.m { background: var(--wp--preset--color--tint-mint); }
.esa-dash__tile.s { background: #FFF7E6; }
.esa-dash__k { font-size: .58rem; letter-spacing: .04em; text-transform: uppercase; color: var(--wp--preset--color--muted); font-weight: 700; }
.esa-dash__v { font-family: var(--wp--preset--font-family--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; margin-top: 2px; color: var(--wp--preset--color--ink); }
.esa-dash__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.esa-dash__panel { border: 1px solid var(--wp--preset--color--line); border-radius: 10px; padding: 11px; }
.esa-dash__panel h5 { font-family: var(--wp--preset--font-family--display); font-size: .7rem; margin: 0 0 8px; font-weight: 700; color: var(--wp--preset--color--ink); }
.esa-dash__chart { display: block; width: 100%; height: 66px; }
.esa-dash__donut { display: flex; align-items: center; gap: 10px; }
.esa-dash__legend { font-size: .62rem; color: var(--wp--preset--color--muted); line-height: 1.8; }
.esa-dash__dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* Checklist bullets — coral check marks (replaces Divi's redtikmrk_pntp) */
.esa-checks { list-style: none; padding-left: 0; }
.esa-checks li { position: relative; padding-left: 1.7em; margin-bottom: .45em; }
.esa-checks li::before {
  content: "";
  position: absolute; left: 0; top: .28em;
  width: 1.05em; height: 1.05em;
  border-radius: 50%;
  background: var(--wp--preset--color--coral);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.6 5.9-4.2 4.9a.75.75 0 0 1-1.13.02L4.4 8.8a.75.75 0 1 1 1.1-1.02l1.3 1.4 3.66-4.27a.75.75 0 0 1 1.14.98z"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.6 5.9-4.2 4.9a.75.75 0 0 1-1.13.02L4.4 8.8a.75.75 0 1 1 1.1-1.02l1.3 1.4 3.66-4.27a.75.75 0 0 1 1.14.98z"/></svg>') no-repeat center / contain;
}

/* ============================================================
   "WHAT IS" SECTION — explainer + convergence diagram
   ============================================================ */
.esa-kicker {
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--wp--preset--color--indigo); margin: 0 0 12px;
}
.esa-whatis__text > p:not(.esa-kicker) { max-width: 52ch; }
.esa-figure {
  margin: 0; background: #fff; border-radius: 18px; padding: 26px;
  box-shadow: 0 26px 55px -38px rgba(45,61,168,.45);
}
.esa-figure svg { display: block; width: 100%; height: auto; }
.esa-figure .dlabel {
  font-family: var(--wp--preset--font-family--body);
  font-size: 13.5px; fill: var(--wp--preset--color--ink);
}
.esa-figure .dhub {
  font-family: var(--wp--preset--font-family--display);
  font-size: 14px; font-weight: 700; fill: #fff;
}
@media (max-width: 781px) {
  .esa-figure { padding: 18px; }
  .esa-figure .dlabel { font-size: 15px; }
  .esa-figure .dhub { font-size: 16px; }
}

/* ============================================================
   MODULE EXPLORER — accessible tabs (rail + detail pane)
   No-JS: every panel visible. JS adds .is-enhanced and tab behaviour.
   ============================================================ */
.esa-exp__intro {
  max-width: 68ch; margin-left: auto; margin-right: auto;
}
.esa-exp {
  display: grid; grid-template-columns: 310px 1fr;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 18px; overflow: hidden; background: #fff;
  margin-top: var(--wp--preset--spacing--50);
}
.esa-exp__rail {
  background: #FAFBFF; border-right: 1px solid var(--wp--preset--color--line);
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
}
.esa-exp__tab {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; border: none; background: none;
  font-family: var(--wp--preset--font-family--body);
  font-size: .89rem; line-height: 1.35; color: var(--wp--preset--color--muted);
  text-align: left; width: 100%; cursor: pointer;
  transition: background .15s, color .15s;
}
.esa-exp__tab:hover { background: #F1F4FF; color: var(--wp--preset--color--ink); }
.esa-exp__tab .esa-exp__chip {
  width: 27px; height: 27px; border-radius: 7px; flex: none;
  background: #fff; border: 1px solid var(--wp--preset--color--line);
  display: flex; align-items: center; justify-content: center;
}
.esa-exp__chip svg { width: 14px; height: 14px; fill: none; stroke: var(--wp--preset--color--muted); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.esa-exp__tab.is-active {
  background: var(--wp--preset--color--indigo); color: #fff; font-weight: 600;
}
.esa-exp__tab.is-active .esa-exp__chip { background: rgba(255,255,255,.16); border-color: transparent; }
.esa-exp__tab.is-active .esa-exp__chip svg { stroke: #fff; }
.esa-exp__tab:focus-visible { outline: 2px solid var(--wp--preset--color--indigo); outline-offset: -2px; }
.esa-exp__tab.is-active:focus-visible { outline-color: #fff; }

.esa-exp__panels { padding: 0; }
.esa-exp__panel { padding: 34px; }
/* No-JS: every panel stacks and stays readable. */
.esa-exp:not(.is-enhanced) .esa-exp__panel + .esa-exp__panel { border-top: 1px solid var(--wp--preset--color--line); }
/* JS-enhanced: only the active panel shows. Never set `display` on the panel
   itself — an author-level display value beats the UA rule for [hidden]. */
.esa-exp.is-enhanced .esa-exp__panel { display: none; }
.esa-exp.is-enhanced .esa-exp__panel.is-active {
  display: flex; flex-direction: column; justify-content: center; min-height: 340px;
}
.esa-exp .esa-exp__panel[hidden] { display: none; }
.esa-exp__panel .esa-exp__ic {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 15px;
  background: var(--wp--preset--color--tint-indigo);
  display: flex; align-items: center; justify-content: center;
}
.esa-exp__panel .esa-exp__ic svg { width: 24px; height: 24px; fill: none; stroke: var(--wp--preset--color--indigo); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.esa-exp__panel h3 { margin: 0 0 10px; font-size: 1.45rem; letter-spacing: -.025em; }
.esa-exp__panel > p { margin: 0 0 18px; color: var(--wp--preset--color--muted); font-size: .96rem; line-height: 1.65; max-width: 48ch; }
.esa-exp__panel ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.esa-exp__panel li { font-size: .87rem; display: flex; gap: 9px; align-items: flex-start; color: var(--wp--preset--color--ink); }
.esa-exp__panel li::before {
  content: ""; width: 16px; height: 16px; flex: none; margin-top: .18em; border-radius: 50%;
  background: var(--wp--preset--color--coral);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.6 5.9-4.2 4.9a.75.75 0 0 1-1.13.02L4.4 8.8a.75.75 0 1 1 1.1-1.02l1.3 1.4 3.66-4.27a.75.75 0 0 1 1.14.98z"/></svg>') no-repeat center/contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.6 5.9-4.2 4.9a.75.75 0 0 1-1.13.02L4.4 8.8a.75.75 0 1 1 1.1-1.02l1.3 1.4 3.66-4.27a.75.75 0 0 1 1.14.98z"/></svg>') no-repeat center/contain;
}
@media (max-width: 860px) {
  .esa-exp { grid-template-columns: 1fr; }
  .esa-exp__rail { border-right: none; border-bottom: 1px solid var(--wp--preset--color--line); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .esa-exp.is-enhanced .esa-exp__panel { min-height: 0; }
  .esa-exp__panel { padding: 24px; }
}
@media (max-width: 480px) {
  .esa-exp__rail { grid-template-columns: 1fr; }
  .esa-exp__tab { font-size: .85rem; }
}

/* Card hover lift — used by feature patterns */
.esa-card { transition: transform .18s ease, box-shadow .18s ease; }
.esa-card:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--lift); }
@media (prefers-reduced-motion: reduce) { .esa-card, .esa-card:hover { transform: none; transition: none; } }
