/*
 * En Clau Vocal – site styles on top of Twenty Twenty-Five.
 * Colours and fonts come from theme.json (logo palette: black, crimson #B40223, white).
 */

/* ---------------------------------------------------------------- header */
.ecv-capcalera {
	padding-top: var(--wp--preset--spacing--40);
}
.ecv-logotip {
	gap: clamp(1rem, 4vw, 3rem);
}
.ecv-logotip figure {
	margin: 0;
}
.ecv-logotip img {
	display: block;
	height: auto;
}
.ecv-logotip__emblema img {
	width: clamp(64px, 14vw, 130px) !important;
}
.ecv-logotip__nom img {
	width: clamp(180px, 46vw, 520px) !important;
}
.ecv-menu {
	margin-top: var(--wp--preset--spacing--30) !important;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	padding: 0.75rem 0;
}
.ecv-menu .wp-block-navigation {
	/* narrower gaps on tablets, so the menu stays on one line (from 680px; below 600px: menu button) */
	gap: 0.25rem clamp(0.75rem, 5vw - 1.25rem, 2rem);
}
.ecv-menu .wp-block-navigation-item.current-menu-item > a,
.ecv-menu .wp-block-navigation-item a[aria-current="page"] {
	color: var(--wp--preset--color--accent-1);
	font-weight: 700;
}
.ecv-menu .wp-block-navigation__responsive-container-open {
	color: var(--wp--preset--color--accent-1);
}

/* ---------------------------------------------------------------- main area */
.ecv-principal {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--60);
}
.ecv-principal > .wp-block-post-title {
	margin-bottom: var(--wp--preset--spacing--40);
}
.wp-block-post-content .wp-block-heading {
	margin-top: 1.6em;
}
.wp-block-post-content > .wp-block-heading:first-child {
	margin-top: 0;
}

/* Responsive columns (Membres, Repertori, Vídeos): headings closer to their lists */
.ecv-columnes > .wp-block-group > .wp-block-heading:first-child {
	margin-top: 0;
}
.ecv-columnes {
	margin-top: var(--wp--preset--spacing--40);
}

/* ---------------------------------------------------------------- home page */
.ecv-portada .wp-block-columns {
	margin-top: var(--wp--preset--spacing--50);
	gap: var(--wp--preset--spacing--50);
}
.ecv-titol-columna {
	font-size: var(--wp--preset--font-size--small) !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700 !important;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--wp--preset--color--accent-5);
	margin-top: 0 !important;
}
.ecv-columna-noticies {
	border: 1px solid #e3e3e3;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	padding: var(--wp--preset--spacing--30);
	align-self: flex-start;
}
.ecv-columna-principal > .wp-block-heading:first-child {
	margin-top: 0;
}
.wp-block-latest-posts {
	padding-left: 0;
}
.wp-block-latest-posts li {
	margin-bottom: 1.25rem;
}
.wp-block-latest-posts__post-title {
	font-family: var(--wp--preset--font-family--sintony);
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.wp-block-latest-posts__post-title:hover {
	color: var(--wp--preset--color--accent-1);
}
.wp-block-latest-posts__post-date {
	color: var(--wp--preset--color--accent-4);
}
/* Instagram column: image and the beginning of the post's text (added by the site
   plugin). Beside the other columns: text under the image. Full width (phones, tablets):
   text beside the image. Decided by the column's width, not the screen's: the columns
   only stack below 782px, the feed plugin switches at other widths. */
.ecv-columna-xarxes {
	container-type: inline-size;
}
.ecv-instagram-text {
	margin: 0.45rem 0 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}
@container (min-width: 300px) {
	.ecv-columna-xarxes #sb_instagram #sbi_images .sbi_item {   /* more specific than the plugin's */
		display: grid;
		grid-template-columns: min(40%, 180px) 1fr;
		gap: 0 1rem;
		align-items: start;
	}
	.ecv-columna-xarxes .ecv-instagram-text {
		margin-top: 0;
		-webkit-line-clamp: 6;
		line-clamp: 6;
	}
}

/* ---------------------------------------------------------------- slideshow (Gallery block, style "Presentació") */
.wp-block-gallery.is-style-presentacio {
	--ecv-proporcio: 5 / 2;
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	aspect-ratio: var(--ecv-proporcio);
	margin-bottom: 0;
	background: #000;
}
.wp-block-gallery.is-style-presentacio::-webkit-scrollbar {
	display: none;
}
.wp-block-gallery.is-style-presentacio.has-nested-images > figure.wp-block-image {
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	position: relative;
}
.wp-block-gallery.is-style-presentacio.has-nested-images > figure.wp-block-image img,
.wp-block-gallery.is-style-presentacio.has-nested-images > figure.wp-block-image a {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.wp-block-gallery.is-style-presentacio.has-nested-images figure.wp-block-image figcaption {
	position: absolute;
	left: 6%;
	right: auto;
	bottom: 12%;
	max-width: min(30rem, 70%);
	max-height: none;
	overflow: visible;
	margin: 0;
	padding: 0.6rem 1rem;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	font-size: var(--wp--preset--font-size--small);
	text-align: left;
	backdrop-filter: none;
	box-sizing: border-box;
}
.wp-block-gallery.is-style-presentacio.has-nested-images figure.wp-block-image figcaption strong {
	display: block;
	font-family: var(--wp--preset--font-family--sintony);
	font-size: clamp(1rem, 2.4vw, 1.6rem);
	font-weight: 400;
	line-height: 1.2;
}
.wp-block-gallery.is-style-presentacio.has-nested-images figure.wp-block-image:has(figcaption)::before {
	display: none; /* no gradient behind captions, the caption box is opaque */
}
@media (max-width: 600px) {
	.wp-block-gallery.is-style-presentacio {
		--ecv-proporcio: 3 / 2;
	}
	.wp-block-gallery.is-style-presentacio.has-nested-images figure.wp-block-image figcaption {
		left: 0;
		bottom: 0;
		max-width: 100%;
		width: 100%;
	}
}
/* Controls added by presentacio.js */
.ecv-presentacio {
	position: relative;
}
.ecv-presentacio__boto {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ecv-presentacio__boto:hover,
.ecv-presentacio__boto:focus-visible {
	background: var(--wp--preset--color--accent-1);
}
.ecv-presentacio__boto--anterior {
	left: 0.75rem;
}
.ecv-presentacio__boto--seguent {
	right: 0.75rem;
}
.ecv-presentacio__punts {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.6rem;
}
.ecv-presentacio__punt {
	width: 0.7rem;
	height: 0.7rem;
	padding: 0;
	border: 1px solid var(--wp--preset--color--accent-4);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}
.ecv-presentacio__punt[aria-current="true"] {
	background: var(--wp--preset--color--accent-1);
	border-color: var(--wp--preset--color--accent-1);
}

/* ---------------------------------------------------------------- concert list (Table block, style "Actuacions") */
.wp-block-table.is-style-actuacions table {
	border-collapse: collapse;
	table-layout: auto;
	width: 100%;
}
.wp-block-table.is-style-actuacions thead {
	/* column titles only for screen readers, like the old visual list */
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.wp-block-table.is-style-actuacions {
	container-type: inline-size;
}
.wp-block-table.is-style-actuacions tr {
	/* 1 column on narrow screens, 2 on medium ones, 3 on wide ones (like the old site) */
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 1rem;
	border-bottom: 1px solid var(--wp--preset--color--accent-5);
	padding: 0.45rem 0;
}
@container (min-width: 30rem) {
	.wp-block-table.is-style-actuacions tr {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
	.wp-block-table.is-style-actuacions td:nth-child(3) {
		grid-column: 2;
	}
}
@container (min-width: 44rem) {
	.wp-block-table.is-style-actuacions tr {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.3fr);
	}
	.wp-block-table.is-style-actuacions td:nth-child(3) {
		grid-column: auto;
	}
}
.wp-block-table.is-style-actuacions td,
.wp-block-table.is-style-actuacions th {
	border: 0;
	padding: 0.1rem 0.25rem;
}
.wp-block-table.is-style-actuacions td:first-child {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}
.wp-block-table.is-style-actuacions td:not(:first-child) {
	color: #555;
}

/* Other tables (concert programmes in the news): no lines and only as wide as their
   content, as on the old site. Borders set in the block's settings still apply. */
.wp-block-table:not(.is-style-actuacions) table {
	width: auto;
	table-layout: auto;
}
.wp-block-table:not(.is-style-actuacions) :where(thead, tfoot, th, td) {
	border: 0;
}
.wp-block-table:not(.is-style-actuacions) :where(th, td) {
	padding: 0.15em 2em 0.15em 0;
	vertical-align: top;
}
.wp-block-table:not(.is-style-actuacions) :where(th, td):last-child {
	padding-right: 0;
}
.wp-block-table:not(.is-style-actuacions) tr:not(:first-child) > td[colspan] {
	padding-top: 0.9em;   /* "2a part" */
}
/* In the editor only: faint cell outlines, so the cells can still be seen while editing */
.wp-block-table[data-type="core/table"]:not(.is-style-actuacions) :where(th, td) {
	outline: 1px dashed #cccccc;
	outline-offset: -1px;
}

/* ---------------------------------------------------------------- news list and news posts */
.ecv-llista-noticies .wp-block-post-template > li {
	padding: var(--wp--preset--spacing--30) 0;
	border-bottom: 1px solid var(--wp--preset--color--accent-5);
}
.ecv-llista-noticies .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	margin-bottom: 0.25rem;
}
.ecv-llista-noticies .wp-block-post-excerpt {
	margin-top: 0.5rem;
}
.ecv-llista-noticies .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--40);
}
.ecv-noticia > .wp-block-post-date {
	margin-top: calc(-1 * var(--wp--preset--spacing--30));
}
.ecv-noticia__navegacio {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--accent-5);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------------------------------------------------------------- footer */
.ecv-peu {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--40);
	border-top: 1px solid #ddd;
	color: #555;
	font-size: var(--wp--preset--font-size--small);
}
.ecv-peu p {
	margin: 0;
}
.ecv-peu a {
	color: inherit;
}
.ecv-peu a:hover {
	color: var(--wp--preset--color--accent-1);
}
.wp-block-social-links.is-style-logos-only .wp-social-link {
	color: var(--wp--preset--color--contrast);
}
.wp-block-social-links.is-style-logos-only .wp-social-link:hover {
	color: var(--wp--preset--color--accent-1);
}

/* ---------------------------------------------------------------- accessibility */
:where(a, button):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-presentacio {
		scroll-behavior: auto;
	}
}
.ecv-presentacio > .wp-block-gallery {
	max-width: none;
	margin: 0;
}

/* ---------------------------------------------------------------- contact form (Contact Form 7) */
.wpcf7-form p {
	margin: 0 0 1.1rem;
}
.wpcf7-form label {
	display: block;
	font-weight: 600;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 36rem;
	margin-top: 0.3rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid #b5b5b5;
	border-radius: 4px;
	background: #fff;
	font: inherit;
	font-weight: 400;
	color: inherit;
}
.wpcf7-form textarea {
	min-height: 10rem;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 0;
	border-color: var(--wp--preset--color--accent-1);
}
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}
.wpcf7-form .wpcf7-acceptance label {
	display: flex;
	gap: 0.6rem;
	align-items: baseline;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--small);
}
.wpcf7-form .wpcf7-submit {
	padding: 0.7rem 1.8rem;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--accent-1);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.wpcf7-form .wpcf7-submit:hover,
.wpcf7-form .wpcf7-submit:focus-visible {
	background: var(--wp--preset--color--accent-2);
}
.wpcf7-form .wpcf7-response-output {
	margin: 1rem 0 0 !important;
	padding: 0.75rem 1rem !important;
	border-radius: 4px;
}
.wpcf7-not-valid-tip {
	color: var(--wp--preset--color--accent-1);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------------------------------------------------------------- embedded videos (Embed Privacy overlay) */
/* Let the locally stored preview image show through; the text stays readable. */
.embed-privacy-container .embed-privacy-overlay {
	background-color: rgba(0, 0, 0, 0.45);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.embed-privacy-container:hover .embed-privacy-overlay {
	background-color: rgba(0, 0, 0, 0.6);
}
.embed-privacy-container .embed-privacy-overlay a {
	color: #fff;
}
