/**
 * Catàleg i inscripció.
 *
 * Estils mínims i prefixats: el tema hi posa la tipografia i el color de
 * marca. Tot el que és de marca passa per una variable perquè el tema la
 * pugui redefinir sense tocar aquest fitxer.
 */

.tthe-catalog,
.tthe-detail {
	--tthe-accent: var( --wp--preset--color--primary, #0b5fff );
	--tthe-text: var( --wp--preset--color--foreground, #1a1a1a );
	--tthe-muted: #6b7280;
	--tthe-line: #e3e6ea;
	--tthe-radius: 10px;
	color: var( --tthe-text );
}

/* Filtres */

.tthe-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-bottom: 28px;
	padding: 16px;
	border: 1px solid var( --tthe-line );
	border-radius: var( --tthe-radius );
}

.tthe-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 180px;
	min-width: 0;
}

.tthe-field > span {
	font-size: 0.8125rem;
	color: var( --tthe-muted );
}

.tthe-field input,
.tthe-field select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var( --tthe-line );
	border-radius: 6px;
	background: #fff;
	font: inherit;
}

/* Graella */

.tthe-grid {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat( 1, minmax( 0, 1fr ) );
}

@media ( min-width: 600px ) {
	.tthe-grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( min-width: 900px ) {
	.tthe-cols-3 {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}

	.tthe-cols-4 {
		grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	}
}

/* Targeta */

.tthe-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var( --tthe-line );
	border-radius: var( --tthe-radius );
	overflow: hidden;
	background: #fff;
}

.tthe-card-media {
	display: block;
	aspect-ratio: 16 / 9;
	background: #f3f4f6;
}

.tthe-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tthe-card-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient( 135deg, #eef1f5, #dfe4ea );
}

.tthe-card-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	flex: 1;
}

.tthe-card-title {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.35;
}

.tthe-card-title a {
	color: inherit;
	text-decoration: none;
}

.tthe-card-title a:hover,
.tthe-card-title a:focus {
	text-decoration: underline;
}

.tthe-card-text {
	margin: 0;
	font-size: 0.9375rem;
	color: var( --tthe-muted );
}

.tthe-card-meta {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
}

.tthe-card-body .tthe-button {
	margin-top: auto;
	align-self: flex-start;
}

.tthe-eyebrow {
	margin: 0;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --tthe-accent );
}

/* Etiquetes */

.tthe-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.tthe-badge {
	display: inline-block;
	padding: 3px 9px;
	border: 1px solid var( --tthe-line );
	border-radius: 999px;
	font-size: 0.75rem;
	color: var( --tthe-muted );
}

.tthe-tag {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	background: #e8f5ec;
	color: #1d6b3a;
	font-size: 0.8125rem;
	font-weight: 600;
}

.tthe-tag-muted {
	background: #f3f4f6;
	color: var( --tthe-muted );
}

/* Botons */

.tthe-button {
	display: inline-block;
	padding: 10px 18px;
	border: 1px solid var( --tthe-accent );
	border-radius: 6px;
	background: var( --tthe-accent );
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.tthe-button:hover,
.tthe-button:focus {
	filter: brightness( 0.92 );
	color: #fff;
}

.tthe-button-ghost {
	background: transparent;
	color: var( --tthe-accent );
}

.tthe-button-ghost:hover,
.tthe-button-ghost:focus {
	background: var( --tthe-accent );
	color: #fff;
}

/* Fitxa */

.tthe-back {
	margin: 0 0 16px;
	font-size: 0.875rem;
}

.tthe-detail-head {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.tthe-detail-title {
	margin: 0;
}

.tthe-detail-media {
	margin-bottom: 28px;
	border-radius: var( --tthe-radius );
	overflow: hidden;
}

.tthe-detail-media img {
	width: 100%;
	height: auto;
	display: block;
}

.tthe-detail-grid {
	display: grid;
	gap: 32px;
	grid-template-columns: minmax( 0, 1fr );
	margin-bottom: 40px;
}

@media ( min-width: 860px ) {
	.tthe-detail-grid {
		grid-template-columns: minmax( 0, 2fr ) minmax( 0, 1fr );
	}
}

.tthe-facts {
	margin: 0;
	padding: 18px;
	border: 1px solid var( --tthe-line );
	border-radius: var( --tthe-radius );
}

.tthe-facts dt {
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --tthe-muted );
}

.tthe-facts dd {
	margin: 0 0 14px;
	font-weight: 600;
}

.tthe-facts dd:last-of-type {
	margin-bottom: 0;
}

/* Convocatòries */

.tthe-sessions h2 {
	margin: 0 0 16px;
	font-size: 1.25rem;
}

.tthe-session-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var( --tthe-line );
	border-radius: var( --tthe-radius );
	overflow: hidden;
}

.tthe-session {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid var( --tthe-line );
}

.tthe-session:last-child {
	border-bottom: 0;
}

.tthe-session.is-enrolled {
	background: #f7fbf8;
}

.tthe-session-info {
	min-width: 0;
}

.tthe-session-date {
	margin: 0;
	font-weight: 600;
}

.tthe-session-places {
	margin: 2px 0 0;
	font-size: 0.875rem;
	color: var( --tthe-muted );
}

/* Avisos */

.tthe-notice {
	margin: 0 0 24px;
	padding: 16px 18px;
	border: 1px solid var( --tthe-line );
	border-left: 4px solid var( --tthe-accent );
	border-radius: var( --tthe-radius );
	background: #f9fafb;
}

.tthe-notice p {
	margin: 0 0 10px;
}

.tthe-notice p:last-child {
	margin-bottom: 0;
}

.tthe-empty {
	padding: 24px;
	border: 1px dashed var( --tthe-line );
	border-radius: var( --tthe-radius );
	color: var( --tthe-muted );
	text-align: center;
}

/* Agenda de convocatòries
 *
 * Tot l'estil és d'aquest fitxer i penja del prefix .tthe-ag: no depèn de cap
 * classe ni estil del tema. El color i la forma es canvien amb variables, que
 * es poden redefinir des del CSS addicional del tema:
 *
 *   .tthe-ag { --tthe-ag-accent: #0b5fff; --tthe-ag-radius: 4px; }
 */

.tthe-ag {
	--tthe-ag-accent: #e63323;
	--tthe-ag-accent-hover: #c92b1d;
	--tthe-ag-accent-soft: #f7eaea;
	--tthe-ag-text: #111;
	--tthe-ag-muted: #2d2d2d;
	--tthe-ag-line: #d9d9d9;
	--tthe-ag-radius: 8px;
	--tthe-ag-gap: 22px;
	box-sizing: border-box;
	width: 100%;
	color: var( --tthe-ag-text );
	font-family: inherit;
	line-height: 1.4;
}

.tthe-ag *,
.tthe-ag *::before,
.tthe-ag *::after {
	box-sizing: border-box;
}

.tthe-ag [hidden] {
	display: none !important;
}

/* Filtres */

.tthe-ag .tthe-ag-filters {
	margin: 0 0 30px;
}

.tthe-ag .tthe-ag-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 40px;
	align-items: flex-start;
}

.tthe-ag .tthe-ag-filters__group {
	min-width: 0;
}

.tthe-ag .tthe-ag-filters__label {
	margin: 0 0 10px;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	color: var( --tthe-ag-text );
}

.tthe-ag .tthe-ag-filters__cats,
.tthe-ag .tthe-ag-filters__selects {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.tthe-ag .tthe-ag-pill,
.tthe-ag .tthe-ag-select {
	appearance: none;
	margin: 0;
	padding: 6px 16px;
	border: 1px solid var( --tthe-ag-line );
	border-radius: 50px;
	background-color: #fff;
	color: var( --tthe-ag-text );
	font: inherit;
	font-size: 17px;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	height: auto;
	min-height: 0;
	box-shadow: none;
	cursor: pointer;
}

.tthe-ag .tthe-ag-pill:hover,
.tthe-ag .tthe-ag-select:hover {
	background-color: #f5f5f5;
	color: var( --tthe-ag-text );
}

.tthe-ag .tthe-ag-pill.is-active {
	border-color: var( --tthe-ag-accent );
	background-color: var( --tthe-ag-accent );
	color: #fff;
}

.tthe-ag .tthe-ag-select {
	min-width: 130px;
	padding-right: 36px;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.tthe-ag .tthe-ag-pill:focus-visible,
.tthe-ag .tthe-ag-select:focus-visible,
.tthe-ag .tthe-ag-clear:focus-visible,
.tthe-ag .tthe-ag-btn:focus-visible,
.tthe-ag .tthe-ag-search__input:focus-visible,
.tthe-ag .tthe-ag-search__submit:focus-visible {
	outline: 2px solid var( --tthe-ag-accent );
	outline-offset: 2px;
}

.tthe-ag .tthe-ag-search {
	display: inline-flex;
	margin: 0;
	padding: 0;
}

.tthe-ag .tthe-ag-search__input {
	appearance: none;
	width: 220px;
	max-width: 100%;
	margin: 0;
	padding: 8px 20px;
	border: 1px solid var( --tthe-ag-accent );
	border-right: 0;
	border-radius: 50px 0 0 50px;
	background: #fff;
	color: var( --tthe-ag-text );
	font: inherit;
	font-size: 16px;
	line-height: 1.3;
	box-shadow: none;
}

.tthe-ag .tthe-ag-search__submit {
	appearance: none;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0 12px 0 9px;
	border: 1px solid var( --tthe-ag-accent );
	border-radius: 0 50px 50px 0;
	background: var( --tthe-ag-accent );
	color: #fff;
	cursor: pointer;
	box-shadow: none;
}

.tthe-ag .tthe-ag-search__submit:hover {
	background: var( --tthe-ag-accent-hover );
	border-color: var( --tthe-ag-accent-hover );
}

.tthe-ag .tthe-ag-search__submit svg {
	fill: #fff;
}

.tthe-ag .tthe-ag-clear {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #515151;
	font: inherit;
	font-size: 16px;
	text-decoration: underline;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
}

.tthe-ag .tthe-ag-clear:hover {
	color: var( --tthe-ag-text );
	background: none;
}

/* Llista i targetes */

.tthe-ag .tthe-ag__grid {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: var( --tthe-ag-gap );
}

.tthe-ag .tthe-ag__empty {
	margin: 24px 0;
	padding: 0;
	text-align: center;
	color: var( --tthe-ag-muted );
}

.tthe-ag .tthe-ag-card {
	display: flex;
	flex-direction: column;
	min-height: 230px;
	margin: 0;
	padding: 0;
	border: 1px solid var( --tthe-ag-line );
	border-radius: var( --tthe-ag-radius );
	background: #fff;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 );
	overflow: hidden;
}

.tthe-ag .tthe-ag-card__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 12px;
	padding: 14px 16px 12px;
	border-bottom: 1px solid #efefef;
	font-size: 15px;
	color: var( --tthe-ag-muted );
}

.tthe-ag .tthe-ag-card__date,
.tthe-ag .tthe-ag-card__time {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tthe-ag .tthe-ag-card__icon {
	flex: none;
}

.tthe-ag .tthe-ag-card__body {
	flex: 1 1 auto;
	padding: 18px 16px 20px;
}

.tthe-ag .tthe-ag-card__title {
	margin: 0 0 10px;
	padding: 0;
	font-size: 18px;
	line-height: 1.35;
	font-weight: 700;
	color: var( --tthe-ag-text );
}

.tthe-ag .tthe-ag-card__info {
	margin: 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.4;
	color: var( --tthe-ag-muted );
}

.tthe-ag .tthe-ag-sessions {
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.tthe-ag .tthe-ag-session {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 9px 0;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
	font-size: 14px;
	line-height: 1.35;
}

.tthe-ag .tthe-ag-session[hidden] {
	display: none;
}

.tthe-ag .tthe-ag-session__when {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
}

.tthe-ag .tthe-ag-session__extra,
.tthe-ag .tthe-ag-session__state {
	color: var( --tthe-ag-muted );
}

.tthe-ag .tthe-ag-session__link {
	flex: 0 0 auto;
	font-weight: 600;
	text-decoration: underline;
	color: var( --tthe-ag-accent );
}

.tthe-ag .tthe-ag-session__link:hover {
	color: var( --tthe-ag-accent-hover );
}

.tthe-ag .tthe-ag-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px;
	background: var( --tthe-ag-accent-soft );
}

.tthe-ag .tthe-ag-card__agreement {
	font-size: 14px;
	font-weight: 600;
	color: var( --tthe-ag-text );
}

.tthe-ag .tthe-ag-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 110px;
	min-height: 42px;
	margin: 0 0 0 auto;
	padding: 10px 16px;
	border: 0;
	border-radius: var( --tthe-ag-radius );
	background: var( --tthe-ag-accent );
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.tthe-ag a.tthe-ag-btn:hover,
.tthe-ag a.tthe-ag-btn:focus {
	background: var( --tthe-ag-accent-hover );
	color: #fff;
}

/* Una convocatòria que ja no admet ningú no ha de semblar un botó clicable. */
.tthe-ag .tthe-ag-btn--full,
.tthe-ag .tthe-ag-btn--done {
	cursor: default;
	pointer-events: none;
	opacity: 0.65;
}

.tthe-ag .tthe-ag-btn--done {
	opacity: 1;
}

@media ( max-width: 980px ) {
	.tthe-ag .tthe-ag__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 767px ) {
	.tthe-ag .tthe-ag__grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.tthe-ag .tthe-ag-card__head {
		flex-direction: column;
	}

	.tthe-ag .tthe-ag-card__foot {
		flex-direction: column;
		align-items: stretch;
	}

	.tthe-ag .tthe-ag-btn {
		width: 100%;
		margin: 0;
	}

	.tthe-ag .tthe-ag-search,
	.tthe-ag .tthe-ag-search__input {
		width: 100%;
	}
}

.tthe-session.is-chosen {
	box-shadow: inset 3px 0 0 var( --tthe-accent, #0b5fff );
}

/* Conveni i confirmació */

.tthe-badge-conveni {
	border-color: var( --tthe-accent );
	color: var( --tthe-accent );
}

.tthe-notice-error {
	border-left-color: #b42318;
	background: #fef3f2;
}

.tthe-confirmation .tthe-facts {
	margin-bottom: 24px;
}

.tthe-confirmation-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

/* Registre i inscripció */

.tthe-checkout .tthe-login-banner {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
}

.tthe-checkout .tthe-login-banner p {
	margin: 0;
}

.tthe-checkout-lead {
	margin: 24px 0;
}

.tthe-form {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.tthe-block {
	margin: 0;
	padding: 20px;
	border: 1px solid var( --tthe-line );
	border-radius: var( --tthe-radius );
	min-width: 0;
}

.tthe-block legend {
	padding: 0 8px;
	font-size: 1.125rem;
	font-weight: 600;
}

.tthe-fields {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 16px;
	grid-template-columns: minmax( 0, 1fr );
}

@media ( min-width: 700px ) {
	.tthe-fields {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	.tthe-fieldrow-check {
		grid-column: 1 / -1;
	}
}

.tthe-fieldrow {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.tthe-fieldrow > label {
	font-size: 0.875rem;
	font-weight: 600;
}

.tthe-fieldrow input:not( [type="checkbox"] ),
.tthe-fieldrow select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var( --tthe-line );
	border-radius: 6px;
	background: #fff;
	font: inherit;
	box-sizing: border-box;
}

.tthe-fieldrow.has-error input,
.tthe-fieldrow.has-error select {
	border-color: #b42318;
}

.tthe-fieldrow-check label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-weight: 400;
}

.tthe-field-help {
	margin: 0;
	font-size: 0.8125rem;
	color: var( --tthe-muted );
}

.tthe-field-error {
	margin: 0;
	font-size: 0.8125rem;
	color: #b42318;
}

.tthe-form-error {
	padding: 14px 16px;
	border: 1px solid #fda29b;
	border-left: 4px solid #b42318;
	border-radius: var( --tthe-radius );
	background: #fef3f2;
	color: #7a271a;
}

.tthe-privacy {
	margin-top: 16px;
	font-size: 0.8125rem;
	color: var( --tthe-muted );
}

.tthe-privacy p {
	margin: 0 0 8px;
}

.tthe-form-actions {
	margin: 0;
}

.tthe-wait {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba( 55, 60, 70, 0.72 );
	outline: none;
}

.tthe-wait[hidden] {
	display: none;
}

.tthe-wait-box {
	width: 100%;
	max-width: 440px;
	padding: 36px 28px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.35 );
	text-align: center;
}

html.tthe-wait-open,
html.tthe-wait-open body {
	overflow: hidden;
}

.tthe-wait-title {
	margin: 16px 0 6px;
	font-size: 1.125rem;
	font-weight: 600;
}

.tthe-wait-step {
	margin: 0;
	color: var( --tthe-muted );
}

.tthe-spinner {
	width: 40px;
	height: 40px;
	margin: 0 auto;
	border: 4px solid var( --tthe-line );
	border-top-color: var( --tthe-accent, #0b5fff );
	border-radius: 50%;
	animation: tthe-spin 0.9s linear infinite;
}

@keyframes tthe-spin {
	to {
		transform: rotate( 360deg );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.tthe-spinner {
		animation-duration: 3s;
	}
}

/* Preu */

.tthe-session-price {
	font-weight: 600;
}

/* Pàgina de la fitxa (/formacio/<slug>/) */

.tthe-page {
	display: block;
	padding: 40px 16px 64px;
}

.tthe-page .tthe-page__inner {
	max-width: 1100px;
	margin: 0 auto;
}
