/* toha/grid: reemplazo minimo de Essential Grid 2.0.8 (layout "even", skins Washington y Quincy). */

.toha-grid { position: relative; z-index: 0; min-height: 100px; height: auto; }
.toha-grid .esg-container-fullscreen-forcer { position: relative; left: 0; top: 0; width: auto; height: auto; }
.toha-grid .esg-grid {
	position: relative; width: 100%; max-width: 100%; height: auto; padding: 0; box-sizing: border-box;
	background-color: transparent; font-family: 'Open Sans', sans-serif;
	-webkit-backface-visibility: hidden; backface-visibility: hidden; transform: translateZ(0);
}
.toha-grid .esg-grid * { -webkit-font-smoothing: antialiased; }
.toha-grid .esg-overflowtrick { position: relative; width: 100%; height: auto; overflow: hidden; padding: 0; box-sizing: border-box; z-index: 1; }
.toha-grid .mainul,
.toha-grid .mainul > li { list-style: none; margin: 0; padding: 0; transform-style: flat; }
.toha-grid .mainul { position: relative; width: 100%; max-width: 100%; overflow: visible; display: block; }

/* Item */
.toha-grid .tp-esg-item { position: relative; box-sizing: border-box; z-index: 5; border: 0 solid transparent; outline: 0 solid transparent; }
.toha-grid .esg-media-cover-wrapper { position: relative; width: 100%; height: 100%; }
.toha-grid .esg-entry-media-wrapper { position: relative; width: 100%; height: 100%; overflow: hidden; z-index: 0; }
.toha-grid .esg-entry-media { position: relative; width: 100%; height: 100%; overflow: hidden; border: 0 solid transparent; outline: 0 solid transparent; }
.toha-grid .esg-entry-media img { position: absolute; display: block; visibility: visible; max-width: none !important; min-width: 0 !important; margin: 0; border: 0; }

/* Sin JS (y en el editor): grilla CSS aproximada */
.toha-grid .mainul { display: grid; grid-template-columns: repeat(var(--toha-grid-cols, 5), 1fr); gap: var(--toha-grid-space, 0px); }
.toha-grid .tp-esg-item { aspect-ratio: var(--toha-grid-ratio, 4 / 3); }
@media (max-width: 1399px) { .toha-grid { --toha-grid-cols: 4; } }
@media (max-width: 959px) { .toha-grid { --toha-grid-cols: 3; } }
@media (max-width: 639px) { .toha-grid { --toha-grid-cols: 1; } }
.toha-grid-pdestacados { --toha-grid-ratio: 4 / 3; --toha-grid-space: 0px; }
.toha-grid-NT { --toha-grid-ratio: 16 / 12; --toha-grid-space: 10px; }

/* Con JS: posiciones absolutas calculadas igual que Essential Grid */
.toha-grid.is-ready .mainul { display: block; }
.toha-grid.is-ready .tp-esg-item { position: absolute; top: 0; left: 0; aspect-ratio: auto; }
.toha-grid.is-ready .tp-esg-item.is-hidden { display: none; }

/* Fondo de cada skin */
.toha-grid .eg-washington-wrapper { background-color: #3f424a; }
.toha-grid .eg-quincy-wrapper { background-color: #2d3039; }

/* Cover (hover) */
.toha-grid .esg-entry-cover {
	position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-sizing: border-box; overflow: hidden;
	visibility: hidden; opacity: 0; transition: opacity .3s ease, visibility .3s;
}
.toha-grid .esg-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.toha-grid .eg-washington-container { background-color: rgba(0, 0, 0, .65); }
.toha-grid .eg-quincy-container { background-color: rgba(45, 48, 57, .75); }
.toha-grid .eec {
	position: absolute; top: 50%; left: 0; width: 100%; transform: translateY(-50%);
	display: block; font-size: 20px; text-align: center;
}
.toha-grid .esg-center { position: relative; }
.toha-grid .esg-clear { clear: both; height: 5px; }
.toha-grid .tp-esg-item:hover .esg-entry-cover,
.toha-grid .tp-esg-item:focus-within .esg-entry-cover { visibility: visible; opacity: 1; }

.toha-grid .esg-cc a { text-decoration: none; }
.toha-grid .toha-grid-icon { display: block; width: 1em; height: 1em; margin: auto; }

/* Washington: iconos en circulo + titulo */
.toha-grid .eg-washington-element-0-a,
.toha-grid .eg-washington-element-1-a { display: inline-block; margin: 0 10px 0 0; transition: transform .3s ease; transform: translateY(-30%); }
.toha-grid .eg-washington-element-0,
.toha-grid .eg-washington-element-1 {
	display: block; box-sizing: content-box; width: 22px; height: 22px; padding: 17px; border-radius: 60px;
	font-size: 16px; line-height: 22px; color: #fff; background-color: rgba(255, 255, 255, .15); transition: background-color .2s;
}
.toha-grid .eg-washington-element-0:hover,
.toha-grid .eg-washington-element-1:hover { background-color: rgba(0, 0, 0, .5); color: #fff; }
.toha-grid .eg-washington-element-0 .toha-grid-icon,
.toha-grid .eg-washington-element-1 .toha-grid-icon { margin-top: 3px; }
.toha-grid .eg-washington-element-3 {
	display: inline-block; margin: 15px 0 0; padding: 5px 10px; font: 700 13px/20px 'Open Sans', sans-serif;
	color: #fff; text-transform: uppercase; background-color: rgba(255, 255, 255, .15);
}

/* Quincy: iconos sueltos + titulo Raleway */
.toha-grid .eg-quincy-element-0-a,
.toha-grid .eg-quincy-element-1-a { display: inline-block; margin: 0 10px; transition: transform .3s ease; transform: scale(1.5); }
.toha-grid .eg-quincy-element-0,
.toha-grid .eg-quincy-element-1 { display: block; font-size: 24px; line-height: 22px; color: #fff; }
.toha-grid .eg-quincy-element-3 {
	display: inline-block; margin: 15px 0 0; padding: 5px 10px; font: 800 13px/20px 'Raleway', sans-serif;
	color: #fff; text-transform: uppercase; background-color: rgba(255, 255, 255, .15);
	transition: transform .3s ease; transform: translateY(50%);
}
.toha-grid .tp-esg-item:hover .esg-center,
.toha-grid .tp-esg-item:focus-within .esg-center { transform: none; }
.toha-grid .eg-quincy-wrapper .esg-entry-media { transition: transform .3s ease; }
.toha-grid .eg-quincy-wrapper:hover .esg-entry-media { transform: scale(.9); }

@media (prefers-reduced-motion: reduce) {
	.toha-grid .esg-entry-cover,
	.toha-grid .esg-center,
	.toha-grid .esg-entry-media { transition: none !important; }
}

/* Lightbox minimo */
.toha-grid-lb {
	position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .75); padding: 40px 20px; box-sizing: border-box; cursor: pointer;
}
.toha-grid-lb figure { position: relative; margin: 0; cursor: default; text-align: center; }
.toha-grid-lb img { display: block; max-width: calc(100vw - 40px); max-height: calc(100vh - 120px); width: auto; height: auto; background: #f9f9f9; box-shadow: 0 10px 25px rgba(0, 0, 0, .5); }
.toha-grid-lb figcaption {
	display: inline-block; margin-top: 15px; padding: 5px 20px; border-radius: 15px; background: rgba(0, 0, 0, .8);
	color: #fff; font: 700 15px/20px 'Open Sans', sans-serif; text-align: center;
}
.toha-grid-lb button {
	position: absolute; top: -18px; right: -18px; width: 36px; height: 36px; padding: 0; border: 2px solid #fff; border-radius: 50%;
	background: #000; color: #fff; font: 700 20px/30px sans-serif; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
