/*
Theme Name: Taalam Online
Theme URI: https://www.taalamonline.com
Author: Taalam Online
Description: قالب تعليمي عربي/فرنسي لمنصة الدروس التفاعلية في الفيزياء والكيمياء للإعدادي: صفحة رئيسية بالمستويات، صفحة درس بفهرس تلقائي، وأدوات جاهزة للفيديو والمختبر والاختبارات والحلول المخفية.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: taalam
Tags: rtl-language-support, education, blog, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments
*/

/* ---------- Tokens ---------- */
:root {
	--ink: #16324F;
	--ink-dark: #0F2438;
	--accent: #F2B544;
	--paper: #FBFAF6;
	--card: #FFFFFF;
	--line: #E5E1D8;
	--line-soft: #EEEAE0;
	--grid: #E9E4D8;
	--muted: #4A5568;
	--body: #3A4A5C;
	--chip: #F3F0E8;
	--sky: #E8EEF6;
	--sky-2: #EEF2F7;
	--mint: #E3F2EE;
	--mint-ink: #1E6B48;
	--sand: #FDF1DC;
	--rose: #FCE8E6;
	--rose-ink: #A3341F;
	--foot-text: #DCE5EF;
	--foot-muted: #B8C6D6;
	--radius: 18px;
	--font-head: "Cairo", "IBM Plex Sans Arabic", system-ui, sans-serif;
	--font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
	--wrap: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--ink-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 3px solid #2B6CB0;
	outline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.4; color: var(--ink); }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link:focus {
	position: fixed; top: 10px; inset-inline-start: 10px; z-index: 1000;
	width: auto; height: auto; clip: auto; margin: 0;
	background: var(--card); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.t-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.grid-paper {
	background-color: var(--paper);
	background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 28px 28px;
}

/* ---------- Buttons & chips ---------- */
.t-button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px; border-radius: 12px; border: 0;
	font: inherit; font-weight: 600; font-size: 16px; line-height: 1.2;
	text-decoration: none; cursor: pointer;
	background: var(--ink); color: #fff;
}
.t-button:hover { background: var(--ink-dark); color: #fff; }
.t-button--accent { background: var(--accent); color: var(--ink); font-weight: 700; }
.t-button--accent:hover { background: var(--accent); color: var(--ink-dark); filter: brightness(0.96); }
.t-button--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.t-button--ghost:hover { background: var(--sky-2); color: var(--ink); }
.t-chip {
	display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.5;
	background: var(--chip); color: var(--ink); border-radius: 6px; padding: 4px 10px; text-decoration: none;
}
.t-chip--ink { background: var(--ink); color: #fff; }
.t-chip--accent { background: var(--accent); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.t-chip--outline { background: var(--card); border: 1px solid var(--line); }

/* ---------- Header ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.site-brand__mark {
	width: 46px; height: 46px; border-radius: 12px; background: var(--accent);
	display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
}
.site-brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.site-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.site-brand__name { font-family: var(--font-head); font-weight: 800; font-size: 21px; }
.site-brand__tag { font-size: 13px; color: var(--muted); }
.custom-logo-link { display: block; }

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav li { position: relative; }
.site-nav a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
	border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px;
}
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a, .site-nav .current-cat > a { background: var(--sky-2); }
.site-nav .sub-menu {
	display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 220px;
	background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
	box-shadow: 0 12px 32px rgba(22,50,79,.1); flex-direction: column;
}
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: flex; }
.site-nav .sub-menu a { width: 100%; }
.lang-switch { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.lang-switch a, .lang-switch__link {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
	border: 1.5px solid var(--ink); border-radius: 999px; text-decoration: none;
	font-weight: 600; font-size: 14px; text-transform: uppercase;
}
.menu-toggle {
	display: none; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px;
	border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
	align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
}
@media (max-width: 960px) {
	.menu-toggle { display: inline-flex; }
	.site-header__bar { flex-wrap: wrap; }
	.site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
	.site-nav.is-open { display: flex; }
	.site-nav ul { flex-direction: column; }
	.site-nav a { width: 100%; }
	.site-nav .sub-menu { display: flex; position: static; box-shadow: none; border: 0; padding: 0 16px 0 0; }
}

/* ---------- Hero ---------- */
.t-hero { padding: 72px 0 80px; border-bottom: 1px solid var(--line); }
.t-hero__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.t-hero__main { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.t-hero__badge { font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.t-hero h1 { margin: 0; font-weight: 800; font-size: clamp(32px, 5vw, 50px); line-height: 1.35; }
.t-hero h1 mark { background: var(--accent); color: inherit; padding: 0 10px; border-radius: 8px; }
.t-hero__text { margin: 0; font-size: 19px; color: var(--body); max-width: 560px; }
.t-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.t-search { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; max-width: 560px; }
.t-search input[type="search"] {
	flex: 1 1 240px; min-height: 52px; padding: 0 18px; border: 1.5px solid #C9C2B2; border-radius: 12px;
	background: var(--card); font: inherit; font-size: 16px; color: var(--ink);
}
.t-search button { min-height: 52px; }
.t-teacher {
	flex: 0 1 340px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px;
	display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
	box-shadow: 0 12px 32px rgba(22,50,79,.08);
}
.t-teacher__photo {
	width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: var(--sky-2);
	border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px;
}
.t-teacher__name { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 21px; }
.t-teacher__bio { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- Sections ---------- */
.t-section { padding: 80px 0; }
.t-section--tight { padding: 0 0 80px; }
.t-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 32px; }
.t-section__head h2 { margin: 0; font-weight: 800; font-size: clamp(26px, 3.4vw, 34px); }
.t-section__head p { margin: 4px 0 0; color: var(--muted); }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

/* Level cards */
.t-level { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.t-level__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.t-level__num {
	font-family: var(--font-head); font-weight: 800; font-size: 26px; width: 56px; height: 56px; border-radius: 16px;
	background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center;
}
.t-level h3 { margin: 0; font-size: 24px; }
.t-level h3 a { text-decoration: none; }
.t-level__units { display: flex; flex-wrap: wrap; gap: 8px; }
.t-level__units a { font-size: 14px; background: var(--chip); border-radius: 8px; padding: 6px 12px; text-decoration: none; }
.t-level__units a:hover { background: var(--sky-2); }
.t-level__meta { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.t-level__meta a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* Post cards */
.t-post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.t-post__media { display: block; aspect-ratio: 16 / 9; background: var(--sky); overflow: hidden; }
.t-post__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.t-post:hover .t-post__media img { transform: scale(1.03); }
.t-post__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.t-post__placeholder--1 { background: var(--sky); }
.t-post__placeholder--2 { background: var(--sand); }
.t-post__placeholder--3 { background: var(--mint); }
.t-post__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.t-post__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.t-post__title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.5; }
.t-post__title a { text-decoration: none; }
.t-post__title a:hover { text-decoration: underline; }
.t-post__excerpt { margin: 0; font-size: 15px; line-height: 1.7; color: var(--muted); flex-grow: 1; }
.t-post__more { font-weight: 600; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }

/* Feature panels */
.t-panels { display: flex; flex-wrap: wrap; gap: 24px; }
.t-panel { flex: 1 1 420px; border-radius: 24px; padding: 40px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.t-panel h2 { margin: 0; font-weight: 800; font-size: 28px; }
.t-panel p { margin: 0; font-size: 17px; }
.t-panel--mint { background: var(--mint); }
.t-panel--mint p { color: #2D4A3F; }
.t-panel--ink { background: var(--ink); color: #fff; }
.t-panel--ink h2 { color: #fff; }
.t-panel--ink p { color: var(--foot-text); }

/* Newsletter */
.t-news { border: 2px solid var(--ink); border-radius: 24px; padding: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
.t-news__text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.t-news__text h2 { margin: 0; font-weight: 800; font-size: 30px; }
.t-news__text p { margin: 0; color: var(--body); }
.t-news__form { flex: 1 1 380px; }
.t-news__form input[type="email"], .t-news__form input[type="text"] {
	min-height: 52px; padding: 0 16px; border: 1.5px solid #C9C2B2; border-radius: 12px; background: var(--card); font: inherit; width: 100%;
}
.t-news__form button, .t-news__form input[type="submit"] {
	min-height: 52px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.t-admin-hint { background: var(--sand); border-radius: 12px; padding: 14px 18px; font-size: 15px; }

/* ---------- Page header (archives, single) ---------- */
.t-pagehead { padding: 40px 0 44px; border-bottom: 1px solid var(--line); }
.t-pagehead__inner { display: flex; flex-direction: column; gap: 14px; }
.t-pagehead h1 { margin: 0; font-weight: 800; font-size: clamp(28px, 4.2vw, 42px); }
.t-pagehead__desc { margin: 0; color: var(--body); max-width: 760px; font-size: 18px; }
.t-crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.t-crumbs a { color: var(--muted); }
.t-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 15px; color: var(--body); }
.t-byline img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); }
.t-subcats { display: flex; flex-wrap: wrap; gap: 8px; }
.t-subcats a { font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.t-subcats a:hover { background: var(--sky-2); }

/* ---------- Article layout ---------- */
.t-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px; padding-top: 48px; padding-bottom: 72px; }
.t-main { flex: 999 1 620px; min-width: 0; }
.t-aside { flex: 1 1 280px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 961px) { .t-aside__sticky { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; } }
.t-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.t-box__title { margin: 0 0 8px; font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.t-box ul { list-style: none; margin: 0; padding: 0; }
.t-box li a { min-height: 40px; display: flex; align-items: center; font-size: 15px; }
.t-toc a { text-decoration: none; border-inline-start: 3px solid var(--line-soft); padding-inline-start: 12px; }
.t-toc a:hover, .t-toc a.is-active { border-inline-start-color: var(--accent); }
.t-box--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.t-box--ink .t-box__title { color: #fff; }
.t-box--ink p { margin: 0 0 12px; font-size: 15px; color: var(--foot-text); line-height: 1.7; }
.t-featured { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; }
.t-featured img { display: block; width: 100%; }

/* ---------- Entry content ---------- */
.entry-content { font-size: 18px; line-height: 1.95; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 28px; font-weight: 800; margin: 1.8em 0 .6em; scroll-margin-top: 24px; }
.entry-content h3 { font-size: 22px; font-weight: 700; margin: 1.5em 0 .5em; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content blockquote { margin: 1.5em 0; padding: 18px 24px; background: var(--sky-2); border-radius: 14px; border: 0; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 17px; background: var(--card); }
.entry-content th, .entry-content td { text-align: start; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.entry-content thead th, .entry-content tr:first-child th { background: var(--sky-2); border-top: 0; }
.entry-content .wp-block-table, .entry-content .t-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 0 0 1.5em; }
.entry-content .wp-block-table table { margin: 0; }
.entry-content > table { display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.entry-content img { border-radius: 14px; }
.entry-content figure { margin: 0 0 1.5em; }
.entry-content figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content code { background: var(--chip); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry-content .wp-block-embed__wrapper iframe, .entry-content .wp-embed-responsive iframe { border-radius: 14px; }
.page-links { margin-top: 24px; font-weight: 600; }

/* ---------- Lesson shortcodes ---------- */
.t-block { margin: 0 0 1.8em; border-radius: var(--radius); }
.t-block > :last-child { margin-bottom: 0; }
.t-block__label { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.4; }
.t-block__label svg { flex: none; }

.t-goals { background: var(--card); border: 1px solid var(--line); padding: 24px 28px; }
.t-goals ul { margin: 0; }

.t-formula { border: 2px solid var(--ink); padding: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.t-formula__eq { margin: 0 !important; font-family: var(--font-head); font-weight: 800; font-size: clamp(30px, 5vw, 46px); line-height: 1.2; direction: ltr; unicode-bidi: isolate; }
.t-formula__legend { list-style: none; margin: 0 !important; padding: 0 !important; font-size: 16px; line-height: 1.9; }

.t-example { background: var(--sky); padding: 24px 28px; }
.t-note { background: var(--sand); padding: 20px 24px; }

.t-lesson-video { background: var(--ink); padding: 14px; }
.t-lesson-video .t-block__label { color: #fff; padding: 6px 8px 0; }
.t-lesson-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0B1F33; }
.t-lesson-video__frame iframe, .t-lesson-video__frame video, .t-lesson-video__frame object, .t-lesson-video__frame embed { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.t-lesson-video__cap { color: var(--foot-text); font-size: 15px; margin: 10px 8px 4px; }

.t-lab { background: var(--card); border: 1px solid var(--line); padding: 22px; }
.t-lab__frame { position: relative; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.t-lab__frame iframe { display: block; width: 100%; border: 0; }
.t-lab__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 15px; color: var(--muted); }

.t-solution { background: var(--card); border: 2px dashed #C9C2B2; padding: 22px 26px; }
.t-solution > :not(details):last-child { margin-bottom: 0; }
.t-solution details { margin: 0; }
.t-solution summary {
	display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px;
	background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; list-style: none;
}
.t-solution summary::-webkit-details-marker { display: none; }
.t-solution summary .t-hide { display: none; }
.t-solution details[open] summary .t-show { display: none; }
.t-solution details[open] summary .t-hide { display: inline; }
.t-solution__body { margin-top: 16px; background: var(--mint); border-radius: 12px; padding: 18px 22px; }
.t-solution__body > :last-child { margin-bottom: 0; }

.t-quiz { background: var(--card); border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 26px; font-size: 17px; }
.t-quiz__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.t-quiz__head .t-block__label { margin: 0; }
.t-quiz__score { margin: 0 !important; font-family: var(--font-head); font-weight: 800; font-size: 17px; background: var(--accent); border-radius: 999px; padding: 6px 16px; }
.t-q { border: 0; margin: 0; padding: 0; min-width: 0; }
.t-q legend { padding: 0; margin-bottom: 12px; font-weight: 700; line-height: 1.7; }
.t-q__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.t-q__opt {
	min-height: 48px; padding: 10px 16px; text-align: start; border-radius: 12px; background: var(--card);
	border: 2px solid #D9D3C5; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; cursor: pointer;
}
.t-q__opt:hover:not([disabled]) { background: var(--sky-2); }
.t-q__opt[disabled] { cursor: default; }
.t-q__opt.is-correct { background: var(--mint); border-color: var(--mint-ink); }
.t-q__opt.is-wrong { background: var(--rose); border-color: var(--rose-ink); }
.t-q__fb { margin: 12px 0 0 !important; font-weight: 600; font-size: 16px; }
.t-q__fb.is-ok { color: var(--mint-ink); }
.t-q__fb.is-no { color: var(--rose-ink); }
.t-quiz__reset { align-self: flex-start; }

.t-download { background: var(--accent); padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.t-download__title { margin: 0 !important; font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1.4; }
.t-download__text { margin: 4px 0 0 !important; font-size: 16px; }

.t-cta { background: var(--ink); color: #fff; padding: 28px 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.t-cta__title { margin: 0 !important; font-family: var(--font-head); font-weight: 800; font-size: 22px; color: #fff; line-height: 1.4; }
.t-cta__text { margin: 4px 0 0 !important; font-size: 16px; color: var(--foot-text); }

/* Related */
.t-related { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 24px; }
.t-related h2 { margin: 0 0 14px; font-size: 22px; font-weight: 800; }
.t-related__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.t-related__item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-decoration: none; font-weight: 600; line-height: 1.6; }
.t-related__item span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.t-related__item:hover { border-color: var(--ink); }

/* Pagination */
.t-pagination { margin-top: 40px; }
.t-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.t-pagination .page-numbers {
	min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px;
	border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; font-weight: 600;
}
.t-pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.t-empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }

/* Comments */
.t-comments { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 28px; }
.t-comments h2 { font-size: 22px; }
.t-comments ol { list-style: none; padding: 0; margin: 0 0 24px; }
.t-comments ol ol { padding-inline-start: 24px; }
.t-comments .comment-body { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 12px; }
.t-comments .comment-meta { font-size: 14px; color: var(--muted); }
.t-comments .avatar { border-radius: 50%; vertical-align: middle; margin-inline-end: 8px; }
.t-comments textarea, .t-comments input[type="text"], .t-comments input[type="email"], .t-comments input[type="url"] {
	width: 100%; padding: 12px 14px; border: 1.5px solid #C9C2B2; border-radius: 12px; font: inherit; background: var(--card);
}
.t-comments .submit { min-height: 48px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Widgets */
.widget { margin: 0; }
.widget-title { margin: 0 0 8px; font-family: var(--font-head); font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-dark); color: var(--foot-text); padding: 56px 0 28px; }
.site-footer a { color: var(--foot-text); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.site-footer__brand { font-family: var(--font-head); font-weight: 800; font-size: 22px; color: #fff; margin: 0 0 8px; }
.site-footer p { margin: 0; font-size: 15px; line-height: 1.8; }
.site-footer__title { margin: 0 0 8px; font-weight: 700; color: #fff; font-size: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { min-height: 36px; display: inline-flex; align-items: center; }
.site-footer__copy { margin-top: 36px; padding-top: 20px; border-top: 1px solid #2A4560; font-size: 14px; color: var(--foot-muted); }

/* WP core alignment */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, .gallery-caption { font-size: 14px; color: var(--muted); }
.sticky, .bypostauthor { }

@media (max-width: 600px) {
	body { font-size: 16px; }
	.t-wrap { padding-left: 16px; padding-right: 16px; }
	.t-hero { padding: 44px 0 52px; }
	.t-section { padding: 56px 0; }
	.t-section--tight { padding-bottom: 56px; }
	.t-panel, .t-news, .t-quiz { padding: 24px; }
	.entry-content { font-size: 17px; }
	.t-formula, .t-goals, .t-example, .t-solution, .t-download, .t-cta { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}

/* Platform (Taalam TMS) stats on level cards */
.t-level__stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.t-level__stats li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; background: var(--sky-2); border-radius: 8px; padding: 6px 10px; }
.t-level__soon { margin: 0; font-size: 15px; color: var(--muted); background: var(--chip); border-radius: 10px; padding: 10px 14px; }
.t-level__meta { flex-wrap: wrap; }
.t-level__meta .t-button { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* =========================================================================
 * Platform pages (Taalam TMS): level, chapter, task
 * ====================================================================== */
.t-tms-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.t-tms-meta li { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.t-tms-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; padding-top: 40px; padding-bottom: 72px; }
.t-tms-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.t-tms-aside { flex: 1 1 260px; }
@media (min-width: 961px) { .t-tms-aside { position: sticky; top: 24px; } }

/* Plugin design tokens aligned with the theme */
.t-tms .taalam {
	--t-ink: var(--ink);
	--t-ink-soft: var(--body);
	--t-muted: var(--muted);
	--t-paper: var(--paper);
	--t-line: var(--line);
	--t-action: var(--ink);
	--t-action-dark: var(--ink-dark);
	--t-radius: var(--radius);
	--t-font: var(--font-body);
	--t-font-display: var(--font-head);
}
.t-tms .taalam.t-preview { margin: 0; gap: 20px; }
.t-tms .taalam .t-crumb { display: none; } /* the theme shows full breadcrumbs */
.t-tms .taalam .t-list:empty { display: none; }
.t-tms .taalam .t-list { border: 0; background: none; border-radius: 0; padding: 0; margin: 0; }

/* Level: chapters as cards */
.t-tms--level .taalam .t-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; counter-reset: none; }
.t-tms--level .taalam .t-list li {
	position: relative; flex-direction: column; align-items: flex-start; gap: 10px;
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.t-tms--level .taalam .t-list li:hover { border-color: var(--ink); box-shadow: 0 10px 24px rgba(22,50,79,.08); transform: translateY(-2px); }
.t-tms--level .taalam .t-list a { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.5; }
.t-tms--level .taalam .t-list a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card clickable */
.t-tms--level .taalam .t-list a:hover { color: var(--ink); }
.t-tms--level .taalam .t-num {
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
	background: var(--ink); color: #fff; font-family: var(--font-head); font-size: 17px; font-weight: 800;
}
.t-tms--level .taalam .t-list bdi { display: block; }
.t-tms--level .taalam .t-badge--free { position: absolute; top: 20px; inset-inline-end: 20px; background: var(--accent); color: var(--ink); }

/* Chapter: tasks as a numbered path */
.t-tms--chapter .taalam .t-list { display: flex; flex-direction: column; gap: 10px; counter-reset: task; }
.t-tms--chapter .taalam .t-list li {
	counter-increment: task; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; gap: 14px;
	transition: border-color .2s ease, background .2s ease;
}
.t-tms--chapter .taalam .t-list li::before {
	content: counter(task); flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: var(--sky-2); color: var(--ink); font-weight: 800; font-family: var(--font-head);
}
.t-tms--chapter .taalam .t-list li:hover { border-color: var(--ink); background: var(--sky-2); }
.t-tms--chapter .taalam .t-list a { font-size: 17px; line-height: 1.6; }
.t-tms--chapter .taalam .t-list a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.t-tms--chapter .taalam .t-list strong { color: var(--ink); }

/* Task: notices, video, summary */
.t-tms .taalam .t-alert--info {
	display: flex; align-items: center; gap: 14px; padding: 22px 24px; border-radius: var(--radius);
	background: var(--sky); border: 1px solid #C9D6E8; color: var(--ink); font-size: 17px; font-weight: 600;
}
.t-tms .taalam .t-alert--info::before {
	content: ""; flex: none; width: 44px; height: 44px; border-radius: 12px; background-color: var(--accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316324F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: center; background-size: 24px;
}
.t-tms .taalam .t-video { border-radius: var(--radius); box-shadow: 0 12px 32px rgba(22,50,79,.12); }
.t-tms .taalam .t-summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: none; }

/* Empty level */
.t-tms-empty { background: var(--card); border: 2px dashed #C9C2B2; border-radius: 24px; padding: 48px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.t-tms-empty p { margin: 0; color: var(--body); }
.t-tms-empty__title { font-family: var(--font-head); font-weight: 800; font-size: 24px; color: var(--ink) !important; }
.t-tms-empty__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }

/* Previous / next */
.t-tms-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.t-tms-pager__link { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; text-decoration: none; }
.t-tms-pager__link span { font-size: 14px; color: var(--muted); }
.t-tms-pager__link strong { font-size: 16px; }
.t-tms-pager__link--next { text-align: end; }
.t-tms-pager__link:hover { border-color: var(--ink); }

/* Task list in the sidebar */
.t-tms-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.t-tms-steps a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 10px; text-decoration: none; font-size: 15px; }
.t-tms-steps a:hover { background: var(--sky-2); }
.t-tms-steps__n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); font-weight: 700; font-size: 13px; }
.t-tms-steps .is-current a { background: var(--sky-2); font-weight: 700; }
.t-tms-steps .is-current .t-tms-steps__n { background: var(--accent); }

/* Home: "how a lesson works" card (shown when no teacher card) */
.t-steps-card { flex: 0 1 360px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: 0 16px 40px rgba(22,50,79,.10); display: flex; flex-direction: column; gap: 14px; }
.t-steps-card__title { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 19px; }
.t-steps-card ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.t-steps-card li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line-soft); }
.t-steps-card__icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--sky); }
.t-steps-card li:nth-child(2) .t-steps-card__icon { background: var(--mint); }
.t-steps-card li:nth-child(3) .t-steps-card__icon { background: var(--sand); }
.t-steps-card li:nth-child(4) .t-steps-card__icon { background: var(--accent); }
.t-steps-card strong { display: block; font-size: 16px; line-height: 1.4; }
.t-steps-card small { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; }

@media (max-width: 600px) {
	.t-tms-pager { grid-template-columns: 1fr; }
	.t-tms-empty { padding: 32px 18px; }
}
/* Every chapter of the level is free: no need for a badge on each card. */
.t-tms--allfree .taalam .t-badge--free { display: none; }

/* HTML lab on task pages */
.t-lab-embed { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.t-lab-embed__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.t-lab-embed__title { margin: 0 !important; display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 20px; }
.t-lab-embed__full { min-height: 40px; padding: 0 16px; font-size: 14px; }
.t-lab-embed__frame { display: block; width: 100%; height: min(78vh, 720px); min-height: 480px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.t-lab-embed__frame:fullscreen { border: 0; border-radius: 0; height: 100%; }

/* Exercises on task pages */
.t-exercises { display: flex; flex-direction: column; gap: 16px; }
.t-exercises__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.t-exercises__title { margin: 0 !important; display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 22px; }
.t-exercises__score { margin: 0 !important; font-family: var(--font-head); font-weight: 800; font-size: 16px; background: var(--accent); border-radius: 999px; padding: 6px 16px; }
.t-exercises__note { margin: 0 !important; font-size: 14px; color: var(--muted); }
.t-ex { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.t-ex.is-ok { border-color: var(--mint-ink); box-shadow: inset 4px 0 0 var(--mint-ink); }
.t-ex.is-no { border-color: var(--rose-ink); }
.t-ex__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.t-ex__n { font-family: var(--font-head); font-weight: 800; font-size: 16px; background: var(--ink); color: #fff; border-radius: 8px; padding: 2px 10px; }
.t-ex__kind { font-size: 14px; color: var(--muted); }
.t-ex__pts { margin-inline-start: auto; font-size: 13px; font-weight: 700; background: var(--chip); border-radius: 999px; padding: 3px 10px; }
.t-ex__prompt { font-size: 17px; font-weight: 600; line-height: 1.8; }
.t-ex__prompt p { margin: 0 0 .5em; }
.t-ex__prompt p:last-child { margin: 0; }
.t-ex__body { display: flex; flex-direction: column; gap: 8px; }
.t-ex__opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: 2px solid #D9D3C5; border-radius: 12px; cursor: pointer; font-size: 16px; }
.t-ex__opt:hover { background: var(--sky-2); }
.t-ex__opt:has(input:checked) { border-color: var(--ink); background: var(--sky-2); }
.t-ex__opt input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; margin: 0; }
.t-ex__num { display: inline-flex; align-items: center; gap: 10px; }
.t-ex__num input { min-height: 48px; width: min(260px, 100%); padding: 0 14px; border: 2px solid #D9D3C5; border-radius: 12px; font: inherit; font-size: 17px; background: #fff; color: var(--ink); }
.t-ex__unit { font-weight: 700; }
.t-ex__pair { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.t-ex__left { font-weight: 600; }
.t-ex__pair select { min-height: 44px; min-width: 180px; padding: 0 10px; border: 2px solid #D9D3C5; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.t-ex__order { list-style: decimal; margin: 0; padding-inline-start: 1.6em; display: flex; flex-direction: column; gap: 8px; }
.t-ex__order li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; padding-inline-start: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.t-ex__moves { display: flex; gap: 4px; }
.t-ex__moves button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; font-size: 14px; }
.t-ex__moves button:hover { background: var(--sky-2); }
.t-ex__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.t-ex__hint summary { cursor: pointer; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.t-ex__hint p { margin: 4px 0 0; color: var(--body); }
.t-ex__fb { margin: 0 !important; font-weight: 700; }
.t-ex__fb.is-ok { color: var(--mint-ink); }
.t-ex__fb.is-no { color: var(--rose-ink); }
.t-ex__explain { background: var(--mint); border-radius: 12px; padding: 12px 16px; font-size: 16px; }

/* Header actions (account buttons from plugins) */
.site-nav__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-inline-start: 8px; }
.site-nav__actions:empty { display: none; }
@media (max-width: 960px) { .site-nav__actions { margin: 8px 0 0; } }
