"""Generate the Helalia Language School public site.

Static output only — no backend, no build step beyond `python build_pages.py`.
Every page is a "room": the shell is shared, the room is set by
<body data-room="..."> which the stylesheet and site.js read.

School facts in this file come from Helalia's own material (founding, address,
phones, rules, mission, the two news posts, the Ministry 2026/2027 calendar).
Nothing here is invented; empty things are left honestly empty.
"""
from calendar import Calendar
from datetime import date, timedelta
from html import escape
from pathlib import Path

ROOT = Path(__file__).resolve().parent

# --- brand assets -----------------------------------------------------------
LOGO = "assets/media/settings/h9nsam_1723393686.png"
LOGO_LIGHT = "assets/media/settings/aLvpaB_1723393686.png"
FAV = "assets/media/settings/9qeOWv_1725134635.png"

HERO_VIDEO = "assets/media/hero/helalia-sun.mp4"
HERO_POSTER = "assets/media/sliders/1724071808i1lGMKhW6z.jpg"
HERO_LOGO = "assets/media/logo.png"

# --- school facts -----------------------------------------------------------
SCHOOL_AR = "مدارس هلالية للغات"
PHONE = "+2011271139690"
PHONE_TEL = "+2011271139690"
MAIL = "info@helalia-ls.org"
MAIL_ADM = "admission@helalia-ls.org"
ADDRESS = "Ring Rd, ABBIS, Alexandria Governorate, Egypt"
FOUNDED = "2008"
COPY_YEAR = date.today().year

DEPARTMENTS = [
    ("P.S", "assets/media/contact_info/17251428811v0xoyRmJD.png",
     [("+20 1118947479", None)]),
    ("KG", "assets/media/contact_info/1725143019fKfm12kKBf.webp",
     [("+20 1018708611", None)]),
    ("Low Dep.", "assets/media/contact_info/17251433859MZCNopZHJ.png",
     [("+20 1200954250", None), ("+20 12009442500", "WhatsApp")]),
    ("Upper Dep", "assets/media/contact_info/17251438679PeCNdWoMv.png",
     [("+20 1200948185", None), ("+20 1227058829", "WhatsApp")]),
    ("Middle & Senior Dep.", "assets/media/contact_info/1725143927OhPCF8rDUG.png",
     [("+20 1200948545", None)]),
]

NAV = [
    ("index.html", "Home", "الرئيسية"),
    ("about.html", "About", "عن المدرسة"),
    ("news.html", "News", "الأخبار"),
    ("events.html", "Events", "التقويم"),
    ("notices.html", "Notices", "الإعلانات"),
    ("results.html", "Results", "النتائج"),
    ("contact.html", "Contact", "اتصل بنا"),
    ("missions.html", "Missions", "رسالتنا"),
]


# --- shell ------------------------------------------------------------------
def shell(title, active, body, room, description):
    links = []
    for href, label, label_ar in NAV:
        cls = ' class="is-active" aria-current="page"' if href == active else ""
        links.append(
            f'<a href="{href}"{cls}>{label}<span class="nav-ar" aria-hidden="true">{label_ar}</span></a>'
        )
    nav = "\n          ".join(links)

    return f"""<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{escape(title)} · Helalia Language School</title>
  <meta name="description" content="{escape(description)}">
  <meta name="theme-color" content="#0a1b3d">
  <meta property="og:title" content="{escape(title)} · Helalia Language School">
  <meta property="og:description" content="{escape(description)}">
  <meta property="og:image" content="{HERO_POSTER}">
  <meta property="og:type" content="website">
  <link rel="icon" href="{FAV}">
  <script>document.documentElement.className += " js";</script>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Manrope:wght@400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,200..600;1,6..72,200..400&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="assets/css/site.css">
</head>
<body data-room="{room}">
  <a class="skip" href="#main">Skip to content</a>
  <header class="site">
    <div class="head-strip">
      <div class="wrap">
        <div>
          <a href="tel:{PHONE_TEL}">{PHONE}</a><span class="strip-mail"><span class="dot">·</span><a href="mailto:{MAIL}">{MAIL}</a></span><span class="strip-addr"><span class="dot">·</span>{ADDRESS}</span>
        </div>
        <div class="ar" dir="rtl">{SCHOOL_AR}</div>
      </div>
    </div>
    <div class="head-bar">
      <div class="wrap navrow">
        <a class="brand" href="index.html"><img class="brand-dark" src="{LOGO}" alt="Helalia Language School — home" width="426" height="116"><img class="brand-light" src="{LOGO_LIGHT}" alt="" aria-hidden="true" width="426" height="116"></a>
        <nav class="primary" id="primary-nav" aria-label="Main">
          {nav}
        </nav>
        <a class="btn head-cta" href="admission.html">Apply</a>
        <button class="menu-toggle" type="button" aria-label="Menu" aria-expanded="false" aria-controls="primary-nav">
          <span></span><span></span><span></span>
        </button>
      </div>
    </div>
  </header>
  <main id="main">{body}</main>
  <footer class="site">
    <div class="wrap ft">
      <div>
        <img src="{LOGO_LIGHT}" alt="Helalia Language School" width="426" height="116" loading="lazy">
        <p class="ft-ar" dir="rtl">{SCHOOL_AR}</p>
        <p>A bilingual campus in Alexandria, founded in {FOUNDED} by Helal Al-Kuwait Company.</p>
      </div>
      <div>
        <h4>School</h4>
        <nav aria-label="School">
          <a href="about.html">About</a>
          <a href="missions.html">Our missions</a>
          <a href="news.html">News</a>
          <a href="events.html">School calendar</a>
        </nav>
      </div>
      <div>
        <h4>Families</h4>
        <nav aria-label="Families">
          <a href="results.html">Results</a>
          <a href="notices.html">Notices</a>
          <a href="admission.html">Online admission</a>
          <a href="contact.html">Contact</a>
        </nav>
      </div>
      <div>
        <h4>Visit</h4>
        <p>{ADDRESS}</p>
        <p><a href="mailto:{MAIL}">{MAIL}</a><br><a href="mailto:{MAIL_ADM}">{MAIL_ADM}</a><br><a href="tel:{PHONE_TEL}">{PHONE}</a></p>
      </div>
    </div>
    <div class="wrap copy">
      <span>© {COPY_YEAR} Helalia Language School. All rights reserved.</span>
      <span><a href="privacy.html">Privacy</a> · <a href="terms.html">Terms</a></span>
    </div>
  </footer>
  <script src="assets/js/site.js" defer></script>
</body>
</html>
"""


def masthead(crumb, title, room_ar, lead, active_label):
    """Every inner room opens the same way."""
    return f"""
<section class="masthead">
  <div class="wrap">
    <p class="crumbs"><a href="index.html">Home</a><span class="sep">/</span>{escape(crumb)}</p>
    <h1 data-split>{title}</h1>
    <p class="masthead-ar" dir="rtl">{room_ar}</p>
    <p class="lead">{lead}</p>
  </div>
</section>"""


# ============================================================================
# HOME — light, campus, welcome
# ============================================================================
home = f"""
<section class="hero" aria-label="Helalia Language School">
  <div class="hero-stage">
    <video class="hero-video" autoplay muted loop playsinline preload="metadata"
           poster="{HERO_POSTER}" aria-hidden="true" tabindex="-1">
      <source src="{HERO_VIDEO}" type="video/mp4">
    </video>
    <div class="hero-veil" aria-hidden="true"></div>
    <div class="hero-glint" aria-hidden="true"></div>
  </div>
  <div class="wrap hero-copy">
    <p class="label">Alexandria · Since {FOUNDED}</p>
    <h1 class="hero-mark">
      <img src="{HERO_LOGO}" alt="Helalia Language School" width="1024" height="1024">
    </h1>
    <div class="hero-actions">
      <a class="btn btn-sun" href="about.html">The Helalia story</a>
      <a class="btn btn-line btn-line--light" href="admission.html">Online admission</a>
    </div>
  </div>
  <a class="scroll-cue" href="#welcome">Scroll<i aria-hidden="true"></i></a>
</section>

<section class="band band--sun" id="welcome">
  <div class="wrap duo">
    <div>
      <p class="label" data-rise>Welcome</p>
      <h2 data-rise style="--i:1">Helalia Language School</h2>
      <p data-rise style="--i:2">Helalia Language School was founded in {FOUNDED} by Helal Al-Kuwait Company to be one of Alexandria's leading educational institutions. The school board consulted specialised educators who distilled their experience into HLS.</p>
      <p data-rise style="--i:3">Helalia's mission would not be possible without its distinctive, qualified staff — committed to inspiring every student to reach full potential in a safe, friendly and adventurous environment where everyone is valued and respected.</p>
      <div class="figures" data-rise style="--i:4">
        <div><b>{FOUNDED}</b><span>Founded in Alexandria</span></div>
        <div><b>HLS</b><span>Bilingual language school</span></div>
        <div><b>ABBIS</b><span>Ring Road campus</span></div>
      </div>
      <p style="margin-top:28px" data-rise><a class="ulink" href="about.html">Read the full story</a></p>
    </div>
    <div class="plate-frame" data-rise style="--i:2">
      <div class="plate-pair">
        <figure class="plate">
          <img src="assets/media/gallery/1725135562tl4qo2esvv.jpg" alt="Helalia students on a campus day" loading="lazy" decoding="async" width="335" height="405">
        </figure>
        <figure class="plate">
          <img src="assets/media/gallery/1725134882011FBrRo85.jpg" alt="A Helalia school activity" loading="lazy" decoding="async" width="335" height="405">
        </figure>
      </div>
    </div>
  </div>
</section>

<section class="band band--paper band--tight">
  <div class="wrap">
    <p class="label" data-rise>Campus life</p>
    <h2 data-rise style="--i:1">Three doors into Helalia</h2>
  </div>
  <div class="wrap" style="margin-top:34px" data-stagger>
    <div class="doors">
      <article class="door" data-rise>
        <span class="n">01</span>
        <h3>Academic</h3>
        <p>Helalia's academic departments and the school rules that keep the learning day steady.</p>
      </article>
      <article class="door" data-rise>
        <span class="n">02</span>
        <h3>Join the family</h3>
        <p>Helalia is looking for energetic, hardworking teachers to join the team.</p>
      </article>
      <article class="door" data-rise>
        <span class="n">03</span>
        <h3>Health &amp; safety</h3>
        <p>HLS students wear school uniform every day. Reception holds the full guidance.</p>
      </article>
    </div>
  </div>
</section>

<section class="band band--shade">
  <div class="wrap rules">
    <div>
      <p class="label label--light" data-rise>The guide</p>
      <h2 data-rise style="--i:1">School rules, written clearly.</h2>
      <p class="lead" data-rise style="--i:2">Attendance, respect, and calm visits to campus — the four rules families are asked to keep.</p>
    </div>
    <div data-stagger>
      <div class="rule" data-rise>
        <div class="n">01</div>
        <div><h3>Attendance</h3><p>Attendance in school is compulsory. Absence must be supported by a medical certificate. Excuse may be granted on compassionate grounds, case by case.</p></div>
      </div>
      <div class="rule" data-rise>
        <div class="n">02</div>
        <div><h3>Return to class</h3><p>All medical certificates or letters of excuse must be submitted to the Form Teacher immediately when the student returns.</p></div>
      </div>
      <div class="rule" data-rise>
        <div class="n">03</div>
        <div><h3>Truancy</h3><p>Absence without a valid reason is treated as truancy.</p></div>
      </div>
      <div class="rule" data-rise>
        <div class="n">04</div>
        <div><h3>Visitors</h3><p>Adult visitors are welcome. Visits are arranged through the teacher's conference time (to be announced). On arrival, report to reception and sign the visiting book.</p></div>
      </div>
    </div>
  </div>
</section>

<figure class="moment" style="margin:0">
  <img src="assets/media/sliders/17251470394R0ZRVd7VT.jpg" alt="Helalia pupils gathered on the school field for a morning assembly" loading="lazy" decoding="async" width="1536" height="692">
  <figcaption>
    <div class="wrap">
      <p class="label">On the field</p>
      <p>Morning assembly at Helalia — the whole school on the grass, uniform on, before the day begins.</p>
    </div>
  </figcaption>
</figure>

<section class="band band--sun">
  <div class="wrap">
    <p class="label" data-rise>Contact sheet</p>
    <h2 data-rise style="--i:1">Campus in stills</h2>
    <p class="lead" data-rise style="--i:2">Photographs from Helalia's own gallery, printed on the grid. The strip drifts on its own.</p>
  </div>
  <div class="sheet-bleed" data-rise>
    <div class="sheet">
      <a href="assets/media/gallery/1725135737J1FQ6ql6TA.jpg" data-zoom="A Helalia school trip"><img src="assets/media/gallery/1725135737J1FQ6ql6TA.jpg" alt="A Helalia school trip" loading="lazy" decoding="async" width="335" height="405"></a>
      <a href="assets/media/gallery/1725135562tl4qo2esvv.jpg" data-zoom="Helalia students on a campus day"><img src="assets/media/gallery/1725135562tl4qo2esvv.jpg" alt="Helalia students on a campus day" loading="lazy" decoding="async" width="335" height="405"></a>
      <a href="assets/media/gallery/1725135478difNTUA8Tz.jpg" data-zoom="A Helalia campus activity"><img src="assets/media/gallery/1725135478difNTUA8Tz.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405"></a>
      <a href="assets/media/gallery/1725133845T26D0VZHxw.jpg" data-zoom="A Helalia campus activity"><img src="assets/media/gallery/1725133845T26D0VZHxw.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405"></a>
      <a href="assets/media/gallery/1725133291M1hMQtkxwh.jpg" data-zoom="A Helalia campus activity"><img src="assets/media/gallery/1725133291M1hMQtkxwh.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405"></a>
      <a href="assets/media/gallery/1725136064dbA5gXlzdu.jpg" data-zoom="A Helalia campus activity"><img src="assets/media/gallery/1725136064dbA5gXlzdu.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405"></a>
      <a href="assets/media/gallery/17251361423JvAey3Ml6.jpg" data-zoom="A Helalia campus activity"><img src="assets/media/gallery/17251361423JvAey3Ml6.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405"></a>
    </div>
  </div>
</section>

<section class="band band--paper">
  <div class="wrap">
    <p class="label" data-rise>Newsroom</p>
    <h2 data-rise style="--i:1">From the desk</h2>
    <div class="stubs" style="margin-top:30px" data-stagger>
      <a class="stub" href="news-coming-soon.html" data-rise>
        <img src="assets/media/news/1725138906mWpmoGrTgU.jpg" alt="" loading="lazy" decoding="async" width="690" height="460">
        <div><time datetime="2024-08-31">31 August 2024</time><h3>Coming soon</h3><p>Stay tuned for a new website coming soon.</p></div>
        <span class="go" aria-hidden="true">→</span>
      </a>
      <a class="stub" href="news-welcome.html" data-rise>
        <img src="assets/media/news/1725138880Cm0VIF0k1Z.jpg" alt="" loading="lazy" decoding="async" width="690" height="460">
        <div><time datetime="2024-08-31">31 August 2024</time><h3>Welcome</h3><p>Welcome back to school.</p></div>
        <span class="go" aria-hidden="true">→</span>
      </a>
    </div>
    <div class="invite" data-rise>
      <h3>The 2026/2027 school year, day by day.</h3>
      <a class="btn btn-navy" href="events.html">Open the calendar</a>
    </div>
  </div>
</section>
"""


# ============================================================================
# ABOUT — 2008 to today as a rising path
# ============================================================================
about = masthead(
    "About",
    "The school, without the brochure voice.",
    "عن مدارس هلالية للغات",
    "An Alexandria campus opened in 2008 — staff first, students always.",
    "About",
) + f"""
<section class="band band--sun">
  <div class="wrap duo">
    <div>
      <p class="label" data-rise>Origin</p>
      <h2 data-rise style="--i:1">Founded to last.</h2>
      <p data-rise style="--i:2">Helalia Language School was founded in {FOUNDED} by Helal Al-Kuwait Company to be one of Alexandria's leading educational institutions. The board consulted specialised educators and invested that experience in HLS.</p>
      <p data-rise style="--i:3">The mission depends on distinctive, qualified staff who inspire every student to reach full potential in a safe, friendly and adventurous environment where everyone is valued and respected.</p>
    </div>
    <div class="plate-frame" data-rise style="--i:2">
      <div class="plate-pair">
        <figure class="plate">
          <img src="assets/media/gallery/17251361423JvAey3Ml6.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405">
        </figure>
        <figure class="plate">
          <img src="assets/media/gallery/1725133291M1hMQtkxwh.jpg" alt="A Helalia campus activity" loading="lazy" decoding="async" width="335" height="405">
        </figure>
      </div>
    </div>
  </div>
</section>

<section class="band band--paper">
  <div class="wrap">
    <p class="label" data-rise>The climb</p>
    <h2 data-rise style="--i:1">{FOUNDED} → today</h2>
    <div class="path" style="margin-top:44px">
      <svg class="path-line" viewBox="0 0 1000 520" preserveAspectRatio="none" aria-hidden="true">
        <path d="M18 500 C 180 500, 200 330, 320 320 C 460 308, 470 150, 610 140 C 740 130, 800 40, 980 30"></path>
      </svg>
      <div class="steps-up">
        <article class="step-up" data-rise>
          <span class="yr">{FOUNDED}</span>
          <h3>Helal Al-Kuwait Company founds HLS</h3>
          <p>The company establishes Helalia Language School in Alexandria, with a board that consulted specialised educators before the first day.</p>
        </article>
        <article class="step-up" data-rise style="--i:1">
          <span class="yr">Campus</span>
          <h3>Ring Road, ABBIS</h3>
          <p>A cream tower with terracotta wings on the Ring Road — P.S and KG through the Middle &amp; Senior departments, each with its own office and phone line.</p>
        </article>
        <article class="step-up" data-rise style="--i:2">
          <span class="yr">Today</span>
          <h3>A uniform campus with the door open</h3>
          <p>Departments, an admissions desk ready for new families, and a school calendar published for the year ahead.</p>
        </article>
      </div>
    </div>
  </div>
</section>

<section class="band band--sun">
  <div class="wrap duo--wide duo">
    <div>
      <p class="label" data-rise>How we work</p>
      <h2 data-rise style="--i:1">Academic. Family. Safety.</h2>
      <p class="lead" data-rise style="--i:2">Three commitments the school states plainly, and keeps stating.</p>
    </div>
    <div data-stagger>
      <div class="rule" style="border-color:var(--line)" data-rise>
        <div class="n" style="color:var(--gold-ink)">01</div>
        <div><h3>Departments &amp; rules</h3><p style="color:var(--muted)">Helalia's academic departments, and the rules that keep the day orderly.</p></div>
      </div>
      <div class="rule" style="border-color:var(--line)" data-rise>
        <div class="n" style="color:var(--gold-ink)">02</div>
        <div><h3>Join the family</h3><p style="color:var(--muted)">Energetic, hardworking teachers are invited to join the Helalia team.</p></div>
      </div>
      <div class="rule" style="border-color:var(--line);border-bottom:1px solid var(--line)" data-rise>
        <div class="n" style="color:var(--gold-ink)">03</div>
        <div><h3>Health &amp; uniform</h3><p style="color:var(--muted)">Students wear school uniform daily. Reception holds the full guidance.</p></div>
      </div>
    </div>
  </div>
</section>

<section class="band band--paper">
  <div class="wrap duo">
    <div>
      <p class="label" data-rise>Faculty</p>
      <h2 data-rise style="--i:1">This wall is empty on purpose.</h2>
    </div>
    <div class="reserved" data-rise style="--i:2">
      <h3>Helalia's teachers</h3>
      <p>The school has not published staff portraits, names or subjects. Rather than fill the space with stock faces, it stays reserved for the real teachers — a name, a subject, and a short note from each classroom — for the day the school is ready to add them.</p>
      <p>Until then, the department offices answer directly.</p>
      <a class="btn btn-navy" href="contact.html">Ask the office</a>
    </div>
  </div>
</section>
"""


# ============================================================================
# NEWS — editorial, ticket / magazine
# ============================================================================
news = masthead(
    "News",
    "The Helalia desk.",
    "أخبار المدرسة",
    "Short notes from campus. Two posts are live today — the rest of this page waits for the office.",
    "News",
) + """
<section class="band band--sun">
  <div class="wrap">
    <div class="dateline" data-rise>
      <span>Helalia Language School</span>
      <span class="sp"></span>
      <span class="ar" dir="rtl">مدارس هلالية للغات</span>
      <span class="sp"></span>
      <span>Alexandria · Two posts</span>
    </div>
    <div class="mag">
      <a class="lede" href="news-coming-soon.html" data-rise>
        <img src="assets/media/news/1725138906mWpmoGrTgU.jpg" alt="" loading="lazy" decoding="async" width="690" height="460">
        <div class="cap">
          <time datetime="2024-08-31">31 August 2024</time>
          <h2>Coming soon</h2>
          <p>Stay tuned for a new website coming soon.</p>
        </div>
      </a>
      <div class="column" data-rise style="--i:1">
        <a class="col-item" href="news-welcome.html">
          <img src="assets/media/news/1725138880Cm0VIF0k1Z.jpg" alt="" loading="lazy" decoding="async" width="690" height="460">
          <div>
            <time datetime="2024-08-31">31 August 2024</time>
            <h3>Welcome</h3>
            <p>Welcome back to school.</p>
          </div>
        </a>
        <div class="col-item is-quiet">
          <img src="assets/media/gallery/17251361423JvAey3Ml6.jpg" alt="" loading="lazy" decoding="async" width="335" height="405">
          <div>
            <time>Next</time>
            <h3>The column is open</h3>
            <p>When the office publishes the next note it lands here, in this column — not in a generic blog grid.</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
"""


def article(kicker, title, date_iso, date_human, image, alt, caption, paragraphs):
    body = "\n  ".join(f"<p>{p}</p>" for p in paragraphs)
    return f"""
<section class="masthead">
  <div class="wrap">
    <p class="crumbs"><a href="news.html">News</a><span class="sep">/</span>{date_human}</p>
    <h1 data-split>{title}</h1>
    <p class="lead">{kicker}</p>
  </div>
</section>
<article class="band band--sun">
  <div class="wrap article">
    <figure data-rise>
      <img src="{image}" alt="{escape(alt)}" loading="lazy" decoding="async" width="690" height="460">
      <figcaption><time datetime="{date_iso}">{date_human}</time> · {escape(caption)}</figcaption>
    </figure>
    {body}
    <div class="article-foot">
      <a class="ulink" href="news.html">← Back to the newsroom</a>
    </div>
  </div>
</article>
"""


news_soon = article(
    "A note published on the Helalia public site.",
    "Coming soon",
    "2024-08-31",
    "31 August 2024",
    "assets/media/news/1725138906mWpmoGrTgU.jpg",
    "Helalia Language School news illustration",
    "Helalia newsroom",
    [
        "Stay tuned for a new website coming soon.",
        "This note was published on 31 August 2024 on the Helalia public site. The school is rebuilding its public pages — this redesign is that next step, in the same Helalia navy, gold and cream.",
    ],
)

news_welcome = article(
    "A note published on the Helalia public site.",
    "Welcome",
    "2024-08-31",
    "31 August 2024",
    "assets/media/news/1725138880Cm0VIF0k1Z.jpg",
    "Helalia Language School news illustration",
    "Helalia newsroom",
    [
        "Welcome back to school.",
        "Helalia opens the year the way it was founded: with staff who expect every student to be known, safe, and stretched. Uniform on, reception open, departments ready.",
    ],
)


# ============================================================================
# EVENTS — the Ministry 2026/2027 map, painted onto day cells
# ============================================================================
SCHOOL_EVENTS = [
    ("2026-09-12", "2026-09-12", "term", "1", "First day of school", "Ministry start for government, official language, and private language schools."),
    ("2026-09-12", "2026-09-17", "campus", "1", "Opening week", "Helalia orientation, class lists, and daily uniform."),
    ("2026-10-05", "2026-10-05", "campus", "1", "World Teachers' Day", "Campus thank-you for Helalia staff — not a public holiday."),
    ("2026-10-06", "2026-10-06", "holiday", "1", "Armed Forces Day", "National holiday. School is closed. October ceremony on the nearest school day."),
    ("2026-11-12", "2026-11-13", "campus", "1", "Parent conferences", "First-term visits by appointment. Sign in at reception."),
    ("2026-11-26", "2026-11-26", "campus", "1", "Sports day", "Helalia field day — heats, houses, and family stands."),
    ("2026-12-17", "2026-12-17", "campus", "1", "Arabic Language Day", "Marked on the nearest school day with recitation and bilingual displays."),
    ("2026-12-21", "2026-12-22", "campus", "1", "Winter concert", "KG and primary performance week. Tickets from the stage door."),
    ("2027-01-07", "2027-01-07", "holiday", "1", "Coptic Christmas", "National holiday. School is closed."),
    ("2027-01-09", "2027-01-14", "exam", "1", "Transfer exams", "First-term exams for صفوف النقل."),
    ("2027-01-16", "2027-01-21", "exam", "1", "Prep certificate", "الشهادة الإعدادية — first term."),
    ("2027-01-23", "2027-02-04", "holiday", "break", "Mid-year holiday", "Official two-week break. Term 2 starts Saturday 6 February."),
    ("2027-01-25", "2027-01-25", "holiday", "break", "25 January", "Revolution / Police Day, inside the mid-year break."),
    ("2027-02-06", "2027-02-06", "term", "2", "Second term begins", "Back to Helalia after the mid-year holiday."),
    ("2027-02-09", "2027-02-09", "holiday", "2", "Ramadan begins", "Approximate. School stays open with shorter hours after the circular."),
    ("2027-03-10", "2027-03-12", "holiday", "2", "Eid al-Fitr", "Approximate. School closed for the Eid holiday."),
    ("2027-03-21", "2027-03-21", "campus", "2", "Mother's Day", "Egyptian Mother's Day. KG and primary cards and a short assembly."),
    ("2027-03-29", "2027-04-02", "campus", "2", "Science week", "Labs, reading corners, and class exhibitions."),
    ("2027-04-15", "2027-04-16", "campus", "2", "Parent conferences", "Second-term progress meetings before the May exams."),
    ("2027-04-25", "2027-04-25", "holiday", "2", "Sinai Liberation", "National holiday. Sinai assembly on the nearest school day."),
    ("2027-05-01", "2027-05-01", "holiday", "2", "Labour Day", "National holiday."),
    ("2027-05-03", "2027-05-03", "holiday", "2", "Sham El-Nessim", "Spring festival after Coptic Easter."),
    ("2027-05-16", "2027-05-19", "holiday", "2", "Eid al-Adha", "Approximate. School closed for Arafat and Eid."),
    ("2027-05-22", "2027-05-27", "exam", "2", "Transfer exams", "Second-term exams for صفوف النقل."),
    ("2027-05-29", "2027-06-03", "exam", "2", "Prep certificate", "الشهادة الإعدادية — end of year."),
    ("2027-06-07", "2027-06-07", "holiday", "2", "Islamic New Year", "Approximate Muharram holiday."),
    ("2027-06-22", "2027-06-24", "campus", "2", "End-of-year", "Closing assembly, certificates, and KG graduation."),
    ("2027-06-24", "2027-06-24", "term", "2", "Last day of school", "Ministry end of 2026/2027."),
    ("2027-06-26", "2027-07-21", "exam", "2", "Thanaweya Amma", "General Secondary first-round exams."),
]


def _parse(iso):
    y, m, d = iso.split("-")
    return date(int(y), int(m), int(d))


def _events_by_day():
    by_day = {}
    for start, end, kind, term, label, note in SCHOOL_EVENTS:
        cur, last = _parse(start), _parse(end)
        while cur <= last:
            by_day.setdefault(cur, []).append((kind, term, label, note))
            cur += timedelta(days=1)
    return by_day


def _month_grid(year, month, by_day):
    weeks = Calendar(firstweekday=6).monthdayscalendar(year, month)
    cells = ["<b>Sun</b>", "<b>Mon</b>", "<b>Tue</b>", "<b>Wed</b>", "<b>Thu</b>", "<b>Fri</b>", "<b>Sat</b>"]
    for week in weeks:
        for day_n in week:
            if day_n == 0:
                cells.append('<span aria-hidden="true"></span>')
                continue
            day = date(year, month, day_n)
            items = by_day.get(day, [])
            if items:
                names = ", ".join(escape(label) for _, _, label, _ in items)
                head = (
                    f'<span class="day has" data-date="{day.isoformat()}" role="button" tabindex="0"'
                    f' aria-label="{day_n} {day.strftime("%B %Y")}: {names}">'
                )
            else:
                head = f'<span class="day" data-date="{day.isoformat()}">'
            bits = [head, f"<em>{day_n}</em>"]
            for kind, term, label, note in items:
                bits.append(
                    f'<i class="ev" data-kind="{kind}" data-term="{term}" title="{escape(note)}">{escape(label)}</i>'
                )
            bits.append("</span>")
            cells.append("".join(bits))
    return "".join(cells)


def calendar_page():
    by_day = _events_by_day()
    months = [
        (2026, 9, "September 2026", True),
        (2026, 10, "October 2026", False),
        (2026, 11, "November 2026", False),
        (2026, 12, "December 2026", False),
        (2027, 1, "January 2027", False),
        (2027, 2, "February 2027", False),
        (2027, 3, "March 2027", False),
        (2027, 4, "April 2027", False),
        (2027, 5, "May 2027", False),
        (2027, 6, "June 2027", False),
        (2027, 7, "July 2027", False),
    ]
    jumps, boards = [], []
    for i, (y, m, label, on) in enumerate(months):
        short = label.split()[0][:3]
        on_btn = ' class="is-on"' if on else ""
        on_month = " is-on" if on else ""
        jumps.append(f'<button type="button" data-jump="{i}"{on_btn}>{short}</button>')
        boards.append(
            f'<div class="cal-month{on_month}" data-label="{label}">'
            f'<div class="cal">{_month_grid(y, m, by_day)}</div></div>'
        )

    return masthead(
        "Events",
        "The Egyptian school year.",
        "التقويم الدراسي ٢٠٢٦ / ٢٠٢٧",
        "Helalia follows the Ministry of Education map for official and private language schools, plus the national holidays every campus in Egypt closes for — and Helalia's own campus days.",
        "Events",
    ) + f"""
<section class="band band--sun">
  <div class="wrap">
    <div class="year-map" data-stagger>
      <article data-rise>
        <h3>Term 1</h3>
        <p>Saturday 12 September 2026 → Thursday 21 January 2027. Mid-year holiday Saturday 23 January – Thursday 4 February 2027.</p>
      </article>
      <article data-rise>
        <h3>Term 2</h3>
        <p>Saturday 6 February 2027 → Thursday 24 June 2027. About 39 weeks and 183 school days across the full year.</p>
      </article>
    </div>

    <div class="legend" data-rise>
      <span><i></i> Ministry / term</span>
      <span><i class="navy"></i> National holiday</span>
      <span><i class="exam"></i> Exams</span>
      <span><i class="campus"></i> Campus programme</span>
    </div>

    <div class="event-filters" role="group" aria-label="Filter events" data-rise>
      <button type="button" class="is-on" data-filter="all" aria-pressed="true">All</button>
      <button type="button" data-filter="term1" aria-pressed="false">Term 1</button>
      <button type="button" data-filter="term2" aria-pressed="false">Term 2</button>
      <button type="button" data-filter="holiday" aria-pressed="false">Holidays</button>
      <button type="button" data-filter="exam" aria-pressed="false">Exams</button>
      <button type="button" data-filter="campus" aria-pressed="false">Campus</button>
    </div>

    <div class="cal-box" data-rise>
      <div class="cal-nav">
        <button type="button" class="cal-prev" aria-label="Previous month">‹</button>
        <h2 class="cal-title">September 2026</h2>
        <button type="button" class="cal-next" aria-label="Next month">›</button>
      </div>
      <div class="cal-jumps">{''.join(jumps)}</div>
      <div class="cal-scroll" tabindex="0" role="group" aria-label="Month grid — scroll sideways on a narrow screen">
        {''.join(boards)}
      </div>
      <p class="cal-hint">Gold days carry an event. Select a day to read it.</p>
      <div class="cal-detail" hidden></div>
    </div>

    <p class="note-moon">Islamic dates (Ramadan, Eid, Muharram) move with moon sighting and the presidency's holiday circular. Ministry exam windows are the official 2026/2027 map for language schools. Helalia campus days can shift a week if the office posts a notice.</p>
    <p style="margin-top:22px"><a class="btn btn-navy" href="contact.html">Department phones</a></p>
  </div>
</section>
"""


events = calendar_page()


# ============================================================================
# NOTICES — a pin board, honest about being empty
# ============================================================================
notices = masthead(
    "Notices",
    "The notice board.",
    "لوحة الإعلانات",
    "Helalia has not published public notices. The board is built and waiting — these pins are the standing ones from the school rules.",
    "Notices",
) + """
<section class="band band--sun">
  <div class="wrap">
    <div class="board" data-stagger>
      <article class="pin" data-rise>
        <p class="tagline">Standing · School rules</p>
        <h3>Uniform</h3>
        <p>HLS students wear school uniform every day. Reception holds the full guidance.</p>
      </article>
      <article class="pin" data-rise>
        <p class="tagline">Standing · School rules</p>
        <h3>Visitors</h3>
        <p>Adult visitors are welcome. Visits are arranged through the teacher's conference time (to be announced). On arrival, report to reception and sign the visiting book.</p>
      </article>
      <article class="pin" data-rise>
        <p class="tagline">Standing · School rules</p>
        <h3>Absence</h3>
        <p>Medical certificates and letters of excuse go to the Form Teacher immediately when the student returns.</p>
      </article>
      <div class="pin pin--empty" data-rise><p>Empty pin — kept blank until the office publishes a notice.</p></div>
      <div class="pin pin--empty" data-rise><p>Empty pin</p></div>
      <div class="pin pin--empty" data-rise><p>Empty pin</p></div>
    </div>
    <div class="invite" data-rise>
      <h3>Dated announcements live on the calendar.</h3>
      <a class="btn btn-navy" href="events.html">2026/2027 calendar</a>
    </div>
  </div>
</section>
"""


# ============================================================================
# RESULTS — a navy instrument on the exam desk
# ============================================================================
results = masthead(
    "Results",
    "Look up a result.",
    "نتائج الطلاب",
    "The same fields as the Helalia result form — academic year, class, section, exam, admission number.",
    "Results",
) + """
<section class="band band--sun">
  <div class="wrap">
    <div class="instrument" data-rise>
      <div class="instrument-head">
        <h2>Result lookup</h2>
        <span class="ar" dir="rtl">استعلام عن النتيجة</span>
      </div>
      <form data-preview>
        <div class="field">
          <label for="r-year">Academic year</label>
          <select id="r-year"><option>2024 / 2025</option></select>
        </div>
        <div class="field">
          <label for="r-class">Class</label>
          <select id="r-class"><option>Select class</option></select>
        </div>
        <div class="field">
          <label for="r-section">Section</label>
          <select id="r-section"><option>Select section</option></select>
        </div>
        <div class="field">
          <label for="r-exam">Exam</label>
          <select id="r-exam"><option>Select exam</option></select>
        </div>
        <div class="field full">
          <label for="r-adm">Admission number</label>
          <input id="r-adm" type="text" placeholder="Admission number" autocomplete="off">
        </div>
        <div class="full"><button class="btn btn-sun" type="submit">Search result</button></div>
      </form>
      <p class="instrument-note">The class, section and exam lists are filled by the school system. On this static preview nothing is submitted.</p>
    </div>
  </div>
</section>
"""


# ============================================================================
# CONTACT — a department switchboard
# ============================================================================
def switchboard_rows():
    rows = []
    for name, img, phones in DEPARTMENTS:
        nums = []
        for number, note in phones:
            tel = number.replace(" ", "")
            tag = f'<span class="wa">{note}</span> ' if note else ""
            nums.append(f'{tag}<a href="tel:{tel}">{number}</a>')
        rows.append(
            f"""      <div class="line" data-rise>
        <img src="{img}" alt="" loading="lazy" decoding="async">
        <div>
          <h3>{escape(name)}</h3>
          <div class="nums">{' '.join(nums)}<a href="mailto:{MAIL}">{MAIL}</a></div>
        </div>
        <span class="jack" aria-hidden="true"></span>
      </div>"""
        )
    return "\n".join(rows)


contact = masthead(
    "Contact",
    "The switchboard.",
    "اتصل بنا",
    "Write to the school — or call the department that already knows your child.",
    "Contact",
) + f"""
<section class="band band--sun">
  <div class="wrap switchboard">
    <div>
      <p class="label" data-rise>The desk</p>
      <h2 data-rise style="--i:1">Mail &amp; address</h2>
      <ul class="desk-facts" data-rise style="--i:2">
        <li><span class="k">Phone</span><a href="tel:{PHONE_TEL}">{PHONE}</a></li>
        <li><span class="k">General</span><a href="mailto:{MAIL}">{MAIL}</a></li>
        <li><span class="k">Admission</span><a href="mailto:{MAIL_ADM}">{MAIL_ADM}</a></li>
        <li><span class="k">Campus</span>{ADDRESS}</li>
      </ul>
      <form class="form-paper" data-preview data-rise style="--i:3">
        <div>
          <label for="c-name">Name</label>
          <input id="c-name" placeholder="Your name" required autocomplete="name">
        </div>
        <div>
          <label for="c-phone">Phone</label>
          <input id="c-phone" placeholder="Phone number" autocomplete="tel">
        </div>
        <div>
          <label for="c-mail">Email</label>
          <input id="c-mail" type="email" placeholder="you@example.com" required autocomplete="email">
        </div>
        <div>
          <label for="c-subject">Subject</label>
          <input id="c-subject" placeholder="What is this about?">
        </div>
        <div>
          <label for="c-msg">Message</label>
          <textarea id="c-msg" rows="4" placeholder="Your message"></textarea>
        </div>
        <button class="btn btn-navy" type="submit">Send message</button>
        <p class="preview-note">Preview only — this static build does not send mail. Use the addresses above.</p>
      </form>
    </div>
    <div>
      <p class="label" data-rise>Departments</p>
      <h2 data-rise style="--i:1">Direct lines</h2>
      <div style="margin-top:24px" data-stagger>
{switchboard_rows()}
      </div>
    </div>
  </div>
</section>
"""


# ============================================================================
# ADMISSION — a calm stepper
# ============================================================================
admission = masthead(
    "Admission",
    "Apply to Helalia.",
    "التقديم الإلكتروني",
    "The same fields as the Helalia online admission form, taken three calm steps at a time.",
    "Admission",
) + """
<section class="band band--sun">
  <div class="wrap">
    <div class="stepper" data-step="0" data-rise>
      <div class="step-rail" role="tablist" aria-label="Application steps">
        <button type="button" role="tab" class="is-on" aria-selected="true" aria-controls="step-1" id="tab-1">
          <span class="n">STEP 01</span><span class="t">The student</span>
        </button>
        <button type="button" role="tab" aria-selected="false" aria-controls="step-2" id="tab-2">
          <span class="n">STEP 02</span><span class="t">The family</span>
        </button>
        <button type="button" role="tab" aria-selected="false" aria-controls="step-3" id="tab-3">
          <span class="n">STEP 03</span><span class="t">Review &amp; send</span>
        </button>
      </div>

      <form data-preview>
        <div class="step-panel is-on" id="step-1" role="tabpanel" aria-labelledby="tab-1">
          <p class="hint">Who is applying, and to which year.</p>
          <div class="grid-form">
            <div><label for="a-first">First name *</label><input id="a-first" required placeholder="First name"></div>
            <div><label for="a-last">Last name *</label><input id="a-last" required placeholder="Last name"></div>
            <div><label for="a-phone">Phone</label><input id="a-phone" type="tel" placeholder="Phone number"></div>
            <div><label for="a-cpr">CPR number</label><input id="a-cpr" placeholder="CPR number"></div>
            <div><label for="a-mail">Email *</label><input id="a-mail" type="email" required placeholder="you@example.com"></div>
            <div><label for="a-dob">Date of birth</label><input id="a-dob" type="date"></div>
            <div><label for="a-year">Academic year</label><select id="a-year"><option>2024</option><option>2025</option></select></div>
            <div><label for="a-class">Class</label><select id="a-class"><option>Select class</option></select></div>
            <div><label for="a-section">Section</label><select id="a-section"><option>Select section</option></select></div>
            <div><label for="a-shift">Shift</label><select id="a-shift"><option>Shift 1</option><option>Shift 2</option></select></div>
            <div><label for="a-gender">Gender</label><select id="a-gender"><option>Male</option><option>Female</option></select></div>
            <div><label for="a-religion">Religion</label><select id="a-religion"><option>Islam</option><option>Christian</option></select></div>
            <div class="full"><label for="a-prev">Previous school</label><input id="a-prev" placeholder="Previous school"></div>
            <div><label for="a-birthplace">Place of birth</label><input id="a-birthplace" placeholder="Place of birth"></div>
            <div><label for="a-nationality">Nationality *</label><input id="a-nationality" required placeholder="Nationality"></div>
            <div><label for="a-language">Language at home</label><input id="a-language" placeholder="Language at home"></div>
            <div class="full"><label for="a-address">Residence address</label><input id="a-address" placeholder="Residence address"></div>
          </div>
          <div class="step-actions">
            <button class="btn btn-navy" type="button" data-step-next>Continue to family</button>
          </div>
        </div>

        <div class="step-panel" id="step-2" role="tabpanel" aria-labelledby="tab-2" hidden>
          <p class="hint">The guardian the school calls first, and the parents' details.</p>
          <div class="grid-form">
            <div><label for="a-gname">Guardian name *</label><input id="a-gname" required placeholder="Guardian name"></div>
            <div><label for="a-gphone">Guardian phone *</label><input id="a-gphone" type="tel" required placeholder="Guardian phone"></div>
            <div class="full"><label for="a-gjob">Guardian profession</label><input id="a-gjob" placeholder="Guardian profession"></div>
            <div><label for="a-fname">Father name</label><input id="a-fname" placeholder="Father name"></div>
            <div><label for="a-fphone">Father phone</label><input id="a-fphone" type="tel" placeholder="Father phone"></div>
            <div class="full"><label for="a-fnat">Father nationality</label><input id="a-fnat" placeholder="Father nationality"></div>
            <div><label for="a-mname">Mother name</label><input id="a-mname" placeholder="Mother name"></div>
            <div><label for="a-mphone">Mother phone</label><input id="a-mphone" type="tel" placeholder="Mother phone"></div>
            <div class="full"><label for="a-mjob">Mother profession</label><input id="a-mjob" placeholder="Mother profession"></div>
          </div>
          <div class="step-actions">
            <button class="btn btn-line" type="button" data-step-back>Back</button>
            <button class="btn btn-navy" type="button" data-step-next>Continue to review</button>
          </div>
        </div>

        <div class="step-panel" id="step-3" role="tabpanel" aria-labelledby="tab-3" hidden>
          <p class="hint">What happens after you send the form.</p>
          <div class="reserved">
            <h3>Documents are handed in at reception</h3>
            <p>The admission office confirms which papers are required for the year and department the student is joining. Bring them to the front desk on Ring Rd, ABBIS, or ask first by email.</p>
            <p><a class="ulink" href="mailto:admission@helalia-ls.org">admission@helalia-ls.org</a></p>
          </div>
          <div class="step-actions">
            <button class="btn btn-line" type="button" data-step-back>Back</button>
            <button class="btn btn-sun" type="submit">Submit application</button>
          </div>
          <p class="preview-note" style="margin-top:18px">Preview only — this static build does not store or send applications.</p>
        </div>
      </form>
    </div>
  </div>
</section>
"""


# ============================================================================
# MISSIONS — oversized type, a manifesto
# ============================================================================
missions = masthead(
    "Missions",
    "What we serve.",
    "رسالتنا",
    "The mission Helalia states, and the five values underneath it.",
    "Missions",
) + """
<section class="band band--sun manifesto">
  <div class="wrap">
    <p class="label" data-rise>Helalia</p>
    <h2 data-rise style="--i:1">A nurturing campus that asks more of every student.</h2>
    <p class="lead" data-rise style="--i:2">At Helalia we are dedicated to a nurturing, enriching education. The mission is academic excellence, character, and lifelong learning.</p>
    <div class="creed" data-stagger>
      <div class="creed-row" data-rise>
        <div class="big">01</div>
        <div><h3>Excellence</h3><p>The highest quality of teaching, resources, and support the school can sustain.</p></div>
      </div>
      <div class="creed-row" data-rise>
        <div class="big">02</div>
        <div><h3>Integrity</h3><p>Honesty and ethical behaviour with students, parents, staff, and the city around us.</p></div>
      </div>
      <div class="creed-row" data-rise>
        <div class="big">03</div>
        <div><h3>Respect</h3><p>Every person on campus has a place — abilities, views, and backgrounds included.</p></div>
      </div>
      <div class="creed-row" data-rise>
        <div class="big">04</div>
        <div><h3>Collaboration</h3><p>Students, parents, and teachers work as one table, not three waiting rooms.</p></div>
      </div>
      <div class="creed-row" data-rise>
        <div class="big">05</div>
        <div><h3>Innovation</h3><p>New ways to teach when the old way stops serving the child in front of us.</p></div>
      </div>
    </div>
  </div>
</section>
"""


# ============================================================================
# LEGAL — Helalia only
# ============================================================================
privacy = masthead(
    "Privacy",
    "Privacy",
    "سياسة الخصوصية",
    "What helalia-ls.org collects, and what the school does with it.",
    "Privacy",
) + f"""
<section class="band band--sun">
  <div class="wrap legal" data-rise>
    <p>This policy describes the information Helalia Language School may collect on <strong>helalia-ls.org</strong> and how that information is used. It covers the public website only. It does not cover paper files kept on campus.</p>
    <h2>Consent</h2>
    <p>Using the website means you agree to this policy.</p>
    <h2>What we collect</h2>
    <p>The contact form may ask for a name, phone number, email address and a message. The online admission form additionally collects the student, guardian and parent details needed to process an application.</p>
    <h2>How we use it</h2>
    <p>To operate the website, answer enquiries, process admissions and run the school. Helalia does not sell personal information.</p>
    <h2>Children</h2>
    <p>Admission details concerning a student are submitted by a parent or guardian and are used for the admission process.</p>
    <h2>Contact</h2>
    <p><a class="ulink" href="mailto:{MAIL}">{MAIL}</a><br><br>{PHONE} · {ADDRESS}</p>
    <p class="legal-meta">Helalia Language School · founded {FOUNDED} by Helal Al-Kuwait Company · Alexandria, Egypt.</p>
  </div>
</section>
"""

terms = masthead(
    "Terms",
    "Terms of use",
    "شروط الاستخدام",
    "The terms that cover this website — not the school regulations given to enrolled families.",
    "Terms",
) + f"""
<section class="band band--sun">
  <div class="wrap legal" data-rise>
    <p>These terms cover use of the Helalia Language School public website. They do not replace the school regulations given to enrolled families.</p>
    <h2>The site</h2>
    <p>These pages exist to inform families about Helalia in Alexandria and to receive admission or contact requests.</p>
    <h2>Accounts</h2>
    <p>Staff and parent logins belong to the school system, not to this public site. Keep credentials private.</p>
    <h2>Content</h2>
    <p>Text, photographs and the Helalia emblem are owned by the school unless stated otherwise.</p>
    <h2>Accuracy</h2>
    <p>School calendar dates follow the Ministry of Education map for language schools. Islamic holidays move with the official circular, and campus dates can change — the office confirms.</p>
    <h2>Contact</h2>
    <p><a class="ulink" href="mailto:{MAIL}">{MAIL}</a></p>
    <p class="legal-meta">Helalia Language School · founded {FOUNDED} by Helal Al-Kuwait Company · Alexandria, Egypt.</p>
  </div>
</section>
"""


# ============================================================================
# write
# ============================================================================
PAGES = {
    "index.html": ("Home", "index.html", home, "home",
                   f"Helalia Language School — a bilingual campus on the Ring Road at ABBIS, Alexandria, founded in {FOUNDED} by Helal Al-Kuwait Company."),
    "about.html": ("About", "about.html", about, "about",
                   f"How Helalia Language School was founded in {FOUNDED}, how the campus works, and what the school commits to."),
    "news.html": ("News", "news.html", news, "news",
                  "Notes from the Helalia desk in Alexandria."),
    "news-coming-soon.html": ("Coming soon", "news.html", news_soon, "news",
                              "Stay tuned for a new website coming soon — a note from the Helalia desk, 31 August 2024."),
    "news-welcome.html": ("Welcome", "news.html", news_welcome, "news",
                          "Welcome back to school — a note from the Helalia desk, 31 August 2024."),
    "events.html": ("Events", "events.html", events, "events",
                    "The Helalia 2026/2027 school calendar — Ministry terms, national holidays, exam windows and campus days."),
    "notices.html": ("Notices", "notices.html", notices, "notices",
                     "The Helalia notice board — standing notices from the school rules."),
    "results.html": ("Results", "results.html", results, "results",
                     "Look up a Helalia student result by academic year, class, section, exam and admission number."),
    "contact.html": ("Contact", "contact.html", contact, "contact",
                     f"Contact Helalia Language School — {PHONE}, {MAIL}, and the direct department lines."),
    "admission.html": ("Admission", "", admission, "admission",
                       "Apply to Helalia Language School — the online admission form, in three steps."),
    "missions.html": ("Missions", "missions.html", missions, "missions",
                      "The Helalia mission and its five values: excellence, integrity, respect, collaboration, innovation."),
    "privacy.html": ("Privacy", "", privacy, "legal",
                     "How Helalia Language School handles information collected on helalia-ls.org."),
    "terms.html": ("Terms", "", terms, "legal",
                   "Terms of use for the Helalia Language School public website."),
}


def main():
    for name, (title, active, body, room, description) in PAGES.items():
        (ROOT / name).write_text(shell(title, active, body, room, description), encoding="utf-8")
        print("wrote", name)
    print("done —", len(PAGES), "pages")


if __name__ == "__main__":
    main()
