/*
Theme Name: Sports Games Plus
Description: Theme for sportsgamesplus.com: free HTML5 sports games catalog with a news section.
Version: 1.1.0
Requires PHP: 8.0
Text Domain: sgp
*/

:root {
	--sgp-navy: #111144;
	--sgp-navy-2: #1c1c5c;
	--sgp-purple: #423780;
	--sgp-red: #dd2033;
	--sgp-red-dark: #b81828;
	--sgp-lime: #cbff3b;
	--sgp-bg: #f2f3fa;
	--sgp-surface: #ffffff;
	--sgp-ink: #1a1b38;
	--sgp-muted: #5c5f80;
	--sgp-line: #e1e3f0;
	--sgp-radius: 12px;
	--sgp-shadow: 0 1px 2px rgb(17 17 68 / 6%), 0 4px 14px rgb(17 17 68 / 6%);
	--sgp-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--sgp-bg);
	color: var(--sgp-ink);
	font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--sgp-purple); }
a:hover { color: var(--sgp-red); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h2 { font-size: 1.35rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sgp-wrap { max-width: var(--sgp-max); margin: 0 auto; padding: 0 16px; }

/* Header */
.sgp-header { background: linear-gradient(180deg, var(--sgp-navy) 0%, var(--sgp-navy-2) 100%); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgb(0 0 0 / 25%); }
.sgp-header__inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.sgp-logo { display: block; flex: 0 0 auto; }
.sgp-logo img { display: block; width: 220px; height: auto; }
.sgp-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.sgp-nav a, .sgp-nav summary { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; list-style: none; }
.sgp-nav summary::-webkit-details-marker { display: none; }
.sgp-nav a:hover, .sgp-nav summary:hover, .sgp-nav .is-current { background: rgb(255 255 255 / 12%); color: var(--sgp-lime); }
.sgp-dropdown { position: relative; }
.sgp-dropdown summary::after { content: " ▾"; font-size: .8em; }
.sgp-dropdown__menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--sgp-surface); border-radius: var(--sgp-radius); box-shadow: 0 12px 30px rgb(0 0 0 / 25%); padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.sgp-dropdown__menu a { color: var(--sgp-ink); font-weight: 500; padding: 6px 10px; }
.sgp-dropdown__menu a:hover { background: var(--sgp-bg); color: var(--sgp-red); }
.sgp-search { margin-left: auto; display: flex; }
.sgp-search input { width: 180px; border: 0; border-radius: 8px 0 0 8px; padding: 8px 12px; font: inherit; }
.sgp-search button { border: 0; border-radius: 0 8px 8px 0; background: var(--sgp-red); color: #fff; padding: 0 12px; cursor: pointer; font: inherit; }
.sgp-menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgb(255 255 255 / 30%); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }

@media (max-width: 900px) {
	.sgp-logo img { width: 170px; }
	.sgp-menu-toggle { display: block; }
	.sgp-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--sgp-navy-2); padding: 10px 16px 16px; gap: 2px; }
	.sgp-header.is-open .sgp-nav { display: flex; }
	.sgp-dropdown__menu { position: static; box-shadow: none; background: rgb(255 255 255 / 6%); }
	.sgp-dropdown__menu a { color: #fff; }
	.sgp-search { margin: 8px 0 0; }
	.sgp-search input { flex: 1; width: auto; }
}

/* Layout */
.sgp-main { padding: 24px 0 48px; }
.sgp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .sgp-layout { grid-template-columns: minmax(0, 1fr); } }
.sgp-card { background: var(--sgp-surface); border-radius: var(--sgp-radius); box-shadow: var(--sgp-shadow); padding: 20px; margin-bottom: 24px; }
.sgp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sgp-section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.sgp-breadcrumbs { font-size: .9rem; color: var(--sgp-muted); margin-bottom: 10px; }
.sgp-breadcrumbs a { color: var(--sgp-muted); }
.sgp-muted { color: var(--sgp-muted); }

/* Hero */
.sgp-hero { background: radial-gradient(1200px 300px at 20% 0%, var(--sgp-purple) 0%, var(--sgp-navy) 70%); color: #fff; border-radius: var(--sgp-radius); padding: 28px 24px; margin-bottom: 24px; }
.sgp-hero h1 { color: #fff; }
.sgp-hero p { margin: 0 0 16px; color: rgb(255 255 255 / 85%); max-width: 640px; }

/* Chips */
.sgp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sgp-chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--sgp-bg); color: var(--sgp-ink); text-decoration: none; font-size: .9rem; font-weight: 500; border: 1px solid var(--sgp-line); }
.sgp-chip:hover { border-color: var(--sgp-red); color: var(--sgp-red); }
.sgp-hero .sgp-chip { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 20%); color: #fff; }
.sgp-hero .sgp-chip:hover { background: var(--sgp-lime); color: var(--sgp-navy); border-color: var(--sgp-lime); }
.sgp-chip small { opacity: .7; }

/* Game grid */
.sgp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.sgp-game { background: var(--sgp-surface); border-radius: var(--sgp-radius); overflow: hidden; box-shadow: var(--sgp-shadow); transition: transform .15s ease, box-shadow .15s ease; }
.sgp-game:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgb(17 17 68 / 16%); }
.sgp-game a { display: block; color: var(--sgp-ink); text-decoration: none; }
.sgp-game__img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sgp-line); }
.sgp-game__body { padding: 8px 10px 10px; }
.sgp-game__title { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgp-game__sport { display: block; font-size: .8rem; color: var(--sgp-muted); }

/* Player */
.sgp-player { position: relative; width: 100%; max-height: 75vh; background: #000; border-radius: var(--sgp-radius); overflow: hidden; display: grid; place-items: center; }
.sgp-player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.55); transform: scale(1.03); }
.sgp-player__play { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 16px 28px; border: 0; border-radius: 999px; background: var(--sgp-red); color: #fff; font-family: inherit; font-weight: 700; font-size: 1.15rem; line-height: 1.2; cursor: pointer; box-shadow: 0 8px 28px rgb(221 32 51 / 45%); max-width: 90%; }
.sgp-player__play:hover { background: var(--sgp-red-dark); }
.sgp-player__icon { font-size: 1.3em; }
.sgp-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sgp-player:fullscreen { max-height: none; border-radius: 0; }
.sgp-player__bar { display: flex; justify-content: flex-end; margin: 8px 0 0; }
.sgp-player__fullscreen { background: none; border: 1px solid var(--sgp-line); border-radius: 8px; padding: 4px 12px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--sgp-muted); }
.sgp-player__fullscreen:hover { color: var(--sgp-red); border-color: var(--sgp-red); }
.sgp-note { font-size: .92rem; color: var(--sgp-muted); background: var(--sgp-bg); border-left: 3px solid var(--sgp-purple); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0 0; }

.sgp-about { display: flow-root; }
.sgp-about__thumb { float: left; width: 80px; height: 80px; border-radius: 10px; margin: 4px 16px 8px 0; object-fit: cover; }
.sgp-terms { margin-top: 16px; display: grid; gap: 8px; }

/* Promo */
.sgp-promo { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, var(--sgp-navy) 0%, var(--sgp-purple) 100%); color: #fff; border-radius: var(--sgp-radius); padding: 18px 20px; margin: 0 0 24px; }
.sgp-promo__media img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; }
.sgp-promo__body { flex: 1; }
.sgp-promo__title { font-weight: 700; font-size: 1.1rem; margin: 0 0 4px; color: var(--sgp-lime); }
.sgp-promo__text p { margin: 0 0 12px; color: rgb(255 255 255 / 88%); }
.sgp-promo__button { display: inline-block; background: var(--sgp-red); color: #fff; padding: 8px 18px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.sgp-promo__button:hover { background: #fff; color: var(--sgp-red); }
.sgp-promo--sidebar { flex-direction: column; align-items: flex-start; }

/* Sidebar */
.sgp-sidebar .sgp-card { padding: 16px; }
.sgp-sidebar h2 { font-size: 1.05rem; }
.sgp-sport-list { list-style: none; margin: 0; padding: 0; }
.sgp-sport-list li { break-inside: avoid; }
.sgp-sport-list a { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--sgp-line); text-decoration: none; color: var(--sgp-ink); }
.sgp-sport-list a:hover { color: var(--sgp-red); }
.sgp-sport-list span { color: var(--sgp-muted); font-size: .85rem; }

/* News */
.sgp-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.sgp-post { background: var(--sgp-surface); border-radius: var(--sgp-radius); box-shadow: var(--sgp-shadow); overflow: hidden; }
.sgp-post__img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sgp-line); }
.sgp-post__body { padding: 14px 16px 16px; }
.sgp-post__title { font-size: 1.1rem; margin: 0 0 6px; }
.sgp-post__title a { color: var(--sgp-ink); text-decoration: none; }
.sgp-post__meta { font-size: .85rem; color: var(--sgp-muted); }
.sgp-entry { font-size: 1.05rem; }
.sgp-author { display: flex; gap: 14px; align-items: flex-start; border-top: 1px solid var(--sgp-line); margin-top: 20px; padding-top: 16px; }
.sgp-author img { border-radius: 50%; flex: 0 0 auto; }
.sgp-author p { margin: 0 0 4px; }
.sgp-author__name { font-weight: 700; }
.sgp-author__name a { color: var(--sgp-ink); text-decoration: none; }
.sgp-entry img { border-radius: 10px; }

/* Forms */
.sgp-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.sgp-form input[type="text"], .sgp-form input[type="email"], .sgp-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--sgp-line); border-radius: 8px; font: inherit; background: #fff; }
.sgp-form input:focus, .sgp-form textarea:focus { outline: 2px solid var(--sgp-purple); outline-offset: 1px; }
.sgp-form__hp { position: absolute; left: -9999px; }
.sgp-button { background: var(--sgp-red); color: #fff; border: 0; border-radius: 999px; padding: 10px 24px; font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; cursor: pointer; }
.sgp-button:hover { background: var(--sgp-red-dark); }
.sgp-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.sgp-notice p { margin: 0; }
.sgp-notice--ok { background: #e7f8ec; color: #135c2b; }
.sgp-notice--error { background: #fdecee; color: #8a1220; }

/* Cookie consent */
.sgp-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; max-width: 760px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; background: var(--sgp-surface); color: var(--sgp-ink); border-radius: var(--sgp-radius); box-shadow: 0 12px 40px rgb(17 17 68 / 30%); padding: 16px 20px; }
.sgp-consent[hidden] { display: none; }
.sgp-consent p { margin: 0; flex: 1 1 320px; font-size: .95rem; }
.sgp-consent__actions { display: flex; gap: 8px; }
.sgp-button--ghost { background: transparent; color: var(--sgp-ink); border: 1px solid var(--sgp-line); }
.sgp-button--ghost:hover { background: var(--sgp-bg); color: var(--sgp-ink); }

/* Pagination */
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.page-numbers { padding: 6px 12px; border-radius: 8px; background: var(--sgp-surface); box-shadow: var(--sgp-shadow); text-decoration: none; color: var(--sgp-ink); }
.page-numbers.current { background: var(--sgp-purple); color: #fff; }

/* Footer */
.sgp-footer { background: var(--sgp-navy); color: rgb(255 255 255 / 75%); padding: 28px 0; font-size: .92rem; }
.sgp-footer a { color: #fff; }
.sgp-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.sgp-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
