/*
Theme Name: Team Hayat
Theme URI: https://teamhayat.com
Author: Team Hayat
Description: Team Hayat studio site. Child theme of Twenty Twenty-Five with a sidebar layout. See docs/design.md.
Template: twentytwentyfive
Version: 0.3.3
Requires at least: 6.7
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teamhayat
*/

/* Colours, fonts and widths live in theme.json. This file is layout and components.
   Mockups for this design: development/ui/. */

:root {
	--th-sidebar: 272px;
	--th-radius: 12px;
	--th-base: var(--wp--preset--color--base);
	--th-text: var(--wp--preset--color--contrast);
	--th-gold: var(--wp--preset--color--accent-1);
	--th-sky: var(--wp--preset--color--accent-2);
	--th-coral: var(--wp--preset--color--accent-3);
	--th-muted: var(--wp--preset--color--accent-4);
	--th-panel: var(--wp--preset--color--accent-5);
	--th-border: var(--wp--preset--color--accent-6);
	--th-green: #7fd1a4;
	--th-violet: #b79cff;
}

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
.wp-site-blocks *, .wp-site-blocks *::before, .wp-site-blocks *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------------------------------------------------------------------------
   Layout: fixed sidebar on desktop, top bar + drawer on mobile
   ------------------------------------------------------------------------- */
@media (min-width: 901px) {
	.wp-site-blocks { padding-left: var(--th-sidebar); }
	.th-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--th-sidebar); }
}

.wp-site-blocks > * + * { margin-block-start: 0; }

.th-sidebar {
	z-index: 40;
	display: flex; flex-direction: column; gap: 28px;
	height: 100vh; overflow-y: auto;
	padding: 28px 20px;
	background: linear-gradient(180deg, #151826 0%, var(--th-base) 100%);
	border-right: 1px solid var(--th-border);
}
.th-sidebar a { text-decoration: none; }
.th-sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.th-brand { display: grid; justify-items: start; gap: 6px; color: var(--th-text); }
.th-brand:hover { color: var(--th-text); }
.th-brand-logo { display: block; width: 132px; height: auto; }
.th-brand-sub { color: var(--th-muted); font-size: 0.75rem; line-height: 1.2; }

.th-menu { display: flex; flex-direction: column; gap: 28px; flex: 1; }
.th-nav-label {
	margin: 0 0 8px 12px; color: var(--th-muted);
	font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.th-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.th-nav a {
	display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px;
	color: var(--th-text); font-weight: 500; font-size: 0.95rem; line-height: 1.3;
}
.th-nav a:hover { background: var(--th-panel); color: var(--th-text); }
.th-nav a[aria-current="page"] { background: var(--th-panel); box-shadow: inset 3px 0 0 var(--th-gold); }
.th-nav svg { flex: none; color: var(--th-muted); }
.th-game-link img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.th-game-meta { display: grid; line-height: 1.25; }
.th-game-meta small { color: var(--th-muted); font-size: 0.75rem; font-weight: 400; }

.th-sidebar-foot { margin-top: auto; color: var(--th-muted); font-size: 0.85rem; }
.th-sidebar-foot a { color: var(--th-muted); text-decoration: underline; text-underline-offset: 3px; }

/* Social links (inc/social.php). Icons: 40px targets; list: icon, name, handle. */
.th-social { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.th-social a { color: var(--th-muted); text-decoration: none; }
.th-social-icons a {
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
	background: var(--th-panel); border: 1px solid var(--th-border);
}
.th-sidebar-foot .th-social-icons a { text-decoration: none; }
.th-social a:hover, .th-social a:focus-visible { color: var(--th-gold); border-color: var(--th-gold); }
.th-social a:focus-visible { outline: 2px solid var(--th-gold); outline-offset: 2px; }
.th-social-list { flex-direction: column; gap: 10px; margin: 1em 0; }
.th-social-list a { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--th-text); }
.th-social-list a strong { margin-right: 4px; }
.th-social-list a span { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--th-border); }
.th-social-list a:hover span, .th-social-list a:focus-visible span { text-decoration-color: currentColor; }

.th-menu-btn {
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
	background: var(--th-panel); border: 1px solid var(--th-border); color: var(--th-text);
}
.th-menu-btn[hidden] { display: none; }

@media (max-width: 900px) {
	.th-header { position: sticky; top: 0; z-index: 40; }
	.th-sidebar {
		height: auto; overflow: visible; gap: 0; padding: 12px 20px;
		background: rgba(17, 19, 28, 0.94); backdrop-filter: blur(8px);
		border-right: 0; border-bottom: 1px solid var(--th-border);
	}
	.th-brand-sub { display: none; }
	.th-brand-logo { width: 92px; }
	.th-menu { padding-top: 20px; }
	/* With JS the menu becomes a drawer under the top bar. */
	.th-js .th-menu { display: none; }
	.th-js .th-sidebar.is-open .th-menu {
		display: flex; max-height: calc(100vh - 69px); overflow-y: auto; padding-bottom: 20px;
	}
	.th-sidebar-foot { margin-top: 0; }
}
@media (min-width: 901px) { .th-menu-btn { display: none !important; } }

/* ---------------------------------------------------------------------------
   Page shell
   ------------------------------------------------------------------------- */
.th-page { box-sizing: border-box; max-width: 1120px; margin: 0 auto; padding: 48px 48px 64px; }
.th-article { padding-top: 48px; }
@media (max-width: 900px) { .th-page { padding: 28px 20px 48px; } }

.th-eyebrow { margin: 0 0 8px; color: var(--th-gold); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.th-lede { margin: 0 0 32px; max-width: 60ch; color: var(--th-muted); font-size: 1.15rem; }
.th-page > h1, .th-page > .wp-block-post-title { margin-top: 0; }

.th-footer { padding: 24px 48px 40px; color: var(--th-muted); border-top: 1px solid var(--th-border); }
.th-footer a { color: var(--th-muted); }
@media (max-width: 900px) { .th-footer { padding: 24px 20px 32px; } }

/* ---------------------------------------------------------------------------
   Chips, pills, buttons
   ------------------------------------------------------------------------- */
.th-chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px; flex: none;
	border: 1px solid var(--th-border); border-radius: 999px;
	color: var(--th-text); font-size: 0.875rem; font-weight: 500; line-height: 1; text-decoration: none;
}
.th-chip:hover { border-color: var(--th-gold); color: var(--th-text); }
.th-chip[aria-current="true"] { background: var(--th-gold); border-color: var(--th-gold); color: var(--th-base); }
.th-chip img { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; }
.th-chip-tag { min-height: 28px; padding: 4px 10px; color: var(--th-muted); font-size: 0.8rem; }
.th-chip-tag::before { content: "#"; opacity: 0.6; }

.th-pill, .th-pill-terms a {
	display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
	font-size: 0.75rem; font-weight: 600; line-height: 1.6; text-decoration: none;
}
.th-pill-terms { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.th-pill-terms .wp-block-post-terms__separator { display: none; }
.th-pill-game a { background: rgba(232, 181, 77, 0.14); color: var(--th-gold); }
.th-pill-type a, .th-pill-devlog { background: rgba(127, 166, 255, 0.14); color: var(--th-sky); }
.th-pill-type a[href*="/announcements/"], .th-pill-announcements { background: rgba(255, 122, 107, 0.14); color: var(--th-coral); }
.th-pill-type a[href*="/releases/"], .th-pill-releases { background: rgba(127, 209, 164, 0.14); color: var(--th-green); }
.th-pill-type a[href*="/guides/"], .th-pill-guides { background: rgba(183, 156, 255, 0.14); color: var(--th-violet); }
.th-pill-terms a:hover { filter: brightness(1.2); }
.th-pill-status { background: rgba(17, 19, 28, 0.85); border: 1px solid rgba(127, 209, 164, 0.5); color: var(--th-green); }
.th-pill-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.th-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border-radius: 10px; font-size: 0.95rem; font-weight: 600; line-height: 1.2; text-decoration: none; }
.th-btn-primary { background: var(--th-gold); color: var(--th-base); }
.th-btn-primary:hover { background: var(--th-sky); color: var(--th-base); }
.th-btn-ghost { border: 1px solid var(--th-border); background: rgba(17, 19, 28, 0.55); color: var(--th-text); }
.th-btn-ghost:hover { border-color: var(--th-gold); color: var(--th-text); }
.th-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------------------
   News filters
   ------------------------------------------------------------------------- */
.th-filters {
	display: grid; gap: 14px; margin: 0 0 28px; padding: 18px;
	background: var(--th-panel); border: 1px solid var(--th-border); border-radius: var(--th-radius);
}
.th-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.th-filter-label { width: 72px; color: var(--th-muted); font-size: 0.8rem; font-weight: 600; }
.th-search {
	flex: 1 1 220px; min-height: 40px; padding: 8px 14px; border-radius: 999px;
	border: 1px solid var(--th-border); background: var(--th-base); color: var(--th-text); font: inherit; font-size: 0.95rem;
}
.th-filter-summary { display: flex; justify-content: space-between; gap: 16px; margin: -12px 0 20px; color: var(--th-muted); font-size: 0.875rem; }
.th-empty { padding: 48px; text-align: center; color: var(--th-muted); border: 1px dashed var(--th-border); border-radius: var(--th-radius); }

@media (max-width: 900px) {
	.th-filter-row:not(form) { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
	.th-filter-label { display: none; }
	form.th-filter-row .th-filter-label { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------- */
.th-cards { display: grid !important; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 0; padding: 0; list-style: none; }
.th-cards > li { margin: 0 !important; display: flex; }
.th-card {
	display: flex; flex-direction: column; width: 100%; overflow: hidden; margin: 0 !important;
	background: var(--th-panel); border: 1px solid var(--th-border); border-radius: var(--th-radius);
	transition: border-color 0.15s, transform 0.15s;
}
.th-card:hover { border-color: #4a4f6a; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .th-card { transition: none; } .th-card:hover { transform: none; } }
.th-card-media { margin: 0 !important; aspect-ratio: 1200 / 630; background: #232738; overflow: hidden; }
.th-card-media img, .th-card-media a { display: block; width: 100%; height: 100% !important; object-fit: cover; }
.th-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; margin: 0 !important; padding: 18px 20px 20px; }
.th-card-body > * { margin: 0 !important; }
.th-card-title { font-size: 1.25rem; line-height: 1.25; }
.th-card-title a { color: var(--th-text); text-decoration: none; }
.th-card-title a:hover { color: var(--th-gold); }
.th-card-excerpt, .th-card-excerpt p { margin: 0; color: var(--th-muted); font-size: 0.95rem; }
.th-card-excerpt .wp-block-post-excerpt__more-text { display: none; }
.th-meta-row { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--th-muted); font-size: 0.8rem; }
.th-meta-row > * { margin: 0 !important; }
.th-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto !important; padding-top: 6px; }
.th-card-tags a {
	display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px;
	border: 1px solid var(--th-border); border-radius: 999px; color: var(--th-muted); font-size: 0.8rem; text-decoration: none;
}
.th-card-tags a::before { content: "#"; opacity: 0.6; margin-right: 2px; }
.th-card-tags a:hover { border-color: var(--th-gold); color: var(--th-text); }
.th-card-tags .wp-block-post-terms__separator { display: none; }

/* Newest post is featured on the first, unfiltered page. */
@media (min-width: 901px) {
	body.home:not(.paged):not(.search) .th-cards > li:first-child { grid-column: 1 / -1; }
	body.home:not(.paged):not(.search) .th-cards > li:first-child .th-card { display: grid; grid-template-columns: 1.3fr 1fr; }
	body.home:not(.paged):not(.search) .th-cards > li:first-child .th-card-media { aspect-ratio: auto; min-height: 320px; }
	body.home:not(.paged):not(.search) .th-cards > li:first-child .th-card-title { font-size: 1.8rem; }
}

.th-cards-games { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.th-card-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 20px; overflow-x: auto; padding-bottom: 8px; }
.th-section { padding-top: 48px; }
.th-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px; }
.th-pagination { margin-top: 32px; }

/* ---------------------------------------------------------------------------
   Articles and pages
   ------------------------------------------------------------------------- */
.th-article > * { max-width: 760px; margin-left: auto !important; margin-right: auto !important; }
.th-article .wp-block-post-title { margin-top: 12px; }
.th-article-cover { margin: 28px auto 32px !important; }
.th-article-cover img, .th-prose img { border-radius: 10px; border: 1px solid var(--th-border); }
.th-prose { font-size: 1.075rem; }
.th-prose h2 { margin-top: 1.8em; }
.th-article-tags { margin-top: 32px !important; }
.th-post-nav { margin-top: 48px !important; padding-top: 24px; border-top: 1px solid var(--th-border); font-size: 0.95rem; }

.th-game-callout {
	display: flex; gap: 16px; align-items: center; margin: 40px auto 0; padding: 16px;
	background: var(--th-panel); border: 1px solid var(--th-border); border-radius: var(--th-radius);
}
.th-game-callout img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: none; }
.th-game-callout p { margin: 2px 0 8px; color: var(--th-muted); }

/* ---------------------------------------------------------------------------
   Game page
   ------------------------------------------------------------------------- */
.th-game { padding: 0 0 64px; }
.th-game-hero { position: relative; display: flex; align-items: flex-end; min-height: 460px; margin: 0 !important; overflow: hidden; max-width: none !important; }
.th-game-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th-game-hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(17,19,28,0) 30%, rgba(17,19,28,0.85) 75%, var(--th-base) 100%);
}
.th-game-hero-inner { position: relative; z-index: 1; box-sizing: border-box; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 48px 36px; }
.th-game-hero h1 { margin: 0 0 8px; font-size: clamp(2.4rem, 6vw, 4.2rem); text-shadow: 0 2px 20px rgba(0,0,0,0.6); }
.th-game-tagline { max-width: 52ch; margin: 0 0 18px; font-size: 1.15rem; text-shadow: 0 1px 8px rgba(0,0,0,0.7); }

.th-tabs {
	position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; overflow-x: auto; max-width: none !important;
	margin: 0 0 24px !important; padding: 0 48px;
	background: rgba(17, 19, 28, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--th-border);
}
.th-tabs a { padding: 16px 14px; color: var(--th-muted); font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.th-tabs a:hover, .th-tabs a:focus-visible { color: var(--th-text); border-bottom-color: var(--th-gold); }
.th-game-content, .th-game > .th-section { box-sizing: border-box; max-width: 860px; margin-left: auto !important; margin-right: auto !important; padding-left: 24px; padding-right: 24px; }

@media (max-width: 900px) {
	.th-game-hero { min-height: 380px; }
	.th-game-hero-inner { padding: 0 20px 28px; }
	.th-tabs { top: 69px; padding: 0 12px; }
}

/* ---------------------------------------------------------------------------
   Team pattern
   ------------------------------------------------------------------------- */
.teamhayat-avatar {
	display: grid; place-items: center; width: 6rem; height: 6rem; margin-inline: auto;
	border-radius: 50%; background: linear-gradient(135deg, var(--th-gold), #c98f2e);
	color: var(--th-base); font: 700 2rem/1 var(--wp--preset--font-family--display); letter-spacing: 0.05em;
}

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
