/*
Theme Name: Mitihani
Theme URI: https://mitihani.co.tz
Author: Mitihani
Author URI: https://mitihani.co.tz
Description: A very light, mobile-first education theme for past papers, marking schemes, study notes and exam results. Built-in Past Papers section (exam level, subject, year), download counter, table of contents, AdSense slots, WhatsApp sharing and no jQuery on the front end.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.8
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: mitihani
Tags: education, blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--primary: #0b6e4f;
	--primary-dark: #08573e;
	--primary-soft: #e7f3ee;
	--accent: #f2a900;
	--ink: #16211c;
	--muted: #5b6660;
	--line: #e3e7e4;
	--bg: #f7f8f6;
	--card: #fff;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 14px rgba(16, 24, 20, .05);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--wrap: 1160px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 1rem/1.65 var(--font); color: var(--ink); background: var(--bg); }
img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
[hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p, ul, ol, table, figure, blockquote { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed !important; z-index: 999; top: 8px; left: 8px; width: auto; height: auto; clip: auto; padding: 10px 14px; background: #fff; border-radius: 6px; }

/* ---------- Buttons & forms ---------- */
.btn, button[type="submit"], input[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 10px 18px; border: 2px solid var(--primary); border-radius: 8px;
	background: var(--primary); color: #fff; font: 600 .95rem/1.2 var(--font);
	text-decoration: none; cursor: pointer;
}
.btn:hover, button[type="submit"]:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); color: var(--primary-dark); }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1d1600; }
.btn-accent:hover { background: #d99700; border-color: #d99700; color: #1d1600; }
.btn-link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; text-decoration: underline; cursor: pointer; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea, select {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
	background: #fff; color: var(--ink); font: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.search-form { display: flex; gap: 8px; }
.search-form .search-field { flex: 1; min-width: 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.site-branding { margin-right: auto; }
.site-title { display: inline-block; font-size: 1.3rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.site-title::first-letter { color: var(--primary); }
.custom-logo { max-height: 44px; width: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--primary-soft); }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 10px 12px; color: var(--ink); font-weight: 600; text-decoration: none; border-radius: 6px; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--primary); background: var(--primary-soft); }
.header-search { padding: 12px 0; border-top: 1px solid var(--line); background: #fff; }

@media (max-width: 899px) {
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 60px); overflow-y: auto; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 16px 16px; }
	.main-nav.is-open { display: block; }
	.main-nav .sub-menu { padding-left: 14px; border-left: 2px solid var(--line); }
}
@media (min-width: 900px) {
	.nav-toggle { display: none; }
	.main-nav > ul { display: flex; gap: 2px; }
	.main-nav li { position: relative; }
	.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
	.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: block; }
}

/* ---------- Layout ---------- */
.layout { display: grid; gap: 28px; padding-top: 20px; padding-bottom: 40px; }
@media (min-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } .layout-full { grid-template-columns: minmax(0, 1fr); } }
.content-area { min-width: 0; }
.section { padding: 32px 0; }
.section + .section { padding-top: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 44px 0 40px; }
.hero-title { margin: 0 0 10px; max-width: 760px; font-size: clamp(1.7rem, 5vw, 2.6rem); }
.hero-text { max-width: 640px; margin-bottom: 20px; opacity: .92; font-size: 1.05rem; }
.hero .search-form { max-width: 640px; }
.hero .search-field { border: 0; padding: 14px 16px; }
.hero .search-form button { background: var(--accent); border-color: var(--accent); color: #1d1600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: .9rem; font-weight: 600; text-decoration: none; }
.chip:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* ---------- Exam level cards ---------- */
.level-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.level-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.level-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.level-card:nth-child(3n+2) { border-top-color: var(--accent); }
.level-card:nth-child(3n+3) { border-top-color: #2563eb; }
.level-name { font-weight: 700; }
.level-desc { color: var(--muted); font-size: .85rem; line-height: 1.4; }
.level-count { margin-top: auto; padding-top: 6px; color: var(--primary); font-size: .85rem; font-weight: 600; }

/* ---------- Class cards (homepage: Form One, Form Two …) ---------- */
.section-sub { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.class-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.class-card { --c1: #0b6e4f; --c2: #129163; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.class-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(16, 24, 20, .10); }
.tone-1 { --c1: #1d4ed8; --c2: #3b82f6; }
.tone-2 { --c1: #b45309; --c2: #f59e0b; }
.tone-3 { --c1: #7c3aed; --c2: #8b5cf6; }
.tone-4 { --c1: #be123c; --c2: #fb7185; }
.tone-5 { --c1: #0e7490; --c2: #06b6d4; }
.class-card-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 18px; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; text-decoration: none; overflow: hidden; }
.class-card-head::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.class-card-head:hover { color: #fff; }
.class-badge { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: var(--c1); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.class-head-text { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.class-name { font-size: 1.2rem; font-weight: 800; line-height: 1.2; }
.class-count { margin-top: 2px; font-size: .85rem; opacity: .92; }
.class-list { list-style: none; margin: 0; padding: 8px 18px; flex: 1; }
.class-list li { padding: 9px 0; border-top: 1px solid var(--line); font-size: .93rem; line-height: 1.4; }
.class-list li:first-child { border-top: 0; }
.class-list a { color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.class-list a:hover { color: var(--c1); }
.class-list li::before { content: ""; float: left; width: 6px; height: 6px; margin: 8px 10px 0 0; border-radius: 50%; background: var(--c2); }
.class-empty { flex: 1; margin: 0; padding: 16px 18px; color: var(--muted); font-size: .92rem; }
.class-more { display: flex; justify-content: space-between; align-items: center; margin: 0 18px 18px; padding: 10px 14px; border-radius: 10px; background: var(--bg); color: var(--c1); font-weight: 700; font-size: .9rem; text-decoration: none; }
.class-more:hover { background: var(--c1); color: #fff; }

/* ---------- Past paper cards (homepage) ---------- */
.paper-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.paper-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); transition: transform .15s, box-shadow .15s; }
.paper-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.paper-card:nth-child(3n+2) { border-top-color: var(--accent); }
.paper-card:nth-child(3n+3) { border-top-color: #2563eb; }
.paper-card-top { display: flex; gap: 12px; align-items: flex-start; }
.paper-card-top .paper-icon { width: 34px; height: 42px; }
.paper-card-title { margin: 0; font-size: 1rem; line-height: 1.35; }
.paper-card-title a { color: var(--ink); text-decoration: none; }
.paper-card-title a:hover { color: var(--primary); }
.paper-card-btn { margin-top: auto; align-self: flex-start; }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.card-title { margin: 6px 0 6px; font-size: 1.05rem; line-height: 1.35; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.card-meta, .entry-meta { color: var(--muted); font-size: .85rem; }
.card-meta { margin-top: auto; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .75rem; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .02em; }
.badge-subject { background: #eef2ff; color: #3730a3; }
.badge-year { background: #fff6dc; color: #7a5300; }
.badge:hover { filter: brightness(.95); }

/* ---------- Past paper list ---------- */
.paper-list { list-style: none; margin: 0 0 20px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.paper-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.paper-row + .paper-row { border-top: 1px solid var(--line); }
.paper-row-main { flex: 1; min-width: 0; }
.paper-row-title { margin: 0 0 6px; font-size: 1rem; line-height: 1.35; }
.paper-row-title a { color: var(--ink); text-decoration: none; }
.paper-row-title a:hover { color: var(--primary); }
.paper-icon { flex: none; display: grid; place-items: center; width: 40px; height: 48px; border-radius: 6px; background: #fdecec; color: #b42318; font-size: .7rem; font-weight: 800; }
.paper-filter { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-active { margin: -6px 0 14px; color: var(--muted); font-size: .9rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; color: var(--muted); font-size: .85rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Page headers & entries ---------- */
.page-header { margin-bottom: 18px; }
.page-title { margin: 0 0 6px; }
.archive-description { color: var(--muted); }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
@media (min-width: 700px) { .entry { padding: 32px 36px; } }
.entry-title { margin: 8px 0 8px; }
.entry-header { margin-bottom: 18px; }
.entry-thumb { margin: 0 0 20px; }
.entry-thumb img { width: 100%; border-radius: 8px; }
.entry-content { font-size: 1.05rem; overflow-wrap: break-word; }
.entry-content > :first-child { margin-top: 0; }
.entry-content img { border-radius: 6px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote { margin-left: 0; padding: 12px 16px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 8px 8px 0; }
.entry-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.entry-content th, .entry-content thead td { background: var(--primary-soft); font-weight: 700; }
.entry-content tr:nth-child(even) td { background: #fafbfa; }
.entry-content pre { overflow-x: auto; padding: 14px; background: #0f1a15; color: #e9f2ee; border-radius: 8px; }
.entry-content code { font-size: .9em; }
.entry-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.tags a { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .85rem; text-decoration: none; }
.page-links { clear: both; margin: 16px 0; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 6px; }

/* ---------- Table of contents ---------- */
.toc { margin: 0 0 1.4em; padding: 12px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.toc summary { cursor: pointer; font-weight: 700; }
.toc ol { margin: 8px 0 0; padding-left: 1.2em; }
.toc a { text-decoration: none; }

/* ---------- Download box ---------- */
.download-box { margin: 0 0 24px; padding: 18px; background: var(--primary-soft); border: 1px dashed var(--primary); border-radius: var(--radius); scroll-margin-top: 80px; }
.download-title { margin: 0 0 12px; font-size: 1.1rem; }
.download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.download-note { margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.pdf-preview { margin-top: 14px; }
.pdf-preview iframe { display: block; width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---------- Share & related ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.share-label { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.share a, .share button { padding: 7px 12px; border: 0; border-radius: 6px; color: #fff; font: 600 .85rem/1 var(--font); text-decoration: none; cursor: pointer; }
.share .s-wa { background: #1fa855; }
.share .s-tg { background: #229ed9; }
.share .s-fb { background: #1877f2; }
.share .s-x { background: #111; }
.share .share-copy { background: var(--muted); }
.share a:hover, .share button:hover { color: #fff; filter: brightness(1.08); }
.related { margin-top: 24px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.related h2 { margin: 0 0 10px; font-size: 1.15rem; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding: 8px 0; border-top: 1px solid var(--line); }
.related li:first-child { border-top: 0; }
.related a { font-weight: 600; text-decoration: none; }
.related small { display: block; color: var(--muted); }
.cta-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0; padding: 18px 20px; background: #e9f9ef; border: 1px solid #bde8cc; border-radius: var(--radius); }
.cta-box p { margin: 0; font-weight: 600; }
.btn-wa { background: #1fa855; border-color: #1fa855; }
.btn-wa:hover { background: #178a45; border-color: #178a45; }

/* ---------- Sidebar & widgets ---------- */
.sidebar { min-width: 0; }
.widget { margin-bottom: 20px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.widget-title { margin: 0 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-top: 1px solid var(--line); }
.widget li:first-child { border-top: 0; }
.widget li a { text-decoration: none; font-weight: 500; }
.widget .count { float: right; color: var(--muted); font-size: .85rem; }

/* ---------- Ads ---------- */
.ad-slot { margin: 20px auto; text-align: center; overflow: hidden; min-height: 50px; }
.ad-header { margin-top: 12px; margin-bottom: 0; }
.ad-widget { margin: 0; }

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

/* ---------- Comments ---------- */
.comments-area { margin-top: 24px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 12px 0; border-top: 1px solid var(--line); }
.comment-meta { font-size: .85rem; color: var(--muted); }
.comment-author .avatar { float: left; margin-right: 10px; border-radius: 50%; }
.comment-form p { margin-bottom: 12px; }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: #0f1a15; color: #c9d4cf; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-widgets { display: grid; gap: 24px; padding-top: 36px; padding-bottom: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer .widget { background: none; border: 0; padding: 0; }
.site-footer .widget-title { color: #fff; }
.site-footer .widget li { border-color: rgba(255, 255, 255, .08); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 18px; padding-bottom: 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; margin: 0; padding: 0; }
.footer-nav a { text-decoration: none; }
.copyright { margin: 0; }

/* ---------- Floating WhatsApp ---------- */
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; background: #1fa855; color: #fff; font-weight: 700; font-size: .9rem; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.wa-float:hover { color: #fff; background: #178a45; }

/* ---------- Misc ---------- */
.notice { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.error-404 { text-align: center; padding: 40px 0; }
.error-404 .search-form { max-width: 520px; margin: 20px auto; }
.error-404 .chips .chip { background: var(--primary-soft); color: var(--primary-dark); }
.error-404 .chips { justify-content: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
	.site-header, .site-footer, .sidebar, .ad-slot, .share, .related, .comments-area, .wa-float, .breadcrumbs { display: none !important; }
	.entry { border: 0; padding: 0; }
	body { background: #fff; }
}

/* ---------- Bottom navigation (phones) ---------- */
.bottom-nav { display: none; }

/* =====================================================
   PHONE LAYOUT (under 700px): compact, app-like
   ===================================================== */
@media (max-width: 699px) {
	body { font-size: .97rem; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
	.container { padding: 0 14px; }
	.header-inner { min-height: 54px; }
	.site-title { font-size: 1.2rem; }

	/* Hero: short, chips scroll sideways in one line */
	.hero { padding: 22px 0 18px; }
	.hero-title { font-size: 1.45rem; margin-bottom: 6px; }
	.hero-text { font-size: .92rem; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.hero .search-field { padding: 12px 14px; }
	.hero .search-form button { padding: 10px 14px; }
	.chips { flex-wrap: nowrap; overflow-x: auto; margin: 14px -14px 0; padding: 0 14px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.chips::-webkit-scrollbar { display: none; }
	.chip { flex: none; }

	/* Sections */
	.section { padding: 20px 0; }
	.section + .section { padding-top: 4px; }
	.section-head { margin-bottom: 12px; }
	.section-head h2 { font-size: 1.2rem; }
	.section-sub { font-size: .85rem; }

	/* Class cards become compact 2-column tiles */
	.class-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.class-card { border: 0; border-radius: 14px; }
	.class-card:hover { transform: none; }
	.class-card-head { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 118px; }
	.class-card-head::after { width: 80px; height: 80px; right: -24px; top: -24px; }
	.class-badge { width: 42px; height: 42px; border-radius: 11px; font-size: 1.05rem; }
	.class-name { font-size: 1rem; }
	.class-count { font-size: .78rem; }
	.class-list, .class-empty, .class-more { display: none; }

	/* Article cards become slim rows: small picture + title */
	.card-grid { grid-template-columns: 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
	.card { flex-direction: row; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 0; }
	.card + .card { border-top: 1px solid var(--line); }
	.card-thumb { flex: none; width: 96px; }
	.card-thumb img, .card-thumb > div { width: 96px; height: 68px; aspect-ratio: auto; border-radius: 8px; font-size: .7rem !important; }
	.card-body { padding: 0; }
	.card-body .badges, .card-excerpt { display: none; }
	.card-title { margin: 0 0 4px; font-size: .95rem; }
	.card-meta { font-size: .78rem; }

	/* Paper lists */
	.paper-row { padding: 12px; gap: 10px; }
	.paper-icon { width: 34px; height: 42px; font-size: .62rem; }
	.paper-row-title { font-size: .95rem; margin-bottom: 4px; }
	.paper-row .btn { padding: 8px; }
	.paper-row .btn { font-size: 0; }
	.paper-row .btn .icon { width: 20px; height: 20px; }
	.badge { font-size: .68rem; padding: 2px 7px; }
	.paper-grid { grid-template-columns: 1fr; }
	.paper-filter { grid-template-columns: 1fr 1fr; padding: 10px; }
	.paper-filter button { padding: 10px; }

	/* Articles & paper pages go edge to edge */
	.layout { padding-top: 12px; gap: 16px; }
	.breadcrumbs ol { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: .8rem; }
	.breadcrumbs ol::-webkit-scrollbar { display: none; }
	.entry, .related, .comments-area { margin-left: -14px; margin-right: -14px; padding: 18px 14px; border-left: 0; border-right: 0; border-radius: 0; }
	.entry-title { font-size: 1.45rem; }
	.entry-content { font-size: 1rem; }
	.download-box { padding: 14px; }
	.download-actions { flex-direction: column; }
	.download-actions .btn { width: 100%; }
	.share { display: grid; grid-template-columns: repeat(3, 1fr); }
	.share-label { grid-column: 1 / -1; }
	.share a, .share button { text-align: center; padding: 10px 6px; }
	.cta-box { padding: 14px; }
	.cta-box .btn { width: 100%; }

	/* Hide the theme's default sidebar boxes on phones (your own widgets still show) */
	.sidebar .mitihani-default { display: none; }

	/* Footer */
	.footer-widgets { grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 24px; }
	.footer-widgets > :first-child { grid-column: 1 / -1; }
	.site-footer .widget li { padding: 5px 0; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }

	/* Floating WhatsApp is replaced by the bottom bar on phones */
	.wa-float { display: none; }

	.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 20, .06); }
	.bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 60px; border: 0; background: none; color: var(--muted); font: 600 .7rem/1 var(--font); text-decoration: none; cursor: pointer; }
	.bottom-nav .is-active { color: var(--primary); }
	.bottom-nav .bn-wa { color: #1fa855; }
	.bottom-nav .icon { width: 22px; height: 22px; }
}
