/* Bajo Nalón — Audioguías TTS Demo (frontend)
   Componente autónomo: no depende de los estilos del tema. */

/* Integración automática dentro de la ficha pública del lugar. */
.bn-audioguia-integrada {
	clear: both;
	margin: 2.25rem 0 0;
}

.bn-audioguia-integrada .bn-audioguia {
	max-width: none;
}

/* ------------------------------ Reproductor ------------------------------ */

.bn-agp {
	--bn-agp-primary: #0e6b5c;
	--bn-agp-primary-dark: #0a4f44;
	--bn-agp-bg: #ffffff;
	--bn-agp-border: #e2e8f0;
	--bn-agp-text: #1e293b;
	--bn-agp-muted: #64748b;
	background: linear-gradient(145deg, #ffffff 0%, #fbfdfc 100%);
	border: 1px solid var(--bn-agp-border);
	border-radius: 20px;
	padding: clamp(18px, 2.5vw, 26px);
	max-width: 640px;
	color: var(--bn-agp-text);
	font-family: inherit;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
	overflow: hidden;
}

.bn-agp__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}
.bn-agp__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--bn-agp-primary);
	color: #fff;
	flex-shrink: 0;
}
.bn-agp__title {
	font-weight: 750;
	font-size: 1.08rem;
	letter-spacing: -0.01em;
}

.bn-agp__langs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: -2px 0 14px 54px;
}
.bn-agp__lang {
	border: 1.5px solid var(--bn-agp-border);
	background: #fff;
	color: var(--bn-agp-text);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: all 0.15s ease;
}
.bn-agp__lang.is-active {
	background: var(--bn-agp-primary);
	border-color: var(--bn-agp-primary);
	color: #fff;
}
.bn-agp__lang.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.bn-agp__lang:focus-visible {
	outline: 3px solid rgba(14, 107, 92, 0.4);
	outline-offset: 2px;
}

.bn-agp__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
	font-size: 0.82rem;
	color: var(--bn-agp-muted);
}
.bn-agp__current-language {
	font-weight: 700;
	color: var(--bn-agp-primary-dark);
	background: #eaf6f3;
	border-radius: 999px;
	padding: 3px 10px;
}
.bn-agp__status {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.75rem;
}
.bn-agp__status--ready { background: #dcfce7; color: #166534; }
.bn-agp__status--pending { background: #fef9c3; color: #854d0e; }
.bn-agp__status--error { background: #fee2e2; color: #991b1b; }
.bn-agp__status--none { background: #f1f5f9; color: #475569; }

.bn-agp__controls {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 2px;
}
.bn-agp__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-weight: 700;
	transition: background 0.15s ease, transform 0.1s ease;
}
.bn-agp__btn:focus-visible {
	outline: 3px solid rgba(14, 107, 92, 0.4);
	outline-offset: 2px;
}
.bn-agp__btn--play {
	background: var(--bn-agp-primary);
	color: #fff;
	padding: 11px 21px;
	font-size: 0.9rem;
}
.bn-agp__btn--play:hover { background: var(--bn-agp-primary-dark); }
.bn-agp__btn--play:active { transform: scale(0.97); }
.bn-agp__btn--stop {
	background: #f1f5f9;
	color: var(--bn-agp-text);
	width: 42px;
	height: 42px;
	justify-content: center;
	flex-shrink: 0;
}
.bn-agp__btn--stop:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.bn-agp__progress {
	flex: 1;
	height: 7px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	min-width: 60px;
}
.bn-agp__progress-bar {
	height: 100%;
	width: 0;
	background: var(--bn-agp-primary);
	border-radius: 999px;
	transition: width 0.25s linear;
}

.bn-agp__engine {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 13px 0 0;
	font-size: 0.75rem;
	color: var(--bn-agp-muted);
}
.bn-agp__engine::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #94a3b8;
	flex: 0 0 auto;
}

/* El tema aplica una capitular al primer párrafo de las fichas. El reproductor
   debe permanecer aislado de ese estilo editorial. */
.lugar-content .bn-agp p::first-letter,
.lugar-content .bn-agp__engine::first-letter {
	float: none;
	font: inherit;
	line-height: inherit;
	margin: 0;
	color: inherit;
}
.bn-agp__empty {
	color: var(--bn-agp-muted);
	font-size: 0.9rem;
	margin: 0;
}
.bn-agp__audio { width: 100%; margin-top: 6px; }
.bn-agp__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ----------------------------- Página demo ------------------------------ */

.bn-ag-demo {
	--bn-agd-primary: #0e6b5c;
	--bn-agd-text: #1e293b;
	--bn-agd-muted: #64748b;
	max-width: 860px;
	margin: 0 auto;
	padding: 32px 20px 48px;
	color: var(--bn-agd-text);
}

.bn-ag-demo__header { text-align: center; margin-bottom: 32px; }
.bn-ag-demo__kicker {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--bn-agd-primary);
	margin: 0 0 8px;
}
.bn-ag-demo__title {
	font-size: clamp(1.5rem, 4vw, 2.2rem);
	margin: 0 0 14px;
	line-height: 1.2;
}
.bn-ag-demo__intro {
	color: var(--bn-agd-muted);
	max-width: 640px;
	margin: 0 auto;
	line-height: 1.65;
	font-size: 0.98rem;
}

.bn-ag-demo__controls {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
	align-items: flex-end;
	margin-bottom: 26px;
	justify-content: center;
}
.bn-ag-demo__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 240px;
}
.bn-ag-demo__field > span {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--bn-agd-muted);
}
.bn-ag-demo__field select {
	padding: 10px 14px;
	border-radius: 10px;
	border: 1.5px solid #cbd5e1;
	font-size: 0.95rem;
	background: #fff;
	color: var(--bn-agd-text);
	max-width: 340px;
}
.bn-ag-demo__field select:focus-visible {
	outline: 3px solid rgba(14, 107, 92, 0.35);
	outline-offset: 1px;
}

.bn-ag-langs { display: flex; gap: 8px; flex-wrap: wrap; }
.bn-ag-demo__langbtn {
	border: 1.5px solid #cbd5e1;
	background: #fff;
	border-radius: 999px;
	padding: 9px 18px;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	color: var(--bn-agd-text);
	transition: all 0.15s ease;
}
.bn-ag-demo__langbtn.is-active {
	background: var(--bn-agd-primary);
	border-color: var(--bn-agd-primary);
	color: #fff;
}
.bn-ag-demo__langbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.bn-ag-demo__langbtn:focus-visible {
	outline: 3px solid rgba(14, 107, 92, 0.35);
	outline-offset: 2px;
}

.bn-ag-demo__card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	padding: 26px;
}
.bn-ag-demo__cardhead h3 { margin: 0 0 6px; font-size: 1.3rem; }
.bn-ag-demo__provenance {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	color: var(--bn-agd-muted);
	font-size: 0.82rem;
	margin: 0 0 18px;
}
.bn-ag-demo__cms-badge {
	background: #e0f2f1;
	color: #0a4f44;
	padding: 3px 10px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.bn-ag-demo__card .bn-agp {
	max-width: none;
	margin-bottom: 18px;
}

.bn-ag-demo__textwrap summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--bn-agd-primary);
	margin-bottom: 8px;
}
.bn-ag-demo__text {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px 18px;
	max-height: 280px;
	overflow-y: auto;
	line-height: 1.7;
	font-size: 0.94rem;
	white-space: pre-wrap;
}
.bn-ag-demo__text:focus-visible {
	outline: 3px solid rgba(14, 107, 92, 0.35);
}

.bn-ag-demo__empty {
	text-align: center;
	color: var(--bn-agd-muted);
}
.bn-ag-demo__empty[hidden] { display: none; }

.bn-ag-demo__footer {
	margin-top: 28px;
	padding: 16px 20px;
	background: #f1f5f9;
	border-radius: 12px;
	font-size: 0.85rem;
	color: var(--bn-agd-muted);
	line-height: 1.6;
}
.bn-ag-demo__footer code {
	background: #e2e8f0;
	padding: 1px 6px;
	border-radius: 6px;
	font-size: 0.8rem;
}

/* Móvil */
@media (max-width: 600px) {
	.bn-ag-demo { padding: 20px 14px 36px; }
	.bn-ag-demo__card { padding: 18px 16px; }
	.bn-ag-demo__controls { gap: 14px; }
	.bn-ag-demo__field { min-width: 100%; }
	.bn-ag-demo__field select { max-width: none; }
	.bn-agp { padding: 17px; border-radius: 16px; }
	.bn-agp__langs { margin-left: 0; }
	.bn-agp__meta { gap: 8px; }
	.bn-agp__controls { flex-wrap: wrap; }
	.bn-agp__progress { min-width: 100%; order: 3; }
}
