/*
Theme Name:        HolidayDeals
Theme URI:         https://example.com/holidaydeals
Description:       GeneratePress child theme for the HolidayDeals aggregator. Presentation only — all functionality lives in the hd-deal-engine plugin.
Author:            HolidayDeals
Template:          generatepress
Version:           1.0.0
Requires at least: 6.4
Requires PHP:      8.2
License:           GPL-2.0-or-later
Text Domain:       holidaydeals
*/

/* ---------- Deal grid: 1-col mobile / 2-col tablet / 3-4-col desktop ---------- */

.hd-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.hd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
	.hd-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1400px) {
	.hd-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Deal card ---------- */

.hd-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	position: relative;
}

.hd-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: #f6f6f6;
}

.hd-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.hd-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.875rem;
	flex: 1;
}

.hd-card__retailer {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.8125rem;
	color: #555;
}

.hd-card__retailer img {
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.hd-card__title {
	font-size: 1rem;
	line-height: 1.35;
	margin: 0;
}

.hd-card__title a {
	color: inherit;
	text-decoration: none;
}

.hd-card__title a:hover {
	text-decoration: underline;
}

.hd-card__pricing {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.hd-card__price-sale {
	font-size: 1.125rem;
	font-weight: 700;
	color: #0a7d33;
}

.hd-card__price-original {
	text-decoration: line-through;
	color: #888;
	font-size: 0.875rem;
}

.hd-badge {
	display: inline-block;
	padding: 0.125rem 0.5rem;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.4;
}

.hd-badge--discount {
	background: #d32f2f;
	color: #fff;
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 2;
}

.hd-badge--expired {
	background: #757575;
	color: #fff;
}

.hd-badge--instore {
	background: #f5f0e6;
	color: #6d5b2a;
	border: 1px solid #e0d3ae;
}

.hd-badge--upcoming {
	background: #1565c0;
	color: #fff;
}

.hd-card--expired .hd-card__media,
.hd-card--expired .hd-card__title {
	opacity: 0.55;
}

.hd-card__countdown {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #d32f2f;
}

.hd-card__footer {
	margin-top: auto;
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.hd-card__cta {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: #d32f2f;
	color: #fff !important;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.875rem;
	text-decoration: none;
}

.hd-card__cta:hover {
	background: #b71c1c;
}

.hd-card__cta--secondary {
	background: #f0f0f0;
	color: #333 !important;
}

.hd-card__cta--secondary:hover {
	background: #e0e0e0;
}

/* ---------- Coupon chip (click to copy) ---------- */

.hd-coupon {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px dashed #0a7d33;
	background: #f0faf3;
	color: #0a7d33;
	border-radius: 6px;
	padding: 0.375rem 0.625rem;
	font-size: 0.8125rem;
	cursor: pointer;
	font-family: inherit;
}

.hd-coupon__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 700;
	letter-spacing: 0.5px;
}

.hd-coupon__hint {
	font-size: 0.75rem;
	text-transform: uppercase;
	opacity: 0.8;
}

.hd-coupon--copied {
	background: #0a7d33;
	color: #fff;
	border-style: solid;
}

/* ---------- Ad zones: reserved heights prevent CLS; empty zones collapse ---------- */

.hd-ad {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.hd-ad:empty { display: none; }

.hd-ad--header  { min-height: 90px; margin: 0.75rem auto; max-width: 970px; }
.hd-ad--infeed  { min-height: 250px; }
.hd-ad--sidebar { min-height: 600px; position: sticky; top: 1rem; }
.hd-ad--content { min-height: 280px; margin: 1.5rem 0; }
.hd-ad--footer  { min-height: 90px; margin: 1rem auto; max-width: 970px; }

@media (max-width: 1023px) {
	.hd-ad--sidebar { display: none; }
}

/* ---------- Archive layout with sticky sidebar on desktop ---------- */

.hd-archive {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 1024px) {
	.hd-archive--with-sidebar {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
}

.hd-archive__intro {
	margin-bottom: 1rem;
}

.hd-disclosure {
	font-size: 0.8125rem;
	color: #777;
	margin: 0.25rem 0 1rem;
}

.hd-offseason-notice {
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 8px;
	padding: 0.875rem 1rem;
	margin-bottom: 1.25rem;
}

/* ---------- Homepage ---------- */

.hd-hero {
	background: linear-gradient(135deg, #b71c1c, #d32f2f);
	color: #fff;
	border-radius: 10px;
	padding: 2rem 1.5rem;
	margin-bottom: 1.5rem;
}

.hd-hero h1 { color: #fff; margin: 0 0 0.5rem; }

.hd-hero a.hd-card__cta {
	background: #fff;
	color: #b71c1c !important;
	margin-top: 0.75rem;
}

.hd-holiday-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
	margin: 1rem 0 2rem;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.hd-holiday-cards { grid-template-columns: repeat(4, 1fr); }
}

.hd-holiday-cards a {
	display: block;
	padding: 1rem;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	text-align: center;
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.hd-holiday-cards a:hover {
	border-color: #d32f2f;
	color: #d32f2f;
}

.hd-retailer-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0 2rem;
	padding: 0;
	list-style: none;
}

.hd-retailer-strip a {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.375rem 0.75rem;
	border: 1px solid #e2e2e2;
	border-radius: 999px;
	font-size: 0.8125rem;
	text-decoration: none;
	color: inherit;
}

.hd-retailer-strip img {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

/* ---------- Single deal ---------- */

.hd-single__meta {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	align-items: center;
	margin: 1rem 0;
}

.hd-single__cta-row {
	margin: 1.25rem 0;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}

.hd-single__cta-row .hd-card__cta {
	font-size: 1rem;
	padding: 0.75rem 1.5rem;
}
