/*
Theme Name: Swiss Tamil Radio
Theme URI: https://swisstamilradio.com
Author: Swiss Tamil Radio
Description: Tamil online radio theme in red, black and white. Ad slider, RSS news grid, live player with square ad spaces, RJ carousel and program schedule, all controlled from the Radio Panel.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: swiss-tamil-radio
*/

:root {
	--str-red: #e50f2d;
	--str-black: #0a0a0a;
	--str-white: #fff;
	--str-font: "Mukta Malar", "Noto Sans Tamil", system-ui, sans-serif;
	--str-logo-w: 180px;
	--str-slider-ratio: 12 / 5;
	--str-red-dk: color-mix(in srgb, var(--str-red) 80%, #000);
	--str-line: rgba(0, 0, 0, .1);
	--str-muted: rgba(0, 0, 0, .62);
	--str-shadow: 0 2px 10px rgba(0, 0, 0, .12);
	--str-radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--str-font); color: var(--str-black); background: var(--str-white); line-height: 1.6; padding-bottom: 72px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--str-red-dk); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
:focus-visible { outline: 3px solid var(--str-red); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 8px; top: 8px; z-index: 9999; width: auto; height: auto; clip: auto; background: #fff; padding: 10px 14px; }
.str-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.str-narrow { max-width: 760px; }

/* Header: logo + ad, then black menu bar */
.str-header { position: relative; z-index: 50; }
.str-topbar { background: var(--str-white); border-bottom: 1px solid var(--str-line); }
.str-topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 10px; padding-bottom: 10px; min-height: 80px; }
.str-logo img { width: var(--str-logo-w); height: auto; max-width: 100%; }
.str-brand-text { color: var(--str-black); font-weight: 800; font-size: 1.6rem; }
.str-brand-text:hover { text-decoration: none; }
.str-header-ad { flex: 0 1 728px; min-width: 0; }
.str-header-ad img { width: 100%; max-height: 90px; object-fit: contain; margin-left: auto; }
.str-navbar { background: var(--str-black); border-bottom: 3px solid var(--str-red); position: sticky; top: 0; }
.str-navbar-in { display: flex; align-items: center; }
.str-menu, .str-footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.str-menu a { display: block; padding: 12px 18px; color: var(--str-white); font-weight: 600; transition: background .2s; }
.str-menu a:hover, .str-menu .current-menu-item > a, .str-menu .current_page_item > a { background: var(--str-red); text-decoration: none; }
.str-nav-toggle { display: none; background: none; border: 0; padding: 12px 0; cursor: pointer; color: var(--str-white); font: 600 1rem var(--str-font); align-items: center; gap: 10px; }
.str-nav-toggle i { display: block; width: 22px; height: 2px; background: var(--str-white); margin: 4px 0; }
.str-nav-toggle { flex-wrap: wrap; }

/* Sections */
.str-section { padding: 36px 0; }
.str-h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; position: relative; padding-left: 16px; }
.str-h2::before { content: ""; position: absolute; left: 0; top: .12em; bottom: .12em; width: 5px; border-radius: 3px; background: var(--str-red); }
.str-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.str-more { font-weight: 700; }

/* 1. Ad slider */
.str-hero { padding: 24px 0 0; }
.str-carousel { position: relative; border-radius: var(--str-radius); overflow: hidden; background: var(--str-black); }
.str-slides { position: relative; aspect-ratio: var(--str-slider-ratio); }
.str-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; display: block; }
.str-slide.is-active { opacity: 1; z-index: 1; }
.str-slide img { width: 100%; height: 100%; object-fit: cover; }
.str-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; cursor: pointer; }
.str-arrow:hover { background: var(--str-red); }
.str-arrow.prev { left: 10px; } .str-arrow.next { right: 10px; }
.str-dots { position: absolute; z-index: 3; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.str-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.6); cursor: pointer; }
.str-dots button.is-active { background: var(--str-red); width: 26px; border-radius: 6px; }

/* 2. News grid */
.str-news-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
.str-news-card { display: flex; flex-direction: column; background: var(--str-white); border-radius: 10px; box-shadow: var(--str-shadow); overflow: hidden; color: var(--str-black); transition: transform .2s, box-shadow .2s; }
.str-news-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.str-news-img { display: block; aspect-ratio: 2 / 1; background: linear-gradient(135deg, var(--str-black), var(--str-red)); }
.str-news-img img { width: 100%; height: 100%; object-fit: cover; }
.str-news-title { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; padding: 14px 16px 20px; text-align: center; font-size: 1.08rem; font-weight: 500; line-height: 1.5; }
.str-strip { padding-top: 8px; padding-bottom: 8px; }
.str-ad img { width: 100%; }
.str-ad-strip img { border-radius: var(--str-radius); }

/* 3. Live player with square ads */
.str-stage { background: linear-gradient(90deg, var(--str-red), var(--str-black)); padding: 28px 0; margin: 12px 0; }
.str-stage-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 470px) minmax(0, 1fr); gap: 24px; align-items: center; }
.str-stage-in.no-ads { grid-template-columns: minmax(320px, 520px); justify-content: center; }
.str-stage-in.no-ads .str-stage-side { display: none; }
.str-stage-side.left { justify-self: start; }
.str-stage-side.right { justify-self: end; }
.str-ad-square { width: min(300px, 100%); aspect-ratio: 1; background: var(--str-white); }
.str-ad-square img { width: 100%; height: 100%; object-fit: cover; }
.str-player { background: linear-gradient(135deg, rgba(229,15,45,.92), rgba(10,10,10,.92)); border: 1px solid rgba(255,255,255,.25); border-radius: 22px; padding: 18px 20px 20px; color: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.4); }
.str-player-top { display: flex; align-items: center; gap: 12px; }
.str-player-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 8px; flex: none; }
.str-player-titles { flex: 1; text-align: center; min-width: 0; }
.str-player-name { font-size: 1.15rem; margin: 0; font-weight: 800; }
.str-player-tag { margin: 0; font-size: .85rem; opacity: .9; }
.str-iconbtn { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.18); color: #fff; cursor: pointer; display: grid; place-items: center; }
.str-iconbtn:hover { background: rgba(255,255,255,.3); }
.str-iconbtn[aria-pressed="true"] .i-wave { display: none; }
.str-player-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.str-play { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--str-red); color: #fff; cursor: pointer; transition: transform .15s, background .2s; }
.str-play:hover { background: var(--str-red-dk); transform: scale(1.06); }
.str-play-lg { width: 50px; height: 50px; border-radius: 14px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.45); }
.str-play-lg:hover { background: var(--str-white); color: var(--str-red); }
.str-play .i-pause { display: none; }
.is-playing .str-play .i-play { display: none; }
.is-playing .str-play .i-pause { display: block; }
.str-timer { font-size: .85rem; font-variant-numeric: tabular-nums; }
.str-line { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); position: relative; min-width: 30px; }
.str-line i { position: absolute; left: 0; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translateY(-50%); }
.str-livetag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.str-livetag i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.is-playing .str-livetag i { animation: str-pulse 1.2s infinite; }
@keyframes str-pulse { 50% { opacity: .2; } }
.str-volume-inline input, .str-volume input { width: 96px; accent-color: var(--str-red); }
.str-volume-inline input { accent-color: #fff; }
.str-player-warn { margin: 14px 0 0; font-size: .8rem; background: rgba(255,255,255,.15); padding: 8px 10px; border-radius: 8px; }

/* 4. RJs */
.str-rj-wrap { position: relative; margin-top: 16px; }
.str-rj-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 10px; scroll-behavior: smooth; }
.str-rj-track::-webkit-scrollbar { display: none; }
.str-rj { flex: 0 0 calc((100% - 4 * 14px) / 5); scroll-snap-align: start; border-radius: var(--str-radius); overflow: hidden; background: var(--str-red); color: #fff; display: flex; flex-direction: column; box-shadow: var(--str-shadow); }
a.str-rj:hover { text-decoration: none; }
.str-rj-img { display: block; aspect-ratio: 3 / 4; background: var(--str-black); }
.str-rj-img img { width: 100%; height: 100%; object-fit: cover; }
.str-rj-name { padding: 10px 12px; text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.str-rj-wrap .str-arrow.prev { left: 6px; } .str-rj-wrap .str-arrow.next { right: 6px; }
.str-rj-wrap .str-arrow { top: 42%; }

/* 5. Programs */
.str-prog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.str-prog { display: flex; align-items: center; gap: 18px; background: var(--str-white); border-radius: 10px; box-shadow: var(--str-shadow); padding: 14px 16px; border-left: 5px solid transparent; }
.str-prog-img { flex: none; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--str-red); display: block; }
.str-prog-img img { width: 100%; height: 100%; object-fit: cover; }
.str-prog-body { flex: 1; text-align: center; min-width: 0; }
.str-prog-body h3 { font-size: 1.1rem; font-weight: 800; margin: 0; }
.str-prog-time { margin: 2px 0 4px; color: var(--str-muted); font-size: .9rem; }
.str-prog-count { margin: 0; color: var(--str-red); font-weight: 700; font-size: .95rem; }
.str-prog-now { margin: 4px auto 0; display: inline-block; background: var(--str-red); color: #fff; font-weight: 700; font-size: .8rem; padding: 2px 12px; border-radius: 999px; }
.str-prog-now[hidden] { display: none; }
.str-prog.is-live { border-left-color: var(--str-red); }
.str-prog.is-ended { opacity: .7; }
.str-prog.is-ended .str-prog-count { color: var(--str-black); }

/* Inner pages */
.str-page-head { background: var(--str-black); color: #fff; padding: 34px 0; border-bottom: 3px solid var(--str-red); }
.str-page-head h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.str-meta { margin: 6px 0 0; opacity: .8; }
.str-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.str-with-sidebar:has(.str-sidebar) { grid-template-columns: minmax(0, 1fr) 300px; }
.str-content { font-size: 1.05rem; }
.str-content img { border-radius: 10px; }
.str-entry-img { border-radius: var(--str-radius); margin-bottom: 24px; width: 100%; }
.str-sidebar .widget { border-radius: 10px; box-shadow: var(--str-shadow); padding: 18px; margin-bottom: 20px; }
.widget-title { font-size: 1.05rem; }
.str-gallery .wp-block-gallery, .str-gallery .gallery { gap: 14px; }
.str-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-top: 12px; }
.str-card { border-radius: 10px; box-shadow: var(--str-shadow); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.str-card-img { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--str-black), var(--str-red)); overflow: hidden; }
.str-card-img img { width: 100%; height: 100%; object-fit: cover; }
.str-card-ph { display: block; width: 100%; height: 100%; }
.str-card-body { padding: 14px 16px 18px; }
.str-card-body time { font-size: .8rem; color: var(--str-muted); }
.str-card-body h3 { font-size: 1.05rem; margin: 4px 0 8px; }
.str-card-body h3 a { color: var(--str-black); }
.str-card-body p { margin: 0; color: var(--str-muted); font-size: .92rem; }
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 999px; box-shadow: var(--str-shadow); }
.pagination .current { background: var(--str-red); color: #fff; }
.str-btn { display: inline-block; background: var(--str-red); color: #fff; border: 2px solid var(--str-red); padding: 11px 26px; border-radius: 999px; font: 700 1rem var(--str-font); cursor: pointer; transition: background .2s; }
.str-btn:hover { background: var(--str-black); border-color: var(--str-black); text-decoration: none; color: #fff; }

/* Forms */
.str-form label { display: block; font-weight: 700; font-size: .92rem; }
.str-form input, .str-form textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid rgba(0,0,0,.25); border-radius: 10px; font: 400 1rem var(--str-font); background: #fff; }
.str-hp { position: absolute; left: -9999px; }
.str-notice { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-weight: 600; }
.str-notice.ok { background: var(--str-black); color: #fff; }
.str-notice.err { background: var(--str-red); color: #fff; }
.str-comments { margin-top: 40px; }

/* Footer */
.str-footer { background: var(--str-black); color: rgba(255,255,255,.8); padding: 36px 0 28px; margin-top: 24px; border-top: 3px solid var(--str-red); }
.str-footer-in { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.str-footer .str-brand-text { color: #fff; }
.str-social { display: flex; gap: 12px; }
.str-social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; transition: background .2s; }
.str-social a:hover { background: var(--str-red); }
.str-footer-menu { justify-content: center; gap: 6px 22px; }
.str-footer a { color: #fff; }
.str-copy { margin: 0; font-size: .88rem; }

/* Sticky player bar */
.str-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--str-black); color: #fff; border-top: 3px solid var(--str-red); }
.str-bar-in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.str-bar-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.str-bar-info strong { display: block; line-height: 1.2; }
.str-bar-logo { width: 44px; height: 44px; object-fit: contain; }
.str-bar-status { font-size: .8rem; opacity: .75; }
.is-playing .str-bar-status { color: var(--str-red); opacity: 1; font-weight: 700; }

/* Responsive */
@media (max-width: 1000px) {
	.str-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.str-prog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.str-rj { flex-basis: calc((100% - 2 * 14px) / 3); }
}
@media (max-width: 800px) {
	.str-topbar-in { flex-direction: column; align-items: center; gap: 10px; }
	.str-header-ad { flex-basis: auto; width: 100%; }
	.str-header-ad img { margin: 0 auto; }
	.str-nav-toggle { display: flex; }
	.str-navbar-in { flex-wrap: wrap; }
	.str-nav-wrap { display: none; width: 100%; padding-bottom: 10px; }
	.nav-open .str-nav-wrap { display: block; }
	.str-menu { flex-direction: column; }
	.str-stage-in { grid-template-columns: 1fr; }
	.str-stage-side { justify-self: center !important; }
	.str-stage-side.left { order: 2; } .str-stage-side.right { order: 3; }
	.str-with-sidebar:has(.str-sidebar) { grid-template-columns: 1fr; }
	.str-volume { display: none; }
	.str-player-row { flex-wrap: wrap; }
}
@media (max-width: 560px) {
	.str-news-grid, .str-prog-grid { grid-template-columns: 1fr; }
	.str-rj { flex-basis: calc((100% - 14px) / 2); }
	.str-volume-inline { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
