/**
 * AhojNet Tabuľka – frontend štýly.
 *
 * Súbor obsahuje len štruktúru a responzívne správanie.
 * Farby, písma a šírky sa generujú z Elementor ovládacích prvkov.
 */

/* --------------------------------------------------------------------------
   1. Obal tabuľky
   -------------------------------------------------------------------------- */
.ahn-tab__wrap {
	width: 100%;
	max-width: 100%;
}

/* Vodorovné posúvanie pri pretečení (voliteľné cez ovládací prvok). */
.ahn-tab__wrap--scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   2. Samotná tabuľka
   -------------------------------------------------------------------------- */
.ahn-tab {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: fixed;
}

.ahn-tab__c {
	vertical-align: middle;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.ahn-tab__head .ahn-tab__c {
	text-align: inherit;
}

/* Hodnota v bunke – nositeľ typografie a farby daného stĺpca. */
.ahn-tab__value {
	display: inline-block;
	text-decoration: none;
	transition: color 0.2s ease;
}

a.ahn-tab__value:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Responzívne skrytie stĺpcov
   Triedy pridáva PHP podľa nastavenia "Skryť na zariadeniach".
   !important je nutné, aby prebilo šírku generovanú Elementorom.
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	.ahn-tab .ahn-hide-desktop {
		display: none !important;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.ahn-tab .ahn-hide-tablet {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.ahn-tab .ahn-hide-mobile {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
   4. Stohované zobrazenie (tabuľka -> karty)
   Triedu .ahn-tab--stack-mobile / .ahn-tab--stack-tablet pridáva PHP
   podľa nastavenia "Stohovanie na malých displejoch".
   -------------------------------------------------------------------------- */

/* Aktivácia režimu "mobil". */
@media (max-width: 767px) {
	.ahn-tab--stack-mobile,
	.ahn-tab--stack-mobile tbody,
	.ahn-tab--stack-mobile tr,
	.ahn-tab--stack-mobile td {
		display: block;
		width: 100% !important;
	}

	.ahn-tab--stack-mobile thead {
		display: none;
	}

	.ahn-tab--stack-mobile tr {
		margin-bottom: 12px;
	}

	.ahn-tab--stack-mobile tr:last-child {
		margin-bottom: 0;
	}

	.ahn-tab--stack-mobile td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
	}

	.ahn-tab--stack-mobile td[data-label]::before {
		content: attr(data-label);
		flex: 0 0 auto;
		font-weight: 600;
		opacity: 0.75;
	}

	.ahn-tab--stack-mobile td:not([data-label]) {
		justify-content: flex-start;
	}

	/* Skrytý stĺpec musí zostať skrytý aj v stohovanom režime. */
	.ahn-tab--stack-mobile .ahn-hide-mobile {
		display: none !important;
	}
}

/* Aktivácia režimu "tablet a menej". */
@media (max-width: 1024px) {
	.ahn-tab--stack-tablet,
	.ahn-tab--stack-tablet tbody,
	.ahn-tab--stack-tablet tr,
	.ahn-tab--stack-tablet td {
		display: block;
		width: 100% !important;
	}

	.ahn-tab--stack-tablet thead {
		display: none;
	}

	.ahn-tab--stack-tablet tr {
		margin-bottom: 12px;
	}

	.ahn-tab--stack-tablet tr:last-child {
		margin-bottom: 0;
	}

	.ahn-tab--stack-tablet td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
	}

	.ahn-tab--stack-tablet td[data-label]::before {
		content: attr(data-label);
		flex: 0 0 auto;
		font-weight: 600;
		opacity: 0.75;
	}

	.ahn-tab--stack-tablet td:not([data-label]) {
		justify-content: flex-start;
	}
}

@media (max-width: 1024px) and (min-width: 768px) {
	.ahn-tab--stack-tablet .ahn-hide-tablet {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.ahn-tab--stack-tablet .ahn-hide-mobile {
		display: none !important;
	}
}
