/*
 * Seasonal Brochures — brochures.css
 * Supplementary styles for page-brochure.php.
 *
 * catalog.css loads first and provides all of:
 *   hhd-catalog-shell (1290px max-width, margin auto)
 *   hhd-catalog-hero and its children
 *   hhd-hero-read-more
 *   hhd-category-directory, hhd-category-grid, hhd-category-card
 *   hhd-section-heading
 *   hhd-finance-banner
 *   hhd-seo-copy, hhd-seo-copy__inner (full-bleed via calc(50% - 50vw))
 *   hhd-service-strip (full-bleed via calc(50% - 50vw))
 *
 * This file only adds what is unique to brochure pages.
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   BROCHURES HUB PAGE (page-brochures.php)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Hub hero — accent colour defaults to navy; image shows through when set ─── */

.hhd-brochures-hub__hero .hhd-catalog-hero__content h1 {
	font-size: 2.4rem;
}

/* ── Brochure cards — 2 per row, last card full-width if odd ─────────────────── */

.hhd-brochures-hub__cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	padding: 28px 0 36px;
}

/* No active brochure: odd last card spans both columns (existing behaviour) */
.hhd-brochures-hub__cards:not(.has-featured) .hhd-brochure-card:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

/* Active brochure: featured card always occupies the full-width top slot */
.hhd-brochures-hub__cards.has-featured .hhd-brochure-card--featured {
	grid-column: 1 / -1;
	min-height: 300px;
}

/* With featured card present, a lone remaining card at the end also spans full-width.
   The featured card sits at nth-child(1), so remaining lone cards land on even positions. */
.hhd-brochures-hub__cards.has-featured .hhd-brochure-card:not(.hhd-brochure-card--featured):last-child:nth-child(even) {
	grid-column: 1 / -1;
}

.hhd-brochure-card {
	position: relative;
	min-height: 220px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--hhd-accent-color, #0e1a22);
	display: flex;
	align-items: stretch;
}

/* Tinted overlay — same gradient technique as catalog hero */
.hhd-brochure-card::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--hhd-accent-color, #0e1a22) 88%, #000) 0%,
		color-mix(in srgb, var(--hhd-accent-color, #0e1a22) 60%, #0e1a22) 38%,
		rgba(14, 26, 34, 0.18) 100%
	);
	z-index: 1;
}

/* Reduced opacity on ended cards */
.hhd-brochure-card--ended::after {
	background: linear-gradient(
		90deg,
		rgba(14, 26, 34, 0.94) 0%,
		rgba(14, 26, 34, 0.78) 40%,
		rgba(14, 26, 34, 0.25) 100%
	);
}

.hhd-brochure-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.hhd-brochure-card--ended .hhd-brochure-card__image {
	filter: grayscale(35%);
	opacity: 0.85;
}

.hhd-brochure-card__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 32px 40px;
	max-width: 640px;
}

/* ── Status badge ─────────────────────────────────────────────────────────── */

.hhd-brochure-card__badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: 100px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	width: fit-content;
}

.hhd-brochure-badge--active {
	background: #fff;
	color: var(--hhd-accent-color, #0e3a5c);
}

.hhd-brochure-badge--coming {
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #fff;
}

.hhd-brochure-badge--ended {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: rgba(255, 255, 255, 0.6);
}

.hhd-brochure-badge--unknown {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: rgba(255, 255, 255, 0.75);
}

/* ── Card title + period ─────────────────────────────────────────────────── */

.hhd-brochure-card__title {
	font-size: 1.875rem;
	font-weight: 800;
	color: #fff;
	margin: 0;
	line-height: 1.2;
}

.hhd-brochure-card--ended .hhd-brochure-card__title {
	color: rgba(255, 255, 255, 0.75);
}

.hhd-brochure-card__period {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.72);
	margin: 0;
}

.hhd-brochure-card__period svg {
	flex-shrink: 0;
	opacity: 0.75;
}

/* ── Card actions ────────────────────────────────────────────────────────── */

.hhd-brochure-card__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 6px;
}

.hhd-brochure-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 11px 22px;
	background: #fff;
	color: var(--hhd-accent-color, #0e3a5c);
	font-size: 0.9375rem;
	font-weight: 700;
	border-radius: 5px;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.hhd-brochure-card__cta:hover,
.hhd-brochure-card__cta:focus-visible {
	background: rgba(255, 255, 255, 0.88);
	color: var(--hhd-accent-color, #0e3a5c);
	text-decoration: none;
}

.hhd-brochure-card__pdf {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 18px;
	background: rgba(255, 255, 255, 0.12);
	border: 1.5px solid rgba(255, 255, 255, 0.38);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: 5px;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.hhd-brochure-card__pdf:hover,
.hhd-brochure-card__pdf:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	border-color: rgba(255, 255, 255, 0.62);
	color: #fff;
	text-decoration: none;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
	.hhd-brochures-hub__cards {
		grid-template-columns: 1fr;
	}

	.hhd-brochures-hub__cards:not(.has-featured) .hhd-brochure-card:last-child:nth-child(odd),
	.hhd-brochures-hub__cards.has-featured .hhd-brochure-card--featured,
	.hhd-brochures-hub__cards.has-featured .hhd-brochure-card:not(.hhd-brochure-card--featured):last-child:nth-child(even) {
		grid-column: auto;
	}

	.hhd-brochure-card {
		min-height: 180px;
	}

	.hhd-brochure-card__content {
		padding: 24px 20px;
	}

	.hhd-brochure-card__title {
		font-size: 1.5rem;
	}
}

@media (max-width: 480px) {
	.hhd-brochure-card__actions {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.hhd-brochure-card__cta,
	.hhd-brochure-card__pdf {
		width: 100%;
		justify-content: center;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   INDIVIDUAL BROCHURE PAGES (page-brochure.php)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Brochure period date — in hero, between H1 and copy ─────────────────────── */

.hhd-brochure-period {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: -6px 0 6px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.72);
	letter-spacing: 0.02em;
}

.hhd-brochure-period svg {
	flex-shrink: 0;
	opacity: 0.75;
}

/* ── PDF download button — in hero, below read-more link ─────────────────────── */

.hhd-brochure-hero-pdf {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 14px;
	padding: 9px 18px;
	background: rgba(255, 255, 255, 0.14);
	border: 1.5px solid rgba(255, 255, 255, 0.42);
	border-radius: 5px;
	font-size: 0.875rem;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.hhd-brochure-hero-pdf:hover,
.hhd-brochure-hero-pdf:focus-visible {
	background: rgba(255, 255, 255, 0.24);
	border-color: rgba(255, 255, 255, 0.68);
	color: #fff;
	text-decoration: none;
}

.hhd-brochure-hero-pdf svg {
	flex-shrink: 0;
}

/* ── Coming soon state — fills shell width, centred text ─────────────────────── */

.hhd-brochure-coming-soon {
	padding: 52px 0 56px;
	border-bottom: 1px solid #eef0f2;
}

.hhd-brochure-coming-soon__text {
	text-align: center;
	max-width: 620px;
	margin: 0 auto 36px;
}

.hhd-brochure-coming-soon h2 {
	font-size: 1.625rem;
	font-weight: 700;
	color: #0e1a22;
	margin-bottom: 12px;
}

.hhd-brochure-coming-soon p {
	font-size: 1.0625rem;
	color: #4a5568;
	margin: 0 0 24px;
	line-height: 1.65;
}

.hhd-brochure-shop-link {
	display: inline-block;
	padding: 12px 26px;
	background: #0e3a5c;
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	border-radius: 5px;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.hhd-brochure-shop-link:hover {
	opacity: 0.88;
	color: #fff;
	text-decoration: none;
}

.hhd-brochure-coming-soon__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.hhd-brochure-cat-pill {
	display: inline-block;
	padding: 8px 18px;
	background: #fff;
	border: 1.5px solid #d0d8e4;
	border-radius: 100px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #0e3a5c;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hhd-brochure-cat-pill:hover {
	border-color: #0e3a5c;
	background: #0e3a5c;
	color: #fff;
	text-decoration: none;
}

/* ── Product section heading ─────────────────────────────────────────────────── */

.hhd-brochure-products-heading {
	padding: 32px 0 0;
	border-top: 1px solid #eef0f2;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────────── */

.hhd-brochure-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 22px 0 12px;
}

.hhd-brochure-toolbar__left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hhd-brochure-toolbar__right {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.hhd-brochure-count {
	font-size: 14px;
	color: var(--hhd-muted, #6b7b8a);
}

/* ── Square thumbnails for brochure product grid ─────────────────────────────── */

#hhd-brochure-grid .ct-media-container {
	aspect-ratio: 1;
	overflow: hidden;
}

#hhd-brochure-grid .ct-media-container img.ct-swap {
	display: none;
}

#hhd-brochure-grid .ct-media-container img.wp-post-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */

.hhd-brochure-empty {
	text-align: center;
	padding: 64px 24px;
	color: var(--hhd-muted, #6b7b8a);
}

.hhd-brochure-empty p {
	font-size: 1.05rem;
	margin: 0;
}

/* ── Off-canvas panel + backdrop (catalog.css not loaded in this context) ──────
   Base filter-trigger, filter-section, filter-list, filter-label, etc. come
   from catalog.css (always loaded before this file on brochure pages).
   Only the panel shell and backdrop need replicating here. */

.hhd-offers-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.38);
	z-index: 9998;
}

.hhd-offers-panel {
	position: fixed;
	top: 0;
	left: 0;
	height: 100%;
	width: 500px;
	max-width: 90vw;
	background: #fff;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.14);
	transform: translateX(-100%);
	transition: transform 0.26s ease;
	overflow: hidden;
}

.hhd-offers-panel.is-open {
	transform: translateX(0);
}

.hhd-offers-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e5eaee;
	flex-shrink: 0;
}

.hhd-offers-panel__title {
	font-size: 15px;
	font-weight: 700;
	margin: 0;
	color: var(--hhd-ink, #0e1a22);
}

.hhd-offers-panel__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--hhd-muted, #6b7b8a);
	border-radius: 4px;
}

.hhd-offers-panel__close:hover {
	background: #f0f4f7;
	color: var(--hhd-ink, #0e1a22);
}

.hhd-offers-panel__body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
}

.hhd-offers-panel__foot {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	border-top: 1px solid #e5eaee;
	flex-shrink: 0;
}

.hhd-offers-panel__foot .hhd-filter-clear-all {
	flex: 0 0 auto;
}

.hhd-offers-panel__foot .hhd-filter-apply {
	flex: 1;
}

.hhd-offers-panel__body .hhd-filter-section__head {
	padding: 12px 20px;
}

.hhd-offers-panel__body .hhd-filter-list {
	padding: 4px 20px 12px;
}

.hhd-offers-panel__body .hhd-filter-item {
	padding: 4px 0;
}

.hhd-filter-item--has-children {
	flex-wrap: wrap;
}

.hhd-filter-item--has-children > .hhd-filter-label {
	font-weight: 700;
}

.hhd-filter-children {
	width: 100%;
	margin: 0 0 6px 20px;
	padding: 0;
	list-style: none;
}

/* ── Active filter tags ─────────────────────────────────────────────────────── */

.hhd-offers-active-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 0 4px;
}

.hhd-offers-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: var(--hhd-ink, #0e1a22);
	color: #fff;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 500;
}

.hhd-offers-tag-remove {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.75);
	cursor: pointer;
	padding: 0;
	font-size: 15px;
	line-height: 1;
}

.hhd-offers-tag-remove:hover {
	color: #fff;
}

.hhd-offers-clear-link {
	background: none;
	border: none;
	color: var(--hhd-muted, #6b7b8a);
	cursor: pointer;
	font-size: 13px;
	padding: 0;
	text-decoration: underline;
}

.hhd-offers-clear-link:hover {
	color: var(--hhd-ink, #0e1a22);
}

/* ── Load more ───────────────────────────────────────────────────────────────── */

.hhd-load-more-wrap {
	text-align: center;
	margin-top: 32px;
}

.hhd-load-more {
	display: inline-block;
	padding: 12px 32px;
	background: var(--hhd-ink, #0e1a22);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.15s;
}

.hhd-load-more:hover {
	background: #1a2f3a;
}

.hhd-load-more:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ── Loading indicator ───────────────────────────────────────────────────────── */

.hhd-offers-loading {
	font-size: 13px;
	color: var(--hhd-muted, #6b7b8a);
}

/* ── Mobile ──────────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
	.hhd-brochure-coming-soon {
		padding: 40px 0 44px;
	}

	.hhd-brochure-coming-soon h2 {
		font-size: 1.375rem;
	}

	.hhd-brochure-toolbar {
		flex-wrap: wrap;
		gap: 10px;
		margin: 16px 0 10px;
	}

	.hhd-brochure-toolbar__left {
		flex: 1 1 100%;
		justify-content: space-between;
	}

	.hhd-brochure-toolbar__right {
		flex: 1 1 100%;
		justify-content: flex-start;
	}

	.hhd-filter-trigger {
		flex: 1;
		justify-content: center;
	}

	.hhd-offers-panel {
		width: 100%;
		max-width: 100%;
	}
}
