/*
Theme Name: RES Portal
Theme URI: https://res.anything.sg
Author: anything.sg
Description: Members-only theme for the RES Exam Revision Portal (res.anything.sg). Pairs with the RES Exam Portal plugin for sign-up with approval, mock exams, leaderboard and forum.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: res-portal
*/

:root {
	--ink: #13233a;
	--ink-2: #0d1f33;
	--muted: #5d6b7e;
	--line: #e2e7ee;
	--bg: #f5f7fb;
	--card: #ffffff;
	--primary: #0b5f6b;
	--accent: #f2a007;
	--resp-ink: var(--ink);
	--resp-bg: var(--bg);
	--resp-primary: var(--primary);
	--resp-accent: var(--accent);
	--maxw: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: #084a53; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { clip: auto; width: auto; height: auto; left: 10px; top: 10px; background: #fff; padding: 10px 14px; z-index: 1000; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 880px; }
.center { text-align: center; }
.page-wrap { padding-top: 32px; padding-bottom: 48px; }
.resp-btn--lg { padding: 14px 26px; font-size: 1.02rem; }

/* Header */
.site-header { background: var(--ink-2); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__logo { max-height: 44px; width: auto; }
.brand__mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), #ffcd5c); color: var(--ink-2); font-weight: 800; font-size: .85rem; letter-spacing: .04em; }
.brand__mark--sm { width: 30px; height: 30px; font-size: .6rem; border-radius: 8px; display: inline-grid; vertical-align: middle; }
.brand__text { display: grid; line-height: 1.15; }
.brand__text strong { font-size: 1.02rem; }
.brand__text small { font-size: .72rem; opacity: .7; }
.nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.nav__list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav__list a { color: rgba(255, 255, 255, .78); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .92rem; display: block; }
.nav__list a:hover, .nav__list a.is-active, .nav__list .current-menu-item > a { color: #fff; background: rgba(255, 255, 255, .1); }
.nav__account { display: flex; align-items: center; gap: 12px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .15); }
.nav__link { color: rgba(255, 255, 255, .78); text-decoration: none; font-size: .9rem; font-weight: 600; }
.nav__link:hover { color: #fff; }
.nav__user { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.nav__user:hover { color: #fff; }
.nav__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--ink-2); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.nav .resp-btn { background: var(--accent); border-color: var(--accent); color: var(--ink-2) !important; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.nav-toggle span:not(.screen-reader-text) { display: block; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink-2); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
	.nav.is-open { display: flex; }
	.nav__list { flex-direction: column; }
	.nav__account { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; flex-wrap: wrap; }
	.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
	.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Page heading */
.page-head { margin-bottom: 24px; }
.page-head__title { margin: 0 0 4px; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.page-head__lead { margin: 0; color: var(--muted); }
.entry__content > *:first-child { margin-top: 0; }
body.is-auth-page .page-head { text-align: center; }
body.is-exam-mode .site-footer__grid { display: none; }
body.is-exam-mode .page-wrap { padding-top: 16px; }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(242, 160, 7, .22), transparent 60%), linear-gradient(160deg, var(--ink-2) 0%, #123452 55%, #0b5f6b 100%); color: #fff; padding: 72px 0 84px; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.2rem); margin: 10px 0 16px; font-weight: 800; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); padding: 6px 12px; border-radius: 999px; margin: 0; }
.hero__lead { font-size: 1.12rem; color: rgba(255, 255, 255, .82); max-width: 560px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 32px; }
.hero__cta .resp-btn:not(.resp-btn--ghost) { background: var(--accent); border-color: var(--accent); color: var(--ink-2) !important; }
.hero__ghost { color: #fff !important; border-color: rgba(255, 255, 255, .5) !important; }
.hero__ghost:hover { background: rgba(255, 255, 255, .1) !important; }
.hero__stats { list-style: none; display: flex; gap: 32px; padding: 0; margin: 0; flex-wrap: wrap; }
.hero__stats strong { display: block; font-size: 1.8rem; font-weight: 800; }
.hero__stats span { font-size: .85rem; color: rgba(255, 255, 255, .7); }
.mock { background: #fff; color: var(--ink); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: hidden; transform: rotate(1.5deg); }
.mock__bar { background: var(--ink); color: #fff; display: flex; justify-content: space-between; padding: 12px 16px; font-size: .82rem; font-weight: 700; }
.mock__timer { background: rgba(255, 255, 255, .12); padding: 2px 8px; border-radius: 6px; }
.mock__q { padding: 18px; }
.mock__qno { font-size: .75rem; color: var(--primary); font-weight: 700; margin: 0 0 6px; }
.mock__stem { font-weight: 600; margin: 0 0 12px; }
.mock__opt { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: .88rem; }
.mock__opt b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--bg); margin-right: 8px; font-size: .75rem; }
.mock__opt.is-sel { border-color: var(--primary); background: #e3f2f3; }
.mock__opt.is-sel b { background: var(--primary); color: #fff; }
.mock__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; padding: 0 18px 18px; }
.mock__grid i { aspect-ratio: 1; border-radius: 4px; background: var(--bg); position: relative; }
.mock__grid i.a { background: var(--primary); }
.mock__grid i.c { outline: 2px solid var(--ink); }
.mock__grid i.f::after { content: ""; position: absolute; top: 1px; right: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
@media (max-width: 900px) { .hero__inner { grid-template-columns: 1fr; } .hero__visual { max-width: 460px; } }

/* Sections */
.section { padding: 64px 0; }
.section--tint { background: #eaf1f4; }
.section__title { text-align: center; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 32px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.feature__icon { font-size: 1.6rem; display: grid; place-items: center; width: 52px; height: 52px; background: #e3f2f3; border-radius: 14px; }
.feature h3 { margin: 14px 0 6px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }
.syllabus { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .syllabus { grid-template-columns: 1fr; } }
.syllabus__col { background: var(--card); border-radius: 16px; padding: 28px; border-top: 5px solid var(--primary); }
.syllabus__col--p2 { border-top-color: var(--accent); }
.syllabus__col h3 { margin: 10px 0 12px; }
.syllabus__col ul { margin: 0; padding-left: 20px; color: var(--muted); }
.syllabus__col li { margin-bottom: 6px; }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0 0 32px; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; margin-bottom: 10px; }
.steps strong { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: .92rem; }

/* Forum thread */
.crumbs { margin: 0 0 16px; font-size: .9rem; }
.crumbs a { text-decoration: none; }
.thread { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.thread__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.thread__badges a { text-decoration: none; }
.thread__title { margin: 12px 0 4px; font-size: clamp(1.4rem, 3vw, 1.8rem); }
.thread__meta { color: var(--muted); margin: 0 0 16px; font-size: .9rem; }
.thread__tools { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.replies__title { font-size: 1.2rem; }
.replies__list, .replies__list .children { list-style: none; margin: 0; padding: 0; }
.replies__list .children { margin-left: 28px; }
.reply__box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; }
.reply--tutor > .reply__box { border-color: #9fd0d4; background: #f4fbfb; }
.reply__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.reply__head time { color: var(--muted); margin-left: auto; font-size: .8rem; }
.reply__avatar { width: 30px; height: 30px; border-radius: 50%; background: #e3f2f3; color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.reply__body { margin-top: 8px; }
.reply__body p { margin: 0 0 8px; }
.reply__foot { font-size: .85rem; }
.replies__form textarea { width: 100%; border: 1px solid #cfd7e2; border-radius: 10px; padding: 12px; font: inherit; }
.replies__form .comment-reply-title { margin-top: 0; }
.replies__form .form-submit { margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--ink-2); color: rgba(255, 255, 255, .75); padding: 40px 0 24px; font-size: .9rem; }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer__grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.site-footer__brand { color: #fff; font-weight: 700; margin: 0 0 6px; }
.site-footer__small { margin: 0; max-width: 460px; }
.site-footer__menu { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer__disclaimer { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; }
.site-footer__disclaimer strong { color: #fff; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.site-footer__disclaimer p { margin: 4px 0 0; font-size: .85rem; line-height: 1.55; }
.site-footer__copy { margin: 18px 0 0; font-size: .8rem; opacity: .6; }

.big-404 { font-size: 6rem; font-weight: 800; margin: 0; color: var(--primary); line-height: 1; }
body.is-exam-mode .site-header { position: static; }
