/*
Theme Name: Today Stage
Text Domain: today-stage
Version: 1.4.1
Requires at least: 6.6
Description: Block theme for Today Stage: concerts, K-pop, film and series news from Jakarta.
WPVibe: yes
Update URI: false
*/

/* ---------- Light / dark ---------- */
:root { color-scheme: dark; --ts-quote-bg: var(--wp--preset--color--surface); --ts-chip-line: #3A3A3A; --ts-prose: #E5E5E5; --ts-dek: #D4D4D4; }
html[data-theme="light"],
html[data-theme="light"] body {
	color-scheme: light;
	--wp--preset--color--black: #FAFAF7;
	--wp--preset--color--surface: #EFEEE8;
	--wp--preset--color--card: #E3E2DB;
	--wp--preset--color--line: #D9D8D0;
	--wp--preset--color--ink: #0A0A0A;
	--wp--preset--color--muted: #55554F;
	--wp--preset--color--highlight: #3D4800;
	--ts-chip-line: #C9C8C0;
	--ts-prose: #1F1F1F;
	--ts-dek: #3A3A3A;
}

/* Elementor-built articles keep the Elementor kit; make its page colors follow the mode. */
body[class*="elementor-kit-"] { background-color: var(--wp--preset--color--black) !important; color: var(--wp--preset--color--ink) !important; }

/* ---------- Header (always lime, always dark ink) ---------- */
.ts-header, .ts-header .has-black-color, .ts-header .wp-block-navigation a { color: #050505 !important; }
.ts-header .wp-block-navigation a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ts-header .wp-block-navigation .wp-block-navigation-item__content { min-height: 44px; display: inline-flex; align-items: center; }
.ts-header .wp-block-navigation__responsive-container.is-menu-open { background: #D1F400 !important; color: #050505 !important; }
.ts-header .wp-block-navigation__responsive-container-open,
.ts-header .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; color: #050505; }
.ts-search .wp-block-search__button,
.ts-mode-toggle { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #050505; background: transparent; color: #050505; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ts-search .wp-block-search__button svg { fill: currentColor; }
.ts-search .wp-block-search__input { border-color: #050505; background: #FFFFFF; color: #050505; }
.ts-mode-toggle:hover { background: #050505; color: #D1F400; }
.ts-mode-toggle .ts-icon-moon { display: none; }
html[data-theme="light"] .ts-mode-toggle .ts-icon-sun { display: none; }
html[data-theme="light"] .ts-mode-toggle .ts-icon-moon { display: block; }

/* ---------- Focus ---------- */
:where(a, button, input):focus-visible { outline: 3px solid var(--wp--preset--color--highlight); outline-offset: 3px; }
.ts-header :where(a, button, input):focus-visible { outline-color: #050505; }

/* ---------- Chips ---------- */
.ts-chip { display: inline-block; margin: 0 0 0.75rem; padding: 4px 10px; background: #D1F400; color: #050505; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 2px; line-height: 1.4; }
.ts-chip--ink { background: #F5F3EE; }
.ts-chip-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-chip-terms a { display: inline-block; padding: 4px 10px; background: #D1F400; color: #050505; border-radius: 2px; text-decoration: none; }
.ts-chip-terms .wp-block-post-terms__separator { display: none; }

/* ---------- Hero (text stays light over photos in both modes) ---------- */
.ts-hero-card { overflow: hidden; }
.ts-hero-card .wp-block-cover__background { background: linear-gradient(180deg, rgba(5,5,5,0.05) 30%, rgba(5,5,5,0.92) 100%) !important; opacity: 1 !important; }
.ts-hero-title { font-family: var(--wp--preset--font-family--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.02; font-size: clamp(2rem, 3.6vw, 3.25rem); margin: 0 0 0.75rem; }
.ts-hero-card .ts-hero-title a, .ts-hero-card .wp-block-post-date { color: #F5F3EE !important; }

/* ---------- Section heads ---------- */
.ts-section-head { padding-bottom: 0.875rem; border-bottom: 3px solid var(--wp--preset--color--line); margin-bottom: 0.5rem; }
.ts-section-head--lime { border-bottom-color: #D1F400; }
.ts-section-head--ink { border-bottom-color: var(--wp--preset--color--ink); }
.ts-section-head h2 { margin: 0; }
.ts-more { margin: 0; font-weight: 600; font-size: 0.9375rem; }
.ts-more a { display: inline-flex; align-items: center; min-height: 44px; color: var(--wp--preset--color--highlight); }

/* ---------- Lists ---------- */
.ts-list > li { padding: 1.125rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.ts-list--compact > li { padding: 0.875rem 0; }
.ts-list--compact .wp-block-post-title { margin: 0 0 0.25rem; }
.ts-list-item { gap: 1.125rem !important; }
.ts-list-item .wp-block-post-featured-image { flex: 0 0 132px; margin: 0; }
.ts-list-item .wp-block-post-title { margin: 0; }

/* ---------- Upcoming ---------- */
.ts-upcoming-card { height: 100%; box-sizing: border-box; }
.ts-upcoming-card .wp-block-post-featured-image { width: 100%; margin: 0; }
.ts-upcoming-card .wp-block-post-title { margin: 0; }

/* ---------- Article ---------- */
.ts-article-title { max-width: 1080px; margin-top: 1rem; }
.is-layout-constrained > .ts-article-title { max-width: var(--wp--style--global--content-size); }
.single .is-layout-constrained > .ts-article-title { max-width: 1080px; }
.ts-dek { max-width: 720px; font-size: 1.3125rem; line-height: 1.5; color: var(--ts-dek); }
.ts-dek .wp-block-post-excerpt__more-link { display: none; }
.ts-byline p { margin: 0; }
.ts-byline strong { color: var(--wp--preset--color--ink); font-weight: 600; }
.ts-prose { font-size: 1.1875rem; line-height: 1.75; color: var(--ts-prose); }
.ts-prose h2 { font-size: 2.125rem; margin-top: 2.75rem; }
.ts-prose h3 { font-family: var(--wp--preset--font-family--body); text-transform: none; font-weight: 700; font-size: 1.375rem; }
.ts-prose a { color: var(--wp--preset--color--highlight); text-decoration: underline; text-underline-offset: 3px; }
.ts-prose blockquote { margin: 2.25rem 0; padding: 1.75rem; background: var(--ts-quote-bg); border-radius: 4px; border: 0; }
.ts-prose blockquote p { font-weight: 700; font-size: 1.5rem; line-height: 1.35; color: var(--wp--preset--color--highlight); }
.ts-prose img { border-radius: 4px; height: auto; }
.ts-tags a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; margin: 0 6px 6px 0; border: 1px solid var(--ts-chip-line); border-radius: 999px; font-size: 0.875rem; text-decoration: none; }
.ts-tags .wp-block-post-terms__separator { display: none; }
.ts-aside { position: sticky; top: 1.5rem; }

/* ---------- Filter + pagination ---------- */
.ts-filter .wp-block-button.is-style-outline .wp-block-button__link { border: 2px solid var(--ts-chip-line); color: var(--wp--preset--color--ink); background: transparent; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.ts-filter .wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: var(--wp--preset--color--highlight); color: var(--wp--preset--color--highlight); }
.wp-block-query-pagination a, .wp-block-query-pagination span.current { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.wp-block-query-pagination .current { color: var(--wp--preset--color--highlight); }

/* ---------- Instagram cards (OMG Soon) ---------- */
.wp-block-post-featured-image:has(.ts-ig-link) { position: relative; }
.wp-block-post-featured-image:has(.ts-ig-link)::after { content: "Instagram"; position: absolute; top: 10px; left: 10px; padding: 3px 8px; background: #050505; color: #F5F3EE; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 2px; pointer-events: none; }
.ts-ig-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Ad slots (space reserved so nothing jumps when an ad loads) ---------- */
.ts-ad { margin: var(--wp--preset--spacing--50) auto; text-align: center; }
.ts-ad__label { display: block; margin-bottom: 6px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.ts-ad__box { display: flex; align-items: center; justify-content: center; margin: 0 auto; overflow: hidden; background: var(--wp--preset--color--surface); border-radius: 4px; contain: layout; }
.ts-ad__box > * { margin: 0 auto; max-width: 100%; }
.ts-ad__box img { display: block; max-width: 100%; height: auto; }
.ts-ad--leaderboard .ts-ad__box { max-width: 970px; min-height: 100px; }
.ts-ad--rectangle .ts-ad__box { max-width: 336px; min-height: 280px; }
.ts-ad--inline .ts-ad__box { max-width: 700px; min-height: 280px; }
@media (min-width: 782px) { .ts-ad--leaderboard .ts-ad__box { min-height: 90px; } }
.ts-ad-row { grid-column: 1 / -1; list-style: none; }
.ts-ad-row .ts-ad { margin: var(--wp--preset--spacing--30) auto; }
.ts-aside + .ts-ad, .ts-aside ~ .ts-ad { margin-top: var(--wp--preset--spacing--40); }

/* ---------- Social ---------- */
.ts-social .wp-block-social-link { color: #050505 !important; background: #D1F400 !important; }
.ts-social .wp-block-social-link a { padding: 0.6em; min-width: 44px; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.ts-social .wp-block-social-link:hover { background: var(--wp--preset--color--ink) !important; color: var(--wp--preset--color--black) !important; }
.ts-events-block, #after-events, #all-events { scroll-margin-top: 1rem; }

/* ---------- Today's Chart (playlist embed) ---------- */
.ts-chart-embed { margin-top: 1.5rem; max-width: 880px; }
.ts-chart-embed iframe { display: block; width: 100%; height: 452px; border: 0; border-radius: 12px; background: var(--wp--preset--color--card); }

/* ---------- Today's Chart (legacy track list) ---------- */
.ts-chart { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px 24px; counter-reset: chart; }
.ts-chart li { counter-increment: chart; display: flex; align-items: center; gap: 14px; }
.ts-chart li::before { content: counter(chart, decimal-leading-zero); flex: 0 0 52px; font-family: var(--wp--preset--font-family--display); font-size: 2.25rem; line-height: 1; color: var(--wp--preset--color--highlight); }
.ts-chart iframe { flex: 1; min-width: 0; height: 80px; border: 0; border-radius: 12px; background: var(--wp--preset--color--card); }

/* ---------- Images keep their box while loading ---------- */
.wp-block-post-featured-image img { object-fit: cover; }
.wp-block-post-featured-image:not(:has(img)) { background: var(--wp--preset--color--card); }

/* ---------- Footer logo swaps with the mode ---------- */
.ts-footer-logo--dark { display: none; }
html[data-theme="light"] .ts-footer-logo--light { display: none; }
html[data-theme="light"] .ts-footer-logo--dark { display: block; }

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.ts-hero-card { min-height: 420px !important; }
	.ts-list-item .wp-block-post-featured-image { flex-basis: 96px; }
	.ts-aside { position: static; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
