/* ==========================================================
   kawyan School - style.css  (Design 3: Navy & Gold, formal)
   Works for Persian (RTL) and English (LTR).
   Colors are variables at the top: change them in one place.
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700;900&family=Noto+Naskh+Arabic:wght@500;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --navy: #0f1b33;
  --navy-2: #172746;
  --gold: #c9a24a;
  --gold-soft: #e3c47a;
  --bg: #eef1f6;
  --ink: #0f1b33;
  --muted: #5a6680;
  --card: #ffffff;
  --line: #d6dce8;
  --ok: #1f8a5b;
  --bad: #b3392f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1120px, 92%); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- language switching ---------- */
html[lang="fa"] .en { display: none !important; }
html[lang="en"] .fa { display: none !important; }
h1, h2, h3 { line-height: 1.5; }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] .brand b { font-family: 'Noto Naskh Arabic', 'Vazirmatn', serif; }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] .brand b { font-family: 'Playfair Display', Georgia, serif; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- language gate (first visit) ---------- */
.lang-gate {
  position: fixed; inset: 0; z-index: 200;
  background: var(--navy); color: #fff;
  display: grid; place-items: center; text-align: center; padding: 24px;
}
.lang-gate[hidden] { display: none; }
.lang-gate img { width: 96px; height: 96px; margin: 0 auto 18px; background: #fff; border-radius: 12px; padding: 8px; }
.lang-gate h1 { font-size: 30px; font-family: 'Playfair Display', Georgia, serif; }
.lang-gate p { opacity: .85; margin: 6px 0 26px; }
.lang-gate .choices { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.lang-gate button {
  font: inherit; font-weight: 700; font-size: 20px; min-width: 190px;
  padding: 16px 28px; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--gold); background: transparent; color: var(--gold-soft);
}
.lang-gate button:hover { background: var(--gold); color: var(--navy); }

/* ---------- header ---------- */
.skip { position: absolute; inset-inline-start: -999px; background: var(--gold); color: var(--navy); padding: 8px 14px; z-index: 300; }
.skip:focus { inset-inline-start: 8px; top: 8px; }
header.site { background: var(--navy); color: #fff; position: relative; z-index: 60; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo { width: 62px; height: 62px; background: #fff; border-radius: 8px; padding: 5px; flex-shrink: 0; }
.brand b { display: block; font-size: 24px; line-height: 1.3; }
.brand small { display: block; font-size: 12.5px; opacity: .78; }
.actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: 1px solid #ffffff55; border-radius: 6px; overflow: hidden; }
.lang-switch button { font: inherit; font-size: 13px; font-weight: 700; padding: 5px 14px; border: 0; cursor: pointer; background: transparent; color: #fff; }
.lang-switch button[aria-pressed="true"] { background: var(--gold); color: var(--navy); }
.btn-donate { background: var(--gold); color: var(--navy); font-weight: 700; padding: 8px 18px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.btn-donate:hover { background: var(--gold-soft); }
.menu-toggle { display: none; font: inherit; background: transparent; color: #fff; border: 1px solid #ffffff55; border-radius: 6px; padding: 5px 12px; cursor: pointer; }

nav.main { background: var(--navy-2); border-top: 1px solid #ffffff1a; border-bottom: 3px solid var(--gold); }
nav.main ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 6px 0; }
nav.main li { position: relative; }
nav.main a, nav.main .dd-btn {
  display: block; padding: 6px 13px; font-size: 14px; font-weight: 500; color: #fff;
  border-radius: 6px; background: transparent; border: 0; font-family: inherit; cursor: pointer;
}
nav.main a:hover, nav.main .dd-btn:hover, nav.main li:focus-within > .dd-btn { color: var(--gold-soft); }
nav.main a.active { color: var(--gold-soft); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.dd-menu { display: none; position: absolute; inset-inline-start: 0; top: 100%; min-width: 210px; background: var(--navy-2); border: 1px solid #ffffff22; border-top: 2px solid var(--gold); border-radius: 0 0 6px 6px; padding: 6px; z-index: 70; }
nav.main li:hover > .dd-menu, nav.main li:focus-within > .dd-menu { display: block; }
.dd-menu a { padding: 8px 12px; }

/* ---------- hero ---------- */
.hero { background: var(--navy); color: #fff; text-align: center; padding: 58px 0 0; }
.hero .tag { display: inline-block; color: var(--gold-soft); border: 1px solid var(--gold); padding: 2px 16px; border-radius: 4px; font-size: 14px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 700; max-width: 22ch; margin-inline: auto; }
.hero p.lead { font-size: 18px; opacity: .9; max-width: 54ch; margin: 12px auto 0; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.btn { display: inline-block; padding: 10px 24px; border-radius: 6px; font-weight: 700; font-size: 15px; border: 2px solid var(--gold); background: var(--gold); color: var(--navy); cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.btn.ghost { background: transparent; color: var(--gold-soft); }
.btn.ghost:hover { background: var(--gold); color: var(--navy); }
.hero-img { height: 340px; margin-top: 46px; border-top: 4px solid var(--gold); background: var(--navy-2); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- page title band (inner pages) ---------- */
.page-title { background: var(--navy); color: #fff; text-align: center; padding: 38px 0 34px; border-bottom: 4px solid var(--gold); }
.page-title .tag { color: var(--gold-soft); font-size: 14px; display: block; }
.page-title h1 { font-size: clamp(26px, 4vw, 38px); }
.page-title p { opacity: .85; max-width: 60ch; margin: 6px auto 0; }

/* ---------- sections ---------- */
main { padding-bottom: 20px; }
.sec { padding: 46px 0; }
.sec h2 { font-size: 32px; display: inline-block; border-bottom: 2px solid var(--gold); padding-bottom: 2px; margin-bottom: 22px; }
.sec h3 { font-size: 19px; margin: 18px 0 6px; }
.sec p { color: #26324d; max-width: 70ch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { background: var(--card); border-radius: 6px; box-shadow: 0 2px 10px #0f1b3322; overflow: hidden; }
.card .pad { padding: 18px 20px 22px; }

/* quick links */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 34px 0 6px; }
.quick a { background: var(--card); border-inline-start: 4px solid var(--gold); border-radius: 4px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 10px #0f1b3322; font-weight: 700; }
.quick a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px #0f1b3333; }
.quick .ic { font-size: 28px; line-height: 1; }

/* student of the month */
.student-card { background: var(--card); border-radius: 6px; box-shadow: 0 2px 10px #0f1b3322; text-align: center; padding: 22px; max-width: 380px; margin-inline: auto; border-top: 4px solid var(--gold); }
.student-card h3 { margin: 0 0 14px; }
.student-card img { width: 220px; height: 260px; object-fit: cover; margin: 0 auto 14px; border: 4px solid var(--gold); border-radius: 4px; }
.student-card h4 { font-size: 22px; }
.student-card p { color: var(--muted); }
.home-student { padding: 40px 0 10px; }

/* about */
.about-img { border-radius: 6px; overflow: hidden; border-bottom: 4px solid var(--gold); }
.about-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.feature { background: var(--card); border-radius: 6px; padding: 18px 20px; border-inline-start: 4px solid var(--gold); box-shadow: 0 2px 10px #0f1b3322; }
.feature h4 { font-size: 17px; margin-bottom: 4px; }
.feature p { font-size: 15px; }

/* programs */
.program { background: var(--card); border-radius: 6px; padding: 26px 22px; text-align: center; border-top: 4px solid var(--gold); box-shadow: 0 2px 10px #0f1b3322; }
.program .emoji { font-size: 40px; }
.program h3 { margin: 8px 0 6px; }

/* teachers */
.teacher { background: var(--card); border-radius: 6px; padding: 24px 18px; text-align: center; box-shadow: 0 2px 10px #0f1b3322; }
.teacher img { width: 130px; height: 170px; object-fit: cover; margin: 0 auto 14px; border-radius: 4px; border: 3px solid var(--gold); }
.teacher h3 { margin: 0; font-size: 18px; }
.teacher p { color: var(--muted); }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; cursor: zoom-in; transition: transform .2s; }
.gallery-grid img:hover { transform: scale(1.02); }
.lightbox { position: fixed; inset: 0; background: #000000e6; z-index: 150; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 90vh; max-width: 94vw; border: 3px solid var(--gold); }

/* news */
.news-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.news-card small { color: var(--muted); font-size: 13px; }
.news-card h3 { margin: 2px 0 4px; font-size: 18px; }

/* library */
.lib-cat { font-size: 22px; margin: 34px 0 14px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); }
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.book-card { background: var(--card); border-radius: 6px; padding: 20px; box-shadow: 0 2px 10px #0f1b3322; display: flex; flex-direction: column; gap: 4px; border-top: 4px solid var(--navy-2); }
.book-card.computer { border-top-color: var(--gold); }
.book-icon { font-size: 34px; }
.book-card h4 { font-size: 16.5px; }
.book-card p { font-size: 14px; color: var(--muted); flex: 1; }
.download-btn { margin-top: 10px; text-align: center; background: var(--navy); color: #fff; padding: 7px 12px; border-radius: 6px; font-weight: 700; font-size: 14px; }
.download-btn:hover { background: var(--gold); color: var(--navy); }

/* calendar */
.panel { background: var(--card); border-radius: 6px; padding: 30px; box-shadow: 0 2px 10px #0f1b3322; border-top: 4px solid var(--gold); }
table.hours { width: 100%; border-collapse: collapse; margin-top: 14px; }
table.hours th, table.hours td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: start; }
table.hours th { background: var(--navy); color: #fff; }

/* contact / donate */
.contact-box p { margin: 6px 0; }
.contact-box .row { display: flex; gap: 10px; align-items: center; }
.donate-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.donate-list { list-style: none; }
.donate-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay-btn { display: block; text-align: center; margin-top: 12px; padding: 12px; border-radius: 6px; font-weight: 700; }
.pay-stripe { background: var(--gold); color: var(--navy); }
.pay-paypal { background: var(--navy); color: #fff; }
.pay-btn:hover { filter: brightness(1.1); }
.note { font-size: 13.5px; color: var(--muted); margin-top: 12px; }

/* forms */
.form-container { max-width: 760px; margin: 30px auto 50px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
input[type=text], input[type=tel], select, textarea {
  width: 100%; padding: 11px 12px; border: 2px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }
.submit-btn { width: 100%; padding: 13px; border: 0; border-radius: 6px; background: var(--navy); color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; border-bottom: 3px solid var(--gold); }
.submit-btn:hover { background: var(--navy-2); }

/* quiz */
.quiz-wrap { max-width: 780px; margin: 30px auto 50px; }
.timer { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--gold-soft); text-align: center; padding: 8px; font-weight: 700; border-radius: 0 0 6px 6px; }
.question-card { background: var(--card); border-radius: 6px; padding: 18px 20px; margin: 14px 0; box-shadow: 0 2px 10px #0f1b3322; }
.option { display: block; padding: 8px 12px; margin-top: 8px; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; }
.option:hover { border-color: var(--gold); background: #faf5e6; }
.option input { accent-color: var(--navy); margin-inline-end: 8px; }
.result { text-align: center; }
.result .score { font-size: 38px; font-weight: 900; color: var(--navy); margin: 8px 0; }

/* vocabulary */
.selector-box { margin-top: 14px; display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.selector-box select { width: auto; min-width: 130px; }
.day-badge { display: inline-block; background: var(--navy); color: var(--gold-soft); padding: 3px 18px; border-radius: 4px; font-weight: 700; }
.words-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 22px 0 40px; }
.word-card { background: var(--card); border-radius: 6px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; box-shadow: 0 2px 8px #0f1b3322; border-inline-start: 4px solid var(--gold); }
.word-card small { color: var(--muted); font-size: 12px; display: block; }
.word-en { font-weight: 700; font-size: 18px; direction: ltr; display: block; }
.word-fa { color: var(--navy-2); font-weight: 500; text-align: end; }

/* ai tutor chat */
.chat-wrapper { max-width: 720px; margin: 30px auto 50px; background: var(--card); border-radius: 6px; box-shadow: 0 2px 14px #0f1b3333; overflow: hidden; border-top: 4px solid var(--gold); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--navy); color: #fff; }
.chat-avatar { font-size: 30px; }
.chat-info h3 { margin: 0; font-size: 17px; direction: ltr; text-align: start; }
.chat-info p { font-size: 13px; opacity: .8; }
.chat-body { direction: ltr; height: 340px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f6f8fc; }
.message { max-width: 82%; padding: 9px 14px; border-radius: 8px; white-space: pre-line; }
.bot-msg { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.user-msg { align-self: flex-end; background: var(--navy); color: #fff; }
.chat-suggestions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); direction: ltr; }
.suggestion-btn { font: inherit; font-size: 13px; background: #fff; border: 1px solid var(--gold); color: var(--navy); border-radius: 99px; padding: 4px 12px; cursor: pointer; }
.suggestion-btn:hover { background: var(--gold); }
.chat-footer { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); direction: ltr; }
.chat-input { flex: 1; padding: 10px 12px; border: 2px solid var(--line); border-radius: 6px; font: inherit; }
.send-btn { background: var(--navy); color: #fff; border: 0; padding: 0 20px; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; }
.send-btn:hover { background: var(--gold); color: var(--navy); }

/* footer + whatsapp */
footer.site { background: var(--navy); color: #fff; margin-top: 40px; border-top: 4px solid var(--gold); padding: 30px 0 22px; font-size: 14.5px; }
footer.site .cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer.site a:hover { color: var(--gold-soft); }
footer.site .copy { text-align: center; opacity: .7; margin-top: 18px; font-size: 13px; }
.wa { position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 90; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px #0004; }
.wa svg { width: 28px; height: 28px; fill: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .top { flex-wrap: wrap; }
  nav.main { display: none; }
  nav.main.open { display: block; }
  nav.main ul { flex-direction: column; align-items: stretch; }
  .dd-menu { display: block; position: static; border: 0; background: transparent; padding: 0 0 0 0; padding-inline-start: 16px; min-width: 0; }
  .dd-btn { cursor: default; opacity: .7; }
  .grid-3, .quick { grid-template-columns: 1fr 1fr; }
  .grid-2, .donate-grid, .form-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .hero-img { height: 220px; }
}
@media (max-width: 520px) {
  .grid-3, .quick, .gallery-grid { grid-template-columns: 1fr; }
  .brand b { font-size: 20px; }
  .brand .logo { width: 50px; height: 50px; }
  .btn-donate { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
