/*
Theme Name:   GrammarSprint
Description:  Child theme of Twenty Twenty-Five for GrammarSprint: paper background, deep green accent, Source Serif 4 headings and Source Sans 3 body text. Fonts are self-hosted, no Google Fonts requests.
Template:     twentytwentyfive
Version:      1.0.0
Requires at least: 6.5
License:      GPL-2.0-or-later
Text Domain:  grammarsprint
*/

/* Most styling lives in theme.json. This file holds what theme.json can't express. */

/* ---------- Header ---------- */

.gs-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base);
}

.gs-logo a,
.gs-logo a:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 700;
	letter-spacing: -0.01em;
}

/* "Sprint" in green. */
.gs-logo .gs-logo-accent { color: var(--wp--preset--color--accent); }

.gs-header .wp-block-navigation-item__content { text-decoration: none; }
.gs-header .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent); }

/* ---------- Content ---------- */

/* Tables: clean, readable rules tables on grammar pages. */
.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.95em;
}

.wp-block-table th,
.wp-block-table td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.65em 0.75em;
	text-align: left;
	vertical-align: top;
}

.wp-block-table thead th {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	font-weight: 700;
	white-space: nowrap;
}

.wp-block-table tbody tr:nth-child(even) td { background: var(--wp--preset--color--tint); }

@media (max-width: 600px) {
	/* Wide tables scroll sideways; the fade on the right shows there is more. */
	.wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(to left, var(--wp--preset--color--base), var(--wp--preset--color--base)) left / 20px 100% no-repeat local, linear-gradient(to left, rgba(29,42,36,.12), transparent) right / 14px 100% no-repeat scroll; }
	.wp-block-table table { min-width: 540px; font-size: 0.9em; }
}

/* Example sentences in italics get a subtle highlighter on bold words. */
.entry-content em strong,
.wp-block-post-content em strong {
	background: linear-gradient(transparent 62%, var(--wp--preset--color--mark) 62%);
}

/* Lists with ❌ / ✅ examples breathe a little more. */
.wp-block-post-content li + li { margin-top: 0.35em; }

/* ---------- Cards (block style "Card" on Group blocks) ---------- */

.wp-block-group.is-style-gs-card {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	padding: 1.25rem 1.25rem 1.1rem;
	height: 100%;
	transition: border-color 0.15s;
}

.wp-block-group.is-style-gs-card:hover { border-color: var(--wp--preset--color--accent); }

.is-style-gs-card h3,
.is-style-gs-card h4 { margin-top: 0; }

.is-style-gs-card h3 a,
.is-style-gs-card h4 a { text-decoration: none; color: inherit; }

/* Whole card clickable: the link in the heading covers the card. */
.is-style-gs-card { position: relative; }
.is-style-gs-card h3 a::after,
.is-style-gs-card h4 a::after { content: ""; position: absolute; inset: 0; }

.gs-level {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 4px;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	vertical-align: middle;
}

.gs-muted { color: var(--wp--preset--color--muted); }

/* ---------- Footer ---------- */

.gs-footer a { text-decoration: none; }
.gs-plain-list { list-style: none; padding-left: 0; line-height: 1.9; }
.wp-block-post-content .gs-plain-list li + li { margin-top: 0; }
.gs-footer a:hover { text-decoration: underline; }

/* Keep the quiz's sticky bar above everything the theme adds. */
.gsq-bar { z-index: 30; }
