/**
 * SG Acordeón — estilos del front-end.
 * Técnica "checkbox-hack": el estado abierto/cerrado se maneja con CSS
 * puro (radios ocultos + :checked), sin depender de JavaScript.
 */

.sg-acc-group {
	max-width: 100%;
}

.sg-acc-panel {
	margin-bottom: 8px;
}

.sg-acc-radio {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.sg-acc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	cursor: pointer;
	padding: 14px 18px;
	background: var(--sg-acc-bg, #f2f2f2);
	color: var(--sg-acc-color, #222222);
	font-family: var(--sg-acc-font, inherit);
	font-size: var(--sg-acc-font-size, 1rem);
	font-weight: 600;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	transition: background 0.15s ease, color 0.15s ease;
	margin: 0;
}

.sg-acc-title {
	flex: 1;
}

.sg-acc-arrow {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.sg-acc-radio:checked + .sg-acc-header {
	background: var(--sg-acc-bg-active, #1e88e5);
	color: var(--sg-acc-color-active, #ffffff);
	border-radius: 4px 4px 0 0;
}

.sg-acc-radio:checked + .sg-acc-header .sg-acc-arrow {
	transform: rotate(180deg);
}

.sg-acc-radio:focus-visible + .sg-acc-header {
	outline: 3px solid var(--sg-acc-bg-active, #1e88e5);
	outline-offset: 2px;
}

/* Encabezado partido: título enlazado a una URL propia + flecha aparte
   que abre/cierra el panel. */
.sg-acc-header-split {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0;
	cursor: default;
	background: var(--sg-acc-bg, #f2f2f2);
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	margin: 0;
}

.sg-acc-title-link {
	flex: 1;
	padding: 14px 18px;
	color: var(--sg-acc-color, #222222);
	font-family: var(--sg-acc-font, inherit);
	font-size: var(--sg-acc-font-size, 1rem);
	font-weight: 600;
	text-decoration: none;
}

.sg-acc-title-link:hover,
.sg-acc-title-link:focus {
	text-decoration: underline;
}

.sg-acc-arrow-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 52px;
	padding: 14px 16px;
	cursor: pointer;
	color: var(--sg-acc-color, #222222);
	margin: 6px 6px 6px 0;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.12);
	transition: background 0.15s ease;
}

.sg-acc-arrow-toggle:hover,
.sg-acc-arrow-toggle:focus {
	background: rgba(0, 0, 0, 0.22);
}

.sg-acc-arrow-toggle .sg-acc-arrow {
	font-size: 1.3em;
	line-height: 1;
}

.sg-acc-radio:checked + .sg-acc-header-split .sg-acc-arrow-toggle {
	background: rgba(255, 255, 255, 0.25);
}

.sg-acc-radio:checked + .sg-acc-header-split .sg-acc-arrow-toggle:hover,
.sg-acc-radio:checked + .sg-acc-header-split .sg-acc-arrow-toggle:focus {
	background: rgba(255, 255, 255, 0.4);
}

.sg-acc-radio:checked + .sg-acc-header-split {
	background: var(--sg-acc-bg-active, #1e88e5);
	border-radius: 4px 4px 0 0;
}

.sg-acc-radio:checked + .sg-acc-header-split .sg-acc-title-link,
.sg-acc-radio:checked + .sg-acc-header-split .sg-acc-arrow-toggle {
	color: var(--sg-acc-color-active, #ffffff);
}

.sg-acc-radio:checked + .sg-acc-header-split .sg-acc-arrow {
	transform: rotate(180deg);
}

.sg-acc-radio:focus-visible + .sg-acc-header-split .sg-acc-arrow-toggle {
	outline: 3px solid var(--sg-acc-bg-active, #1e88e5);
	outline-offset: -2px;
}

/* Botones insertados dentro del contenido de un panel. */
.sg-acc-body .sg-acc-btn {
	display: inline-block;
	padding: 8px 18px;
	margin: 4px 6px 4px 0;
	background: var(--sg-acc-bg-active, #1e88e5);
	color: #ffffff;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	transition: opacity 0.15s ease;
}

.sg-acc-body .sg-acc-btn:hover,
.sg-acc-body .sg-acc-btn:focus {
	opacity: 0.85;
	color: #ffffff;
}

/* Fila de enlace simple: página/entrada/enlace de nivel superior sin
   hijos ni contenido propio — no es un acordeón, solo navega. */
.sg-acc-panel-link {
	margin-bottom: 8px;
}

.sg-acc-link-item {
	display: block;
	padding: 14px 18px;
	background: var(--sg-acc-bg, #f2f2f2);
	color: var(--sg-acc-color, #222222);
	font-family: var(--sg-acc-font, inherit);
	font-size: var(--sg-acc-font-size, 1rem);
	font-weight: 600;
	text-decoration: none;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.sg-acc-link-item:hover,
.sg-acc-link-item:focus {
	background: var(--sg-acc-bg-active, #1e88e5);
	color: var(--sg-acc-color-active, #ffffff);
}

/* Lista anidada de hijos (Opción A): siempre visible dentro del panel
   abierto de su ancestro, con sangría por nivel. */
.sg-acc-sublist {
	list-style: none;
	margin: 12px 0 0;
	padding: 0 0 0 20px;
	border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.sg-acc-subitem {
	margin-bottom: 10px;
}

.sg-acc-sub-link {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.sg-acc-sub-link:hover,
.sg-acc-sub-link:focus {
	text-decoration: underline;
}

.sg-acc-sub-title {
	font-weight: 600;
	margin-bottom: 4px;
}

.sg-acc-sub-content {
	font-size: 0.95em;
}

.sg-acc-body {
	max-height: 0;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-top: none;
	border-radius: 0 0 4px 4px;
	padding: 0 18px;
	transition: max-height 0.25s ease, padding 0.25s ease;
}

.sg-acc-radio:checked + .sg-acc-header + .sg-acc-body {
	max-height: 4000px;
	padding: 14px 18px;
}

.sg-acc-body > *:first-child {
	margin-top: 0;
}

.sg-acc-body > *:last-child {
	margin-bottom: 0;
}

