/*
Theme Name: SMRC Portal
Theme URI: https://example.com/smrc-portal-theme
Author: SMRC
Description: Minimal host theme for the SMRC School Management System. Gets out of the way on the Authentication and Portal pages (the plugin renders those completely) and provides a clean, card-based design for ordinary site pages.
Version: 1.1.0
Requires PHP: 7.4
Requires Plugins: smrc-school-system
Text Domain: smrc-portal-theme
*/

:root {
	--smrc-primary: #6366f1;
	--smrc-primary-dark: #4338ca;
	--smrc-primary-light: #eef2ff;
	--smrc-accent: #06b6d4;
	--smrc-ink: #0f172a;
	--smrc-body: #475569;
	--smrc-muted: #94a3b8;
	--smrc-border: rgba(15, 23, 42, .08);
	--smrc-radius: 18px;
	--smrc-radius-sm: 12px;
	--smrc-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px -12px rgba(15, 23, 42, .18);
	--smrc-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--smrc-heading-font: 'Manrope', var(--smrc-font);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--smrc-font);
	color: var(--smrc-body);
	background: #f7f8fc;
	line-height: 1.55;
}

/* The plugin fully controls the Auth and Portal templates (full-bleed,
   own header/nav/background). Never let theme chrome or this stylesheet
   leak into those pages. */
body.smrc-app-page,
body.smrc-blank-canvas {
	background: none;
}
body.smrc-blank-canvas .site-header,
body.smrc-blank-canvas .site-footer { display: none; }

h1, h2, h3, h4 { font-family: var(--smrc-heading-font); color: var(--smrc-ink); margin: 0 0 .5em; }
a { color: var(--smrc-primary); }
img { max-width: 100%; height: auto; display: block; }

.smrc-container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---- Site header (ordinary pages only) ---- */
.site-header {
	background: #fff;
	border-bottom: 1px solid var(--smrc-border);
	position: sticky;
	top: 0;
	z-index: 20;
}
.site-header .smrc-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 64px;
}
.site-branding a { font-family: var(--smrc-heading-font); font-weight: 800; font-size: 1.15rem; color: var(--smrc-ink); text-decoration: none; }
.site-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--smrc-body); font-weight: 600; font-size: .93rem; }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--smrc-primary); }
.site-header-actions .smrc-btn { padding: 9px 18px; }

.smrc-nav-toggle-btn {
	display: none;
	background: none; border: 1px solid var(--smrc-border); border-radius: 10px;
	width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer;
}

/* ---- Buttons / cards (used by page.php content and widgets) ---- */
.smrc-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--smrc-primary); color: #fff; border: none;
	border-radius: var(--smrc-radius-sm); padding: 11px 20px;
	font-weight: 700; font-size: .93rem; text-decoration: none; cursor: pointer;
	transition: background .15s ease, transform .1s ease;
}
.smrc-btn:hover { background: var(--smrc-primary-dark); color: #fff; }
.smrc-btn-ghost { background: transparent; color: var(--smrc-primary); border: 1px solid var(--smrc-border); }
.smrc-btn-ghost:hover { background: var(--smrc-primary-light); }

.smrc-card {
	background: #fff; border: 1px solid var(--smrc-border); border-radius: var(--smrc-radius);
	box-shadow: var(--smrc-shadow); padding: 24px;
}
.smrc-card-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
}

/* ---- Generic page/post content ---- */
.smrc-page-hero { padding: 56px 0 36px; text-align: center; }
.smrc-page-hero p { color: var(--smrc-muted); max-width: 640px; margin: 10px auto 0; }
.smrc-content { padding: 8px 0 64px; }
.smrc-content .smrc-card + .smrc-card { margin-top: 18px; }

/* ---- Footer ---- */
.site-footer {
	border-top: 1px solid var(--smrc-border); margin-top: 40px;
	background: #fff;
}
.site-footer-grid {
	display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px;
	padding: 44px 20px 32px;
}
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--smrc-ink); margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 8px; }
.footer-col a { color: var(--smrc-body); text-decoration: none; font-size: .92rem; }
.footer-col a:hover { color: var(--smrc-primary); }
.footer-brand-name { font-family: var(--smrc-heading-font); font-weight: 800; font-size: 1.1rem; color: var(--smrc-ink); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.footer-brand p { font-size: .88rem; color: var(--smrc-muted); margin: 0; max-width: 32ch; }
.footer-hint { font-size: .8rem; color: var(--smrc-muted); margin-top: 6px; }
.footer-contact-list { list-style: none; margin: 0 0 14px; padding: 0; }
.footer-contact-list li + li { margin-top: 8px; }
.footer-widget + .footer-widget { margin-top: 18px; }
.site-footer-bottom {
	border-top: 1px solid var(--smrc-border); padding: 16px 0;
	color: var(--smrc-muted); font-size: .82rem;
}
.site-footer-bottom-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-social-list { list-style: none; display: flex; gap: 10px; margin: 0; padding: 0; }
.footer-social-list a {
	display: flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 50%;
	background: var(--smrc-primary-light); color: var(--smrc-primary);
	transition: background .15s ease, color .15s ease;
}
.footer-social-list a:hover { background: var(--smrc-primary); color: #fff; }
@media (max-width: 720px) {
	.site-footer-grid { grid-template-columns: 1fr; gap: 26px; padding: 36px 20px 26px; }
}

/* ---- 404 ---- */
.smrc-404 { text-align: center; padding: 90px 20px; }
.smrc-404 h1 { font-size: 3rem; }

/* =====================================================================
   Auth page refinements — loaded after every plugin stylesheet
   (smrc-base/auth/theme/ui-v13/rwanda-theme/modules) so these only ever
   add polish on top; nothing here touches markup, JS behaviour, or the
   plugin's authentication logic in class-smrc-auth.php.
   ===================================================================== */

/* Rwanda's flag colours as a soft background wash behind the auth
   card header — no flag shape/sun, just the palette. */
.smrc-auth-logo {
	height: 64px;
	margin: -36px -36px 20px;
	width: calc(100% + 72px);
	border-radius: var(--smrc-radius) var(--smrc-radius) 0 0;
	font-size: 0;
	background:
		linear-gradient(120deg,
			rgba(0,161,222,.85) 0%,
			rgba(250,210,1,.75) 50%,
			rgba(32,96,61,.85) 100%);
}
body.smrc-app-page.smrc-dark .smrc-auth-logo {
	background:
		linear-gradient(120deg,
			rgba(0,161,222,.55) 0%,
			rgba(250,210,1,.45) 50%,
			rgba(32,96,61,.55) 100%);
}

/* Same palette, applied to the page backdrop behind the card so the
   colours read even before the card itself. */
body.smrc-app-page {
	background-image:
		radial-gradient(900px 500px at 8% 0%, rgba(0,161,222,.22), transparent 60%),
		radial-gradient(800px 500px at 95% 10%, rgba(32,96,61,.20), transparent 55%),
		radial-gradient(700px 460px at 50% 100%, rgba(250,210,1,.18), transparent 60%);
}

/* ---- Form balance fixes ---- */
/* Consistent vertical rhythm: the original mixed 12px label margins
   with ad-hoc spacing around alerts/buttons/back-button, which reads
   uneven once the alert box appears. Establish one scale. */
.smrc-auth-wrap { padding-top: 32px; }
.smrc-auth-header { margin-bottom: 22px; }
#smrc-alert.smrc-alert { margin: 0 0 18px; }
.smrc-auth-wrap label { margin: 16px 0 6px; }
.smrc-auth-wrap label:first-of-type { margin-top: 4px; }
.smrc-back-btn { margin-bottom: 14px; }
.smrc-auth-wrap .smrc-btn { width: 100%; margin-top: 22px; }
.smrc-auth-chooser { gap: 10px; }
.smrc-choice-card { padding: 16px 18px; }

/* Inputs were a hair shorter than their focus ring made them look;
   equalize height and give every field the same left/right rhythm as
   the buttons above/below it. */
.smrc-auth-wrap input, .smrc-auth-wrap select, .smrc-auth-wrap textarea {
	padding: 13px 14px;
}

/* Keep the dark-mode toggle from crowding the now-larger flag mark on
   narrow screens. */
@media (max-width: 480px) {
	.smrc-theme-toggle-auth { top: 16px; right: 16px; }
	.smrc-auth-logo { width: 92px; height: 61px; }
}

@media (max-width: 720px) {
	.site-nav { position: fixed; inset: 64px 0 0 0; background: #fff; padding: 20px; transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; }
	.site-nav.is-open { transform: translateX(0); }
	.site-nav ul { flex-direction: column; gap: 4px; }
	.site-nav a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--smrc-border); }
	.smrc-nav-toggle-btn { display: inline-flex; }
}
