/*
Theme Name: St. John's Global School
Author: St Johns Educational Trust
Description: Website theme for St. John's Global School, Old Perungalathur, Chennai. Navy, gold and teal from the school crest, an illustrated school scene, an admissions enquiry form that prepares a WhatsApp or email message, and pages and news that the office can edit in the WordPress editor.
Version: 1.0.5
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stjohns
*/

:root {
	--sj-navy: var(--wp--preset--color--navy, #13285a);
	--sj-navy2: var(--wp--preset--color--navy-dark, #0d1d44);
	--sj-gold: var(--wp--preset--color--gold, #e0a82e);
	--sj-teal: var(--wp--preset--color--teal, #1a8aa3);
	--sj-ink: var(--wp--preset--color--ink, #13213f);
	--sj-soft: var(--wp--preset--color--soft, #4a5877);
	--sj-paper: var(--wp--preset--color--paper, #f6f8fc);
	--sj-line: var(--wp--preset--color--line, #e1e6f0);
	--sj-bg: #ffffff;
	/* used by the map illustration */
	--paper: var(--sj-paper); --line: var(--sj-line); --soft: var(--sj-soft); --ink: var(--sj-ink);
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { overflow-x: clip; }
h1, h2, h3 { letter-spacing: -0.02em; text-wrap: balance; }
:where(.sj-header, .sj-hero, .sj-band, .sj-footer) :where(p, ul, ol, figure, h1, h2, h3) { margin: 0; }
:where(.sj-header, .sj-hero, .sj-band, .sj-footer) a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .wp-block-button__link:focus-visible { outline: 3px solid var(--sj-gold); outline-offset: 3px; }

/* Remove WordPress's automatic top-level gaps so sections sit edge to edge */
body .wp-site-blocks > * { margin-block: 0; }

/* Containers */
.sj-wrap { max-width: 1240px; margin-inline: auto; padding-inline: max(5vw, 16px); box-sizing: border-box; width: 100%; }
body .sj-band, body .sj-hero, body .sj-header, body .sj-footer, body .sj-topbar, body .sj-nav { margin-block: 0; }
body .wp-site-blocks .alignfull.sj-band, body .wp-site-blocks .alignfull.sj-hero { max-width: none; }
.sj-band { padding-block: clamp(56px, 7vw, 100px); }
.sj-muted { color: var(--sj-soft); }
.sj-note { font-size: 14px; color: var(--sj-soft); }

/* Grid helpers: switch off WordPress's vertical gaps inside these */
body :is(.sj-main, .sj-header, .sj-hero, .sj-band, .sj-hero-head, .sj-motto, .sj-pillars, .sj-intro, .sj-steps, .sj-step, .sj-day, .sj-times, .sj-time, .sj-cards, .sj-adm, .sj-contact, .sj-info, .sj-info-row, .sj-nav-row, .sj-brand, .sj-brand-text, .sj-topbar-row, .sj-footer-row, .sj-mapfoot) > * { margin-block: 0; }

/* Buttons */
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 2px solid transparent; font-family: var(--wp--preset--font-family--heading, Nunito, sans-serif); font-weight: 800; font-size: 16px; text-decoration: none; transition: transform .15s; box-sizing: border-box; }
.wp-block-button__link:hover { transform: translateY(-2px); }
.wp-block-button.is-style-gold .wp-block-button__link { background: var(--sj-gold); color: #13213f; }
.wp-block-button.is-style-navy .wp-block-button__link { background: var(--sj-navy); color: #fff; }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: inherit; border: 2px solid currentColor; padding: 0 24px; }
.wp-block-buttons { gap: 12px; }

/* Top bar and navigation */
.sj-header-part, header.wp-block-template-part:has(> .sj-header) { position: sticky; top: -38px; z-index: 50; }
.admin-bar .sj-header-part, .admin-bar header.wp-block-template-part:has(> .sj-header) { top: calc(32px - 38px); }
@media (max-width: 782px) { .admin-bar .sj-header-part, .admin-bar header.wp-block-template-part:has(> .sj-header) { top: calc(46px - 38px); } }
.sj-topbar { background: var(--sj-navy2); color: #dfe6f5; font-size: 14px; height: 38px; overflow: hidden; }
.sj-topbar-row { display: flex; align-items: center; gap: 6px 22px; height: 38px; white-space: nowrap; }
.sj-topbar a { text-decoration: none; color: #fff; }
.sj-topbar-row > p:last-child { margin-left: auto; color: var(--sj-gold); }
.sj-nav { background: color-mix(in srgb, #fff 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--sj-line); }
.sj-nav-row { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.sj-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.sj-brand .wp-block-image img { width: 56px; height: auto; display: block; }
.sj-brand .wp-block-site-title, .sj-brand .sj-site-name { font: 700 19px/1.2 var(--wp--preset--font-family--display, Cinzel, serif); letter-spacing: .02em; }
.sj-brand .wp-block-site-title a { text-decoration: none; color: var(--sj-ink); }
.sj-brand .wp-block-site-tagline { font-size: 12.5px; font-weight: 600; color: var(--sj-soft); letter-spacing: .02em; }
.sj-nav .wp-block-navigation { font-weight: 700; font-size: 15.5px; gap: 20px; }
.sj-nav .wp-block-navigation a { text-decoration: none; }
.sj-nav .wp-block-navigation a:hover { color: var(--sj-teal); }
.sj-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; font-size: 20px; }

/* Hero */
.sj-hero { background: linear-gradient(180deg, #fff3d6, #fff); padding-top: clamp(34px, 5vw, 60px); }
.sj-hero-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: end; }
.sj-motto { display: flex; gap: 10px; flex-wrap: wrap; }
.sj-motto p { font: 700 14px var(--wp--preset--font-family--display, Cinzel, serif); letter-spacing: .12em; padding: 6px 14px; border-radius: 999px; background: var(--sj-navy); color: var(--sj-gold); }
.sj-hero h1 { font-size: clamp(38px, 5.6vw, 60px); line-height: 1.08; }
.sj-lead { font-size: 19px; color: var(--sj-soft); max-width: 36em; }
.sj-hero .sj-cta .wp-block-button.is-style-outline .wp-block-button__link { color: var(--sj-ink); }
.sj-scene { position: relative; height: clamp(300px, 40vw, 470px); margin-top: clamp(26px, 4vw, 44px) !important; }
.sj-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Motto band */
.sj-navy { background: var(--sj-navy); color: #fff; }
.sj-navy h2, .sj-navy h3 { color: #fff; }
.sj-pillars-title { max-width: 16em; margin-bottom: clamp(26px, 3vw, 40px) !important; }
.sj-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.sj-pillar-name { font: 700 30px var(--wp--preset--font-family--display, Cinzel, serif); color: var(--sj-gold); letter-spacing: .06em; margin-bottom: 8px !important; }
.sj-pillars p:not(.sj-pillar-name), .sj-navy .sj-light { color: #d5ddef; }

/* Section intros */
.sj-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(20px, 4vw, 60px); align-items: end; margin-bottom: clamp(28px, 4vw, 48px) !important; }
.sj-intro p { font-size: 18px; color: var(--sj-soft); }

/* Programmes: a staircase from playgroup to primary */
.sj-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: end; }
.sj-step { border-radius: 22px; padding: 20px 18px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; }
.sj-step h3 { color: #fff; margin: 4px 0 8px !important; }
.sj-step p { font-size: 15px; opacity: .95; }
.sj-step .sj-age { font: 800 14px var(--wp--preset--font-family--heading, Nunito, sans-serif); opacity: .9; }
.sj-steps > .sj-step:nth-child(1) { background: #1a8aa3; min-height: 230px; }
.sj-steps > .sj-step:nth-child(2) { background: #1d6f9b; min-height: 270px; }
.sj-steps > .sj-step:nth-child(3) { background: #1b5289; min-height: 310px; }
.sj-steps > .sj-step:nth-child(4) { background: #163d78; min-height: 350px; }
.sj-steps > .sj-step:nth-child(n+5) { background: #13285a; min-height: 390px; box-shadow: inset 0 -6px 0 #e0a82e; }

/* A day here */
.sj-paper { background: var(--sj-paper); border-block: 1px solid var(--sj-line); }
.sj-day { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 64px); }
.sj-day .sj-muted { font-size: 18px; }
.sj-time { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--sj-line); }
.sj-time-at { font: 900 22px var(--wp--preset--font-family--heading, Nunito, sans-serif); color: var(--sj-teal); white-space: nowrap; }
.sj-time strong { display: block; font: 800 18px var(--wp--preset--font-family--heading, Nunito, sans-serif); }
.sj-time > div > p + p { margin-top: 2px !important; color: var(--sj-soft); }

/* Global cards */
.sj-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.sj-card { border: 1px solid var(--sj-line); border-radius: 22px; padding: 22px; }
.sj-card .wp-block-image img { width: 46px; height: 46px; }
.sj-card h3 { margin-top: 12px !important; }
.sj-card p { color: var(--sj-soft); font-size: 16px; margin-top: 6px !important; }

/* Admissions */
.sj-adm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: start; }
.sj-adm-lead { font-size: 18px; color: #d5ddef; }
ol.sj-adm-steps { list-style: none; margin: 26px 0 0 !important; padding: 0; display: grid; gap: 16px; counter-reset: s; }
ol.sj-adm-steps > li { position: relative; padding-left: 62px; min-height: 44px; counter-increment: s; color: #d5ddef; }
ol.sj-adm-steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--sj-gold); color: #13213f; font: 900 20px var(--wp--preset--font-family--heading, Nunito, sans-serif); display: grid; place-items: center; }
ol.sj-adm-steps > li strong { color: #fff; }
.sj-docs { margin-top: 26px !important; padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, .08); }
.sj-docs ul { margin: 8px 0 0 !important; padding-left: 20px; color: #d5ddef; }

/* Enquiry form */
.sj-form { background: var(--sj-bg); color: var(--sj-ink); border-radius: 26px; padding: clamp(22px, 3vw, 34px); }
.sj-form h3 { font: 900 26px/1.15 var(--wp--preset--font-family--heading, Nunito, sans-serif); margin: 0 0 6px; color: var(--sj-ink); }
.sj-form p { margin: 0; }
.sj-field { display: grid; gap: 6px; margin-top: 14px; }
.sj-field label { font-weight: 700; font-size: 15px; }
.sj-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sj-form input, .sj-form select, .sj-form textarea { font: 16px var(--wp--preset--font-family--body, "Nunito Sans", sans-serif); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--sj-line); background: #fff; color: var(--sj-ink); width: 100%; min-height: 48px; box-sizing: border-box; }
.sj-form textarea { min-height: 90px; resize: vertical; }
.sj-form .sj-err { color: #c0392b; min-height: 1.2em; margin-top: 8px; font-size: 14px; }
.sj-form button { margin-top: 6px; display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 0; background: var(--sj-navy); color: #fff; font: 800 16px var(--wp--preset--font-family--heading, Nunito, sans-serif); cursor: pointer; }
.sj-out { display: none; margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--sj-paper); }
.sj-out.show { display: block; }
.sj-out .sj-send { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.sj-out .sj-send a { display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px; border-radius: 999px; font: 800 16px var(--wp--preset--font-family--heading, Nunito, sans-serif); text-decoration: none; }
.sj-out .sj-wa { background: var(--sj-gold); color: #13213f; }
.sj-out .sj-em { border: 2px solid currentColor; color: var(--sj-ink); }

/* Contact */
.sj-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: start; }
.sj-info { display: grid; gap: 18px; margin-top: 22px !important; }
.sj-info-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.sj-info-row .wp-block-image img { width: 26px; height: 26px; margin-top: 2px; }
.sj-info-row > div > p + p { margin-top: 0 !important; }
.sj-info a { font-weight: 700; text-decoration: none; color: var(--sj-teal); overflow-wrap: anywhere; }
.sj-mapcard { border-radius: 26px; overflow: hidden; border: 1px solid var(--sj-line); }
body .sj-mapcard > * { margin-block: 0; }
.sj-map { position: relative; height: 300px; }
.sj-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sj-mapfoot { padding: 18px 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Footer */
.sj-footer { background: var(--sj-navy2); color: #c9d3ea; font-size: 15px; padding-block: 34px; }
.sj-footer-row { display: flex; flex-wrap: wrap; gap: 16px 30px; align-items: center; }
.sj-footer .wp-block-image img { width: 52px; height: auto; }
.sj-footer strong { font: 700 17px var(--wp--preset--font-family--display, Cinzel, serif); color: #fff; }
.sj-footer-name { margin-right: auto !important; }
.sj-footer-links a { margin-right: 22px; }

/* Ordinary pages and news */
.sj-page { padding-block: clamp(40px, 6vw, 80px); }
.sj-page > .wp-block-post-title, .sj-page > h1 { margin-bottom: 12px; }
.sj-news .wp-block-post-template { list-style: none; padding: 0; display: grid; gap: 22px; }
.sj-news .wp-block-post { border: 1px solid var(--sj-line); border-radius: 22px; padding: 22px; }
.sj-news .wp-block-post-title a { text-decoration: none; color: var(--sj-ink); }
.sj-news .wp-block-post-date { color: var(--sj-soft); font-size: 14px; }
.sj-404 { text-align: center; }
.sj-404 .wp-block-buttons { justify-content: center; }

/* Phones and tablets */
@media (max-width: 980px) {
	.sj-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sj-steps > .sj-step:nth-child(n) { min-height: 0; }
	.sj-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.sj-hero-head, .sj-intro, .sj-day, .sj-adm, .sj-contact, .sj-pillars { grid-template-columns: minmax(0, 1fr); }
	.sj-topbar-row > p:nth-child(2), .sj-topbar-row > p:last-child { display: none; }
	.sj-nav-row > .wp-block-buttons { display: none; }
}
@media (max-width: 520px) {
	.sj-steps, .sj-cards, .sj-row2 { grid-template-columns: minmax(0, 1fr); }
	.sj-brand .wp-block-site-title, .sj-brand .sj-site-name { font-size: 16px; }
	.sj-brand .wp-block-site-tagline { display: none; }
	.sj-scene { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.wp-block-button__link { transition: none; }
	.sj-sun-rays { animation: none !important; }
}
@keyframes sj-spin { to { transform: rotate(360deg); } }

/* Keep the menu on one line */
.wp-block-button__link { white-space: nowrap; }
.sj-nav .wp-block-navigation__container { flex-wrap: nowrap; }
.sj-nav .wp-block-navigation-item__content { white-space: nowrap; }
.sj-brand .wp-block-site-tagline { white-space: nowrap; }
@media (max-width: 1180px) { .sj-brand .wp-block-site-tagline { display: none; } .sj-nav .wp-block-navigation { font-size: 15px; } }
@media (max-width: 1000px) { .sj-nav-row > .wp-block-buttons { display: none; } }
.sj-news .wp-block-post-title { font-size: 26px; line-height: 1.2; margin-block: 6px 8px; }
.sj-news .wp-block-post > * { margin-block: 0; }
.sj-news .wp-block-post-excerpt__excerpt { margin: 0; color: var(--sj-soft); }

/* Hosting providers (e.g. GoDaddy) add their own form styles; keep the school's form look */
body .wp-site-blocks .sj-form input, body .wp-site-blocks .sj-form select, body .wp-site-blocks .sj-form textarea { font: 16px var(--wp--preset--font-family--body, "Nunito Sans", sans-serif); padding: 12px 14px; border-radius: 12px; border: 1.5px solid #cfd7e6; background: #fff; color: var(--sj-ink); width: 100%; min-height: 48px; box-sizing: border-box; box-shadow: none; }
body .wp-site-blocks .sj-form textarea { min-height: 90px; }
body .wp-site-blocks .sj-form input:focus, body .wp-site-blocks .sj-form select:focus, body .wp-site-blocks .sj-form textarea:focus { border-color: var(--sj-teal); outline: 3px solid color-mix(in srgb, var(--sj-gold) 60%, transparent); outline-offset: 1px; }
body .wp-site-blocks .sj-form button { margin-top: 6px; display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 0; background: var(--sj-navy); color: #fff; font: 800 16px var(--wp--preset--font-family--heading, Nunito, sans-serif); cursor: pointer; }
body .wp-site-blocks form.sj-form input, body .wp-site-blocks form.sj-form select, body .wp-site-blocks form.sj-form textarea { border: 1.5px solid #cfd7e6 !important; background: #fff !important; border-radius: 12px !important; padding: 12px 14px !important; min-height: 48px !important; }
body .wp-site-blocks form.sj-form button { background: var(--sj-navy) !important; color: #fff !important; border: 0 !important; border-radius: 999px !important; padding: 0 24px !important; min-height: 50px !important; }

/* Larger crest so the shield lettering is readable */
.sj-brand .wp-block-image img { width: 88px !important; height: auto !important; max-width: none; }
.sj-nav-row { padding-block: 8px; }
.sj-brand .wp-block-site-title, .sj-brand .sj-site-name { font-size: 22px; }
.sj-brand .wp-block-site-tagline { font-size: 13.5px; }
.sj-footer .wp-block-image img { width: 76px !important; }
@media (max-width: 1180px) { .sj-brand .wp-block-image img { width: 76px !important; } .sj-brand .wp-block-site-title { font-size: 20px; } }
@media (max-width: 760px) { .sj-brand .wp-block-image img { width: 66px !important; } }
@media (max-width: 520px) { .sj-brand .wp-block-image img { width: 60px !important; } .sj-brand .wp-block-site-title { font-size: 17px; } }

/* full emblem (shield, laurels and book) */
.sj-brand .wp-block-image img { width: 84px !important; }
@media (max-width: 1180px) { .sj-brand .wp-block-image img { width: 74px !important; } }
@media (max-width: 760px) { .sj-brand .wp-block-image img { width: 64px !important; } }
@media (max-width: 520px) { .sj-brand .wp-block-image img { width: 58px !important; } }
