/*
Theme Name: ScoreSheet
Theme URI: https://example.com/scoresheet
Author: Your Name
Description: A simple magazine-style theme for game and app review blogs. Uses standard posts with a Review Details box. Features a newspaper masthead, a lead story grid, a Top Rated strip, score stamps, and review pages with a sticky score card, automatic table of contents and reading progress bar.
Version: 1.0.0
Requires at least: 6.0
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: scoresheet
Tags: blog, news, one-column, custom-logo, custom-menu, featured-images, footer-widgets, threaded-comments
*/

:root {
	--paper: #f6f2ea;
	--card: #fffdf8;
	--ink: #1c1a17;
	--ink-2: #3b3730;
	--muted: #6f685d;
	--line: #e3dccf;
	--accent: #e0452b;
	--navy: #1e2f4d;
	--t-essential: #0e8f6e;
	--t-excellent: #2f9e44;
	--t-good: #c98a04;
	--t-mixed: #e07014;
	--t-skip: #c92a2a;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "DejaVu Serif", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1180px;
	--radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.7 var(--sans); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px; padding: 8px 14px; background: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- Masthead */
.topbar { border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--accent); }

.masthead { text-align: center; padding: 26px 0 18px; }
.site-title { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.site-title a { text-decoration: none; color: var(--ink); }
.site-title a:hover { color: var(--ink); }
.site-title .dot { color: var(--accent); }
.site-desc { margin: 8px 0 0; color: var(--muted); font-family: var(--serif); font-style: italic; }
.custom-logo { margin: 0 auto; max-height: 72px; width: auto; }

.navbar { border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 40; }
.navbar .wrap { display: flex; align-items: center; justify-content: center; min-height: 48px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; }
.main-nav a { text-decoration: none; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--accent); }
.nav-btn { display: none; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 6px 14px; font: 700 .75rem var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }

@media (max-width: 760px) {
	.navbar .wrap { justify-content: space-between; }
	.nav-btn { display: block; margin-left: auto; }
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border-bottom: 1px solid var(--ink); }
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 16px; }
	.main-nav a { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); }
	.main-nav li:last-child a { border-bottom: 0; }
}

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }

/* ---------------------------------------------------------------- Common */
.site-main { padding: 34px 0 64px; }
.kicker { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
a.kicker:hover { color: var(--ink); }
.byline { color: var(--muted); font-size: .84rem; }
.byline .sep { margin: 0 6px; opacity: .6; }
.rule-title { display: flex; align-items: center; gap: 14px; margin: 48px 0 20px; font-family: var(--sans); font-size: .8rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.rule-title::before, .rule-title::after { content: ""; flex: 1; height: 1px; background: var(--ink); }
.rule-title:first-child { margin-top: 0; }

.page-head { text-align: center; margin: 0 auto 34px; max-width: 720px; }
.page-head h1 { margin: 6px 0 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-head p { color: var(--muted); margin: 8px 0 0; }

.thumb { display: block; overflow: hidden; background: var(--line); aspect-ratio: 16 / 9; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.thumb:hover img { transform: scale(1.03); }

/* ---------------------------------------------------------------- Score stamp */
.stamp {
	--c: var(--t-good);
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
	width: 64px; height: 64px; border: 3px solid var(--c); color: var(--c); background: var(--card);
	border-radius: 4px; transform: rotate(-4deg); line-height: 1; box-shadow: 2px 2px 0 var(--c);
}
.stamp b { font-family: var(--serif); font-size: 1.45rem; font-weight: 800; }
.stamp small { margin-top: 3px; font-size: .52rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stamp.t-essential { --c: var(--t-essential); }
.stamp.t-excellent { --c: var(--t-excellent); }
.stamp.t-good { --c: var(--t-good); }
.stamp.t-mixed { --c: var(--t-mixed); }
.stamp.t-skip { --c: var(--t-skip); }
.stamp.sm { width: 46px; height: 46px; border-width: 2px; box-shadow: 1px 1px 0 var(--c); }
.stamp.sm b { font-size: 1.05rem; }
.stamp.sm small { display: none; }
.stamp.lg { width: 112px; height: 112px; border-width: 4px; box-shadow: 4px 4px 0 var(--c); }
.stamp.lg b { font-size: 2.6rem; }
.stamp.lg small { font-size: .7rem; margin-top: 6px; }

/* ---------------------------------------------------------------- Lead */
.lead { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--ink); }
.lead-main .thumb { aspect-ratio: 16 / 9; }
.lead-main { position: relative; }
.lead-main-body { position: relative; margin-top: 16px; }
.lead-main-body .stamp { position: absolute; top: -86px; right: 18px; }
.lead-main h2 { margin: 6px 0 10px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.lead-main h2 a, .lead-side h3 a, .card h3 a, .strip a { text-decoration: none; }
.lead-main .deck { margin: 0 0 10px; color: var(--ink-2); font-family: var(--serif); font-size: 1.12rem; line-height: 1.55; }
.lead-side { display: grid; gap: 26px; align-content: start; }
.lead-side article + article { padding-top: 26px; border-top: 1px solid var(--line); }
.lead-side .row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.lead-side h3 { margin: 6px 0 6px; font-size: 1.25rem; }
.lead-side .thumb { margin-bottom: 12px; }
@media (max-width: 900px) {
	.lead { grid-template-columns: 1fr; }
	.lead-main-body .stamp { top: -70px; right: 12px; width: 88px; height: 88px; }
	.lead-main-body .stamp b { font-size: 2rem; }
}

/* ---------------------------------------------------------------- Top rated strip */
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); counter-reset: n; margin: 0; padding: 0; list-style: none; }
.strip li { position: relative; padding: 16px 16px 16px 50px; border-right: 1px solid var(--line); counter-increment: n; }
.strip li:last-child { border-right: 0; }
.strip li::before { content: counter(n); position: absolute; left: 14px; top: 10px; font-family: var(--serif); font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.strip a { display: block; font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.3; margin-bottom: 8px; }
.strip .score-text { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 1000px) { .strip { grid-template-columns: 1fr 1fr; } .strip li { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .strip { grid-template-columns: 1fr; } .strip li { border-right: 0; } }

.score-text.t-essential { color: var(--t-essential); }
.score-text.t-excellent { color: var(--t-excellent); }
.score-text.t-good { color: var(--t-good); }
.score-text.t-mixed { color: var(--t-mixed); }
.score-text.t-skip { color: var(--t-skip); }

/* ---------------------------------------------------------------- Card grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 28px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; }
.card .media { position: relative; }
.card .media .stamp { position: absolute; right: 10px; bottom: -14px; }
.card-kicker { margin-top: 16px; min-height: 1em; }
.card h3 { margin: 4px 0 8px; font-size: 1.25rem; }
.card p { margin: 0 0 10px; color: var(--ink-2); font-size: .93rem; line-height: 1.6; }
.card .byline { margin-top: auto; }

/* ---------------------------------------------------------------- Pagination */
.pagination { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--ink); }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.page-numbers { min-width: 40px; padding: 6px 12px; text-align: center; text-decoration: none; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .9rem; }
.page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
a.page-numbers:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- Single */
.article-head { max-width: 860px; margin: 0 auto; text-align: center; }
.article-head h1 { margin: 10px 0 14px; font-size: clamp(2rem, 4.6vw, 3.1rem); }
.article-head .deck { margin: 0 auto 16px; max-width: 700px; color: var(--ink-2); font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; font-style: italic; }
.article-figure { margin: 28px 0 0; }
.article-figure img { width: 100%; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }

.article-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; margin-top: 40px; align-items: start; }
.article-body.no-aside { grid-template-columns: minmax(0, 760px); justify-content: center; }
.article-body > * { min-width: 0; }
@media (max-width: 960px) {
	.article-body { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.article-aside { order: -1; }
}

.entry-content { font-size: 1.08rem; line-height: 1.8; color: var(--ink-2); }
.entry-content > p:first-of-type::first-letter { float: left; font-family: var(--serif); font-size: 3.6rem; line-height: .9; font-weight: 800; padding: 6px 10px 0 0; color: var(--accent); }
.entry-content h2 { margin: 2em 0 .6em; font-size: 1.65rem; color: var(--ink); scroll-margin-top: 70px; }
.entry-content h3 { margin: 1.6em 0 .5em; font-size: 1.25rem; color: var(--ink); }
.entry-content strong { color: var(--ink); }
.entry-content a { color: var(--accent); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content li::marker { color: var(--accent); }
.entry-content blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--ink); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content th { border-bottom: 2px solid var(--ink); }
.entry-content hr { border: 0; border-top: 1px solid var(--ink); margin: 2.2em 0; }

.article-aside { position: sticky; top: 70px; display: grid; gap: 22px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 0 8px 8px 0; scrollbar-width: thin; }
@media (max-width: 960px) { .article-aside { position: static; max-height: none; overflow: visible; padding: 0; } }

.scorecard { background: var(--card); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--ink); }
.scorecard-top { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.scorecard-top .stamp { margin-left: 4px; }
.scorecard-top h2 { margin: 0 0 4px; font-size: .74rem; font-family: var(--sans); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.scorecard-top p { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.45; color: var(--ink); }
.scorecard dl { margin: 0; padding: 6px 20px; border-bottom: 1px solid var(--line); }
.scorecard dl div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.scorecard dl div:last-child { border-bottom: 0; }
.scorecard dt { color: var(--muted); flex: none; }
.scorecard dd { margin: 0; text-align: right; font-weight: 600; }
.scorecard .pc { padding: 14px 20px 18px; }
.scorecard h3 { margin: 6px 0 8px; font-family: var(--sans); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.scorecard .pros h3 { color: var(--t-excellent); }
.scorecard .cons h3 { color: var(--t-skip); }
.scorecard ul { list-style: none; margin: 0 0 8px; padding: 0; font-size: .88rem; line-height: 1.5; }
.scorecard li { position: relative; padding-left: 18px; margin-bottom: 5px; }
.scorecard .pros li::before { content: "+"; position: absolute; left: 2px; font-weight: 800; color: var(--t-excellent); }
.scorecard .cons li::before { content: "–"; position: absolute; left: 2px; font-weight: 800; color: var(--t-skip); }

.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.toc summary { cursor: pointer; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 10px 0 0; padding-left: 1.2em; font-size: .88rem; line-height: 1.45; }
.toc li { margin-bottom: 6px; }
.toc a { text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.tags a { padding: 3px 10px; border: 1px solid var(--ink); font-size: .78rem; font-weight: 700; text-decoration: none; letter-spacing: .04em; }
.tags a:hover { background: var(--ink); color: var(--paper); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; padding-top: 22px; border-top: 3px double var(--ink); }
.post-nav a { display: block; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; line-height: 1.35; }
.post-nav span { display: block; margin-bottom: 6px; font-family: var(--sans); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.post-nav .next { text-align: right; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { text-align: left; } }

/* ---------------------------------------------------------------- Page */
.page-article { max-width: 760px; margin: 0 auto; }
.page-figure { margin: 0 0 28px; }
.page-article h1 { text-align: center; margin: 0 0 30px; font-size: clamp(2rem, 4.4vw, 2.8rem); }
.page-article .entry-content > p:first-of-type::first-letter { all: unset; }

/* ---------------------------------------------------------------- Comments */
.comments-area { max-width: 760px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid var(--ink); }
.comments-title { font-size: 1.5rem; margin: 0 0 12px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: 24px; border-left: 2px solid var(--line); }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.comment-author .avatar { border-radius: 50%; }
.comment-metadata a { color: var(--muted); font-size: .8rem; text-decoration: none; }
.reply a { font-size: .82rem; font-weight: 700; }
.comment-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; font: inherit; font-size: .95rem; background: var(--card); color: var(--ink); border: 1px solid var(--ink); border-radius: 0;
}
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { margin: 0; }

/* ---------------------------------------------------------------- Buttons & search */
.search-form { display: flex; max-width: 460px; margin: 0 auto; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: 11px 14px; font: inherit; font-size: .95rem; background: var(--card); color: var(--ink); border: 1px solid var(--ink); border-right: 0; border-radius: 0; }
.search-form input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.search-form button, .comment-form .submit {
	padding: 11px 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer;
	font: 800 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; border-radius: 0;
}
.search-form button:hover, .comment-form .submit:hover { background: var(--accent); border-color: var(--accent); }

.empty { text-align: center; padding: 40px 16px; }
.empty .big { margin: 0; font-family: var(--serif); font-size: 5rem; font-weight: 800; line-height: 1; color: var(--accent); }
.empty h1 { margin: 10px 0; }

/* ---------------------------------------------------------------- Footer */
.footer-widgets { border-top: 3px double var(--ink); padding: 36px 0; }
.footer-widgets .wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 800px) { .footer-widgets .wrap { grid-template-columns: 1fr; } }
.footer-widgets .widget { font-size: .92rem; overflow-wrap: anywhere; }
.footer-widgets .widget-title, .footer-widgets .wp-block-heading, .footer-widgets .wp-block-search__label { margin: 0 0 12px; font-family: var(--sans); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.footer-widgets li a { text-decoration: none; }
.footer-widgets .wp-block-search__inside-wrapper { display: flex; }
.footer-widgets .wp-block-search__input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--ink); border-right: 0; background: var(--card); font: inherit; }
.footer-widgets .wp-block-search__button { margin: 0; padding: 9px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 800 .74rem var(--sans); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.footer-widgets .wp-block-latest-comments { padding: 0; }
.footer-widgets .wp-block-latest-comments__comment { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }

.site-footer { background: var(--ink); color: #cfc8bc; padding: 30px 0; font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer .brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 800; color: #fff; }
.site-footer .brand .dot { color: var(--accent); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: #cfc8bc; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0; width: 100%; color: #8f887c; font-size: .78rem; }

/* ---------------------------------------------------------------- WP core */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { margin-top: 6px; font-size: .82rem; color: var(--muted); text-align: center; font-style: italic; }
.card.sticky h3::before { content: "★ "; color: var(--accent); }
.bypostauthor > .comment-body .fn::after { content: " · Author"; color: var(--accent); font-size: .78rem; }
