/*
Theme Name: RACE22 Legacy
Theme URI: https://race22.online
Author: Roanoke Creative
Description: Dark, photo-forward archive theme for RACE22.com. Most Read, Best of RACE22, season browsing, Races & Series hubs, sponsor slots, and a Latest row for new stories.
Version: 1.2.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: race22
*/

:root {
	--bg: #0f1113;
	--panel: #181b1f;
	--line: #343a40;
	--text: #f2f2ee;
	--soft: #d0d3d6;
	--mute: #a3a8ad;
	--accent: #01fe0d;
	--cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
	--body: Barlow, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 17px; line-height: 1.5; }
img { max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p, figure, blockquote { margin: 0; }

.r22-wrap { max-width: 1216px; margin: 0 auto; padding: 0 32px; }
.r22-skip { position: absolute; left: -9999px; }
.r22-skip:focus { left: 16px; top: 16px; z-index: 10; padding: 12px 16px; background: var(--accent); color: var(--bg); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Shared type */
.r22-label { font-family: var(--cond); font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.r22-kicker { font-family: var(--cond); font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.r22-h2 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 48px; line-height: 1; text-transform: uppercase; }
.r22-more { padding: 12px 0; font-family: var(--cond); font-weight: 600; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.r22-more:hover { color: var(--text); }
.r22-section { padding-top: 72px; display: flex; flex-direction: column; gap: 24px; }
.r22-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.r22-section-head p { color: var(--mute); font-size: 16px; }

/* Header */
.r22-header { border-bottom: 1px solid var(--line); }
.r22-header .r22-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 32px; }
.r22-logo { display: flex; align-items: center; padding: 12px 0; }
.r22-logo img { display: block; height: 80px; width: auto; }
.r22-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 28px; font-family: var(--cond); font-weight: 600; font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase; }
.r22-nav a { display: block; padding: 14px 0; }
.r22-nav .current-menu-item > a { color: var(--accent); }

/* Hero */
.r22-hero-photo { display: block; width: 100%; height: 460px; object-fit: cover; }
.r22-hero-text { display: flex; flex-wrap: wrap; gap: 24px 64px; align-items: flex-end; justify-content: space-between; padding: 32px 0 56px; border-bottom: 1px solid var(--line); }
.r22-hero-main { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.r22-hero-main .r22-kicker { font-size: 17px; letter-spacing: 0.16em; }
.r22-hero-main h1 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: clamp(44px, 6.6vw, 86px); line-height: 0.94; text-transform: uppercase; letter-spacing: -0.01em; text-wrap: balance; }
.r22-hero-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.r22-hero-side p { font-size: 19px; color: var(--soft); }
.r22-btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 28px; background: var(--accent); color: var(--bg); font-family: var(--cond); font-weight: 600; font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; border: 0; cursor: pointer; }
.r22-btn:hover { background: var(--text); color: var(--bg); }

/* Season rail */
.r22-rail { overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line) var(--bg); }
.r22-rail ul { list-style: none; margin: 0; padding: 0; display: flex; width: max-content; }
.r22-rail a { display: flex; align-items: center; min-height: 72px; padding: 0 20px; font-family: var(--cond); font-style: italic; font-weight: 700; font-size: 34px; color: var(--mute); }
.r22-rail a:hover, .r22-rail a[aria-current] { color: var(--accent); }

/* Cards */
.r22-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 32px 24px; }
.r22-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.r22-card-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--panel); }
.r22-card h3 { font-weight: 600; font-size: 22px; line-height: 1.2; }
.r22-card-meta { font-size: 15px; color: var(--mute); }
.r22-card.is-lead h3 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: clamp(36px, 4.4vw, 52px); line-height: 0.95; text-transform: uppercase; }
.r22-card.is-lead .r22-card-img { aspect-ratio: 16 / 9; }

/* Most read */
.r22-ranks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.r22-rank a { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 250px; padding: 20px; background: var(--panel); }
.r22-rank-num { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 84px; line-height: 0.85; color: var(--accent); }
.r22-rank-title { font-weight: 600; font-size: 18px; line-height: 1.25; }
.r22-rank-meta { margin-top: auto; font-size: 14px; color: var(--mute); }
@media (min-width: 900px) { .r22-ranks { grid-template-columns: repeat(5, minmax(0, 1fr)); } .r22-rank a { padding: 16px; } }
.r22-ranks.is-long { grid-template-columns: 1fr; gap: 0; }
.r22-ranks.is-long .r22-rank a { flex-direction: row; align-items: baseline; min-height: 0; gap: 20px; padding: 16px 0; background: none; border-top: 1px solid var(--line); }
.r22-ranks.is-long .r22-rank-num { font-size: 40px; min-width: 56px; }
.r22-ranks.is-long .r22-rank-meta { margin: 0 0 0 auto; white-space: nowrap; }

/* Best of */
.r22-picks { display: flex; flex-wrap: wrap; gap: 24px; }
.r22-picks-lead { flex: 3 1 480px; min-width: 0; }
.r22-picks-rest { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* Races & series */
.r22-races ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; font-family: var(--cond); font-weight: 600; font-size: 24px; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.02em; }
.r22-races a { display: flex; align-items: center; min-height: 72px; padding: 8px 20px; border: 1px solid var(--line); }
.r22-races a:hover { border-color: var(--accent); }
.r22-races.is-index ul { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; font-size: 20px; }
.r22-races.is-index a { min-height: 52px; }
.r22-races-intro { max-width: 640px; color: var(--soft); }

/* Sponsor */
.r22-sponsor { display: flex; flex-direction: column; gap: 10px; }
.r22-sponsor-box { border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.r22-sponsor-box img { display: block; margin: 0 auto; }

/* Archive + search */
.r22-page-head { padding: 48px 0 32px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.r22-page-head h1 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: clamp(44px, 6.6vw, 86px); line-height: 0.94; text-transform: uppercase; text-wrap: balance; }
.r22-page-intro { max-width: 720px; font-size: 19px; color: var(--soft); }
.r22-page-intro p + p { margin-top: 12px; }
.r22-page-intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pagination { padding-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--cond); font-weight: 600; font-size: 20px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; background: var(--panel); }
.pagination .page-numbers.current { background: var(--accent); color: var(--bg); }
.r22-search { display: flex; flex-wrap: wrap; gap: 12px; max-width: 720px; }
.r22-search input[type="search"] { flex: 1 1 280px; min-width: 0; height: 52px; padding: 0 16px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); }

/* Story */
.r22-crumbs { display: flex; flex-wrap: wrap; gap: 0 10px; padding-top: 14px; font-family: var(--cond); font-weight: 600; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.r22-crumbs a, .r22-crumbs span { padding: 10px 0; color: var(--mute); }
.r22-crumbs a:hover, .r22-crumbs a:last-child { color: var(--accent); }
.r22-story-head { display: flex; flex-direction: column; gap: 20px; padding: 20px 0 36px; max-width: 980px; }
.r22-story-head h1 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: clamp(46px, 7.4vw, 96px); line-height: 0.94; text-transform: uppercase; letter-spacing: -0.01em; text-wrap: balance; }
.r22-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.r22-byline a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.r22-badge { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--accent); color: var(--accent); font-family: var(--cond); font-weight: 600; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; }
.r22-story-photo { display: flex; flex-direction: column; gap: 10px; }
.r22-story-photo img { display: block; width: 100%; max-height: 720px; object-fit: cover; }
.r22-story-photo figcaption, .r22-content figcaption, .r22-content .wp-caption-text { font-size: 15px; line-height: 1.4; color: var(--mute); }
.r22-story-body { display: flex; flex-wrap: wrap; gap: 48px 72px; padding: 48px 0 72px; }
.r22-content { flex: 999 1 560px; min-width: 0; max-width: 720px; font-size: 20px; line-height: 1.65; color: #e4e6e8; overflow-wrap: break-word; }
.r22-content > * + * { margin-top: 24px; }
.r22-content > p:first-of-type { font-size: 24px; line-height: 1.5; color: var(--text); }
.r22-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.r22-content a:hover { color: var(--text); }
.r22-content h2, .r22-content h3, .r22-content h4 { margin-top: 40px; font-family: var(--cond); font-weight: 600; font-size: 32px; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text); }
.r22-content h3, .r22-content h4 { font-size: 26px; }
.r22-content blockquote { margin: 36px 0; padding: 4px 0 4px 28px; border-left: 4px solid var(--accent); font-family: var(--cond); font-style: italic; font-weight: 700; font-size: 38px; line-height: 1.1; color: var(--text); }
.r22-content blockquote p + p { margin-top: 12px; }
.r22-content figure, .r22-content .wp-caption { max-width: 100%; margin-left: 0; margin-right: 0; }
.r22-content iframe, .r22-content video, .r22-content audio { max-width: 100%; }
.r22-content table { width: 100%; border-collapse: collapse; font-size: 17px; }
.r22-content th, .r22-content td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.r22-content .alignleft { float: left; margin: 6px 24px 16px 0; max-width: 50%; }
.r22-content .alignright { float: right; margin: 6px 0 16px 24px; max-width: 50%; }
.r22-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.r22-tags { clear: both; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--cond); font-weight: 600; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; }
.r22-tags a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--panel); color: var(--text); text-decoration: none; }
.r22-tags a:hover { color: var(--accent); }
.r22-aside { flex: 1 1 300px; min-width: 0; max-width: 360px; display: flex; flex-direction: column; gap: 40px; }
.r22-aside h2 { margin-bottom: 8px; font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 32px; line-height: 1; text-transform: uppercase; }
.r22-aside-list { display: flex; flex-direction: column; }
.r22-aside-list a { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-top: 1px solid var(--line); }
.r22-aside-list strong { font-weight: 600; font-size: 18px; line-height: 1.25; }
.r22-aside-list span { font-size: 14px; color: var(--mute); }
.r22-aside-list a.r22-more { display: block; }
.r22-adjacent { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px; padding-bottom: 72px; }
.r22-adjacent a { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--panel); }
.r22-adjacent a.is-next { text-align: right; }
.r22-adjacent strong { font-weight: 600; font-size: 22px; line-height: 1.2; }
.r22-after { border-top: 1px solid var(--line); padding-top: 56px; display: flex; flex-direction: column; gap: 24px; }

/* Footer */
.r22-footer { margin-top: 72px; }
.r22-footer .r22-wrap > div { border-top: 1px solid var(--line); padding: 32px 0 48px; display: flex; flex-wrap: wrap; gap: 24px 64px; justify-content: space-between; }
.r22-footer p { flex: 1 1 420px; min-width: 0; max-width: 560px; font-size: 16px; color: var(--soft); }
.r22-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.r22-credit { color: var(--mute); }

@media (max-width: 600px) {
	.r22-wrap { padding: 0 20px; }
	.r22-logo img { height: 60px; }
	.r22-hero-photo { height: 280px; }
	.r22-h2 { font-size: 38px; }
	.r22-content { font-size: 18px; }
	.r22-content > p:first-of-type { font-size: 21px; }
	.r22-content blockquote { font-size: 30px; }
	.r22-content .alignleft, .r22-content .alignright { float: none; margin: 0; max-width: 100%; }
}
