/* ==========================================================================
   WCP Glossary — Frontend Styles
   Version: 1.0.0
   Pixel-perfect from Figma: JZLop0JL23ofEpD8xPi2fQ
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
	--wcp-g-black: #000000;
	--wcp-g-white: #FFFFFF;
	--wcp-g-tan: #BCAC9E;
	--wcp-g-tan-dark: #A6856C;
	--wcp-g-gold: #A2732D;
	--wcp-g-cream: #F8F4F0;
	--wcp-g-orange: #D65E07;
	--wcp-g-body-text: #4A4A5A;
	--wcp-g-card-text: #1D1D1D;
	--wcp-g-gray: #8F8F8F;
	--wcp-g-border: #E4E4E4;
	--wcp-g-footer-bg: #F6F5F3;
	--wcp-g-dark-title-mobile: #262626;
	--wcp-g-font: 'Montserrat', sans-serif;
}

/* --------------------------------------------------------------------------
   2. Page Background Override (Astra default is #F0F5FA blueish)
   -------------------------------------------------------------------------- */
body.post-type-archive-wcp_glossary,
body.single-wcp_glossary {
	background-color: var(--wcp-g-white) !important;
	overflow-y: scroll; /* Always show scrollbar to prevent horizontal reflow on filter */
	scroll-behavior: auto !important; /* Override any global smooth scroll — prevents floaty/laggy feel */
}

html:has(body.post-type-archive-wcp_glossary),
html:has(body.single-wcp_glossary) {
	scroll-behavior: auto !important;
}

body.post-type-archive-wcp_glossary .site-content,
body.single-wcp_glossary .site-content {
	background-color: var(--wcp-g-white) !important;
}

/* Override Astra container width ONLY inside site-content (not header/footer) */
body.post-type-archive-wcp_glossary #content > .ast-container,
body.single-wcp_glossary #content > .ast-container {
	max-width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* --------------------------------------------------------------------------
   3. Page Container
   -------------------------------------------------------------------------- */
.wcp-glossary-page {
	font-family: var(--wcp-g-font);
	max-width: 1440px;
	margin: 0 auto;
	padding: 40px 70px 60px;
	color: var(--wcp-g-black);
}

/* --------------------------------------------------------------------------
   2b. Breadcrumb
   -------------------------------------------------------------------------- */
.wcp-glossary-breadcrumb {
	margin-bottom: 24px;
	font-family: var(--wcp-g-font);
	font-size: 14px;
	line-height: 1.5;
	color: var(--wcp-g-gray);
}

.wcp-glossary-breadcrumb a {
	color: var(--wcp-g-orange);
	text-decoration: none;
}

.wcp-glossary-breadcrumb a:hover {
	text-decoration: underline;
}

.wcp-glossary-breadcrumb .breadcrumb_last {
	color: var(--wcp-g-gray);
}

/* --------------------------------------------------------------------------
   3a. Archive Page Title (H1)
   -------------------------------------------------------------------------- */
.wcp-glossary-page-title {
	font-family: var(--wcp-g-font);
	font-size: 35px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--wcp-g-black);
	text-align: center;
	margin: 0 0 32px;
}

.wcp-glossary-page-subtitle {
	font-family: var(--wcp-g-font);
	font-size: 18px;
	font-weight: 400;
	font-style: italic;
	line-height: 1.5;
	color: var(--wcp-g-body-text);
	text-align: center;
	margin: -16px 0 36px;
}

/* --------------------------------------------------------------------------
   3. Search Bar
   -------------------------------------------------------------------------- */
.wcp-glossary-search-section {
	margin-bottom: 32px;
}

.wcp-glossary-search-bar {
	position: relative;
	max-width: 682px;
	margin: 0 auto 24px;
	z-index: 10;
}

.wcp-glossary-search-input {
	width: 100%;
	height: 50px;
	padding: 0 50px 0 24px;
	border: 1px solid var(--wcp-g-gray);
	border-radius: 50px;
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 28px;
	color: var(--wcp-g-black);
	background: var(--wcp-g-white);
	outline: none;
	box-sizing: border-box;
}

.wcp-glossary-search-input::placeholder {
	color: var(--wcp-g-gray);
}

.wcp-glossary-search-input:focus {
	border-color: var(--wcp-g-tan);
}

.wcp-glossary-search-icon {
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   3b. Search Autocomplete Dropdown
   -------------------------------------------------------------------------- */
.wcp-glossary-search-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: var(--wcp-g-white);
	border: 1px solid var(--wcp-g-border);
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	z-index: 100;
	max-height: 400px;
	overflow-y: auto;
}

.wcp-glossary-search-group {
	padding: 8px 0;
}

.wcp-glossary-search-group + .wcp-glossary-search-group {
	border-top: 1px solid var(--wcp-g-border);
}

.wcp-glossary-search-group-label {
	font-family: var(--wcp-g-font);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--wcp-g-gray);
	padding: 6px 16px 4px;
}

.wcp-glossary-search-result a {
	display: block;
	padding: 8px 16px;
	text-decoration: none;
	transition: background 0.15s ease;
}

.wcp-glossary-search-result a:hover,
.wcp-glossary-search-result.highlighted a {
	background: var(--wcp-g-cream);
}

.wcp-glossary-search-result-title {
	display: block;
	font-family: var(--wcp-g-font);
	font-size: 15px;
	font-weight: 500;
	color: var(--wcp-g-black);
	line-height: 1.3;
}

.wcp-glossary-search-result-desc {
	display: block;
	font-family: var(--wcp-g-font);
	font-size: 13px;
	font-weight: 400;
	color: var(--wcp-g-body-text);
	line-height: 1.4;
	margin-top: 2px;
}

.wcp-glossary-search-empty {
	font-family: var(--wcp-g-font);
	font-size: 14px;
	color: var(--wcp-g-gray);
	padding: 16px;
	text-align: center;
}

/* --------------------------------------------------------------------------
   4. A-Z Filter
   -------------------------------------------------------------------------- */
.wcp-glossary-az-filter {
	text-align: center;
	margin-bottom: 24px;
	line-height: 28px;
}

.wcp-glossary-az-letter {
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 28px;
	letter-spacing: 0.32px;
	color: var(--wcp-g-black);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.wcp-glossary-az-letter:hover {
	color: var(--wcp-g-orange);
}

.wcp-glossary-az-letter.active {
	color: var(--wcp-g-orange);
	font-weight: 600;
}

.wcp-glossary-az-letter.disabled {
	color: var(--wcp-g-gray);
	cursor: default;
	pointer-events: none;
}

.wcp-glossary-az-separator {
	font-size: 16px;
	color: var(--wcp-g-gray);
	margin: 0 4px;
	user-select: none;
}

/* --------------------------------------------------------------------------
   5. Author / Date Line
   -------------------------------------------------------------------------- */
.wcp-glossary-meta-line {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 20px;
	margin-bottom: 32px;
	font-family: var(--wcp-g-font);
	font-size: 14px;
	font-weight: 400;
	color: var(--wcp-g-black);
}

.wcp-glossary-author {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--wcp-g-black);
}

.wcp-glossary-author-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.wcp-glossary-author-name {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wcp-glossary-updated {
	color: var(--wcp-g-black);
}

/* --------------------------------------------------------------------------
   6. Letter Section Headings (Index Page)
   -------------------------------------------------------------------------- */
.wcp-glossary-letter-section {
	margin-bottom: 40px;
	content-visibility: auto; /* Skip rendering off-screen sections — huge scroll perf win */
	contain-intrinsic-size: auto 300px; /* Estimated height for off-screen sections */
}

.wcp-glossary-letter-heading {
	font-family: var(--wcp-g-font);
	font-size: 35px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--wcp-g-black);
	margin: 0 0 20px;
	padding: 0;
}

/* --------------------------------------------------------------------------
   7. Index Term Cards (Grid)
   -------------------------------------------------------------------------- */
.wcp-glossary-cards-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 65px;
}

.wcp-glossary-term-card {
	background: #FFFFFF;
	border-radius: 10px;
	box-shadow: 2px 3px 8px 0px rgba(0, 0, 0, 0.10);
	padding: 15px 20px;
	transition: box-shadow 0.25s ease;
}

.wcp-glossary-term-card:hover {
	box-shadow: 2px 4px 12px 0px rgba(0, 0, 0, 0.14);
}

.wcp-glossary-term-card-link {
	text-decoration: none !important;
	display: block;
}

.wcp-glossary-term-card-name {
	font-family: var(--wcp-g-font);
	font-size: 16px !important;
	font-weight: 400 !important;
	line-height: 24px !important;
	color: #D75E08 !important;
	margin: 0 0 6px !important;
	padding: 0 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

.wcp-glossary-term-card-link:hover .wcp-glossary-term-card-name {
	text-decoration: underline;
}

.wcp-glossary-term-card-desc {
	font-family: var(--wcp-g-font);
	font-size: 16px !important;
	font-weight: 400 !important;
	line-height: 24px !important;
	color: #000000 !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* --------------------------------------------------------------------------
   8. Term Page — Title + Pronunciation
   -------------------------------------------------------------------------- */
.wcp-glossary-term-header {
	margin-bottom: 32px;
}

.wcp-glossary-term-title {
	font-family: var(--wcp-g-font);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--wcp-g-black);
	margin: 0 0 12px;
}

.wcp-glossary-pronunciation {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wcp-glossary-speaker-icon {
	display: flex;
	align-items: center;
	cursor: pointer;
}

/* Button reset for speaker icon */
button.wcp-glossary-speaker-icon {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
}

/* Speaking animation — pulse */
.wcp-glossary-speak-btn.speaking svg path {
	fill: var(--wcp-g-gold);
}

.wcp-glossary-see-also-speaker {
	cursor: pointer;
}

/* Figma: 23x28px filled speaker icon */
.wcp-glossary-speaker-icon svg {
	width: 23px;
	height: 28px;
}

.wcp-glossary-pronunciation-text {
	font-family: var(--wcp-g-font);
	font-size: 18px;
	font-weight: 500;
	font-style: italic;
	line-height: 28px;
	color: var(--wcp-g-black);
}

/* --------------------------------------------------------------------------
   9. Definition Box
   -------------------------------------------------------------------------- */
.wcp-glossary-definition-box {
	background: var(--wcp-g-cream);
	border-left: 3px solid var(--wcp-g-gold);
	padding: 24px;
	margin-bottom: 32px;
	border-radius: 0;
}

.wcp-glossary-definition-label {
	display: block;
	font-family: var(--wcp-g-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	color: var(--wcp-g-tan-dark);
	margin-bottom: 14px;
}

.wcp-glossary-definition-term {
	font-family: var(--wcp-g-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wcp-g-black);
	margin: 0 0 14px;
}

.wcp-glossary-definition-text {
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: var(--wcp-g-body-text);
}

.wcp-glossary-definition-text p {
	margin: 0 0 12px;
}

.wcp-glossary-definition-text p:last-child {
	margin-bottom: 0;
}

.wcp-glossary-definition-text a {
	color: var(--wcp-g-orange);
	text-decoration: underline;
}

.wcp-glossary-definition-text a:hover {
	color: var(--wcp-g-gold);
}

/* --------------------------------------------------------------------------
   10. Did You Know (Fun Fact)
   -------------------------------------------------------------------------- */
.wcp-glossary-fun-fact {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 32px;
	padding: 0;
}

.wcp-glossary-fun-fact-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	margin-top: 3px;
}

.wcp-glossary-fun-fact-text {
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 28px;
	color: var(--wcp-g-black);
}

.wcp-glossary-fun-fact-text strong {
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   11. Infographic
   -------------------------------------------------------------------------- */
.wcp-glossary-infographic {
	margin-bottom: 40px;
}

.wcp-glossary-infographic-img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}

/* --------------------------------------------------------------------------
   12. Section Headings (See Also, Products)
   -------------------------------------------------------------------------- */
.wcp-glossary-section-heading {
	font-family: var(--wcp-g-font);
	font-size: 25px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wcp-g-black);
	margin: 0 0 24px;
	padding: 0;
}

/* --------------------------------------------------------------------------
   13. See Also Carousel
   -------------------------------------------------------------------------- */
.wcp-glossary-see-also {
	margin-bottom: 48px;
	overflow: hidden;
}

.wcp-glossary-carousel-wrapper {
	overflow: visible;
	margin-bottom: 20px;
	padding: 10px 0;
	margin-top: -10px;
}

.wcp-glossary-carousel {
	display: flex;
	gap: 20px;
	transition: transform 0.4s ease;
}

/* --- See Also Card: Pixel-perfect from Figma MCP --- */
.wcp-glossary-see-also-card {
	flex: 0 0 calc(25% - 15px);
	width: calc(25% - 15px);
	min-height: 269px;
	background: var(--wcp-g-white);
	border-radius: 10px;
	box-shadow: 0px 16px 60px 0px rgba(0, 0, 0, 0.06);
	text-decoration: none;
	color: var(--wcp-g-card-text);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.25s ease;
}

.wcp-glossary-see-also-card:hover {
	box-shadow: 0px 16px 60px 0px rgba(0, 0, 0, 0.12);
}

.wcp-glossary-see-also-card:hover .wcp-glossary-see-also-top {
	background: linear-gradient(to bottom, #e5e5e5, #f5f5f5);
}

/* Top gradient area — Figma: linear-gradient #EEE → #FAFAFA, ~93px */
.wcp-glossary-see-also-top {
	background: linear-gradient(to bottom, #eeeeee, #fafafa);
	border-radius: 10px;
	padding: 32px 15px 12px;
	min-height: 93px;
	position: relative;
	text-align: center;
	transition: background 0.25s ease;
}

/* Optional card image — replaces gradient bg */
.wcp-glossary-see-also-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-radius: 10px;
	object-fit: cover;
}

/* Term name — Figma: Montserrat SemiBold 25px, ls 0.5px, #1D1D1D */
.wcp-glossary-see-also-name {
	font-family: var(--wcp-g-font);
	font-size: 25px;
	font-weight: 600;
	line-height: 28px;
	letter-spacing: 0.5px;
	color: var(--wcp-g-card-text);
	margin: 0 0 4px !important;
	padding: 0 !important;
	position: relative;
	z-index: 1;
}

/* Pronunciation pill — Figma: bg white, flex, gap 7px, padding 4px 6px, radius 6px */
.wcp-glossary-see-also-pronunciation {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	background: var(--wcp-g-white);
	padding: 4px 6px;
	border-radius: 6px;
	width: fit-content;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

.wcp-glossary-see-also-speaker {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

/* Icon — Figma: 13x16px filled speaker */
.wcp-glossary-see-also-speaker svg {
	width: 13px;
	height: 16px;
}

/* Pronunciation text — Figma: Montserrat Medium ITALIC 16px, ls 0.32px, #000 */
.wcp-glossary-see-also-pronunciation-text {
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 500;
	font-style: italic;
	line-height: 28px;
	letter-spacing: 0.32px;
	color: var(--wcp-g-black);
}

/* Bottom: description area */
.wcp-glossary-see-also-bottom {
	padding: 16px 15px 20px;
	flex: 1;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

/* Description — Figma: Montserrat 16px/400, lh 24px, #1D1D1D, CENTER */
.wcp-glossary-see-also-desc {
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: var(--wcp-g-card-text);
	text-align: center;
	margin: 0;
	max-width: 240px;
}

/* --------------------------------------------------------------------------
   14. Carousel Pagination Dots
   -------------------------------------------------------------------------- */
.wcp-glossary-carousel-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
}

.wcp-glossary-dot {
	width: 50px;
	height: 6px;
	border-radius: 20px;
	background: var(--wcp-g-border);
	cursor: pointer;
	transition: background 0.25s ease;
}

.wcp-glossary-dot.active {
	background: var(--wcp-g-tan);
}

.wcp-glossary-dot:hover {
	background: var(--wcp-g-tan);
}

/* --------------------------------------------------------------------------
   15. Products Section (uses existing wcpro_wines shortcode)
   -------------------------------------------------------------------------- */
.wcp-glossary-products {
	margin-bottom: 48px;
}

/* --------------------------------------------------------------------------
   16. FAQ Section
   -------------------------------------------------------------------------- */
.wcp-glossary-faq {
	margin-bottom: 48px;
}

.wcp-glossary-faq-item {
	margin-bottom: 24px;
}

.wcp-glossary-faq-question {
	font-family: var(--wcp-g-font);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--wcp-g-black);
	margin: 0 0 8px;
}

.wcp-glossary-faq-answer {
	font-family: var(--wcp-g-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--wcp-g-body-text);
	margin: 0;
}

/* --------------------------------------------------------------------------
   17. Empty State
   -------------------------------------------------------------------------- */
.wcp-glossary-empty {
	text-align: center;
	font-size: 18px;
	color: var(--wcp-g-gray);
	padding: 60px 0;
}

/* --------------------------------------------------------------------------
   17. No Results (search)
   -------------------------------------------------------------------------- */
.wcp-glossary-no-results {
	display: none;
	text-align: center;
	font-size: 16px;
	color: var(--wcp-g-gray);
	padding: 40px 0;
}

.wcp-glossary-no-results.visible {
	display: block;
}

/* ==========================================================================
   RESPONSIVE — Mobile (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

	.wcp-glossary-page {
		padding: 24px 25px 40px;
	}

	/* Page title + subtitle */
	.wcp-glossary-page-title {
		font-size: 28px;
		margin-bottom: 24px;
	}

	.wcp-glossary-page-subtitle {
		font-size: 16px;
		margin: -12px 0 28px;
	}

	/* Search bar full width */
	.wcp-glossary-search-bar {
		max-width: 100%;
	}

	.wcp-glossary-search-input {
		height: 46px;
		font-size: 14px;
	}

	/* A-Z filter wraps */
	.wcp-glossary-az-filter {
		font-size: 14px;
		line-height: 32px;
	}

	.wcp-glossary-az-letter {
		font-size: 14px;
	}

	.wcp-glossary-az-separator {
		margin: 0 2px;
	}

	/* Meta line — stays right-aligned on mobile per Figma */
	.wcp-glossary-meta-line {
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 8px 20px;
	}

	/* Letter headings */
	.wcp-glossary-letter-heading {
		font-size: 30px;
	}

	/* Cards — single column */
	.wcp-glossary-cards-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	/* Term title */
	.wcp-glossary-term-title {
		font-size: 26px;
		color: var(--wcp-g-dark-title-mobile);
	}

	/* Pronunciation */
	.wcp-glossary-pronunciation-text {
		font-size: 16px;
		color: var(--wcp-g-body-text);
	}

	/* Definition box */
	.wcp-glossary-definition-box {
		padding: 20px;
	}

	/* Section headings */
	.wcp-glossary-section-heading {
		font-size: 20px;
	}

	/* See Also cards — Figma mobile: 2 cards, 242.6x269px each */
	.wcp-glossary-see-also-card {
		flex: 0 0 calc(50% - 10px);
		width: calc(50% - 10px);
		min-height: 269px;
	}

	.wcp-glossary-see-also-top {
		padding: 20px 12px 10px;
		min-height: 80px;
	}

	.wcp-glossary-see-also-bottom {
		padding: 12px 10px 16px;
	}

	/* Figma mobile: 20px/600, ls 0.4px */
	.wcp-glossary-see-also-name {
		font-size: 20px;
		line-height: 28px;
		letter-spacing: 0.4px;
	}

	.wcp-glossary-see-also-pronunciation-text {
		font-size: 14px;
	}

	.wcp-glossary-see-also-speaker svg {
		width: 16px;
		height: 19px;
	}

	.wcp-glossary-see-also-desc {
		font-size: 14px;
		line-height: 20px;
		max-width: 200px;
	}

	/* Carousel dots smaller */
	.wcp-glossary-dot {
		width: 35px;
		height: 5px;
	}
}

/* ==========================================================================
   RESPONSIVE — Small Mobile (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {

	.wcp-glossary-page {
		padding: 20px 20px 30px;
	}

	.wcp-glossary-term-title {
		font-size: 22px;
	}

	.wcp-glossary-letter-heading {
		font-size: 26px;
	}

	.wcp-glossary-see-also-card {
		flex: 0 0 calc(50% - 8px);
		width: calc(50% - 8px);
		min-height: 250px;
	}

	.wcp-glossary-see-also-top {
		padding: 16px 10px 8px;
	}

	.wcp-glossary-see-also-name {
		font-size: 18px;
		line-height: 24px;
	}

	.wcp-glossary-see-also-desc {
		font-size: 13px;
		line-height: 18px;
	}
}
