/*
Theme Name: The Grade Calculator
Theme URI: https://example.invalid/the-grade-calculator
Author: The Grade Calculator
Description: Calm, mobile-first classic theme for The Grade Calculator toolkit. Works with the companion calculator plugin and without it.
Version: 2.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-grade-calculator
*/
:root{--tgc-bg:#ffffff;--tgc-surface:#fff;--tgc-ink:#202124;--tgc-accent:#1a73e8;--tgc-muted:#5f6368;--tgc-line:#dadce0;--tgc-soft:#e8f0fe;--tgc-width:1120px;--tgc-read:720px;--tgc-serif:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--tgc-sans:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--tgc-bg);color:var(--tgc-ink);font:1.0625rem/1.65 var(--tgc-sans);-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto}
a{color:var(--tgc-accent);text-underline-offset:.2em}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:3px solid var(--tgc-accent);outline-offset:2px;border-radius:2px}
h1,h2,h3{font-family:var(--tgc-serif);line-height:1.15;letter-spacing:-.01em;margin:0 0 .5em}
h1{font-size:clamp(2rem,6vw,3.1rem)}h2{font-size:clamp(1.5rem,4vw,2rem)}h3{font-size:1.25rem}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip-link:focus{clip:auto;width:auto;height:auto;background:#fff;padding:.75rem 1rem;z-index:100;left:.5rem;top:.5rem}
.wrap{width:min(100% - 2rem,var(--tgc-width));margin-inline:auto}
.site-header{background:var(--tgc-surface);border-bottom:1px solid var(--tgc-line)}
.header-in{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:64px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:.6rem;font:700 1.15rem var(--tgc-serif);color:var(--tgc-ink);text-decoration:none}
.brand .custom-logo{max-height:40px;width:auto}
.brand-mark{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:8px;background:var(--tgc-accent);color:#fff;font:700 1rem var(--tgc-sans)}
.nav-toggle{background:none;border:1px solid var(--tgc-line);border-radius:8px;padding:.5rem .8rem;font:inherit;color:inherit;cursor:pointer}
.primary-nav{display:none;width:100%}
.primary-nav.is-open{display:block}
.primary-nav ul{list-style:none;margin:0;padding:0 0 .75rem}
.primary-nav a{display:block;padding:.6rem 0;color:var(--tgc-ink);text-decoration:none;font-weight:500}
.primary-nav a:hover,.primary-nav .current-menu-item>a{color:var(--tgc-accent)}
@media(min-width:800px){.nav-toggle{display:none}.primary-nav{display:block;width:auto}.primary-nav ul{display:flex;gap:1.5rem;padding:0}.primary-nav a{padding:.4rem 0}}
.crumbs{font-size:.9rem;color:var(--tgc-muted);padding:1rem 0 0}
.main{padding:2rem 0 4rem}
.page-title{margin-bottom:.4em}
.lede{font-size:1.2rem;color:var(--tgc-muted);max-width:60ch}
.hero{background:var(--tgc-soft);border-bottom:1px solid var(--tgc-line);padding:3rem 0 2.5rem}
.hero h1{max-width:18ch}
.search-form{display:flex;gap:.5rem;max-width:560px;margin-top:1.5rem}
.search-form input[type=search]{flex:1;min-width:0;padding:.8rem 1rem;border:1px solid var(--tgc-line);border-radius:10px;font:inherit;background:#fff;color:inherit}
.btn,.search-form button{background:var(--tgc-accent);color:#fff;border:0;border-radius:10px;padding:.8rem 1.2rem;font:600 1rem var(--tgc-sans);cursor:pointer;text-decoration:none;display:inline-block}
.btn:hover,.search-form button:hover{filter:brightness(1.1)}
.section{padding:2.5rem 0}
.section+.section{border-top:1px solid var(--tgc-line)}
.section-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.cat-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr}
.cat-list li{border-top:1px solid var(--tgc-line)}
.cat-list a{display:block;padding:1rem .25rem;text-decoration:none;color:var(--tgc-ink)}
.cat-list strong{display:block;font:600 1.1rem var(--tgc-serif);color:var(--tgc-accent)}
.cat-list span{color:var(--tgc-muted);font-size:.95rem}
@media(min-width:700px){.cat-list{grid-template-columns:1fr 1fr;column-gap:2.5rem}}
.guide-list{list-style:none;margin:0;padding:0;display:grid;gap:1.25rem}
@media(min-width:800px){.guide-list{grid-template-columns:repeat(3,1fr)}}
.guide-list h3 a{color:var(--tgc-ink);text-decoration:none}
.guide-list h3 a:hover{color:var(--tgc-accent)}
.guide-list p{color:var(--tgc-muted);margin:0;font-size:.97rem}
.entry-content>*{max-width:var(--tgc-read)}
.entry-content>.tgc-calculator,.entry-content>.tgc-directory,.entry-content>.alignwide,.entry-content>.alignfull,.entry-content>div,.entry-content>form,.entry-content>section,.entry-content>table{max-width:100%}
.entry-content table{border-collapse:collapse;width:100%}
.entry-content th,.entry-content td{border-bottom:1px solid var(--tgc-line);padding:.5rem;text-align:left}
.entry-meta{color:var(--tgc-muted);font-size:.9rem}
.post-list{list-style:none;margin:0;padding:0;max-width:var(--tgc-read)}
.post-list li{padding:1.1rem 0;border-top:1px solid var(--tgc-line)}
.post-list h2{font-size:1.3rem;margin:0 0 .25rem}
.post-list h2 a{text-decoration:none}
.post-list p{margin:0;color:var(--tgc-muted)}
.pagination{margin-top:2rem}.pagination .page-numbers{padding:.4rem .7rem;text-decoration:none}.pagination .current{font-weight:700}
.site-footer{background:var(--tgc-ink);color:#e8f0fe;padding:2.5rem 0;font-size:.95rem}
.site-footer a{color:#e8f0fe}
.footer-in{display:grid;gap:1.5rem}
@media(min-width:800px){.footer-in{grid-template-columns:2fr 1fr 1fr}}
.site-footer ul{list-style:none;margin:0;padding:0}.site-footer li{padding:.2rem 0}
.site-footer h2{font:700 .8rem var(--tgc-sans);text-transform:uppercase;letter-spacing:.08em;color:#bdc1c6;margin-bottom:.6rem}
.copy{margin-top:1.5rem;color:#bdc1c6;font-size:.85rem}
.empty{border:1px dashed var(--tgc-line);border-radius:12px;padding:1.5rem;color:var(--tgc-muted);max-width:var(--tgc-read)}
.tgc-calculator{max-width:100%}
.tgc-calculator input,.tgc-calculator select,.tgc-calculator textarea{max-width:100%;font:inherit}
#root,.tgc-legacy{max-width:100%;overflow-x:auto}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Contact page */
.tgc-contact-page {
	max-width: 1120px;
}

.tgc-contact-page .entry-content {
	max-width: 100%;
}

.tgc-contact-page .entry-content > p {
	max-width: 720px;
	color: var(--tgc-muted);
}

.tgc-contact-page .forminator-ui.forminator-custom-form {
	max-width: 720px;
	margin: 2rem 0 0;
	padding: clamp(1.25rem, 4vw, 2rem);
	background: var(--tgc-surface);
	border: 1px solid var(--tgc-line);
	border-radius: 16px;
	box-shadow: 0 8px 28px rgba(32,33,36, 0.04);
	color: var(--tgc-ink);
}

.tgc-contact-page .forminator-ui .forminator-label {
	display: block;
	margin-bottom: 0.45rem;
	color: var(--tgc-ink);
	font-weight: 600;
}

.tgc-contact-page .forminator-ui input.forminator-input,
.tgc-contact-page .forminator-ui textarea.forminator-textarea,
.tgc-contact-page .forminator-ui select.forminator-select {
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--tgc-line);
	border-radius: 9px;
	background: #fff;
	color: var(--tgc-ink);
	font: inherit;
	box-shadow: none;
}

.tgc-contact-page .forminator-ui textarea.forminator-textarea {
	min-height: 150px;
	resize: vertical;
}

.tgc-contact-page .forminator-ui input:focus,
.tgc-contact-page .forminator-ui textarea:focus,
.tgc-contact-page .forminator-ui select:focus {
	border-color: var(--tgc-accent);
	outline: 2px solid rgba(26,115,232, 0.15);
	outline-offset: 1px;
}

.tgc-contact-page .forminator-ui .forminator-button-submit {
	min-height: 48px;
	padding: 0.8rem 1.4rem;
	border: 0;
	border-radius: 9px;
	background: var(--tgc-accent);
	color: #fff;
	font: 600 1rem var(--tgc-sans);
	cursor: pointer;
	transition: filter 0.2s ease;
}

.tgc-contact-page .forminator-ui .forminator-button-submit:hover {
	filter: brightness(1.12);
}

.tgc-contact-page .forminator-ui .forminator-error-message {
	border-radius: 7px;
}

@media (max-width: 600px) {
	.tgc-contact-page .forminator-ui.forminator-custom-form {
		padding: 1rem;
		margin-top: 1.5rem;
	}
}

/* === 4-colour directory + calculator cards (8 Nov 2026) === */
.tgc-tool-card{--c:#1a73e8;--t:#e8f0fe;position:relative;border-top:4px solid var(--c)!important;transition:transform .15s ease,box-shadow .15s ease}
.tgc-tool-card:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(60,64,67,.12)}
.tgc-tool-card h2 a,.tgc-tool-card h3 a{text-decoration:none!important;color:#202124!important}
.tgc-tool-card h2 a:hover,.tgc-tool-card h3 a:hover,.tgc-tool-card h2 a:focus-visible{color:var(--c)!important}
.tgc-tool-card::before{display:inline-block;margin:0 0 .55rem;padding:.18rem .6rem;border-radius:999px;background:var(--t);color:var(--c);font-size:.7rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;line-height:1.4}
.tgc-tool-card[data-category="education"],.tgc-tool-card[data-category="math"],.tgc-tool-card[data-category="construction"]{--c:#1a73e8;--t:#e8f0fe}
.tgc-tool-card[data-category="finance"],.tgc-tool-card[data-category="statistics"],.tgc-tool-card[data-category="technology"]{--c:#d93025;--t:#fce8e6}
.tgc-tool-card:not([data-category]),.tgc-tool-card[data-category="health"]{--c:#e37400;--t:#fef7e0}
.tgc-tool-card[data-category="business"],.tgc-tool-card[data-category="date-time"]{--c:#1e8e3e;--t:#e6f4ea}
.tgc-tool-card[data-category="education"]::before{content:"Education"}
.tgc-tool-card[data-category="finance"]::before{content:"Finance"}
.tgc-tool-card:not([data-category])::before{content:"Paycheck & tax"}
.tgc-tool-card[data-category="business"]::before{content:"Business"}
.tgc-tool-card[data-category="math"]::before{content:"Math"}
.tgc-tool-card[data-category="statistics"]::before{content:"Statistics"}
.tgc-tool-card[data-category="health"]::before{content:"Health & fitness"}
.tgc-tool-card[data-category="date-time"]::before{content:"Everyday life"}
.tgc-tool-card[data-category="construction"]::before{content:"Construction"}
.tgc-tool-card[data-category="technology"]::before{content:"Conversion"}
.page-id-113 article > h1.page-title,.page-id-113 .entry-content > p:first-child{background:linear-gradient(90deg,#f6f9ff 0%,#e8f0fe 55%,#fef7e0 100%)!important}
.page-id-113 article > h1.page-title::after{content:"";display:block;width:202px;height:6px;margin:1.1rem 0 .1rem;border-radius:6px;background:linear-gradient(90deg,#4285f4 0 46px,transparent 46px 52px,#ea4335 52px 98px,transparent 98px 104px,#fbbc04 104px 150px,transparent 150px 156px,#34a853 156px 202px)}

/* Directory title styled like home title (8 Nov 2026) */
.tgc-hl{color:#1a73e8}
.page-id-113 article > h1.page-title{font-size:clamp(2.3rem,5.2vw,3.7rem)!important;letter-spacing:-.02em!important;line-height:1.08!important;font-weight:700}
.page-id-113 article > h1.page-title .tgc-strip{background:none!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important;color:#202124!important;width:auto!important}
.page-id-113 article > h1.page-title .tgc-strip::before,.page-id-113 article > h1.page-title .tgc-strip::after{display:none!important;content:none!important}
.page-id-113 article > h1.page-title .tgc-hl{color:#1a73e8!important}

/* Hide "N calculators shown" visually; kept for screen readers (8 Nov 2026) */
.tgc-directory p[role="status"]{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* === Night mode (8 Nov 2026) === */
.tgc-theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;width:40px;height:40px;margin-left:auto;margin-right:-.4rem;padding:0;border-radius:50%;border:1px solid #dadce0;background:#fff;color:#5f6368;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.tgc-theme-toggle:hover{background:#e8f0fe;color:#1a73e8;border-color:#aecbfa}
.tgc-theme-toggle svg{width:20px;height:20px}
.tgc-theme-toggle .tgc-sun{display:none}
html[data-theme="dark"] .tgc-theme-toggle{background:#1b1f24;border-color:#3c4043;color:#fdd663}
html[data-theme="dark"] .tgc-theme-toggle .tgc-sun{display:block}
html[data-theme="dark"] .tgc-theme-toggle .tgc-moon{display:none}
html[data-theme="dark"]{color-scheme:dark;--tgc-bg:#111418;--tgc-surface:#1b1f24;--tgc-ink:#e8eaed;--tgc-muted:#9aa0a6;--tgc-line:#3c4043;--tgc-soft:#1c2633;--tgc-accent:#8ab4f8}
html[data-theme="dark"] body{background:#111418;color:#e8eaed}
html[data-theme="dark"] .site-header{background:#15181d!important;border-color:#2d3136!important}
html[data-theme="dark"] .brand,html[data-theme="dark"] .brand span,html[data-theme="dark"] .primary-nav a,html[data-theme="dark"] .nav-toggle{color:#e8eaed}
html[data-theme="dark"] .nav-toggle{background:#1b1f24;border-color:#3c4043}
html[data-theme="dark"] .tgc-hl{color:#8ab4f8!important}
html[data-theme="dark"] a{color:#8ab4f8}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:#e8eaed}
html[data-theme="dark"] .lede,html[data-theme="dark"] .tgc-feature-lede{color:#bdc1c6}
html[data-theme="dark"] .site-footer{background:#0b0d10!important;color:#bdc1c6!important}
html[data-theme="dark"] .site-footer a{color:#e8eaed}
html[data-theme="dark"] .tgc-hero{background:linear-gradient(135deg,#131922 0%,#172238 60%,#2a2414 100%)!important}
html[data-theme="dark"] .tgc-eyebrow{background:#1b1f24;border-color:#2d3a4f;color:#8ab4f8}
html[data-theme="dark"] .tgc-cat-tile{background:#1b1f24;border-color:#3c4043;color:#e8eaed}
html[data-theme="dark"] .tgc-cat-tile strong{color:#e8eaed}
html[data-theme="dark"] .tgc-cat-tile span{color:#9aa0a6}
html[data-theme="dark"] .tgc-cat-tile:hover{border-color:#8ab4f8;box-shadow:0 8px 20px rgba(0,0,0,.45)}
html[data-theme="dark"] .tgc-cat-tile:nth-child(4n+1) svg{color:#8ab4f8;background:#1c2b45}
html[data-theme="dark"] .tgc-cat-tile:nth-child(4n+2) svg{color:#f28b82;background:#3a1f1d}
html[data-theme="dark"] .tgc-cat-tile:nth-child(4n+3) svg{color:#fdd663;background:#3a3016}
html[data-theme="dark"] .tgc-cat-tile:nth-child(4n+4) svg{color:#81c995;background:#17321f}
html[data-theme="dark"] .tgc-cat-all{background:#15181d!important}
html[data-theme="dark"] .tgc-cat-all svg{color:#bdc1c6!important;background:#2a2d31!important}
html[data-theme="dark"] .tgc-tool-card{background:#1b1f24!important;border-left-color:#3c4043!important;border-right-color:#3c4043!important;border-bottom-color:#3c4043!important;color:#bdc1c6}
html[data-theme="dark"] .tgc-tool-card p{color:#bdc1c6}
html[data-theme="dark"] .tgc-tool-card h2 a,html[data-theme="dark"] .tgc-tool-card h3 a{color:#e8eaed!important}
html[data-theme="dark"] .tgc-tool-card::before{background:#2a2d31;color:#e8eaed}
html[data-theme="dark"] .tgc-tool-card[data-category="education"]::before,html[data-theme="dark"] .tgc-tool-card[data-category="math"]::before,html[data-theme="dark"] .tgc-tool-card[data-category="construction"]::before{background:#1c2b45;color:#8ab4f8}
html[data-theme="dark"] .tgc-tool-card[data-category="finance"]::before,html[data-theme="dark"] .tgc-tool-card[data-category="statistics"]::before,html[data-theme="dark"] .tgc-tool-card[data-category="technology"]::before{background:#3a1f1d;color:#f28b82}
html[data-theme="dark"] .tgc-tool-card:not([data-category])::before,html[data-theme="dark"] .tgc-tool-card[data-category="health"]::before{background:#3a3016;color:#fdd663}
html[data-theme="dark"] .tgc-tool-card[data-category="business"]::before,html[data-theme="dark"] .tgc-tool-card[data-category="date-time"]::before{background:#17321f;color:#81c995}
html[data-theme="dark"] .page-id-113 article > h1.page-title,html[data-theme="dark"] .page-id-113 .entry-content > p:first-child{background:linear-gradient(90deg,#131922 0%,#172238 55%,#2a2414 100%)!important;border-color:#3c4043!important;color:#e8eaed!important}
html[data-theme="dark"] .page-id-113 article > h1.page-title .tgc-strip{color:#e8eaed!important}
html[data-theme="dark"] .page-id-113 article > h1.page-title::before{background:#1b1f24!important;border-color:#2d3a4f!important;color:#8ab4f8!important}
html[data-theme="dark"] .tgc-directory-controls label{color:#8ab4f8!important}
html[data-theme="dark"] .tgc-directory-controls input,html[data-theme="dark"] .tgc-directory-controls select,html[data-theme="dark"] .tgc-directory-controls button,html[data-theme="dark"] [class*="tgc-dd"]{background:#1b1f24!important;color:#e8eaed!important;border-color:#3c4043!important}
html[data-theme="dark"] [class*="tgc-dd"] li:hover,html[data-theme="dark"] [class*="tgc-dd"] [aria-selected="true"]{background:#1a73e8!important;color:#fff!important}
html[data-theme="dark"] .tgc-feature{background:#161c26!important;border-color:#2d3136!important}
html[data-theme="dark"] .tgc-feature .tgc-strip{background:#1b1f24!important;color:#8ab4f8!important;border-color:#2d3a4f!important}
html[data-theme="dark"] .tgc-calculator{background:#1b1f24!important;border-color:#3c4043!important;color:#e8eaed!important}
html[data-theme="dark"] .tgc-field label{color:#e8eaed!important}
html[data-theme="dark"] .tgc-field input,html[data-theme="dark"] .tgc-field select,html[data-theme="dark"] .tgc-field textarea{background:#111418!important;color:#e8eaed!important;border-color:#5f6368!important}
html[data-theme="dark"] .tgc-results{background:#17223a!important;color:#e8eaed!important;border-color:#2d3a4f!important}
html[data-theme="dark"] .tgc-reset{background:transparent!important;color:#e8eaed!important;border-color:#5f6368!important}
html[data-theme="dark"] .tgc-private-note,html[data-theme="dark"] .tgc-content{color:#c4c7c5}
html[data-theme="dark"] table,html[data-theme="dark"] th,html[data-theme="dark"] td{border-color:#3c4043!important}
html[data-theme="dark"] th{background:#1c2633!important;color:#e8eaed!important}
html[data-theme="dark"] .tgc-legacy{filter:invert(.9) hue-rotate(180deg)}
html[data-theme="dark"] .tgc-legacy{color:#202124}
html[data-theme="dark"] .tgc-legacy h1,html[data-theme="dark"] .tgc-legacy h2,html[data-theme="dark"] .tgc-legacy h3,html[data-theme="dark"] .tgc-legacy h4{color:#202124}
html[data-theme="dark"] .tgc-legacy a{color:#1a73e8}
html[data-theme="dark"] .tgc-legacy th{background:#e8f0fe!important;color:#202124!important}
html[data-theme="dark"] .tgc-legacy table,html[data-theme="dark"] .tgc-legacy td{border-color:#dadce0!important}


/* 11 Nov 2026: compact home hero - smaller title, no intro text, category tiles visible on first screen */
.home .tgc-hero { padding: 22px 0 18px !important; }
.home .tgc-hero .tgc-eyebrow { margin: 0 0 8px !important; }
.home .tgc-hero h1 { font-size: clamp(1.8rem, 3.2vw, 2.5rem) !important; line-height: 1.12 !important; margin: 0 0 8px !important; }
.home .tgc-hero .tgc-colorbar { margin: 0 !important; }
.home .tgc-cats { padding-top: 20px !important; }
@media (min-width: 1000px) {
  .home .tgc-cat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 14px !important; }
  .home .tgc-cat-tile { padding: 16px 10px 14px !important; }
}
@media (min-width: 640px) and (max-width: 999px) {
  .home .tgc-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px !important; }
  .home .tgc-cat-tile { padding: 14px 8px 12px !important; }
}
