/*
 * Awaz styles. One accent colour, set in Settings, reaches every element
 * through --awaz-accent. Focus is always visible. Motion is removed for
 * readers who prefer reduced motion.
 */

.awaz-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Sticky bar ---------- */

.awaz-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99990;
	background: #101418;
	color: #f5f2ec;
	box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.35);
	--plyr-color-main: var(--awaz-accent, #b5352a);
}

.awaz-bar-bottom { bottom: 0; }
.awaz-bar-top { top: 0; box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }

body.awaz-bar-visible { padding-bottom: var(--awaz-bar-height, 96px); }
body.awaz-bar-visible-top { padding-bottom: 0; padding-top: var(--awaz-bar-height, 96px); }

.awaz-bar-inner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0.5rem 0.75rem;
}

.awaz-bar-art {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	flex: none;
}

.awaz-bar-main { flex: 1 1 auto; min-width: 0; }

.awaz-bar-title {
	margin: 0 0 0.15rem;
	font-size: 0.95rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.awaz-bar-link { color: inherit; text-decoration: none; }
.awaz-bar-link:hover, .awaz-bar-link:focus { text-decoration: underline; }

.awaz-bar .plyr {
	--plyr-audio-controls-background: transparent;
	--plyr-audio-control-color: #f5f2ec;
	--plyr-control-icon-size: 18px;
	background: transparent;
}

.awaz-bar-side {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: none;
}

.awaz-bar-chapters-toggle,
.awaz-bar-close {
	background: transparent;
	color: #f5f2ec;
	border: 1px solid rgba(245, 242, 236, 0.5);
	border-radius: 6px;
	padding: 0.35rem 0.6rem;
	font-size: 0.9rem;
	cursor: pointer;
	line-height: 1.2;
}

.awaz-bar-close { font-size: 1.2rem; padding: 0.2rem 0.55rem; }

.awaz-bar-chapters {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 0.75rem 0.75rem;
	max-height: 40vh;
	overflow: auto;
}

.awaz-bar-chapters-title { font-size: 1rem; margin: 0.25rem 0 0.5rem; }

/* ---------- Focus, everywhere ---------- */

.awaz-bar :focus-visible,
.awaz-episodes :focus-visible,
.awaz-single :focus-visible,
.awaz-transcript :focus-visible,
.awaz-chapters :focus-visible,
.awaz-subscribe :focus-visible {
	outline: 3px solid var(--awaz-accent, #b5352a);
	outline-offset: 2px;
}

.awaz-bar :focus-visible { outline-color: #ffd166; }

/* ---------- Play buttons ---------- */

.awaz-play {
	display: inline-flex;
	align-items: baseline;
	gap: 0.5rem;
	background: var(--awaz-accent, #b5352a);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 0.55rem 1.1rem;
	font-size: 1rem;
	cursor: pointer;
	max-width: 100%;
}

.awaz-play-title {
	font-weight: 400;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.awaz-play:hover { filter: brightness(1.08); }

/* ---------- Episode lists and grids ---------- */

.awaz-episodes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

.awaz-columns-2 { grid-template-columns: repeat(2, 1fr); }
.awaz-columns-3 { grid-template-columns: repeat(3, 1fr); }
.awaz-columns-4 { grid-template-columns: repeat(4, 1fr); }
.awaz-columns-5 { grid-template-columns: repeat(5, 1fr); }
.awaz-columns-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 720px) {
	.awaz-episodes { grid-template-columns: 1fr; }
}

.awaz-episode {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}

.awaz-columns-2 .awaz-episode,
.awaz-columns-3 .awaz-episode,
.awaz-columns-4 .awaz-episode,
.awaz-columns-5 .awaz-episode,
.awaz-columns-6 .awaz-episode { flex-direction: column; }

.awaz-episode-art {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 8px;
	flex: none;
}

.awaz-episode-title { margin: 0 0 0.25rem; font-size: 1.1rem; }
.awaz-episode-meta { margin: 0 0 0.35rem; opacity: 0.8; font-size: 0.9rem; }
.awaz-episode-duration::before { content: "· "; }
.awaz-episode-excerpt { margin: 0 0 0.5rem; }

/* ---------- Single episode ---------- */

.awaz-single-art {
	width: 180px;
	height: 180px;
	object-fit: cover;
	border-radius: 10px;
}

.awaz-single-head { margin-bottom: 1rem; }

/* ---------- Chapters ---------- */

.awaz-chapters {
	list-style: none;
	margin: 0;
	padding: 0;
}

.awaz-chapter {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	border-bottom: 1px solid rgba(127, 127, 127, 0.25);
	color: inherit;
	padding: 0.45rem 0.25rem;
	cursor: pointer;
	font-size: 1rem;
}

.awaz-chapter:hover { text-decoration: underline; }
.awaz-chapter-time { font-variant-numeric: tabular-nums; opacity: 0.85; }
.awaz-chapter-current { font-weight: 700; }
.awaz-chapter-current .awaz-chapter-time { color: var(--awaz-accent, #b5352a); opacity: 1; }
.awaz-bar .awaz-chapter-current .awaz-chapter-time { color: #ffd166; }

/* ---------- Transcript ---------- */

.awaz-transcript {
	max-height: 24rem;
	overflow: auto;
	padding: 0.5rem;
	border: 1px solid rgba(127, 127, 127, 0.35);
	border-radius: 8px;
}

.awaz-transcript-plain { max-height: none; overflow: visible; border: 0; padding: 0; }

.awaz-cue { margin: 0; }

.awaz-cue-button {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	color: inherit;
	padding: 0.35rem 0.4rem;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1.45;
	border-radius: 4px;
}

.awaz-cue-button:hover { text-decoration: underline; }
.awaz-cue-time { font-variant-numeric: tabular-nums; opacity: 0.75; font-size: 0.9em; }
.awaz-cue-active .awaz-cue-button {
	background: var(--awaz-accent, #b5352a);
	color: #fff;
}
.awaz-cue-active .awaz-cue-time { opacity: 0.9; }

.awaz-follow-row { margin: 0 0 0.5rem; }

/* ---------- Subscribe ---------- */

.awaz-subscribe-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.awaz-subscribe-list a {
	display: inline-block;
	border: 2px solid var(--awaz-accent, #b5352a);
	color: inherit;
	border-radius: 999px;
	padding: 0.35rem 0.9rem;
	text-decoration: none;
}

.awaz-subscribe-list a:hover { text-decoration: underline; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.awaz-bar, .awaz-play, .awaz-cue-button, .awaz-chapter {
		transition: none !important;
		animation: none !important;
	}
	.awaz-transcript { scroll-behavior: auto !important; }
}
