/*
Theme Name:   Wodka Vines (NitroShock child)
Template:     NitroShock
Description:  Wodka Vines templates for producers, wines, spirits and stores; list and map shortcodes; the monthly store import (Tools > Store Import).
Version:      1.4.6
Requires PHP: 7.4
Text Domain:  wodkavines
*/

/* ----------------------------------------------------------------------
   Colours come from the theme's brand variables. Fallbacks only apply if
   a variable is missing.
   ---------------------------------------------------------------------- */
:root {
	--wv-accent: var(--color-primary, currentColor);
	--wv-text-muted: var(--color-text-muted, inherit);
	--wv-border: var(--color-border, currentColor);
	--wv-surface: var(--color-surface, transparent);
	--wv-wine-tint: var(--color-wine-tint, var(--wv-surface));
	--wv-spirit-tint: var(--color-spirit-tint, var(--wv-surface));
	--wv-bg: var(--color-bg, Canvas);
	--wv-gap: 1.5rem;
	--wv-radius: 6px;
}

/* ---------- shared page layout ---------- */
.wv-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1.25rem 4rem;
}

.wv-section {
	margin-top: 3rem;
}

.wv-section > h2 {
	margin-bottom: 1rem;
}

.wv-note {
	color: var(--wv-text-muted);
}

.wv-lines {
	margin: 0;
	padding-left: 1.25rem;
}

/* ---------- the niche: every bottle in the same arched panel ---------- */
.niche {
	position: relative;
	display: block;
	aspect-ratio: 5 / 8;
	overflow: hidden;
	border-radius: 999px 999px var(--wv-radius) var(--wv-radius);
	background: var(--wv-wine-tint);
}

.niche--spirit {
	background: var(--wv-spirit-tint);
}

/* Photos on white blend into the panel; every bottle is the same height. */
.niche-bottle {
	position: absolute;
	left: 50%;
	bottom: 7%;
	transform: translateX(-50%);
	height: 78%;
	width: auto;
	max-width: 80%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.niche-placeholder {
	fill: var(--wv-accent);
	opacity: 0.16;
}

.niche--spirit .niche-placeholder {
	fill: var(--color-secondary, currentColor);
}

.niche-logo {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 78%;
	height: auto;
	max-height: 60%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

/* ---------- product cards (lists, producer pages, store pages) ---------- */
.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: var(--wv-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Niches turn white inside tinted sections (home page panels). */
.product-grid--light .niche {
	background: var(--wv-bg);
}

.product-card {
	margin: 0;
}

.product-card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.product-card-title {
	margin: 0.75rem 0 0.125rem;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.3;
}

.product-card-link:hover .product-card-title,
.product-card-link:focus-visible .product-card-title {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.product-card-meta {
	margin: 0;
	font-size: 0.875rem;
	color: var(--wv-text-muted);
}

.product-group + .product-group {
	margin-top: 2.5rem;
}

.product-group > h2,
.product-group > h3 {
	margin-bottom: 1rem;
}

.product-group > h2 a,
.product-group > h3 a {
	color: inherit;
}

/* ---------- producer features (home page) ---------- */
.producer-features {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 3rem 4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.producer-feature {
	display: grid;
	grid-template-columns: 4.5rem minmax(0, 1fr);
	gap: 1.5rem;
	align-items: start;
}

.producer-feature-name {
	margin: 0;
}

.producer-feature-name a {
	color: inherit;
	text-decoration: none;
}

.producer-feature-name a:hover {
	color: var(--wv-accent);
	text-decoration: underline;
}

.producer-feature-place {
	margin: 0.25rem 0 0;
	font-size: 0.9375rem;
	color: var(--wv-text-muted);
}

.producer-feature-text {
	margin: 0.75rem 0 0;
}

/* ---------- recent stores and latest posts (home page) ---------- */
.wv-recent-stores {
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.wv-recent-stores li {
	padding: 0.75rem 0;
	border-top: 1px solid currentColor;
	border-top-color: color-mix(in srgb, currentColor 25%, transparent);
}

.wv-recent-stores a {
	color: inherit;
	text-decoration: none;
}

.wv-recent-stores a:hover {
	text-decoration: underline;
}

.wv-recent-stores span {
	display: block;
	font-size: 0.9375rem;
	opacity: 0.8;
}

.wv-post-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wv-post-list li {
	padding-top: 1rem;
	border-top: 2px solid currentColor;
}

.wv-post-list-title {
	color: inherit;
	font-size: 1.3125rem;
	line-height: 1.3;
	text-decoration: none;
}

.wv-post-list-title:hover {
	color: var(--wv-accent);
	text-decoration: underline;
}

.wv-post-list p {
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
	color: var(--wv-text-muted);
}

/* ---------- product page (wines and spirits) ---------- */
.product-hero {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 2.5rem;
	align-items: start;
}

.product-hero-image .niche {
	max-width: 420px;
	margin: 0 auto;
}

.product-jump {
	margin: 1.5rem 0 0;
}

.product-producer {
	margin: 0 0 0.5rem;
	font-weight: 600;
}

.product-title {
	margin: 0 0 0.5rem;
}

.product-meta {
	margin: 0 0 1.5rem;
	color: var(--wv-text-muted);
}

.product-status {
	display: inline-block;
	margin: 0 0 1rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--wv-border);
	border-radius: var(--wv-radius);
	font-weight: 600;
}

.wv-facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.5rem 1.5rem;
	margin: 0;
}

.wv-facts dt {
	font-weight: 600;
}

.wv-facts dd {
	margin: 0;
}

.product-body {
	margin-top: 2rem;
	max-width: 70ch;
}

/* ---------- producer page ---------- */
.producer-banner {
	margin: 0 0 var(--space-7, 3rem);
	overflow: hidden;
	border-radius: var(--wv-radius);
	aspect-ratio: 12 / 5;
	max-height: 480px;
	background: var(--wv-wine-tint);
}

.producer-banner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.producer-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2rem;
	align-items: center;
}

/* Logo in a quiet box beside the name. */
.producer-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 220px;
	min-height: 130px;
	padding: 1.25rem;
	border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
	border-radius: var(--wv-radius);
	background: #fff; /* White, so logos supplied on a white background blend in. */
}

.producer-logo img {
	display: block;
	width: 100%;
	max-height: 110px;
	height: auto;
	object-fit: contain;
}

/* Story on the left, facts panel on the right. */
.producer-layout {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
	gap: var(--space-8, 4rem);
	align-items: start;
}

.producer-layout--single {
	grid-template-columns: minmax(0, 1fr);
}

.producer-aside {
	padding: var(--space-6, 2rem);
	border-radius: var(--wv-radius);
	background: var(--wv-wine-tint);
}

.producer-aside h2 {
	margin-top: 0;
	font-size: var(--text-xl, 1.5rem);
}

.producer-meta {
	margin: 0 0 1rem;
	color: var(--wv-text-muted);
}

.producer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.producer-body {
	max-width: 70ch;
}

/* ---------- store pages and store finder ---------- */
.store-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

.store-type {
	margin: 0 0 0.5rem;
	font-weight: 600;
}

.store-address {
	margin: 0 0 1rem;
	font-style: normal;
}

.store-hours {
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.store-map {
	width: 100%;
	height: 420px;
	border-radius: var(--wv-radius);
}

.store-map.is-small {
	height: 320px;
}

.store-map.is-empty {
	display: none;
}

.store-finder-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0 0 1rem;
}

.store-finder-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.store-finder-filter legend {
	float: left;
	margin-right: 0.5rem;
	font-weight: 600;
}

/* Each option is a button-like pill; the radio stays for keyboards and screen readers. */
.store-finder-filter label {
	position: relative;
	cursor: pointer;
}

.store-finder-filter input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.store-finder-filter span {
	display: inline-block;
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--color-border-strong, currentColor);
	border-radius: 999px;
	line-height: 1.2;
}

.store-finder-filter input:checked + span {
	background: var(--wv-accent);
	border-color: var(--wv-accent);
	color: var(--color-on-dark, #fff);
}

.store-finder-filter input:focus-visible + span {
	outline: 2px solid var(--color-focus, currentColor);
	outline-offset: 2px;
}

.store-list-group + .store-list-group {
	margin-top: 1.5rem;
}

.store-list {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 2 260px;
	column-gap: 2rem;
}

.store-list li {
	break-inside: avoid;
	margin: 0 0 0.75rem;
}

.store-list-name {
	font-weight: 600;
}

.store-list-address {
	display: block;
	font-size: 0.875rem;
	color: var(--wv-text-muted);
}

.store-pin {
	fill: var(--wv-accent);
	stroke: var(--wv-accent);
}

.store-pin--drink {
	fill-opacity: 0.35;
}

.store-finder [hidden] {
	display: none;
}

/* ---------- recipes and articles (added below post content) ---------- */
.recipe-details {
	margin-top: 2rem;
}

.recipe-method {
	padding-left: 1.25rem;
}

/* ---------- small screens ---------- */
@media (max-width: 782px) {
	.product-hero,
	.producer-hero,
	.store-hero {
		grid-template-columns: 1fr;
	}

	.producer-logo {
		order: -1;
		width: 180px;
		min-height: 100px;
	}

	.producer-layout {
		grid-template-columns: 1fr;
		gap: var(--space-6, 2rem);
	}

	.store-map {
		height: 320px;
	}

	.producer-features,
	.wv-post-list {
		grid-template-columns: 1fr;
	}

	.product-hero-image .niche {
		max-width: 260px;
	}
}

@media (max-width: 576px) {
	.product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* One row that scrolls sideways, two and a bit in view. */
	.product-grid--row {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: 0.5rem;
	}

	.product-grid--row > li {
		flex: 0 0 42%;
		scroll-snap-align: start;
	}
}

/* Space between a store map and the list heading below it. */
.store-finder .store-map {
	margin-bottom: var(--space-8, 2.5rem);
}

/* Archive and term page header (Wines, Spirits, Producers, grapes, regions;
   .page-header = the parent theme's category, blog and search pages):
   space between the page title and the first group below it. */
.wv-archive-header,
.page-header {
	margin-bottom: var(--space-7, 3rem);
}

/* Producer with no logo or photo: its name in the arch. */
.niche-name {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 1rem;
	font-family: var(--font-display, inherit);
	font-size: var(--text-lg, 1.25rem);
	font-weight: var(--weight-light, 300);
	line-height: 1.2;
	text-align: center;
	color: var(--color-text-muted, currentColor);
}

/* Search results page. */
.search-again {
	display: flex;
	gap: 0.75rem;
	max-width: 40rem;
	margin-top: var(--space-5, 1.5rem);
}

.search-again input {
	flex: 1;
	min-width: 0;
	padding: 0.7rem 1rem;
	border: 1px solid var(--color-border-strong, currentColor);
	border-radius: var(--radius-sm, 3px);
	font: inherit;
}

.search-again button {
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: var(--radius-sm, 3px);
	background: var(--wv-accent);
	color: var(--color-on-dark, #fff);
	font-family: var(--font-ui, inherit);
	cursor: pointer;
}

.search-count {
	margin-top: var(--space-3, 0.75rem);
	color: var(--color-text-muted, currentColor);
}

.search-page .product-group + .product-group,
.search-page .product-group + .wv-section {
	margin-top: var(--space-8, 4rem);
}

.search-list {
	max-width: 48rem;
	margin: var(--space-4, 1rem) 0 0;
	padding: 0;
	list-style: none;
}

.search-list li {
	padding: var(--space-4, 1rem) 0;
	border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
}

.search-list h3 {
	margin: 0.15rem 0 0.35rem;
	font-size: var(--text-lg, 1.25rem);
}

.search-list p {
	margin: 0;
	color: var(--color-text-muted, currentColor);
}

.search-list-type {
	font-family: var(--font-ui, inherit);
	font-size: var(--text-xs, 0.75rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-text-muted, currentColor);
}

/* Blog lists (News, Recipes): one row per post, small image beside the text. */
.post-row {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: var(--space-6, 2rem);
	align-items: start;
	padding: var(--space-6, 2rem) 0;
	border-top: 1px solid var(--wv-border);
}

/* The parent spaces every listed article with .ns-theme-content .main > article. */
.main > article.post-row {
	margin: 0;
}

/* The parent centres the list heading in a narrow prose column; line it up
   with the post rows instead. */
.blog .page-header,
.archive.category .page-header,
.archive.tag .page-header {
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

.post-row:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.post-row-image {
	display: block;
	text-decoration: none;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--wv-radius);
	background: var(--wv-wine-tint);
}

.post-row-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-row-title {
	margin: 0 0 0.25rem;
	font-size: var(--text-xl, 1.5rem);
}

.post-row-title a {
	color: inherit;
	text-decoration: none;
}

.post-row-title a:hover,
.post-row-title a:focus-visible {
	color: var(--wv-accent);
}

.post-row-date {
	margin: 0 0 0.75rem;
	color: var(--wv-text-muted);
	font-size: var(--text-sm, 0.875rem);
}

.post-row-excerpt p {
	margin: 0;
}

@media (max-width: 640px) {
	.post-row {
		grid-template-columns: 1fr;
		gap: var(--space-4, 1rem);
	}

	.post-row-image {
		aspect-ratio: 16 / 9;
	}

	/* On a phone a big empty box says nothing; show just the text. */
	.post-row-image:not(:has(img)) {
		display: none;
	}
}

/* Leaflet stacks its panes at z-index 400 to 1000; keep them inside the map
   so the sticky header passes over it when scrolling. */
.store-map {
	position: relative;
	z-index: 0;
}

.post-row-label {
	display: flex;
	text-decoration: none;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--wv-text-muted);
	font-size: var(--text-lg, 1.25rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- single blog post (news, recipes) ---------- */

/* Same light display heading as every other page, not the parent's bold 32px. */
.single-post .entry-title {
	margin-bottom: var(--space-3, 0.75rem);
	font-size: var(--text-3xl, 2.5rem);
	font-weight: var(--weight-light, 300);
}

.single-post .entry-meta {
	color: var(--wv-text-muted);
	font-size: var(--text-sm, 0.875rem);
}

/* The parent lets the featured image run the full width while the title and
   text sit in a 760px column; keep it in the column. */
.single-post .post-thumbnail {
	max-width: 760px;
	margin: 0 auto var(--space-6, 2rem);
}

.single-post .post-thumbnail:not(:has(img)) {
	display: none;
}

.single-post .post-thumbnail img {
	width: 100%;
	max-height: 520px;
	object-fit: cover;
	border-radius: var(--wv-radius);
}

.single-post .entry-content > h2,
.single-post .entry-content > h3,
.recipe-details > h2 {
	margin: var(--space-7, 3rem) 0 var(--space-3, 0.75rem);
}

.single-post .entry-content ul,
.single-post .entry-content ol {
	margin-bottom: var(--space-4, 1rem);
}

/* .entry-content img sets height:auto, which beat the niche's fixed bottle
   height and pushed the bottle into the arch, cutting off the top. */
.niche img.niche-bottle {
	height: 78%;
}

.single-post .entry-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin-top: var(--space-7, 3rem);
	padding-top: var(--space-4, 1rem);
	border-top: 1px solid var(--wv-border);
	color: var(--wv-text-muted);
	font-size: var(--text-sm, 0.875rem);
}

.post-navigation {
	margin-top: var(--space-6, 2rem);
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wv-gap);
}

.post-navigation .nav-next {
	grid-column: 2;
	text-align: right;
}

.post-navigation a {
	display: block;
	height: 100%;
	padding: var(--space-4, 1rem) var(--space-5, 1.5rem);
	border: 1px solid var(--wv-border);
	border-radius: var(--wv-radius);
	color: inherit;
	text-decoration: none;
}

.post-navigation a:hover,
.post-navigation a:focus-visible {
	border-color: var(--wv-accent);
}

.post-navigation .nav-label {
	display: block;
	color: var(--wv-text-muted);
	font-size: var(--text-sm, 0.875rem);
}

.post-navigation .nav-title {
	display: block;
	margin-top: 0.25rem;
	font-family: var(--font-display, inherit);
	font-size: var(--text-lg, 1.25rem);
}

@media (max-width: 640px) {
	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		grid-column: auto;
	}
}
