/**
 * Scherrer Wine Archive – Structural Styles
 *
 * SCOPE: Layout and accessibility structure only.
 * NO brand colours, NO hardcoded fonts — those live in Elementor / Additional CSS.
 *
 * BEM naming: .wine-archive__[element]--[modifier]
 */

/* ── Outer wrapper ─────────────────────────────────────────────────── */
.wine-archive {
	width: 100%;
}

/* ── Inner content container ───────────────────────────────────────── */
.wine-archive__inner {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 1.5rem;
	padding-block: 2rem;
}

/* ── Hero image — full viewport width bleed ─────────────────────────── */
.wine-archive__hero {
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: 100vw;
	overflow: hidden;
}

/* Prevent Chrome scrollbar-width causing horizontal overflow on hero pages.
 * scrollbar-gutter: stable reserves space for the scrollbar permanently so
 * 100vw and the scrollbar never fight each other. */
html:has(.wine-archive) {
	scrollbar-gutter: stable;
}

.wine-archive__hero-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 1;
	object-fit: cover;
}

/* ── Category title ────────────────────────────────────────────────── */
.wine-archive__title {
	margin-block-end: 0.5rem;
}

/* ── Category description ──────────────────────────────────────────── */
.wine-archive__description {
	margin-block-end: 2rem;
}

/* ── Tab container ─────────────────────────────────────────────────── */
.wine-archive__tabs {
	width: 100%;
}

/* ── Tab list ──────────────────────────────────────────────────────── */
.wine-archive__tablist {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	border: none;
	list-style: none;
	padding: 0;
	margin: 0;
	position: relative;
	z-index: 1;
}

/* ── Individual tab button ─────────────────────────────────────────── */
/*
 * !important is used on border and background to override Elementor's
 * global button styles, which otherwise win on specificity and break the
 * classic tab appearance. No brand colours are set here — only the
 * structural grey/white distinction that makes the tab pattern readable.
 */
.wine-archive__tab {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;

	display: inline-block;
	padding: 0.5rem 1rem;
	margin-bottom: -1px; /* overlap the panel top border */

	border-top: 1px solid #ccc !important;
	border-left: 1px solid #ccc !important;
	border-right: 1px solid #ccc !important;
	border-bottom: 1px solid #ccc !important;
	border-radius: 0 !important;
	box-shadow: none !important;

	/* Inactive: slightly recessed grey */
	background-color: #e0e0e0 !important;
	color: inherit !important;

	font-size: inherit;
	line-height: inherit;
	text-transform: uppercase;
	letter-spacing: 0.03em;

	position: relative;
	z-index: 1;

	transition: background-color 0.15s ease;
}

/* Accessible focus ring */
.wine-archive__tab:focus-visible {
	outline: 3px solid;
	outline-offset: 2px;
	z-index: 3;
}

/* Hover — lighten inactive tabs only */
.wine-archive__tab:hover:not([aria-selected="true"]) {
	background-color: #efefef !important;
}

/* Active / selected: white, bottom border matches panel background to merge */
.wine-archive__tab--active,
.wine-archive__tab[aria-selected="true"] {
	background-color: #fff !important;
	border-bottom-color: #fff !important;
	color: inherit !important;
	z-index: 2;
}

/* ── Shared border wrapper around all panels ────────────────────────── */
.wine-archive__panels-border {
	border: 1px solid #ccc;
	background-color: #fff;
	position: relative;
	z-index: 0;
}

/* ── Tab panel ─────────────────────────────────────────────────────── */
.wine-archive__panel {
	padding: 1.5rem;
}

/* [hidden] is the authoritative visibility gate — do not override it */
.wine-archive__panel[hidden] {
	display: none !important;
}

/* ── Empty state ───────────────────────────────────────────────────── */
.wine-archive__empty {
	font-style: italic;
}

/* ── Panel intro description ───────────────────────────────────────── */
/*
 * Sits between the tab panel edge and the wine columns.
 * margin-block-end matches the panel's padding so the visual gap
 * above the description and below it (before the wines) feels equal.
 */
.wine-archive__panel-intro {
	margin-block-start: 0;
	margin-block-end: 1.5rem;
}

/* ── Three-column layout for bottling groups ────────────────────────── */
.wine-archive__columns {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.wine-archive__column {
	flex: 1;
	min-width: 0;
}

@media ( min-width: 768px ) {
	.wine-archive__columns {
		flex-direction: row;
		align-items: flex-start;
		gap: 2rem;
	}
}

/* ── Bottling section ──────────────────────────────────────────────── */
.wine-archive__bottling {
	margin-block-end: 2rem;
}

.wine-archive__bottling:last-child {
	margin-block-end: 0;
}

.wine-archive__bottling-name {
	margin-block-end: 0.5rem;
}

/* ── Wine list ─────────────────────────────────────────────────────── */
.wine-archive__wine-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

/* ── Wine item ─────────────────────────────────────────────────────── */
.wine-archive__wine-item {
	display: block;
}

/* ── Wine link ─────────────────────────────────────────────────────── */
.wine-archive__wine-link {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0;
	text-decoration: none;
}

.wine-archive__wine-link:hover,
.wine-archive__wine-link:focus-visible {
	text-decoration: underline;
}

.wine-archive__wine-link:focus-visible {
	outline: 3px solid;
	outline-offset: 2px;
	border-radius: 2px;
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media ( prefers-reduced-motion: reduce ) {
	.wine-archive__tab {
		transition: none;
	}
}
