/*
Theme Name: Silverleaf PSC Academy
Theme URI: https://silverleafpscacademy.com
Author: Silverleaf PSC Academy
Description: Malayalam-first theme for Silverleaf PSC Academy, Kozhikode. Home page with hero, batch timetable, rank holders, training list, reasons, online notes, about, sister websites and admission call-to-action. Includes a Rank Holders post type and Customizer settings for contact details and sister websites.
Version: 1.0.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: silverleaf
*/

:root {
  --g900: #0A2D26;
  --g850: #071F1A;
  --g800: #0E3B32;
  --g700: #144A3F;
  --g600: #2F7A68;
  --g300: #9FD8C2;
  --g200: #C9D8D2;
  --accent: #F2B84B;
  --ink: #10241F;
  --bg: #F5F6F2;
  --bg2: #E8ECE8;
  --line: #D9DFDA;
  --muted: #3E4F4A;
  --serif: 'Noto Serif Malayalam', serif;
  --sans: 'Inter', 'Noto Sans Malayalam', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
}
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; margin: 0; padding: 12px 18px; background: #fff; color: var(--g800); z-index: 100000; top: 8px; left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 17px; line-height: 1.3; border: 1.5px solid transparent;
}
.btn svg { flex: none; }
.btn--accent { background: var(--accent); color: var(--g900); font-weight: 700; }
.btn--dark { background: var(--g800); color: #fff; }
.btn--ghost { border-color: #5E9C8C; color: #fff; }
.btn--outline { border-color: var(--g800); color: var(--g800); }
.btn--lg { padding: 14px 26px; font-size: 18px; }

.about__body p + p { margin-top: 0; }
.fact__big--ml { overflow-wrap: anywhere; }

/* ---------- Top strip ---------- */
.top-strip { background: var(--g900); color: var(--g200); font-size: 14px; }
.top-strip .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 28px; justify-content: space-between; }

/* ---------- Header ---------- */
.site-header { background: var(--g800); color: #fff; }
.site-header .wrap { padding-top: 22px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.brand__mark { flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 21px; }
.brand__sub { font-size: 11px; letter-spacing: .16em; color: var(--g300); font-weight: 600; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 16px; font-weight: 500; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.site-nav li a { display: block; padding: 10px 14px; }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--accent); }
.nav-call { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; padding: 11px 18px; border-radius: 999px; background: var(--accent); color: var(--g900); font-weight: 700; min-height: 44px; }

/* ---------- Hero ---------- */
.hero { background: var(--g800); color: #fff; position: relative; overflow: hidden; }
.hero__art { position: absolute; right: -140px; top: -60px; opacity: .09; pointer-events: none; }
.hero .wrap { position: relative; display: flex; flex-wrap: wrap; gap: 48px 56px; align-items: center; padding-top: 64px; padding-bottom: 88px; }
.hero__copy { flex: 1 1 480px; min-width: 0; }
.hero__badge { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--g600); background: var(--g700); color: #CFEDE2; font-size: 15px; font-weight: 600; }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 5vw, 54px); line-height: 1.4; margin: 24px 0 20px; }
.hero__lead { font-size: 19px; color: var(--g200); margin: 0 0 32px; max-width: 560px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__note { margin: 22px 0 0; font-size: 15px; color: var(--g300); }

.timetable { flex: 1 1 360px; min-width: 0; max-width: 480px; background: var(--bg); color: var(--ink); border-radius: 24px; padding: 28px; }
.timetable__eyebrow { font-size: 13px; letter-spacing: .06em; font-weight: 700; color: var(--g600); }
.timetable__title { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.4; margin: 6px 0 18px; }
.timetable__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.timetable__day { font-weight: 600; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--g800); color: #fff; }
.pill--exam { background: var(--accent); color: var(--g900); }
.timetable__none { color: #5A6A65; }
.timetable__note { margin: 16px 0 0; font-size: 14px; color: #4A5A55; }

/* ---------- Facts strip ---------- */
.facts { background: var(--bg2); border-bottom: 1px solid #D2D9D4; }
.facts .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 24px 16px; }
.fact { flex: 1 1 220px; }
.fact__big { font-family: var(--sans); font-weight: 700; font-size: 34px; line-height: 1.2; color: var(--g800); }
.fact__big--ml { font-family: var(--serif); font-size: 28px; line-height: 1.4; }
.fact__small { font-size: 15px; color: var(--muted); }
.fact__small a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Generic sections ---------- */
.section { padding: 88px 0; }
.section--white { background: #fff; border-bottom: 1px solid #E0E5E1; }
.section--grey { background: var(--bg2); }
.eyebrow { font-size: 14px; letter-spacing: .06em; font-weight: 700; color: var(--g600); }
.h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.4; margin: 8px 0 0; }
.section__head { display: flex; flex-wrap: wrap; gap: 20px 32px; justify-content: space-between; align-items: flex-end; margin-bottom: 36px; }
.lead { margin: 12px 0 40px; max-width: 640px; color: var(--muted); }

/* Rank holders */
.rank-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.rank-card { flex: 1 1 240px; max-width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.rank-card__photo { aspect-ratio: 4 / 5; background: var(--bg2); object-fit: cover; width: 100%; }
.rank-card__body { padding: 18px 22px 22px; }
.rank-card__name { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.5; margin: 0; }
.rank-card__rank { font-size: 15px; color: var(--muted); margin: 2px 0 0; }
.rank-empty { border: 1.5px dashed #6E8A82; border-radius: 20px; padding: 28px; color: var(--muted); }

/* Training */
.exam-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.exam-card { flex: 1 1 240px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.exam-card__n { font-weight: 700; font-size: 14px; color: var(--g600); }
.exam-card__t { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.5; margin-top: 6px; }
.section__cta { margin-top: 36px; }

/* Reasons */
.reasons { background: #fff; border-top: 1px solid #E0E5E1; border-bottom: 1px solid #E0E5E1; padding: 96px 0; }
.reasons .wrap { display: flex; flex-wrap: wrap; gap: 48px 72px; }
.reasons__intro { flex: 1 1 340px; min-width: 0; }
.reasons__list { flex: 1.6 1 440px; min-width: 0; list-style: none; margin: 0; padding: 0; }
.reasons__list li { display: flex; gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); font-size: 18px; }
.reasons__list li:last-child { border-bottom: 1px solid var(--line); }
.reasons__n { font-weight: 700; font-size: 30px; line-height: 1.2; color: var(--g600); min-width: 48px; }

/* Online notes band */
.band { background: var(--g800); color: #fff; padding: 88px 0; }
.band .wrap { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: center; }
.band__copy { flex: 1.3 1 400px; min-width: 0; }
.tag { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--g900); font-size: 14px; font-weight: 700; }
.band h2 { margin: 18px 0 16px; }
.band p { margin: 0; font-size: 18px; color: var(--g200); max-width: 600px; }
.band__card { flex: 1 1 300px; min-width: 0; background: var(--g700); border: 1px solid var(--g600); border-radius: 24px; padding: 32px; }
.band__card-top { font-size: 14px; color: var(--g300); font-weight: 600; }
.band__time { font-weight: 700; font-size: 72px; line-height: 1.1; margin: 8px 0; color: var(--accent); }
.band__time span { font-size: 28px; margin-left: 8px; }
.band__card a { text-decoration: underline; text-underline-offset: 3px; }

/* About */
.about { padding: 96px 0; }
.about .wrap { display: flex; flex-wrap: wrap; gap: 40px 72px; }
.about__title { flex: 1 1 340px; min-width: 0; }
.about__body { flex: 1.4 1 440px; min-width: 0; font-size: 18px; color: #2C3E39; }
.about__body p { margin: 0 0 20px; }
.about__body p:last-of-type { margin-bottom: 28px; }

/* Sister websites */
.sister-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.sister-card { flex: 1 1 320px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; }
.sister-card__name { font-weight: 700; font-size: 22px; color: var(--g800); overflow-wrap: anywhere; }
.sister-card__desc { color: var(--muted); }
.sister-card__go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--g800); }

/* CTA */
.cta { background: var(--g900); color: #fff; padding: 88px 0; }
.cta .wrap { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: center; justify-content: space-between; }
.cta__copy { flex: 1 1 420px; min-width: 0; }
.cta h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.4; margin: 0 0 12px; }
.cta p { margin: 0; font-size: 18px; color: var(--g200); }
.cta__info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cta__phone { font-size: 26px; min-height: 56px; padding: 16px 30px; }
.cta__row { display: flex; gap: 10px; align-items: flex-start; color: var(--g200); font-size: 16px; }
.cta__row svg { flex: none; margin-top: 4px; }

/* Footer */
.site-footer { background: var(--g850); color: #9DB3AB; font-size: 14px; }
.site-footer .wrap { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { display: inline-block; padding: 8px 0; }

/* ---------- Inner pages ---------- */
.page-head { background: var(--g800); color: #fff; padding: 56px 0 64px; }
.page-head h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.4; margin: 0; }
.page-head__meta { margin-top: 8px; color: var(--g300); font-size: 15px; }
.content { padding: 64px 0 96px; }
.entry { max-width: 780px; font-size: 18px; }
.entry h2, .entry h3, .entry h4 { font-family: var(--serif); line-height: 1.5; margin: 1.6em 0 .6em; }
.entry a { color: var(--g600); text-decoration: underline; text-underline-offset: 3px; }
.entry img { border-radius: 14px; }
.entry blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: var(--muted); }
.entry table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }

.post-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.post-card { flex: 1 1 320px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.post-card__img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--bg2); }
.post-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__title { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.5; margin: 0; }
.post-card__meta { font-size: 14px; color: var(--muted); }
.post-card__more { margin-top: auto; font-weight: 600; color: var(--g800); }
.pagination { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; }
.pagination .current { background: var(--g800); color: #fff; border-color: var(--g800); }
.not-found { text-align: center; padding: 96px 0; }

@media (max-width: 640px) {
  .section, .band, .cta { padding: 64px 0; }
  .reasons, .about { padding: 64px 0; }
  .hero .wrap { padding-top: 40px; padding-bottom: 56px; }
  .band__time { font-size: 56px; }
  .nav-call { margin-left: 0; }
}

/* ---------- Timetable: many batches ---------- */
.timetable__head { font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.5; color: var(--g800); padding: 16px 0 6px; border-top: 1px solid var(--line); break-after: avoid; break-inside: avoid; }
.timetable__head span { font-family: var(--sans); font-weight: 500; font-size: 14px; color: #4A5A55; margin-left: 10px; }
.timetable__list > :first-child { border-top: 0; padding-top: 0; }
.timetable__row { break-inside: avoid; }
.timetable--wide { flex: 1 1 100%; max-width: none; }
.timetable--wide .timetable__list { column-count: 2; column-gap: 48px; }
.timetable--wide .timetable__row { padding: 9px 0; }
@media (max-width: 760px) { .timetable--wide .timetable__list { column-count: 1; } }

/* Timetable: several time slots in one row ("A & B") stack neatly instead of one giant pill. */
.timetable__row { align-items: flex-start; }
.timetable__day { padding-top: 4px; }
.timetable__none { padding-top: 4px; }
.timetable__slots { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
.timetable .pill { border-radius: 14px; line-height: 1.4; text-align: right; }

/* Footer: social links + optional footer menu side by side */
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; }

/* ---------- Phone side panel (menu + working hours + address) ---------- */
.nav-toggle, .drawer, .drawer-overlay { display: none; }

@media (max-width: 820px) {
  /* Only when JavaScript is available; otherwise the normal wrapped menu stays. */
  .js .top-strip, .js .site-nav { display: none; }
  .js .site-header .wrap { flex-wrap: nowrap; padding-bottom: 14px; }
  .js .site-header .wrap { padding-top: 14px; }

  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; flex: none; border-radius: 12px;
    border: 1.5px solid #5E9C8C; background: transparent; color: #fff; cursor: pointer; padding: 0;
  }

  .js .drawer-overlay {
    display: block; position: fixed; inset: 0; background: rgba(4, 20, 16, .6);
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; z-index: 9998;
  }
  .js .drawer {
    display: flex; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0;
    width: min(86vw, 360px); background: var(--g900); color: #fff; z-index: 9999;
    transform: translateX(100%); visibility: hidden;
    transition: transform .28s ease, visibility 0s linear .28s; overflow-y: auto; overscroll-behavior: contain;
  }
  body.drawer-open { overflow: hidden; }
  body.drawer-open .drawer-overlay { opacity: 1; visibility: visible; transition: opacity .25s ease; }
  body.drawer-open .drawer { transform: none; visibility: visible; transition: transform .28s ease; }

  .drawer__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid #1E4A40; }
  .drawer__title { font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.4; }
  .drawer__close { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: none; border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; padding: 0; }

  .drawer__nav { padding: 8px 12px; }
  .drawer__nav ul { list-style: none; margin: 0; padding: 0; }
  .drawer__nav li a { display: flex; align-items: center; min-height: 52px; padding: 10px 12px; border-radius: 10px; font-size: 18px; font-weight: 500; }
  .drawer__nav li a:hover, .drawer__nav .current-menu-item > a, .drawer__nav .current_page_item > a { background: var(--g700); color: var(--accent); opacity: 1; }

  .drawer__info { margin-top: auto; padding: 20px; border-top: 1px solid #1E4A40; display: flex; flex-direction: column; gap: 14px; }
  .drawer__row { display: flex; gap: 10px; align-items: flex-start; color: var(--g200); font-size: 15px; }
  .drawer__row svg { flex: none; margin-top: 3px; }
  .drawer__call { justify-content: center; font-size: 20px; min-height: 52px; }
}

/* Top bar now shows date and time */
.top-strip__time { font-variant-numeric: tabular-nums; font-weight: 600; color: #fff; }

/* ---------- Sunday MEM batch ---------- */
.mem { background: var(--bg2); padding: 88px 0; }
.mem .wrap { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: center; }
.mem__copy { flex: 1 1 380px; min-width: 0; }
.mem__copy .tag { background: var(--g800); color: #fff; }
.mem__copy .h2 { margin: 16px 0 12px; font-size: clamp(34px, 5vw, 52px); }
.mem__copy p { margin: 0 0 28px; font-size: 19px; color: var(--muted); max-width: 520px; }
.mem__tiles { flex: 1.2 1 380px; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.mem__tile { flex: 1 1 150px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.mem__n { font-weight: 700; font-size: 14px; color: var(--g600); }
.mem__subject { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.4; color: var(--g800); overflow-wrap: anywhere; }
@media (max-width: 640px) { .mem { padding: 64px 0; } }
