/*
Theme Name: CrazySales GenZ
Version: 1.0.0
Description: Gen Z-facing redesign for crazysales.in. Photo-led deal feed with a signal-red urgency accent and a distinct strip layout for multi-item drop posts. Standalone theme, no parent.
Author: CrazySales
Text Domain: crazysales-genz
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
	--paper: #FAFAF7;
	--ink-black: #0E0E10;
	--ink: #161616;
	--signal-red: #FF3D2E;
	--drop-yellow: #FFE14D;
	--muted: #7A7A85;
	--white: #FFFFFF;
	--hair: #232326;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--ink-black);
	color: var(--paper);
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	line-height: 1.4;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

:focus-visible {
	outline: 2px solid var(--signal-red);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---- Header ------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background-color: var(--ink-black);
	border-bottom: 1px solid var(--hair);
}

.site-header__bar {
	max-width: 1100px;
	margin-inline: auto;
	padding: 0.9rem 1.1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.site-header__wordmark {
	display: inline-flex;
	align-items: center;
}

/*
 * A cream card behind the logo, matching the artwork's own native
 * background color (sampled from the source image) rather than an
 * arbitrary white or brand color. On flat black the logo read as
 * floating/disconnected and its navy elements (bag handle, price tag)
 * lost contrast — this makes it read as a deliberate badge instead.
 */
.site-header__logo-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.75rem;
	border-radius: 12px;
	background-color: #FEF7ED;
}

/* The full logo (icon + wordmark together), used exactly as designed —
   cropped from the source artwork with a transparent background. */
.site-header__logo-full {
	display: block;
	height: 32px;
	width: auto;
}

.site-header__menu {
	list-style: none;
	display: flex;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	font-size: 0.85rem;
	font-weight: 600;
}

.site-header__menu a:hover {
	color: var(--signal-red);
}

/* ---- Feed shell ----------------------------------------------------- */

.feed {
	max-width: 1100px;
	margin-inline: auto;
	padding: 1.5rem 1.1rem 3rem;
}

/* ---- Promo banner (dated sale event) ---------------------------------- */

.promo-banner {
	display: block;
	margin: 0 0 1.1rem;
	padding: 1.6rem 1.25rem;
	border-radius: 16px;
	text-align: center;
	background: linear-gradient(135deg, #2874f0 0%, #4a2fb8 55%, #7b2ff7 100%);
	box-shadow: 0 8px 28px rgba(40, 116, 240, 0.28);
}

.promo-banner__kicker {
	display: inline-block;
	margin-bottom: 0.65rem;
	padding: 0.3rem 0.9rem;
	border-radius: 999px;
	background: var(--drop-yellow);
	color: var(--ink-black);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.04em;
}

.promo-banner__title {
	margin: 0 0 0.4rem;
	color: #fff;
	font-family: 'Archivo Black', sans-serif;
	font-size: clamp(1.3rem, 4vw, 2rem);
	line-height: 1.1;
}

.promo-banner__blurb {
	margin: 0 auto 1rem;
	max-width: 46ch;
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.9rem;
	line-height: 1.45;
}

.promo-banner__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 0 0 1.1rem;
	padding: 0;
	list-style: none;
}

.promo-banner__tags li {
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 600;
}

.promo-banner__cta {
	display: inline-block;
	padding: 0.75rem 1.75rem;
	border-radius: 999px;
	background: #fff;
	color: #2874f0;
	font-size: 0.92rem;
	font-weight: 800;
}

/* ---- Telegram community banner ----------------------------------------- */

.tg-banner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1.25rem;
	padding: 0.85rem 0.9rem;
	border: 1px solid rgba(255, 62, 46, 0.2);
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(34, 158, 217, 0.14), rgba(255, 62, 46, 0.07));
}

.tg-banner__icon {
	flex: none;
}

.tg-banner__copy {
	flex: 1 1 auto;
	min-width: 0;
}

.tg-banner__title {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--paper);
}

.tg-banner__sub {
	margin: 0.15rem 0 0;
	font-size: 0.76rem;
	line-height: 1.35;
	color: var(--muted);
}

.tg-banner__cta {
	flex: none;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	background: #229ed9;
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
}

.tg-banner__cta:hover {
	background: #1b8ec4;
}

.tg-banner__close {
	flex: none;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.tg-banner__close:hover {
	color: var(--paper);
}

@media (max-width: 420px) {
	.tg-banner__sub {
		display: none;
	}
}

.feed__intro {
	margin-bottom: 1.25rem;
}

.feed__heading {
	font-family: 'Archivo Black', sans-serif;
	font-size: clamp(2rem, 6vw, 2.8rem);
	line-height: 0.95;
	letter-spacing: -0.01em;
	margin: 0 0 0.35rem;
	color: var(--paper);
}

.feed__sub {
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.feed__empty {
	color: var(--muted);
}

/* ---- Hero ------------------------------------------------------------ */

.hero {
	position: relative;
	display: block;
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 1.25rem;
	background-color: var(--white);
	aspect-ratio: 4 / 3;
}

/* The image itself is a full-bleed internal link, same split as a card's
   title-vs-CTA: this goes to the detail page, .hero__cta below is the one
   real outbound affiliate link. */
a.hero__link:first-child {
	position: absolute;
	inset: 0;
}

.hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__panel {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 1.1rem 1.1rem 1.25rem;
	background: linear-gradient(to top, rgba(14, 14, 16, 0.92) 10%, rgba(14, 14, 16, 0.35) 65%, transparent 100%);
	color: var(--white);
}

.hero__discount {
	display: inline-block;
	background-color: var(--signal-red);
	color: var(--white);
	font-family: 'Archivo Black', sans-serif;
	font-size: 1.1rem;
	padding: 0.2rem 0.55rem;
	border-radius: 6px;
	margin-bottom: 0.5rem;
}

.hero__title {
	font-family: 'Archivo Black', sans-serif;
	font-size: clamp(1.2rem, 4vw, 1.7rem);
	line-height: 1.05;
	margin: 0 0 0.4rem;
	max-width: 34ch;
}

.hero__title .hero__link {
	color: inherit;
	text-decoration: none;
}

.hero__title .hero__link:hover {
	text-decoration: underline;
}

.hero__prices {
	margin: 0 0 0.65rem;
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.hero__now {
	font-size: 1.3rem;
	font-weight: 800;
}

.hero__was {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.9rem;
}

.hero__cta {
	display: inline-flex;
	align-items: center;
	background-color: var(--signal-red);
	color: var(--white);
	font-weight: 800;
	font-size: 0.9rem;
	padding: 0.55rem 1rem;
	border-radius: 8px;
}

/* ---- Grid ------------------------------------------------------------- */

/*
 * Fixed column COUNT (repeat(N, 1fr)), matching CRAZYSALES_CARDS_PER_ROW in
 * front-page.php exactly. PHP now pre-chunks posts into complete rows of N
 * before rendering (drops render as their own separate full-width row, never
 * a partial row of cards), so every .feed__grid the server sends IS a full
 * row — auto-fill/minmax here would just recompute a different column count
 * from the container width and break that guarantee.
 */
.feed__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.9rem;
}

/* Every direct block in the feed (a card grid, a drop strip) gets consistent
   vertical rhythm, whether it's a <div class="feed__grid"> or a lone
   .drop-strip sitting between two grids. */
.feed > .feed__grid,
.feed > .drop-strip {
	margin-bottom: 0.9rem;
}

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

@media (min-width: 960px) {
	.feed__grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

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

.deal-card {
	display: flex;
	flex-direction: column;
	background-color: var(--ink);
	border: 1px solid var(--hair);
	border-radius: 12px;
	overflow: hidden;
}

.deal-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background-color: var(--white);
}

.deal-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * No product photo (~26% of posts): a store-branded tile stands in, not an
 * empty box. Real brand color + wordmark, generated in CSS — no image
 * assets to source, and it still tells the shopper which store this is at
 * a glance instead of just showing blank space.
 */
.deal-card__media--flat {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem;
}

.deal-card__brand {
	font-family: 'Archivo Black', sans-serif;
	font-size: 1.1rem;
	letter-spacing: -0.01em;
	opacity: 0.92;
	text-align: center;
}

.deal-card__discount {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	background-color: var(--signal-red);
	color: var(--white);
	font-family: 'Archivo Black', sans-serif;
	font-size: 0.78rem;
	padding: 0.2rem 0.4rem;
	border-radius: 5px;
}

/* Absolute like the photo variant's badge — the tile is centered content
   now, not a bottom-aligned strip, so the badge needs its own corner. */
.deal-card__discount--flat {
	top: 0.5rem;
	left: 0.5rem;
}

.deal-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.75rem;
	flex: 1;
}

.deal-card__topline {
	min-height: 1rem;
}

.deal-card__store {
	color: var(--muted);
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.deal-card__title {
	margin: 0;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--paper);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.deal-card__prices {
	margin: 0.15rem 0 0;
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
}

.deal-card__now {
	font-size: 1.1rem;
	font-weight: 800;
	color: var(--paper);
}

.deal-card__was {
	font-size: 0.75rem;
	color: var(--muted);
}

.deal-card__note,
.deal-card__rating,
.deal-card__trust {
	margin: 0;
	font-size: 0.68rem;
	color: var(--muted);
}

.deal-card__cta {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--signal-red);
	color: var(--white);
	font-weight: 800;
	font-size: 0.82rem;
	padding: 0.55rem 0.7rem;
	border-radius: 8px;
}

/* ---- Drop strip ------------------------------------------------------- */

.drop-strip {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background-color: var(--drop-yellow);
	color: var(--ink-black);
	border-radius: 12px;
	padding: 0.9rem 0.9rem 0.9rem 1.1rem;
	transition: filter 0.15s ease;
}

.drop-strip:hover,
.drop-strip:focus-visible {
	filter: brightness(0.96);
}

.drop-strip__label {
	font-family: 'Archivo Black', sans-serif;
	font-size: 0.72rem;
	background-color: var(--ink-black);
	color: var(--drop-yellow);
	padding: 0.2rem 0.5rem;
	border-radius: 5px;
	flex: none;
}

.drop-strip__title {
	font-weight: 800;
	font-size: 0.95rem;
	flex: 1;
}

/*
 * A real button, not text: this is the strip's only CTA, and text alone
 * under-signals "this is tappable" (a real crazysales.in post got read as
 * non-actionable with the old text-only treatment). Solid ink-black pill
 * against the yellow strip makes it the obvious, unambiguous tap target,
 * matching the weight of a card's red "Get deal" button.
 */
.drop-strip__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	flex: none;
	background-color: var(--ink-black);
	color: var(--drop-yellow);
	font-weight: 800;
	font-size: 0.78rem;
	white-space: nowrap;
	padding: 0.5rem 0.7rem;
	border-radius: 8px;
}

.drop-strip__arrow {
	width: 14px;
	height: 14px;
	flex: none;
}

/* ---- Pagination --------------------------------------------------------- */

.feed__pagination {
	margin-top: 2rem;
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.feed__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.2rem;
	height: 2.2rem;
	padding-inline: 0.5rem;
	border-radius: 8px;
	border: 1px solid var(--hair);
	color: var(--paper);
	font-size: 0.85rem;
	font-weight: 600;
}

.feed__pagination .page-numbers.current {
	background-color: var(--signal-red);
	border-color: var(--signal-red);
	color: var(--white);
}

/* ---- Deal detail page ------------------------------------------------------ */

.single {
	max-width: 700px;
	margin-inline: auto;
	padding: 1.25rem 1.1rem 3rem;
}

.single__crumb {
	margin-bottom: 1rem;
}

.single__crumb a {
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.single__crumb a:hover {
	color: var(--paper);
}

/* ---- Single: product deal ---- */

.single-deal__media {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background-color: var(--white);
	margin-bottom: 1.1rem;
}

.single-deal__media img {
	width: 100%;
	max-height: 420px;
	object-fit: contain;
	background-color: var(--white);
}

/* No product photo: same store-branded tile concept as the card, sized for
   the detail page's larger media slot. */
.single-deal__media--flat {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 1.5rem;
}

.single-deal__brand {
	font-family: 'Archivo Black', sans-serif;
	font-size: 1.6rem;
	letter-spacing: -0.01em;
	opacity: 0.92;
	text-align: center;
}

.single-deal__discount--flat {
	top: 0.75rem;
	left: 0.75rem;
}

.single-deal__discount {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	background-color: var(--signal-red);
	color: var(--white);
	font-family: 'Archivo Black', sans-serif;
	font-size: 0.95rem;
	padding: 0.25rem 0.55rem;
	border-radius: 6px;
}

.single-deal__store {
	display: inline-block;
	color: var(--muted);
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	margin-bottom: 0.4rem;
}

.single-deal__title {
	font-family: 'Archivo Black', sans-serif;
	font-size: clamp(1.3rem, 4vw, 1.9rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 0.65rem;
	color: var(--paper);
}

.single-deal__prices {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 0.5rem;
}

.single-deal__now {
	font-size: 1.7rem;
	font-weight: 800;
	color: var(--paper);
}

.single-deal__was {
	font-size: 1rem;
	color: var(--muted);
}

.single-deal__note,
.single-deal__rating,
.single-deal__stock {
	margin: 0 0 0.4rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.single-deal__trust {
	margin: 0 0 1.1rem;
	font-size: 0.78rem;
	color: var(--muted);
}

.single-deal__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background-color: var(--signal-red);
	color: var(--white);
	font-weight: 800;
	font-size: 1rem;
	padding: 0.85rem 1.2rem;
	border-radius: 10px;
}

@media (min-width: 640px) {
	.single-deal {
		display: grid;
		grid-template-columns: 280px 1fr;
		gap: 1.75rem;
		align-items: start;
	}

	.single-deal__media {
		margin-bottom: 0;
	}

	.single-deal__cta {
		width: auto;
		padding-inline: 2rem;
	}
}

/* ---- Single: drop ---- */

.single-drop__label {
	display: inline-block;
	font-family: 'Archivo Black', sans-serif;
	font-size: 0.72rem;
	background-color: var(--drop-yellow);
	color: var(--ink-black);
	padding: 0.2rem 0.5rem;
	border-radius: 5px;
	margin-bottom: 0.6rem;
}

.single-drop__title {
	font-family: 'Archivo Black', sans-serif;
	font-size: clamp(1.3rem, 4vw, 1.9rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 0.5rem;
	color: var(--paper);
}

.single-drop__trust {
	margin: 0 0 1.25rem;
	font-size: 0.78rem;
	color: var(--muted);
}

.single-drop__body {
	color: var(--paper);
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: 1.5rem;
}

.single-drop__body p {
	margin: 0 0 0.85rem;
}

.single-drop__body a {
	color: var(--drop-yellow);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.single-drop__body img {
	display: none;
}

.single-drop__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background-color: var(--drop-yellow);
	color: var(--ink-black);
	font-weight: 800;
	font-size: 1rem;
	padding: 0.85rem 1.2rem;
	border-radius: 10px;
}

@media (min-width: 640px) {
	.single-drop__cta {
		width: auto;
		padding-inline: 2rem;
	}
}

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
	max-width: 1100px;
	margin-inline: auto;
	padding: 1.5rem 1.1rem 2.5rem;
	border-top: 1px solid var(--hair);
	color: var(--muted);
	font-size: 0.78rem;
}

.site-footer__note {
	margin: 0 0 0.4rem;
	max-width: 60ch;
}

.site-footer__copy {
	margin: 0;
}
