/*
Theme Name: Elmaura
Author: Elmaura
Description: Theme for the Elmaura online Quran teaching platform. Made to work with the Elmaura Core plugin: it keeps the plugin's top bar as the site header and styles the home page, Find a Teacher, Login, Register, Class and teacher pages.
Version: 1.3.0
Requires at least: 6.0
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: elmaura
*/

/* ---------- Tokens ---------- */
:root {
  --green-900: #082f24;
  --green-800: #0b3d2e;   /* same as the plugin bar */
  --green-600: #0b6b4f;   /* same as the plugin buttons */
  --green-100: #e6f3ee;
  --gold: #f0b429;        /* taken from the student's yellow top in the hero picture */
  --gold-soft: #ffd36b;
  --ink: #14231d;
  --muted: #4f625a;
  --line: #dcebe4;
  --page: #f4f8f6;
  --white: #fff;
  --radius: 10px;
  --font-head: "Amiri", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Jameel Noori Nastaleeq", serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--green-600); }
a:hover { color: var(--green-800); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--green-800); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
/* The plugin's tools and forms keep the plain body font for their headings. */
.app-wrap h1, .app-wrap h2, .app-wrap h3, .app-wrap h4, .elmaura-form h3, .elmaura-dash-box h3, .elmaura-dash-who h2, .elmaura-card h3, .cr-gate h3 { font-family: var(--font-body); }
:focus-visible { outline: 3px solid var(--green-600); outline-offset: 3px; }
.hero :focus-visible, .band :focus-visible, .site-footer :focus-visible, .elmaura-bar :focus-visible { outline-color: var(--gold); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100000; background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 0 0 8px 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 0; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 26px; border-radius: var(--radius); font: 700 1rem/1.2 var(--font-body); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-soft); color: var(--ink); }
.btn--ghost { border-color: rgba(255,255,255,.75); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn--green { background: var(--green-600); color: #fff; }
.btn--green:hover { background: var(--green-800); color: #fff; }

/* ---------- Plugin bar: same bar, dressed to match the theme ---------- */
.elmaura-bar { background: var(--green-800); box-shadow: none; border-bottom: 1px solid rgba(255,255,255,.08); font-family: var(--font-body); }
.elmaura-bar .eb-brand { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.elmaura-bar .eb-cta { background: var(--gold); color: var(--ink) !important; }
.elmaura-bar .eb-cta:hover { background: var(--gold-soft); color: var(--ink) !important; }

/* Shown only when the plugin is not active */
.fallback-bar { background: var(--green-800); color: #fff; }
.fallback-bar .container { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.fallback-bar a { color: #fff; text-decoration: none; font-family: var(--font-head); font-size: 24px; font-weight: 700; }

/* ---------- Home: hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--green-800); color: #fff; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 508px); gap: clamp(32px, 6vw, 80px); align-items: center; padding: clamp(40px, 6vw, 76px) 0; }
.hero__copy { max-width: 41rem; animation: hero-in .7s ease-out both; }
.hero__logo { margin-bottom: 22px; }
.hero__logo img { display: block; width: auto; max-height: 64px; }
.hero h1 { color: #fff; font-size: clamp(2.5rem, 5.2vw, 4.2rem); line-height: 1.05; margin: 0 0 .4em; text-wrap: balance; }
.hero__lead { font-size: 1.2rem; line-height: 1.6; color: #dcefe7; max-width: 27em; margin: 0 0 1.6em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__facts { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 10px; font-size: .98rem; color: #cfe8dd; }
.hero__facts li { display: flex; gap: 10px; align-items: flex-start; }
.hero__facts svg { flex: 0 0 20px; margin-top: 3px; color: var(--gold); }
/* The whole picture is always visible: it keeps its own shape and is never cropped or faded. */
.hero__media { position: relative; margin: 0; }
.hero__media::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--gold); border-radius: 18px; }
.hero__media img { position: relative; display: block; width: 100%; height: auto; border-radius: 18px; background: var(--green-900); box-shadow: 0 24px 48px rgba(0, 0, 0, .35); }
@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Home: sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--white { background: var(--white); }
.section__head { max-width: 36em; margin-bottom: 36px; }
.section__head h2, .room__copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.section__head p, .room__copy > p { color: var(--muted); font-size: 1.1rem; }

/* Class Room */
.room { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.room__list { list-style: none; margin: 28px 0 0; padding: 0; }
.room__list li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.room__list li:last-child { border-bottom: 1px solid var(--line); }
.room__list svg { color: var(--green-600); margin-top: 3px; }
.room__list strong { display: block; color: var(--green-800); font-size: 1.05rem; }
.room__list span { color: var(--muted); font-size: .98rem; }
.room-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(11,61,46,.16)); }
.room-art text { font-family: var(--font-body); }

/* Subjects */
.subjects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.subjects a { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 210px 28px; gap: 24px; align-items: center; padding: 22px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background-color .15s; }
.subjects a:hover { background: var(--green-100); }
.subjects__name { font-family: var(--font-head); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; color: var(--green-800); line-height: 1.15; }
.subjects__about { color: var(--muted); font-size: .98rem; }
.subjects__urdu { font-family: var(--font-urdu); font-size: 1.35rem; line-height: 2; color: var(--green-600); text-align: right; }
.subjects svg { color: var(--green-600); }

/* Recent teachers (plugin cards) */
.teachers__more { margin-top: 28px; }

/* Steps: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: step; }
.steps li { border-top: 3px solid var(--green-600); padding-top: 18px; }
.steps li::before { counter-increment: step; content: counter(step); display: block; font-family: var(--font-head); font-size: 3.2rem; line-height: 1; color: var(--green-600); margin-bottom: 10px; }
.steps h3 { font-family: var(--font-body); font-size: 1.15rem; margin-bottom: .3em; }
.steps p { color: var(--muted); margin: 0; }

/* Teacher call-to-action */
.band { background: var(--green-800); color: #fff; padding: clamp(56px, 8vw, 88px) 0; }
.band__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.band h2 { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.band p { color: #cfe8dd; font-size: 1.1rem; max-width: 34em; margin: 0; }
.band__action { justify-self: end; }

/* Why Elmaura: a set of benefits, not a sequence, so no numbers */
.why { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.why li { padding: 4px 28px 4px 24px; border-left: 1px solid var(--line); }
.why li:first-child { padding-left: 0; border-left: 0; }
.why svg { display: block; color: var(--green-600); margin-bottom: 14px; }
.why h3 { font-family: var(--font-body); font-size: 1.15rem; margin-bottom: .35em; }
.why p { color: var(--muted); margin: 0; font-size: .98rem; }

/* FAQ: opens and closes without JavaScript */
.faq { max-width: 52rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; cursor: pointer; list-style: none; padding: 20px 48px 20px 4px; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; line-height: 1.25; color: var(--green-800); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 400 1.9rem/1 var(--font-body); color: var(--green-600); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--green-100); }
.faq details > p { padding: 0 48px 6px 4px; margin: 0 0 1em; color: var(--muted); }
.faq details > p:last-child { padding-bottom: 18px; margin-bottom: 0; }

/* Closing banner */
.final { background: var(--green-100); text-align: center; padding: clamp(56px, 8vw, 88px) 0; }
.final h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.final p { color: var(--muted); font-size: 1.1rem; max-width: 32em; margin: 0 auto 1.6em; }

/* ---------- Inner pages ---------- */
.page-head { background: var(--green-800); color: #fff; padding: 40px 0 34px; }
.page-head h1 { color: #fff; margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); }
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 36px 16px 72px; }
.app-wrap { padding: 8px 0 40px; }
.site-main { min-height: 60vh; }

.entry { max-width: 760px; }
.entry h2 { font-size: 1.8rem; margin-top: 1.6em; }
.entry img { border-radius: var(--radius); }
.post-list article { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin-bottom: 16px; }
.post-list h2 { font-size: 1.6rem; margin: 0 0 .3em; }
.post-list h2 a { text-decoration: none; }
.pagination { margin-top: 24px; }
.pagination .page-numbers { display: inline-block; padding: 6px 12px; border: 1px solid var(--green-600); border-radius: 6px; text-decoration: none; margin: 2px; }
.pagination .current { background: var(--green-600); color: #fff; }
.notfound { text-align: center; padding: 72px 0; }
.notfound .btn { margin-top: 12px; }

/* ---------- Plugin pages in the theme's look ----------
   Find a Teacher, Login, Register, My Account, Edit My Page, teacher cards.
   "body" in front of each rule makes these win over the plugin's own colours, whatever the load order.
   Teacher landing pages (.elmaura-lp) keep the colours each teacher chose. */
.entry--app { max-width: 1100px; margin: 0 auto; }
body .elmaura-wrap { color: var(--ink); font-family: var(--font-body); font-size: 1rem; }

/* Boxes */
body .elmaura-form, body .elmaura-card, body .elmaura-section, body .elmaura-dash-head,
body .elmaura-dash-box, body .elmaura-filters, body .elmaura-sectionbox { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
body .elmaura-sectionbox { background: var(--page); border-radius: 10px; }
body .elmaura-form h3, body .elmaura-dash-box h3, body .elmaura-card h3, body .elmaura-section h2, body .elmaura-dash-who h2 { color: var(--green-800); }
body .elmaura-section h2 { font-family: var(--font-head); font-size: 1.7rem; }
body .elmaura-form legend, body .elmaura-form label, body .elmaura-label { color: var(--ink); }

/* Fields */
body .elmaura-form input[type="text"], body .elmaura-form input[type="email"], body .elmaura-form input[type="password"],
body .elmaura-form input[type="url"], body .elmaura-form select, body .elmaura-form textarea,
body .elmaura-form input[type="file"], body .elmaura-filters select,
body .elmaura-form-plain input[type="text"], body .elmaura-form-plain select, body .elmaura-form-plain input[type="file"] {
  border: 1px solid #b7cfc4; border-radius: 8px; padding: 11px 13px; font-size: 1rem; color: var(--ink); background: var(--white);
}
body .elmaura-form input:focus, body .elmaura-form select:focus, body .elmaura-form textarea:focus, body .elmaura-filters select:focus { border-color: var(--green-600); outline: 3px solid rgba(11, 107, 79, .22); outline-offset: 0; }

/* Buttons: same shape and weight as the buttons on the home page */
body .elmaura-button, body .elmaura-form .login-submit input, body .elmaura-copy {
  background: var(--green-600); color: #fff !important; border: 2px solid transparent; border-radius: var(--radius);
  font: 700 1rem/1.2 var(--font-body); padding: 13px 26px; text-decoration: none; transition: background-color .15s, color .15s;
}
body .elmaura-button:hover, body .elmaura-form .login-submit input:hover, body .elmaura-copy:hover { background: var(--green-800); }
body .elmaura-button-alt { background: transparent; color: var(--green-600) !important; border-color: var(--green-600); }
body .elmaura-button-alt:hover { background: var(--green-100); color: var(--green-800) !important; }
body .elmaura-button-disabled { background: #d5ded9; color: #62736b !important; }
body .elmaura-card .elmaura-button { padding: 10px 22px; font-size: .95rem; }
body .elmaura-copy { padding: 8px 16px; font-size: .9rem; }
body .elmaura-link-button { color: var(--green-600); }

/* Teacher cards and chips */
body .elmaura-card { padding: 24px 18px; }
body .elmaura-card h3 { font-family: var(--font-head); font-size: 1.45rem; }
body .elmaura-avatar { border-color: var(--gold); }
body .elmaura-avatar-text, body .elmaura-subjects, body .elmaura-amount { color: var(--green-600); }
body .elmaura-meta { color: var(--muted); }
body .elmaura-tag { background: var(--green-100); color: var(--green-800); }
body .elmaura-tag-light { background: #eef1ef; color: var(--muted); }
body .elmaura-page { border-color: var(--green-600); color: var(--green-600); border-radius: 8px; }
body .elmaura-page.is-current { background: var(--green-600); color: #fff; }

/* Register: role choice */
body .elmaura-role-body { border: 2px solid var(--line); border-radius: 12px; }
body .elmaura-role input:checked + .elmaura-role-body { border-color: var(--green-600); background: var(--green-100); }
body .elmaura-role-body strong { color: var(--green-800); font-family: var(--font-head); font-size: 1.25rem; }

/* My Account */
body .elmaura-dash-head { padding: 22px; }
body .elmaura-dash-who h2 { font-family: var(--font-head); font-size: 1.9rem; }
body .elmaura-progress { background: var(--green-100); }
body .elmaura-progress span { background: var(--green-600); }
body .elmaura-steps li.is-done, body .elmaura-notices a, body .elmaura-dash-box a { color: var(--green-600); }
body .elmaura-notices li.is-unread { background: var(--page); border-left-color: var(--gold); }
body .elmaura-status-approved { background: var(--green-100); color: var(--green-800); }
body .elmaura-table th { background: var(--green-100); color: var(--green-800); }

@media (max-width: 600px) {
  body .elmaura-form, body .elmaura-dash-head { padding: 16px; }
  body .elmaura-card h3 { font-size: 1.3rem; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #b8d4c8; padding: 48px 0 28px; font-size: .98rem; }
.site-footer a { color: #e6f3ee; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.footer__brand { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: #fff; margin: 0 0 4px; }
.footer__tag { margin: 0; max-width: 24em; }
.footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer__legal { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; padding-bottom: 56px; }
  .hero__copy { max-width: none; }
  .hero__media { max-width: 508px; margin-right: 14px; }
  .room, .band__inner { grid-template-columns: 1fr; }
  .band__action { justify-self: start; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .why { grid-template-columns: repeat(2, 1fr); gap: 32px 0; }
  .why li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .subjects a { grid-template-columns: minmax(0, 1fr) auto 24px; gap: 8px 16px; }
  .subjects__about { grid-column: 1 / -1; grid-row: 2; }
  .subjects__urdu { grid-row: 1; grid-column: 2; }
  .subjects svg { grid-row: 1; grid-column: 3; }
}
@media (max-width: 560px) {
  .why { grid-template-columns: 1fr; }
  .why li, .why li:nth-child(odd) { padding: 0 0 0 16px; border-left: 3px solid var(--line); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero__actions .btn { width: 100%; }
  .faq summary { font-size: 1.2rem; }
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__copy { animation: none; }
  /* A GIF cannot be paused, so the page uses the still picture (see <picture> in front-page.php). */
}
@media print {
  .elmaura-bar, .site-footer, .hero__media { display: none !important; }
}
