/*
Theme Name: Matchday Pro
Description: A fast, professional sports news theme with a live-style headline ticker, hero front page, category sections, dark mode and a clean article layout.
Version: 1.1.0
Requires at least: 6.0
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: matchday
Tags: news, blog, sports, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
	--ink: #0d1b2a;
	--bg: #f3f5f7;
	--card: #ffffff;
	--text: #1b2735;
	--muted: #5b6776;
	--line: #dde2e8;
	--accent: #e11d48;
	--on-accent: #ffffff;
	--radius: 6px;
	--wrap: 1240px;
	--head: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
	--body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
	--ink: #050b12;
	--bg: #0a121c;
	--card: #111e2c;
	--text: #e6ebf1;
	--muted: #92a0b1;
	--line: #213244;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.08; margin: 0 0 .5em; letter-spacing: .005em; }
ul, ol { padding-left: 1.2em; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 800px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: #fff; border-bottom: 3px solid var(--accent); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand-name { font-family: var(--head); font-weight: 800; font-size: 1.9rem; letter-spacing: .01em; color: #fff; }
.brand-name:hover { color: #fff; }
.custom-logo { max-height: 44px; width: auto; }
.primary-nav { flex: 1; }
.primary-nav .menu { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: 8px 12px; font-family: var(--head); font-weight: 600; font-size: 1.15rem; color: #dbe4ee; border-radius: var(--radius); }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { color: #fff; background: rgba(255,255,255,.1); }
.primary-nav li { position: relative; }
.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; list-style: none; margin: 0; padding: 6px; background: var(--ink); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.header-actions { display: flex; gap: 4px; margin-left: auto; }
.icon-btn { background: none; border: 0; color: #fff; width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.menu-toggle { display: none; }
.header-search { background: var(--ink); padding: 0 0 16px; }
.header-search[hidden] { display: none; }

.search-form { display: flex; gap: 8px; max-width: 640px; }
.search-form input { flex: 1; min-width: 0; padding: 12px 14px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
.search-form button, .btn { display: inline-block; padding: 11px 20px; font: 700 1rem var(--body); background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); border-radius: var(--radius); cursor: pointer; }
.search-form button:hover, .btn:hover { filter: brightness(.9); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); padding: 8px 16px; }
.btn-ghost:hover { background: var(--accent); border-color: var(--accent); }

/* Ticker */
.ticker { display: flex; align-items: stretch; background: var(--card); border-bottom: 1px solid var(--line); overflow: hidden; }
.ticker-label { flex: none; display: flex; align-items: center; padding: 0 18px; background: var(--accent); color: var(--on-accent); font-family: var(--head); font-weight: 800; font-size: 1.1rem; }
.ticker-viewport { flex: 1; overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: md-ticker 60s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker-list li { padding: 11px 28px; font-weight: 600; font-size: .95rem; white-space: nowrap; border-right: 1px solid var(--line); }
@keyframes md-ticker { to { transform: translateX(-50%); } }

/* Shared bits */
.badge { display: inline-block; font: 700 .8rem/1 var(--body); color: var(--accent); margin-bottom: 8px; }
.badge:hover { text-decoration: underline; }
.badge-solid { background: var(--accent); color: var(--on-accent); padding: 5px 9px; border-radius: 3px; margin-bottom: 12px; }
.meta { margin: 0; font-size: .875rem; color: var(--muted); }
.meta-light { color: rgba(255,255,255,.85); }
.section-title { font-size: 1.9rem; padding-left: 12px; border-left: 5px solid var(--accent); margin-bottom: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-link { font-weight: 700; font-size: .95rem; color: var(--accent); }
.section-link:hover { text-decoration: underline; }
.thumb-fallback { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--ink), var(--line)); }

/* Hero */
.front { padding-top: 24px; }
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 40px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink); min-height: 460px; }
.hero-link { position: absolute; inset: 0; display: block; }
.hero-link img, .hero-link .thumb-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(5,11,18,.92) 0%, rgba(5,11,18,.35) 55%, rgba(5,11,18,0) 100%); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px; color: #fff; display: flex; flex-direction: column; align-items: flex-start; }
.hero-title { font-family: var(--head); font-weight: 800; font-size: clamp(2.2rem, 4.6vw, 3.9rem); line-height: 1; margin-bottom: 12px; max-width: 18ch; text-wrap: balance; }
.hero-link:hover .hero-title { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }

/* Cards */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ink); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 16px 18px 18px; }
.card-title { font-size: 1.55rem; margin-bottom: 8px; }
.card-excerpt { margin: 0 0 10px; color: var(--muted); font-size: 1rem; }
.card-row { flex-direction: row; }
.card-row .card-media { flex: none; width: 120px; aspect-ratio: auto; }
.card-row .card-body { padding: 12px 14px; }
.card-row .card-title { font-size: 1.2rem; margin-bottom: 4px; }
.card-row .badge { margin-bottom: 4px; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; margin-bottom: 48px; }
.more { margin: 28px 0 0; }
.cat-block { margin-bottom: 44px; }
.sidebar .widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.widget-title { font-size: 1.4rem; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.rank-list { counter-reset: r; list-style: none; padding: 0; }
.rank-list li { counter-increment: r; display: flex; gap: 12px; font-weight: 600; }
.rank-list li::before { content: counter(r); font-family: var(--head); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--accent); min-width: 1.2ch; }

/* Archive */
.archive-head { padding: 36px 0 28px; }
.archive-title { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 10px; }
.archive-desc { color: var(--muted); max-width: 60ch; margin: 0 0 16px; }
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font-weight: 600; }
.page-numbers.current, a.page-numbers:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Article */
.article { padding-top: 32px; min-width: 0; }
.article-title { font-size: clamp(2.4rem, 5.6vw, 4rem); line-height: 1; margin-bottom: 14px; text-wrap: balance; }
.article-dek { font-size: 1.25rem; color: var(--muted); margin: 0 0 20px; max-width: 60ch; }
.byline { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-block: 1px solid var(--line); margin-bottom: 24px; }
.byline .meta { display: block; }
.byline-name { font-weight: 700; }
.avatar { border-radius: 50%; }
.article-media { margin: 0 0 28px; }
.article-media img { width: 100%; border-radius: var(--radius); }
.article-media figcaption { font-size: .875rem; color: var(--muted); margin-top: 8px; }
.entry { max-width: 68ch; font-size: 1.15rem; line-height: 1.7; }
.entry > * + * { margin-top: 1.2em; }
.entry h2 { font-size: 2.1rem; margin-top: 1.6em; }
.entry h3 { font-size: 1.6rem; margin-top: 1.4em; }
.entry a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry blockquote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 5px solid var(--accent); font-family: var(--head); font-size: 1.7rem; line-height: 1.2; font-weight: 600; }
.entry table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.entry th, .entry td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.entry th { font-family: var(--head); font-size: 1.1rem; background: var(--card); }
.entry .alignwide { max-width: none; }
.article-foot { margin-top: 36px; }
.tags a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0; }
.share-label { font-weight: 700; margin-right: 6px; }
.author-box { display: flex; gap: 16px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.author-box p { margin: 4px 0 0; color: var(--muted); }
.related { margin-top: 48px; }

/* Comments */
.comments { margin-top: 48px; max-width: 68ch; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-author .avatar { float: left; margin-right: 12px; }
.comment-metadata { font-size: .85rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 11px 13px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
.comment-form .submit { padding: 11px 22px; font: 700 1rem var(--body); background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--radius); cursor: pointer; }

/* Footer */
.site-footer { background: var(--ink); color: #c3cfdc; margin-top: 24px; border-top: 3px solid var(--accent); }
.footer-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-block: 40px; }
.site-footer .widget-title { color: #fff; }
.site-footer .widget li { border-color: rgba(255,255,255,.12); }
.footer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; }
.footer-bar p { margin: 0; }
.footer-nav .menu { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* WordPress core */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .gallery-caption { font-size: .875rem; color: var(--muted); }
.sticky .card-title::before { content: "Pinned"; font: 700 .75rem var(--body); background: var(--accent); color: var(--on-accent); padding: 3px 7px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }


/* League table */
.league table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.league th, .league td { padding: 8px 5px; text-align: center; border-bottom: 1px solid var(--line); }
.league th { font-family: var(--head); font-size: 1rem; color: var(--muted); font-weight: 700; }
.league .t-team { text-align: left; font-weight: 600; width: 100%; }
.league .t-pos { color: var(--muted); font-weight: 700; }
.league .t-pts { font-weight: 800; }
.league tr.is-top td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.league tr.is-bottom td:first-child { box-shadow: inset 4px 0 0 var(--muted); }
.league-scroll { overflow-x: auto; }
.widget-table { padding: 20px 16px; }
.features-strip { margin-bottom: 36px; }

/* Responsive */
@media (max-width: 1024px) {
	.layout { grid-template-columns: 1fr; }
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
	.hero { grid-template-columns: 1fr; }
	.hero-main { min-height: 400px; }
	.hero-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
	.menu-toggle { display: grid; }
	.primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); padding: 8px 20px 20px; border-bottom: 3px solid var(--accent); }
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .sub-menu { display: block; position: static; border: 0; padding-left: 14px; }
	.header-actions { margin-left: auto; }
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
	.footer-widgets { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.hero-text { padding: 20px; }
	.hero-main { min-height: 360px; }
	.hero-side { grid-template-columns: 1fr; }
	.grid-4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.ticker-track { animation: none; }
	.card-media img { transition: none; }
}
