/* Tarjetas · Características técnicas
   Sin fondo propio (se pone en Divi). Rejilla de 4 columnas con líneas de 1 px.
   Al pasar el cursor: el icono se dibuja, la rayita se alarga y el nombre se subraya. Ningún texto se mueve. */
.tg {
	/* Los mismos colores que las galerías: marrón, marrón suave para textos secundarios, gris piedra y hueso */
	--tg-ink: #513a2a;
	--tg-ink-2: #665244;
	--tg-stone: #afaea7;
	--tg-line: #afaea7;
	--tg-bone: #edece8;
	--tg-tint: rgba(81, 58, 42, .035);
	--tg-ease: cubic-bezier(.65, 0, .15, 1);
	--tg-move: .8s;
	--tg-per: 8;
	position: relative;
	color: var(--tg-ink);
	font-family: inherit; /* la letra de la web (Metropolis), como en las galerías */
	margin: 0;
}
.tg *, .tg *::before, .tg *::after { box-sizing: border-box; }
.tg button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: normal; }
.tg button:focus-visible { outline: 1px solid var(--tg-ink); outline-offset: 3px; }

/* Iconos de trazo fino (1 px) */
.tg .tg-ic { display: block; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.tg .tg-ic > * { stroke-dasharray: 1; stroke-dashoffset: 0; }

/* Usos: como los titulitos (14 px, semibold, mayúsculas, espaciado 1 px) */
/* Usos: sin marco ni fondo, en las mismas 4 columnas que las tarjetas y alineados con su texto (30 px).
 * El texto a la izquierda y el icono a la derecha, como el número y el icono de cada tarjeta. */
.tg-uses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 0; margin: 0 0 30px; border-left: 1px solid transparent; }
.tg-uses span { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; padding: 0 31px 0 30px; /* 31 = 30 + la línea de 1 px de la tarjeta */ font-size: 14px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; line-height: 1.4; }
.tg-uses .tg-ic { width: 35px; height: 35px; flex: none; }

/* Tarjeta: escala 14 / 24, sin negritas, espaciados en múltiplos de 5 */
.tg-cell { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 220px; padding: 30px; border-right: 1px solid var(--tg-line); border-bottom: 1px solid var(--tg-line); background: transparent; transition: background .5s var(--tg-ease); }
.tg-cell:hover { background: var(--tg-tint); }
.tg-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tg-num { font-size: 14px; line-height: 1.4; color: var(--tg-stone); font-variant-numeric: tabular-nums; transition: color .4s; }
.tg-cell .tg-ic { width: 35px; height: 35px; flex: none; color: var(--tg-ink); }
/* Rayita: 1 px marrón; al pasar el cursor se alarga (es lo único que crece, ningún texto se mueve) */
.tg-rule { display: block; width: 30px; height: 0; margin-top: 5px; border-top: 1px solid var(--tg-ink); transition: width var(--tg-move) var(--tg-ease); }
.tg-val { margin-top: 5px; font-size: 24px; font-weight: 400; line-height: 1.2; color: var(--tg-ink); font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.tg-name { font-size: 14px; font-weight: 400; line-height: 1.4; color: var(--tg-ink); }
/* Subrayado igual que en los índices: 1 px, 3 px por debajo de la letra */
.tg-name span { position: relative; }
.tg-name span::before { content: ""; position: absolute; left: 0; bottom: -3px; width: 0; border-top: 1px solid currentColor; transition: width .7s var(--tg-ease); }
.tg-det { font-size: 14px; line-height: 1.5; color: var(--tg-ink-2); }
.tg-norm { font-size: 14px; line-height: 1.4; color: var(--tg-stone); }
.tg-multi { display: flex; flex-direction: column; gap: 10px; }
.tg-multi > span { display: flex; flex-direction: column; gap: 5px; font-size: 24px; }
.tg-multi small { font-size: 14px; font-weight: 400; font-style: italic; letter-spacing: 0; text-transform: none; color: var(--tg-stone); } /* colección: cursiva, 14 regular, tal cual se escribe y en gris piedra */

.tg-cell:hover .tg-ic > * { animation: tg-ink 1.1s var(--tg-ease) both; }
.tg-cell:hover .tg-ic > *:nth-child(2) { animation-delay: .08s; }
.tg-cell:hover .tg-ic > *:nth-child(n+3) { animation-delay: .16s; }
.tg-cell:hover .tg-rule { width: 60px; }
.tg-cell:hover .tg-name span::before { width: 100%; }
.tg-cell:hover .tg-num { color: var(--tg-ink); }
@keyframes tg-ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Rejilla (resumen y páginas) */
.tg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--tg-line); border-left: 1px solid var(--tg-line); }
.tg-cell.tg-empty:hover { background: transparent; }

/* Carrusel */
.tg-view { overflow: hidden; border-top: 1px solid var(--tg-line); border-left: 1px solid var(--tg-line); touch-action: pan-y; }
.tg-track { display: flex; transition: transform var(--tg-move) var(--tg-ease); will-change: transform; }
.tg-track .tg-cell { flex: 0 0 25%; }

/* Controles: idénticos a los de las galerías (contador 01 / 16, línea de 1 px y flechas sin círculo, debajo) */
.tg-ui { margin: 30px 0 0; color: var(--tg-ink); }
.tg-ui__count { display: block; margin: 0 0 15px; font-size: 14px; letter-spacing: .02em; color: var(--tg-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-ui__count b { font-weight: 400; color: var(--tg-ink); }
.tg-ui__row { display: flex; align-items: center; gap: 30px; }
.tg-ui__bar { position: relative; flex: 1 1 auto; height: 1px; }
.tg-ui__bar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--tg-stone); }
.tg-ui__bar i { position: absolute; left: 0; top: 0; z-index: 1; width: 0; border-top: 1px solid var(--tg-ink); transition: width var(--tg-move) var(--tg-ease); }
.tg-ui__arrows { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tg .tg-ui__btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: transparent; color: var(--tg-ink); transition: transform .4s var(--tg-ease), color .3s; }
.tg .tg-ui__btn svg { width: 26px; height: 26px; }
.tg .tg-prev:hover { transform: translateX(-4px); }
.tg .tg-next:hover { transform: translateX(4px); }
.tg .tg-ui__btn[disabled] { color: var(--tg-stone); pointer-events: none; }
.tg-ui.is-single { display: none; }

/* Páginas en cascada */
.tg-pages .tg-cell > * { transition: opacity .4s ease; }
.tg-pages.is-out .tg-cell > * { opacity: 0; }
.tg-pages.is-pre .tg-cell > * { opacity: 0; transition: none; }
.tg-pages .tg-cell[hidden] { display: none !important; }

/* Resumen y ficha completa */
.tg .tg-toggle { display: flex; align-items: center; gap: 15px; width: 100%; margin-top: 30px; padding: 15px 0; border-top: 1px solid var(--tg-line); border-bottom: 1px solid var(--tg-line); font-size: 14px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; text-align: left; }
.tg-toggle small { font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--tg-ink-2); }
.tg-pm { position: relative; width: 12px; height: 12px; margin-left: auto; flex: none; }
.tg-pm::before, .tg-pm::after { content: ""; position: absolute; left: 0; top: 5.5px; width: 12px; height: 1px; background: currentColor; transition: transform .5s var(--tg-ease); }
.tg-pm::after { transform: rotate(90deg); }
.tg.is-open .tg-pm::after { transform: rotate(0); }
.tg-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .8s var(--tg-ease); }
.tg.is-open .tg-more { grid-template-rows: 1fr; }
.tg-more > div { overflow: hidden; min-height: 0; }
.tg-list { columns: 2; column-gap: 30px; padding-top: 10px; }
.tg-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 15px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--tg-line); break-inside: avoid; opacity: 0; transition: opacity .5s ease; }
.tg.is-open .tg-row { opacity: 1; transition-delay: .2s; }
.tg-row .tg-ic { width: 25px; height: 25px; color: var(--tg-ink); align-self: center; }
.tg-row-n { font-size: 14px; line-height: 1.4; }
.tg-row-n small { display: block; margin-top: 5px; font-size: 14px; letter-spacing: 0; color: var(--tg-stone); }
.tg-row-v { text-align: right; font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; }
.tg-row-v .tg-multi { align-items: flex-end; }
.tg-row-v .tg-multi > span { font-size: 14px; }

/* Tablet */
@media (max-width: 980px) {
	.tg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tg-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tg-track .tg-cell { flex-basis: 43%; }
	.tg { --tg-per: 4; }
}
/* Móvil: una tarjeta (y asoma la siguiente) en el carrusel; 2 × 2 en resumen y páginas */
@media (max-width: 600px) {
	.tg-track .tg-cell { flex-basis: 84%; }
	.tg-cell { min-height: 190px; padding: 20px; }
	.tg-list { columns: 1; }
	.tg-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tg-uses span { padding: 0 21px 0 20px; }
	.tg-ui__row { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.tg *, .tg *::before, .tg *::after { transition-duration: .01s !important; transition-delay: 0s !important; animation: none !important; }
}

/* Altura de las tarjetas: la misma que una foto 3:2 de una columna de la rejilla de 4 (las fotos del índice de proyectos) */
.tg { container-type: inline-size; }
@media (min-width: 981px) {
	.tg-cell { min-height: calc((100cqi - 45px) / 4 / 1.5); } /* = una foto 3:2 de 1 columna de 4 (como las de la galería de proyectos); si un texto no cabe, crece la fila entera */
}
/* Dos valores según la colección (Venatto): uno al lado del otro, no apilados, para que la tarjeta no crezca */
.tg-val .tg-multi { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px 15px; align-items: flex-start; } /* uno al lado del otro; si no caben, el segundo baja (nunca se corta el nombre) */
.tg-val .tg-multi small { white-space: nowrap; } /* el nombre de la colección, siempre en una sola línea */
.tg-val .tg-multi > span { gap: 5px; line-height: 1.2; }
.tg-val .tg-multi small { line-height: 1.3; }
/* Tarjeta más compacta para caber en la altura de una foto: 20 px arriba y abajo, icono de 30 px */
@media (min-width: 981px) {
	.tg-cell { padding: 20px 30px; }
	.tg-cell .tg-ic { width: 30px; height: 30px; }
}
.tg-val .tg-multi > span.tg-long { font-size: 14px; line-height: 1.4; }
/* Los dos valores en dos columnas iguales; un resultado largo se reparte en líneas dentro de su columna */
.tg-val .tg-multi > span { flex: 1 1 0; min-width: min-content; }
/* Número e icono arriba; el texto (rayita, resultado, nombre y norma) apoyado abajo, con su margen */
.tg-cell .tg-rule { margin-top: auto; }

/* =====================================================================
 * DESCARGAS: franja de botones (catálogo, folleto, vídeos, más información)
 * Misma tarjeta que las técnicas: número e icono arriba, rayita, nombre a 24 y texto pequeño en cursiva abajo.
 * ================================================================== */
.tg--descargas .tg-dl { display: grid; grid-template-columns: repeat(var(--tg-n, 4), minmax(0, 1fr)); }
.tg--descargas .tg-cell { color: inherit; text-decoration: none; border-bottom: 0; cursor: pointer; }
.tg--descargas .tg-cell:last-child { border-right: 0; }
.tg--descargas a.tg-cell:focus-visible { outline: 1px solid currentColor; outline-offset: -6px; }
.tg-dl__n { font-size: 24px; font-weight: 400; line-height: 1.2; color: var(--tg-ink); hyphens: manual; overflow-wrap: normal; word-break: normal; }
.tg-dl__n span { position: relative; }
.tg-dl__n span::before { content: ""; position: absolute; left: 0; bottom: calc(.21em - 6px); width: 0; border-top: 1px solid currentColor; transition: width .7s var(--tg-ease); }
.tg-cell:hover .tg-dl__n span::before, .tg-cell:focus-visible .tg-dl__n span::before { width: 100%; }
.tg-dl__s { font-size: 14px; font-style: italic; line-height: 1.4; color: var(--tg-stone); }
/* Sobre el marrón de la marca: letra, iconos y rayita en hueso; líneas en hueso suave */
.tg--fondo-marron { background: var(--tg-ink); color: var(--tg-bone); --tg-line: rgba(237, 236, 232, .25); --tg-tint: rgba(237, 236, 232, .05); }
.tg--fondo-marron .tg-cell .tg-ic, .tg--fondo-marron .tg-dl__n { color: var(--tg-bone); }
.tg--fondo-marron .tg-rule { border-top-color: var(--tg-bone); }
.tg--fondo-marron .tg-cell:hover .tg-num { color: var(--tg-bone); }
/* Tablet: 2 × 2 */
@media (min-width: 601px) and (max-width: 980px) {
	.tg--descargas .tg-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tg--descargas .tg-cell { border-right: 0; border-bottom: 1px solid var(--tg-line); }
	.tg--descargas .tg-cell:nth-child(odd):not(:last-child) { border-right: 1px solid var(--tg-line); }
	.tg--descargas .tg-cell:nth-child(odd):nth-last-child(-n+2), .tg--descargas .tg-cell:nth-child(odd):nth-last-child(-n+2) ~ .tg-cell { border-bottom: 0; }
}
/* Móvil: una fila por botón (número, nombre a 24 con su texto pequeño debajo, icono a la derecha), para que ninguna palabra se corte */
@media (max-width: 600px) {
	.tg--descargas .tg-dl { grid-template-columns: minmax(0, 1fr); }
	.tg--descargas .tg-cell { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 15px; row-gap: 5px; align-items: baseline; min-height: 0; padding: 20px; border-right: 0; border-bottom: 1px solid var(--tg-line); }
	.tg--descargas .tg-cell:last-child { border-bottom: 0; }
	.tg--descargas .tg-top { display: contents; }
	.tg--descargas .tg-num { grid-column: 1; grid-row: 1; }
	.tg--descargas .tg-cell .tg-ic { grid-column: 3; grid-row: 1 / span 2; align-self: center; width: 30px; height: 30px; }
	.tg--descargas .tg-rule { display: none; }
	.tg--descargas .tg-dl__n { grid-column: 2; grid-row: 1; }
	.tg--descargas .tg-dl__s { grid-column: 2; grid-row: 2; }
}

/* Iconos más grandes en todas las tarjetas: 50 px (40 px en móvil) */
.tg-cell .tg-ic, .tg-uses .tg-ic { width: 50px; height: 50px; }
@media (min-width: 981px) { .tg-cell .tg-ic { width: 50px; height: 50px; } }
.tg-row .tg-ic { width: 30px; height: 30px; }
@media (max-width: 600px) {
	.tg-cell .tg-ic, .tg-uses .tg-ic { width: 40px; height: 40px; }
	.tg--descargas .tg-cell .tg-ic { width: 40px; height: 40px; }
}
/* Descargas y accesos: tu botón de serie debajo del texto */
.tg-dl__b { display: block; margin-top: 15px; }
.tg--descargas .tg-btn { display: inline-block; }
/* Sobre el marrón, el botón en hueso para que se vea */
.tg--fondo-marron .tg-btn, .tg--fondo-marron .tg-btn:hover { color: var(--tg-bone) !important; border-color: var(--tg-bone) !important; background-color: transparent !important; }
/* Accesos directos: el texto es una descripción (no un dato), en 14 regular marrón suave */
.tg--accesos .tg-dl__s { font-style: normal; color: var(--tg-ink-2); line-height: 1.5; }
/* Sobre el gris claro de la marca */
.tg--fondo-hueso { background: var(--tg-bone); color: var(--tg-ink); --tg-line: var(--tg-stone); }
@media (max-width: 600px) {
	.tg--descargas .tg-dl__b { grid-column: 2; grid-row: 3; margin-top: 10px; }
}
/* El icono grande no hace crecer la tarjeta: la fila de arriba mide lo que el número y el icono baja hacia el hueco libre */
.tg-cell .tg-top { height: 20px; }
/* Descargas y accesos: el nombre empieza siempre a la misma altura en las cuatro y el botón va abajo, alineado en todas */
@media (min-width: 601px) {
	.tg--descargas .tg-cell .tg-rule { margin-top: 30px; }
	.tg--descargas .tg-dl__b { margin-top: auto; padding-top: 15px; }
}
