/*
Theme Name: EOL Classroom
Theme URI: https://eolclassroom-online.com
Author: EOL Classroom Online
Description: Mobile-first learning and classroom games theme with AdSense-safe ad slots (labelled, spaced from navigation and game controls, layout-shift reserved).
Version: 2.0.0
Requires PHP: 8.0
Text Domain: eolclassroom
*/

/* ---------- Tokens ---------- */
:root {
	--navy: #0f2747;
	--navy-2: #173a66;
	--blue: #1d5fc4;
	--blue-soft: #eaf1fd;
	--orange: #f58a1f;
	--orange-ink: #b45309;
	--orange-soft: #fff2e3;
	--green: #0f8a68;
	--green-soft: #e2f5ee;
	--bg: #f7f8fb;
	--card: #ffffff;
	--text: #1f2937;
	--muted: #5b6b7f;
	--line: #e3e8f0;
	--radius: 16px;
	--shadow: 0 1px 2px rgba(15, 39, 71, .06), 0 10px 28px rgba(15, 39, 71, .07);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--header-h: 60px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.drawer-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--blue); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 7.5vw, 48px); font-weight: 800; }
h2 { font-size: clamp(24px, 5.6vw, 34px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 750; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.icon { width: 22px; height: 22px; flex: none; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 10px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 760px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-ink); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.header-bar { max-width: 1180px; margin: 0 auto; height: var(--header-h); padding: 0 12px 0 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.brand-text { font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--navy); white-space: nowrap; }
.brand-text strong { font-weight: 850; color: var(--blue); }
.desktop-nav { display: none; margin-left: auto; }
.desktop-nav .menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.desktop-nav a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--navy); text-decoration: none; font-weight: 650; font-size: 15px; }
.desktop-nav a:hover, .desktop-nav .current-menu-item > a { background: var(--blue-soft); color: var(--blue); }
.header-actions { display: flex; gap: 4px; margin-left: auto; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--navy); cursor: pointer; }
.icon-btn:hover { background: var(--blue-soft); }
.search-panel { border-top: 1px solid var(--line); padding: 12px 16px 16px; background: #fff; }
.search-panel .search-form { max-width: 760px; margin: 0 auto; }

/* ---------- Search form ---------- */
.search-form { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
.search-form input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; padding: 0 12px; font: inherit; font-size: 16px; color: var(--text); }
.search-form input:focus { outline: none; }
.search-form:focus-within { border-color: var(--blue); }
.search-form button { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 11px; background: var(--blue); color: #fff; cursor: pointer; }

/* ---------- Drawer (mobile menu) ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 39, 71, .45); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 360px); background: #fff; padding: 12px 16px 32px; overflow-y: auto; box-shadow: -10px 0 40px rgba(15, 39, 71, .2); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 8px; }
.drawer-menu, .drawer-tools { list-style: none; margin: 0; padding: 0; }
.drawer-menu a { display: block; padding: 14px 12px; border-radius: 12px; font-size: 18px; font-weight: 700; color: var(--navy); text-decoration: none; }
.drawer-menu a:hover, .drawer-menu .current-menu-item > a { background: var(--blue-soft); }
.drawer-label { margin: 20px 12px 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.drawer-tools a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-weight: 650; color: var(--text); text-decoration: none; }
.drawer-tools a:hover { background: var(--bg); }

/* ---------- Tool icons ---------- */
.tool-ico { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; flex: none; }
.tool-ico--games { background: var(--orange-soft); color: var(--orange-ink); }
.tool-ico--labs { background: var(--green-soft); color: var(--green); }
.tool-ico--timer { background: var(--blue-soft); color: var(--blue); }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(120% 90% at 85% 0%, #22508c 0%, var(--navy) 60%); color: #fff; }
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 36px 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.hero-copy { min-width: 0; }
.pill { display: inline-block; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; font-size: 13px; font-weight: 700; color: #cfe0f5; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: clamp(36px, 10vw, 64px); line-height: 1.04; letter-spacing: -.035em; margin-bottom: 16px; }
.hero h1 span { color: var(--orange); }
.hero-lead { color: #cfdcef; font-size: 17px; max-width: 560px; margin-bottom: 22px; }
.hero .search-form { max-width: 520px; border-color: transparent; }
.hero-chips { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hero-chips::-webkit-scrollbar { display: none; }
.hero-chips a { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; text-decoration: none; font-size: 15px; font-weight: 650; }
.hero-chips a:hover { background: rgba(255, 255, 255, .18); }
.hero-chips .icon { width: 18px; height: 18px; color: var(--orange); }
.hero-chips--light { justify-content: center; flex-wrap: wrap; }
.hero-chips--light a { background: #fff; color: var(--navy); border-color: var(--line); }
.hero-art { display: none; }

/* ---------- Sections ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 44px 20px; }
.section-head { margin-bottom: 22px; max-width: 720px; }
.section-head > p:not(.eyebrow) { color: var(--muted); }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .02em; text-decoration: none; }
.chip--link { padding: 8px 14px; font-size: 14px; }
.chip--link:hover { background: var(--blue); color: #fff; }
.chip small { opacity: .7; font-weight: 600; }

/* ---------- Tool cards ---------- */
.tool-grid { display: grid; gap: 14px; }
.tool-card { display: block; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: #c9d6ea; }
.tool-card h3 { margin: 14px 0 6px; }
.tool-card p { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.tool-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; color: var(--blue); }
.tool-cta .icon { width: 18px; height: 18px; }
.tool-card--games { border-top: 4px solid var(--orange); }
.tool-card--labs { border-top: 4px solid var(--green); }
.tool-card--timer { border-top: 4px solid var(--blue); }

/* ---------- Post cards ---------- */
.card-grid { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-link { display: grid; grid-template-columns: 104px 1fr; gap: 14px; padding: 12px; color: inherit; text-decoration: none; height: 100%; }
.card-media { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--blue-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media--empty { display: grid; place-items: center; color: var(--blue); }
.card-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.card-title { font-size: 17px; line-height: 1.3; margin: 0; }
.card-link:hover .card-title { color: var(--blue); }
.card-text { display: none; color: var(--muted); font-size: 15px; margin: 0; }
.card-meta { font-size: 13px; color: var(--muted); margin-top: auto; }
.grid-ad { grid-column: 1 / -1; }

.why { display: grid; gap: 14px; }
.why > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--orange); }
.why p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- Ads ----------
 * Labelled, centred, separated from tappable UI. Space is reserved so the page
 * does not jump when the ad loads (CLS); unfilled slots collapse completely. */
.ad-slot { display: block; clear: both; margin: 36px auto; min-height: 300px; text-align: center; }
.ad-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8794a7; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-after-tool { padding-top: 150px; }
.ad-after-tool:not(:has(.ad-slot)) { display: none; }
.wrap:empty { display: none; }

/* ---------- Article ---------- */
.article { max-width: 760px; margin: 0 auto; padding: 18px 20px 8px; }
.article-head { margin-bottom: 18px; }
.article-head .chip { margin-bottom: 12px; }
.article-head h1 { margin-bottom: 10px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 14px; margin: 0; }
.article-meta span + span::before { content: "•"; margin-right: 16px; color: #b3bdcb; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs p { margin: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs span { margin: 0 6px; }
.crumbs .separator { margin: 0 4px; }
.article-hero { margin: 0 -20px 24px; }
.article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

.entry-content { font-size: 17.5px; line-height: 1.75; overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; }
.entry-content h2 { margin: 1.8em 0 .55em; scroll-margin-top: calc(var(--header-h) + 16px); }
.entry-content h3 { font-size: 20px; margin: 1.5em 0 .45em; scroll-margin-top: calc(var(--header-h) + 16px); }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.1em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin: .35em 0; }
.entry-content li::marker { color: var(--orange-ink); font-weight: 700; }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin: 1.4em 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); text-align: center; }
.entry-content blockquote { margin: 1.5em 0; padding: 14px 18px; border-left: 4px solid var(--orange); background: var(--orange-soft); border-radius: 0 12px 12px 0; }
.entry-content strong { color: var(--navy); }
.entry-content .table-scroll { overflow-x: auto; margin: 1.4em 0; -webkit-overflow-scrolling: touch; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: 15px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.entry-content th { background: var(--blue-soft); color: var(--navy); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.article-tags a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 14px; text-decoration: none; }

.toc { margin: 8px 0 28px; background: var(--blue-soft); border: 1px solid #d3e1f8; border-radius: 14px; }
.toc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; cursor: pointer; font-weight: 800; color: var(--navy); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary small { font-weight: 600; color: var(--muted); }
.toc summary::after { content: "+"; font-size: 22px; font-weight: 600; color: var(--blue); }
.toc[open] summary::after { content: "–"; }
.toc ol { margin: 0; padding: 0 16px 14px 36px; font-size: 15.5px; line-height: 1.45; }
.toc li { margin: 0; }
.toc a { display: block; padding: 7px 0; color: var(--navy); text-decoration: none; }
.toc a:hover { color: var(--blue); text-decoration: underline; }

.related { padding-top: 24px; }

/* ---------- Wide pages (games, simulations) ---------- */
.wide-head { max-width: 1180px; margin: 0 auto; padding: 18px 20px 0; }
.wide-head h1 { font-size: clamp(26px, 6vw, 36px); margin-bottom: 4px; }
.wide-content { max-width: 1180px; margin: 0 auto; padding: 0 4px; }

/* ---------- Archive / search / 404 ---------- */
.archive .section-head h1 { margin-bottom: 8px; }
.archive-desc { color: var(--muted); }
.archive .section-head .search-form { margin-top: 16px; max-width: 560px; }
.empty, .notfound { text-align: center; max-width: 620px; margin: 0 auto; }
.notfound { padding: 64px 20px; }
.notfound .search-form, .empty .search-form { margin: 24px auto 0; max-width: 520px; }
.notfound p:not(.eyebrow) { color: var(--muted); }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pagination .page-numbers { min-width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--navy); text-decoration: none; font-weight: 700; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Contact form ---------- */
.contact-form { margin: 1.5em 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 16px; }
.contact-form .field { margin: 0 0 16px; }
.contact-form label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--navy); font-size: 15px; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 16px; color: var(--text); }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.contact-form .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 14px; color: var(--muted); }
.form-notice { padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.form-notice--ok { background: var(--green-soft); color: #075e46; }
.form-notice--err { background: #fdecec; color: #9b1c1c; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
.btn:hover { background: #174ea3; }
@media (min-width: 600px) { .contact-form { padding: 28px; } .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; background: var(--navy); color: #c8d5e8; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 40px 20px 8px; display: grid; gap: 28px; }
.site-footer .brand-text { color: #fff; }
.site-footer .brand-text strong { color: var(--orange); }
.footer-brand p { margin-top: 10px; font-size: 15px; max-width: 380px; }
.footer-title { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a { display: block; padding: 9px 0; color: #c8d5e8; text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: #fff; }
.copyright { max-width: 1180px; margin: 0 auto; padding: 18px 20px 28px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: #8ea3c0; }

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
	.card-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
	.card-link { display: flex; flex-direction: column; gap: 0; padding: 0; }
	.card-media { aspect-ratio: 16 / 10; border-radius: 0; }
	.card-body { padding: 16px 18px 18px; }
	.card-title { font-size: 18px; }
	.card-text { display: block; }
	.tool-grid, .why { grid-template-columns: repeat(3, 1fr); }
	.footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
	.article-hero { margin: 0 0 28px; }
	.article-hero img { border-radius: var(--radius); }
}
@media (min-width: 768px) {
	.ad-slot { min-height: 130px; }
}
@media (min-width: 900px) {
	:root { --header-h: 68px; }
	.desktop-nav { display: block; }
	.header-actions { margin-left: 0; }
	.menu-btn { display: none; }
	.hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; padding: 64px 24px 72px; gap: 48px; }
	.hero-chips { flex-wrap: wrap; overflow: visible; }
	.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
	.stat { padding: 22px; border-radius: 18px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); }
	.stat strong { display: block; font-size: 40px; line-height: 1; color: #fff; letter-spacing: -.03em; }
	.stat span { color: #cfdcef; font-weight: 600; }
	.stat--games { grid-column: 1 / -1; background: linear-gradient(135deg, var(--orange), #f2a541); border: 0; }
	.stat--games span { color: #fff; }
	.section { padding: 64px 24px; }
	.card-grid { grid-template-columns: repeat(3, 1fr); }
	.entry-content { font-size: 18.5px; }
	.article { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.drawer-panel { animation: none; }
	.tool-card { transition: none; }
}
