/**
 * Pàgina Historial d’informes.
 * Prefix: .pe-historial / .pe-historial-layout
 */

/* Àrea de títol Bridge a amplada completa */
body.page-template-page-informes-historial-php .title_outer {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

body.page-template-page-informes-historial-php .title_outer .title {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Tokens d’accent per pàgina (ACF): .pe-historial-theme o body via inline style */ 
.pe-historial-theme {
	box-sizing: border-box;
}

.pe-historial-layout {
	box-sizing: border-box;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--pe-child-page-gutter);
}

/* H2 principal — títol de secció (ACF) */
.pe-historial__page-heading {
	margin: var(--pe-child-space-page-heading-margin);
	font-size: clamp(1.25rem, 2.5vw, 1.75rem);
	font-weight: 700;
	line-height: 1.25;
	color: var(--pe-child-text);
}

@media (min-width: 992px) {
	.pe-historial__page-heading {
		font-size: 40px;
	}
}

/* Gutenberg: mateix ample que H2, subtítol i llistat (dins .pe-historial-layout) */
.pe-historial__gutenberg {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0 0 var(--pe-child-space-gutenberg-block-end);
	font-size: 1rem;
	line-height: 1.55;
	color: var(--pe-child-text-muted);
}

.pe-historial__gutenberg > *:first-child {
	margin-top: 0;
}

.pe-historial__gutenberg a {
	color: var(--pe-child-accent);
}

/* Subtítol amb icona (accent) */
.pe-historial__subsection {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0 0 var(--pe-child-space-subsection-gap);
	font-weight: 700;
	line-height: 1.25;
	color: var(--pe-child-accent);
}

.pe-historial__subsection-icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--pe-child-accent);
}

.pe-historial__subsection-text {
	flex: 1;
	font-size: clamp(1rem, 2.8vw, 1.65rem);
	line-height: 1.25;
	color: var(--pe-child-accent);
}

.pe-historial {
	box-sizing: border-box;
	max-width: 1200px;
	margin: 0 auto 3rem;
	padding: 0 var(--pe-child-page-gutter) 2rem;
}

.pe-historial__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--pe-child-border-subtle);
	border-radius: 4px;
	overflow: visible;
}  

.pe-historial__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
	padding: 0.85rem 1rem;
	list-style: none;
	transition: background-color 0.18s ease;
}
 
/* Zebrat neutre: blanc trencat / gris molt clar (sense color d’accent) */ 
.pe-historial__list {
	--pe-historial-stripe-off-white: #faf9f7;
	--pe-historial-stripe-gray: #eff1f3;
}

.pe-historial__list > .pe-historial__row:nth-child(odd) {
	background-color: var(--pe-historial-stripe-gray);
}

.pe-historial__list > .pe-historial__row:nth-child(even) {
	background-color: var(--pe-historial-stripe-off-white);
}

.pe-historial__row:hover {
	background-color: var(--pe-child-row-hover) !important;
}
 
.pe-historial__row-link {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
	flex: 1;
	text-decoration: none;
	color: inherit;
	border-radius: 2px;
	cursor: default;
}

.pe-historial__row-link--disabled { 
	cursor: default;
}

.pe-historial__row-link:not(.pe-historial__row-link--disabled) {
	cursor: pointer;
}

/* Sense informe digital obrible: mateix contrast de text que la resta de files */  
.pe-historial__row-link--disabled .pe-historial__row-title {
	color: var(--pe-child-text);
}

.pe-historial__row-link--disabled .pe-historial__bullet {
	opacity: 1;
}
 
.pe-historial__actions {
	flex-shrink: 0;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	overflow: visible;
}

.pe-historial__view,
.pe-historial__map,
.pe-historial__download,
.pe-historial__download--secondary {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	overflow: visible;
	line-height: 0;
	background: var(--pe-child-accent);
	color: var(--pe-child-on-accent) !important;
	border-radius: 3px;
	text-decoration: none !important;
	transition: background-color 0.18s ease, transform 0.15s ease;
}

.pe-historial__view > .pe-historial__download-inner,
.pe-historial__map > .pe-historial__download-inner,
.pe-historial__download > .pe-historial__download-inner,
.pe-historial__download--secondary > .pe-historial__download-inner {
	position: relative;
	z-index: 1;
	flex-shrink: 0;
}

/* Bridge: overflow:hidden als contenidors retalla la caixeta del tooltip */
body.page-template-page-informes-historial-php .wrapper_inner,
body.page-template-page-informes-historial-php .full_width,
body.page-template-page-informes-historial-php .full_width_inner,
body.page-template-page-informes-historial-php .column_inner {
	overflow: visible !important;
}

.pe-historial__view:hover,
.pe-historial__view:focus-visible,
.pe-historial__map:hover,
.pe-historial__map:focus-visible,
.pe-historial__download:hover,
.pe-historial__download:focus-visible,
.pe-historial__download--secondary:hover,
.pe-historial__download--secondary:focus-visible {
	background: var(--pe-child-accent-dark);
	color: var(--pe-child-on-accent) !important;
}

.pe-historial__view:focus {
	outline: none;
}

.pe-historial__map:focus {
	outline: none;
}
 
.pe-historial__download:focus {
	outline: none;
}

.pe-historial__view:focus-visible {
	outline: 3px solid var(--pe-child-focus-ring);
	outline-offset: 2px;
}

.pe-historial__map:focus-visible {
	outline: 3px solid var(--pe-child-focus-ring);
	outline-offset: 2px;
}

.pe-historial__download:focus-visible,
.pe-historial__download--secondary:focus-visible {
	outline: 3px solid var(--pe-child-focus-ring);
	outline-offset: 2px;
} 

.pe-historial__download--secondary:focus {
	outline: none;
}

.pe-historial__row-link:not(.pe-historial__row-link--disabled):hover .pe-historial__row-title,
.pe-historial__row-link:not(.pe-historial__row-link--disabled):focus-visible .pe-historial__row-title {
	color: var(--pe-child-accent);
	text-decoration: underline;
}

.pe-historial__row-link:focus {
	outline: none;
}

.pe-historial__row-link:focus-visible {
	outline: 3px solid var(--pe-child-focus-ring);
	outline-offset: 2px;
}

.pe-historial__bullet {
	flex-shrink: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--pe-child-text);
}

.pe-historial__row-title {
	font-size: 1rem;
	line-height: 1.45;
	color: var(--pe-child-text);
	font-weight: 600;
}

/* (shared styles for .pe-historial__download are defined together with .pe-historial__view and .pe-historial__map) */

/* Evita el buit sota el SVG (baseline d’inline); centra l’icona al quadrat */ 
.pe-historial__download-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	line-height: 0;
}

.pe-historial__download-inner svg {
	display: block;
	flex-shrink: 0;
}

.pe-historial__download--missing {
	background: transparent;
	border: 1px dashed var(--pe-child-download-border);
	pointer-events: none;
}

/* (shared hover/focus styles for .pe-historial__download are defined together with .pe-historial__view and .pe-historial__map) */

.pe-historial__empty {
	margin: 1rem 0;
	color: var(--pe-child-text-soft);
}

body.page-template-page-informes-historial-php .title_outer .title h1,
body.page-template-page-informes-historial-php .title_outer .title h1 span,
body.page-template-page-informes-historial-php .title_outer .title h1 a {
	color: var(--pe-child-on-accent) !important;
}
