/*
Theme Name: Cornelia Selected
Theme URI: https://example.com/cornelia-selected
Author: Cornelia Selected
Description: A marketing theme for a small brand selling products on Amazon. Home page hero, an "Our Products" archive backed by a Product custom post type, product detail popups, and an About Us page.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: cornelia-selected
*/

/* -----------------------------------------------------------------
   Design tokens
----------------------------------------------------------------- */
:root {
	--color-green-900: #2b3327;
	--color-green-700: #3a4632;
	--color-green-600: #4a5940;
	--color-cream: #f6f3ec;
	--color-cream-dark: #efe9dc;
	--color-white: #ffffff;
	--color-text: #23261f;
	--color-text-muted: #6b6b62;
	--color-border: #e2ddce;
	--font-serif: "Fraunces", Georgia, "Times New Roman", serif;
	--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--container-width: 1180px;
	--radius: 4px;
}

/* -----------------------------------------------------------------
   Reset & base
----------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-sans);
	color: var(--color-text);
	background: var(--color-white);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

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

ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

button {
	font-family: inherit;
	cursor: pointer;
}

h1, h2, h3, h4 {
	font-family: var(--font-serif);
	font-weight: 600;
	line-height: 1.15;
	margin: 0 0 0.5em;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.eyebrow {
	font-size: 0.78rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-text-muted);
	font-weight: 600;
	margin-bottom: 0.75em;
}

.center {
	text-align: center;
}

/* -----------------------------------------------------------------
   Buttons
----------------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 26px;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-radius: var(--radius);
	border: 1px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.btn-amazon {
	background: var(--color-green-700);
	color: var(--color-white);
}

.btn-amazon:hover {
	background: var(--color-green-900);
}

.btn-outline {
	background: transparent;
	color: var(--color-text);
	border-color: var(--color-text);
}

.btn-outline:hover {
	background: var(--color-text);
	color: var(--color-white);
}

.btn-small {
	padding: 8px 0;
	font-size: 0.75rem;
	background: none;
	border: none;
	color: var(--color-green-700);
	border-bottom: 1px solid currentColor;
	border-radius: 0;
}

.amazon-icon {
	width: 16px;
	height: 16px;
	flex: none;
}

/* -----------------------------------------------------------------
   Header
----------------------------------------------------------------- */
.site-header {
	border-bottom: 1px solid var(--color-border);
	background: var(--color-white);
	position: relative;
	z-index: 100;
}

.site-header--overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: transparent;
	border-bottom: none;
	z-index: 100;
}

.site-header--overlay .site-logo .logo-mark,
.site-header--overlay .site-logo .logo-name {
	color: var(--color-white);
}

.site-header--overlay .site-logo .logo-sub {
	color: rgba(255, 255, 255, 0.75);
}

.site-header--overlay .nav-toggle span,
.site-header--overlay .nav-toggle::before,
.site-header--overlay .nav-toggle::after {
	background: var(--color-white);
}

@media (min-width: 701px) {
	.site-header--overlay .primary-nav a {
		color: var(--color-white);
	}
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 24px;
	padding-top: 16px;
	padding-bottom: 16px;
	padding-left: 24px;
	padding-right: 24px;
}

.site-logo {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.1;
}

.site-logo img {
	max-height: 48px;
	width: auto;
}

.site-logo .logo-mark {
	font-family: var(--font-serif);
	font-size: 1rem;
	letter-spacing: 0.05em;
}

.site-logo .logo-name {
	font-family: var(--font-serif);
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.site-logo .logo-sub {
	font-size: 0.62rem;
	letter-spacing: 0.28em;
	color: var(--color-text-muted);
	text-transform: uppercase;
}

.primary-nav {
	margin-left: auto;
}

.primary-nav ul {
	display: flex;
	gap: 32px;
}

.primary-nav a {
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.primary-nav a:hover {
	color: var(--color-green-700);
}

.nav-and-cta {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
}

.header-cta {
	display: flex;
	align-items: center;
}

.header-cta .btn-amazon {
	background: transparent;
	color: var(--color-text);
	border: 1px solid var(--color-text);
}

.header-cta .btn-amazon:hover {
	background: var(--color-text);
	color: var(--color-white);
}

.site-header--overlay .header-cta .btn-amazon {
	color: var(--color-white);
	border-color: rgba(255, 255, 255, 0.85);
}

.site-header--overlay .header-cta .btn-amazon:hover {
	background: rgba(255, 255, 255, 0.15);
	color: var(--color-white);
}

.nav-toggle {
	display: none;
	background: none;
	border: none;
	padding: 8px;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
	content: "";
	display: block;
	width: 24px;
	height: 2px;
	background: var(--color-text);
	margin: 5px 0;
}

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

.container-hero {
	max-width: var(--container-width);
	padding: 12px 24px;
}

.hero {
	position: relative;
	min-height: 640px;
	display: flex;
	align-items: flex-end;
	background-size: cover;
	background-position: center;
	color: var(--color-white);
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgba(20, 24, 16, 0.55) 0%, rgba(20, 24, 16, 0.15) 55%, rgba(20, 24, 16, 0.35) 100%);
}

.hero-content {
	position: relative;
	z-index: 1;
	padding-top: 80px;
	padding-bottom: 80px;
	max-width: 640px;

}

.hero .eyebrow {
	color: rgba(255, 255, 255, 0.85);
}

.hero-heading {
	font-size: clamp(2rem, 4.5vw, 3.1rem);
	margin-bottom: 0.4em;
}

.hero-subheading {
	font-size: 1.05rem;
	max-width: 460px;
	margin-bottom: 1.75em;
	color: rgba(255, 255, 255, 0.92);
}

.hero-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.hero-buttons .btn-outline {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.8);
	color: var(--color-white);
}

.hero-buttons .btn-outline:hover {
	background: var(--color-white);
	color: var(--color-text);
}

/* -----------------------------------------------------------------
   Features strip
----------------------------------------------------------------- */
.features {
	background: var(--color-cream);
	padding: 56px 0;
}

.features-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 32px;
	text-align: center;
}

.feature-icon {
	width: 40px;
	height: 40px;
	margin: 0 auto 16px;
	color: var(--color-green-700);
}

.feature-title {
	font-family: var(--font-sans);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 0.5em;
}

.feature-text {
	font-size: 0.9rem;
	color: var(--color-text-muted);
}

/* -----------------------------------------------------------------
   Products grid + cards
----------------------------------------------------------------- */
.home-products,
.products-archive {
	padding: 88px 8px;
}

.section-heading {
	font-size: clamp(1.5rem, 3vw, 2rem);
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 56px;
}

.products-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
}

.product-card {
	display: flex;
	flex-direction: column;
}

.product-card-media {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border: none;
	padding: 0;
	background: var(--color-cream);
	border-radius: var(--radius);
	overflow: hidden;
	position: relative;
	margin-bottom: 20px;
}

.product-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.product-card-media:hover img {
	transform: scale(1.04);
}

.product-card-media.no-image {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-green-600);
	background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-cream-dark) 100%);
}

.product-card-media.no-image svg {
	width: 64px;
	height: 64px;
	opacity: 0.5;
}

.product-card-media .view-more {
	position: absolute;
	inset: auto 0 0 0;
	background: rgba(43, 51, 39, 0.85);
	color: var(--color-white);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	padding: 10px;
	transform: translateY(100%);
	transition: transform 0.2s ease;
}

.product-card-media:hover .view-more,
.product-card-media:focus .view-more {
	transform: translateY(0);
}

.product-title {
	font-size: 1.05rem;
	margin-bottom: 0.4em;
}

.product-title button {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	text-align: left;
	color: inherit;
}

.product-title button:hover {
	color: var(--color-green-700);
}

.product-desc {
	font-size: 0.9rem;
	color: var(--color-text-muted);
	margin-bottom: 0.9em;
}

.product-amazon-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--color-green-700);
	border-bottom: 1px solid var(--color-green-700);
	padding-bottom: 2px;
	align-self: flex-start;
}

.product-amazon-link:hover {
	color: var(--color-green-900);
	border-color: var(--color-green-900);
}

/* Product archive intro banner */
.archive-header {
	background: var(--color-cream);
	padding: 64px 0;
	text-align: center;
}

.archive-pagination {
	margin-top: 56px;
	display: flex;
	justify-content: center;
	gap: 12px;
}

.archive-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	font-size: 0.85rem;
}

.archive-pagination .page-numbers.current {
	background: var(--color-green-700);
	border-color: var(--color-green-700);
	color: var(--color-white);
}

/* -----------------------------------------------------------------
   Product detail popup
----------------------------------------------------------------- */
.product-modal[hidden] {
	display: none;
}

.product-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.product-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 16, 0.6);
}

.product-modal-content {
	position: relative;
	background: var(--color-white);
	border-radius: var(--radius);
	max-width: 720px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.product-modal-media {
	background: var(--color-cream);
	min-height: 280px;
}

.product-modal-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-modal-body {
	padding: 40px 36px;
	display: flex;
	flex-direction: column;
}

.product-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	font-size: 1.4rem;
	line-height: 1;
	color: var(--color-text);
	z-index: 2;
}

.product-modal-close:hover {
	background: var(--color-white);
}

.product-modal-title {
	font-size: 1.4rem;
	margin-bottom: 0.5em;
}

.product-modal-desc {
	color: var(--color-text-muted);
	margin-bottom: 1em;
}

.product-modal-extra {
	font-size: 0.92rem;
	margin-bottom: 1.5em;
}

.product-modal-extra p:first-child {
	margin-top: 0;
}

.product-modal-body .btn {
	align-self: flex-start;
	margin-top: auto;
}

body.modal-open {
	overflow: hidden;
}

/* -----------------------------------------------------------------
   CTA / follow section
----------------------------------------------------------------- */
.cta-section {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 420px;
}

.cta-image {
	background-size: cover;
	background-position: center;
	min-height: 320px;
}

.cta-box {
	background: var(--color-green-900);
	color: var(--color-white);
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 64px;
}

.cta-box .eyebrow {
	color: rgba(255, 255, 255, 0.7);
}

.cta-heading {
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	margin-bottom: 0.5em;
}

.cta-text {
	color: rgba(255, 255, 255, 0.85);
	margin-bottom: 1.5em;
	max-width: 420px;
}

.social-links {
	display: flex;
	gap: 16px;
}

.social-links a {
	width: 38px;
	height: 38px;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.social-links svg {
	width: 18px;
	height: 18px;
}

.social-links a:hover {
	background: rgba(255, 255, 255, 0.1);
}

/* -----------------------------------------------------------------
   Footer
----------------------------------------------------------------- */
.site-footer {
	background: var(--color-white);
	border-top: 1px solid var(--color-border);
	padding: 56px 0 28px;
}

.footer-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 32px;
	text-align: center;
	margin-bottom: 40px;
}

.footer-item-icon {
	width: 44px;
	height: 44px;
	margin: 0 auto 14px;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-green-700);
}

.footer-item-icon svg {
	width: 20px;
	height: 20px;
}

.footer-item-title {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 0.3em;
}

.footer-item-text {
	font-size: 0.85rem;
	color: var(--color-text-muted);
}

.footer-bottom {
	text-align: center;
	font-size: 0.78rem;
	color: var(--color-text-muted);
	border-top: 1px solid var(--color-border);
	padding-top: 24px;
}

/* -----------------------------------------------------------------
   About page
----------------------------------------------------------------- */
.about-page {
	padding: 80px 0;
}

.about-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: center;
}

.about-image img,
.about-image .no-image {
	width: 100%;
	border-radius: var(--radius);
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.about-image .no-image {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-cream);
	color: var(--color-green-600);
}

.about-content h1 {
	font-size: clamp(1.8rem, 3.5vw, 2.4rem);
	padding-left: 8px;
	padding-right: 8px;
}

.about-content .entry-content {
	color: var(--color-text-muted);
	font-size: 1rem;
	padding-left: 8px;
	padding-right: 8px;
}

.about-content .entry-content p {
	margin-bottom: 1.2em;
}

/* -----------------------------------------------------------------
   Single product (fallback full page view)
----------------------------------------------------------------- */
.single-product {
	padding: 64px 0 96px;
}

.single-product-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
}

.single-product-media img,
.single-product-media .no-image {
	width: 100%;
	border-radius: var(--radius);
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.single-product-media .no-image {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-cream);
	color: var(--color-green-600);
}

.single-product-body .entry-content {
	color: var(--color-text-muted);
	margin-bottom: 1.5em;
}

.back-to-products {
	display: inline-block;
	margin-bottom: 24px;
	font-size: 0.82rem;
	color: var(--color-text-muted);
	border-bottom: 1px solid var(--color-border);
}

/* -----------------------------------------------------------------
   Responsive
----------------------------------------------------------------- */
@media (max-width: 900px) {
	.features-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 40px 24px;
	}

	.products-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.cta-section {
		grid-template-columns: 1fr;
	}

	.about-grid,
	.single-product-grid {
		grid-template-columns: 1fr;
	}

	.footer-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.product-modal-content {
		grid-template-columns: 1fr;
	}

	.product-modal-media {
		min-height: 200px;
	}
}

@media (max-width: 700px) {
	.primary-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--color-white);
		border-bottom: 1px solid var(--color-border);
		padding: 16px 24px;
		display: none;
	}

	.primary-nav.is-open {
		display: block;
	}

	.primary-nav ul {
		flex-direction: column;
		gap: 16px;
	}

	.nav-toggle {
		display: block;
	}

	.header-cta .btn span.btn-text {
		display: none;
	}

	.products-grid {
		grid-template-columns: 1fr;
	}

	.footer-grid {
		grid-template-columns: 1fr;
	}
}
