/*
Theme Name: Cars and Crewnecks
Theme URI: https://carsandcrewnecks.com
Author: Cars and Crewnecks
Description: A vintage, old-money block theme for Cars and Crewnecks: motoring apparel for true car enthusiasts. Built for WooCommerce.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carsandcrewnecks
Tags: block-theme, full-site-editing, e-commerce, woocommerce, custom-colors, editor-style
*/

/* ------------------------------------------------------------------
   Most styling lives in theme.json. This file holds the few rules
   that theme.json cannot express.
------------------------------------------------------------------- */

:root {
	--cc-line: var(--wp--preset--color--line);
	--cc-ink: var(--wp--preset--color--ink);
}

body { -webkit-font-smoothing: antialiased; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--oxblood);
	outline-offset: 2px;
}

/* ---------- Eyebrow / label text ---------- */
.cc-eyebrow {
	font-size: 12px !important;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--wp--preset--color--tan);
	margin: 0;
}
.cc-eyebrow.is-light { color: var(--wp--preset--color--cream); }

.cc-tracked {
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-size: 13px;
}

/* Underlined text link ("Shop All", "Read Our Story") */
.cc-text-link a,
a.cc-text-link {
	font-size: 13px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}

/* ---------- Header ---------- */
.cc-announcement p { margin: 0; }

.cc-header-row {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
}
.cc-header-row > .wp-block-navigation { justify-self: start; }
.cc-header-row > .cc-header-tools { justify-self: end; }

.cc-wordmark { margin: 0; line-height: 1; text-align: center; }
.cc-wordmark a {
	text-decoration: none;
	color: inherit;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
}
.cc-wordmark .cc-wordmark__name {
	font-family: var(--wp--preset--font-family--cormorant);
	font-weight: 600;
	font-size: 32px;
	letter-spacing: 0.02em;
}
.cc-wordmark em { font-weight: 500; }
.cc-wordmark .cc-wordmark__sub {
	font-family: var(--wp--preset--font-family--jost);
	font-size: 10px;
	letter-spacing: 0.42em;
	text-transform: uppercase;
	margin-top: 6px;
	color: var(--wp--preset--color--muted);
}

.cc-header-tools { gap: 4px !important; }
.cc-header-tools .wp-block-search__button {
	background: transparent !important;
	color: var(--wp--preset--color--ink) !important;
	border: 0;
	padding: 0;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.cc-header-tools .wp-block-woocommerce-customer-account a,
.cc-header-tools .wc-block-mini-cart__button {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--ink);
}

@media (max-width: 781px) {
	.cc-header-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px; }
	.cc-wordmark .cc-wordmark__name { font-size: 22px; }
	.cc-wordmark .cc-wordmark__sub { font-size: 8px; letter-spacing: 0.36em; margin-top: 4px; }
	.cc-header-tools .wp-block-woocommerce-customer-account { display: none; }
	.cc-announcement { font-size: 10px !important; }
}

/* Mobile menu overlay */
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--cream) !important;
	padding: 24px !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 34px;
	letter-spacing: 0;
	text-transform: none;
}

/* ---------- Cards / tiles ---------- */
.cc-tile .wp-block-cover__inner-container { text-align: center; }
.cc-tile-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.cc-tile a { text-decoration: none; }

/* Placeholder note inside an empty cover */
.cc-placeholder-note {
	font-size: 11px !important;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	opacity: 0.85;
}

/* ---------- Categories as pills (Journal & Shop) ---------- */
.cc-pills.wp-block-categories,
.cc-pills .wp-block-categories,
.cc-pills .wc-block-product-categories-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	padding: 16px 0;
	margin: 0;
}
.cc-pills li { margin: 0; }
.cc-pills .wc-block-product-categories-list { justify-content: flex-start; padding: 6px 0; }
.cc-pills .wc-block-product-categories-list-item-count { display: none; }
.cc-pills li a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid #B9AE99;
	text-decoration: none;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
}
.cc-pills li.current-cat a,
.cc-pills li a:hover {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

/* ---------- Journal grid: first post on page 1 is featured ---------- */
.cc-journal-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 56px 28px;
}
.cc-journal-grid .wp-block-post-template > li { margin: 0; }
body:not(.paged) .cc-journal-grid .wp-block-post-template > li:first-child {
	grid-column: 1 / -1;
}
body:not(.paged) .cc-journal-grid .wp-block-post-template > li:first-child .cc-post-card {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 48px;
	align-items: center;
	padding-bottom: 32px;
	border-bottom: 1px solid var(--cc-line);
}
body:not(.paged) .cc-journal-grid .wp-block-post-template > li:first-child .wp-block-post-title {
	font-size: clamp(36px, 3.6vw, 52px) !important;
}
body:not(.paged) .cc-journal-grid .wp-block-post-template > li:first-child .wp-block-post-featured-image {
	aspect-ratio: 16 / 10;
}
@media (max-width: 900px) {
	.cc-journal-grid .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.cc-journal-grid .wp-block-post-template { grid-template-columns: minmax(0, 1fr); }
	body:not(.paged) .cc-journal-grid .wp-block-post-template > li:first-child .cc-post-card { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.cc-post-card .wp-block-post-featured-image { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wp--preset--color--sand); }
.cc-post-card .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.cc-post-card .wp-block-post-title a { text-decoration: none; }
.cc-post-card .wp-block-post-terms a { text-decoration: none; }

/* ---------- Article ---------- */
.cc-article-content > p:first-of-type::first-letter {
	float: left;
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 88px;
	line-height: 0.8;
	padding: 8px 10px 0 0;
	color: var(--wp--preset--color--racing-green);
}
.cc-article-content .wp-block-pullquote {
	border-top: 1px solid var(--cc-ink);
	border-bottom: 1px solid var(--cc-ink);
	text-align: center;
	padding: 48px 0;
	margin: 48px 0;
}
.cc-article-content .wp-block-pullquote blockquote { border: 0; margin: 0; padding: 0; }
.cc-article-content > .wp-block-quote {
	border-left: 2px solid var(--wp--preset--color--tan);
	padding-left: 24px;
}

/* ---------- Principles row ---------- */
.cc-principles > .wp-block-column + .wp-block-column {
	border-left: 1px solid var(--cc-line);
	padding-left: 32px;
}
@media (max-width: 781px) {
	.cc-principles > .wp-block-column + .wp-block-column { border-left: 0; padding-left: 0; border-top: 1px solid var(--cc-line); padding-top: 24px; }
}

/* ---------- Timeline ---------- */
.cc-timeline > .wp-block-group { border-top: 1px solid var(--cc-line); }
.cc-timeline > .wp-block-group:first-child { border-top-color: var(--cc-ink); }
.cc-timeline > .wp-block-group:last-child { border-bottom: 1px solid var(--cc-line); }

/* ---------- Lookbook "Shop this look" ---------- */
.cc-shop-look {
	border-top: 1px solid var(--cc-line);
	border-bottom: 1px solid var(--cc-line);
}
.cc-shop-look summary {
	cursor: pointer;
	list-style: none;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}
.cc-shop-look summary::-webkit-details-marker { display: none; }
.cc-shop-look summary::after { content: "+"; font-size: 18px; letter-spacing: 0; }
.cc-shop-look[open] summary::after { content: "−"; }
.cc-shop-look ul { list-style: none; padding: 0; margin: 0 0 12px; }
.cc-shop-look li { padding: 10px 0; border-top: 1px solid var(--cc-line); }
.cc-shop-look li a { text-decoration: none; font-family: var(--wp--preset--font-family--cormorant); font-size: 20px; }

/* ---------- Forms (newsletter / contact) ---------- */
.cc-dark input[type="email"],
.cc-dark input[type="text"] {
	background: transparent;
	border: 1px solid #8A8174;
	color: var(--wp--preset--color--cream);
	min-height: 50px;
	padding: 0 16px;
}

/* ---------- WooCommerce ---------- */
.wc-block-components-product-name,
.wc-block-grid__product-title,
.wp-block-woocommerce-product-template .wp-block-post-title {
	font-family: var(--wp--preset--font-family--cormorant) !important;
	font-weight: 500 !important;
}
.wp-block-woocommerce-product-template .wp-block-post-title a { text-decoration: none; }
.wp-block-woocommerce-product-template .wc-block-components-product-image {
	background: var(--wp--preset--color--sand);
	margin-bottom: 12px !important;
}
.wp-block-woocommerce-product-template .wc-block-components-product-image img { aspect-ratio: 4 / 5; object-fit: cover; }

.wc-block-components-product-badge,
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--cream) !important;
	color: var(--wp--preset--color--ink) !important;
	border: 0 !important;
	border-radius: 0 !important;
	font-size: 11px !important;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

/* Square, tracked buttons everywhere in WooCommerce */
.wc-block-components-button:not(.is-link),
.wp-block-woocommerce-add-to-cart-form .single_add_to_cart_button,
.wc-block-mini-cart__footer-checkout,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	border-radius: 0 !important;
	background: var(--wp--preset--color--racing-green) !important;
	color: var(--wp--preset--color--cream) !important;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-size: 13px !important;
	min-height: 52px;
}
.wc-block-mini-cart__footer-cart.wc-block-components-button {
	background: transparent !important;
	color: var(--wp--preset--color--ink) !important;
	border: 1px solid var(--wp--preset--color--ink) !important;
}

/* Quantity and variation inputs */
.wp-block-woocommerce-add-to-cart-form .quantity .qty,
.wc-block-components-quantity-selector {
	border-radius: 0 !important;
	border-color: #8A8174 !important;
	min-height: 52px;
}
.wp-block-woocommerce-add-to-cart-form table.variations select {
	border-radius: 0;
	min-height: 48px;
	border: 1px solid #B9AE99;
	background: transparent;
	padding: 0 12px;
}

/* Product tabs (Description / Additional information / Reviews) */
.wp-block-woocommerce-product-details ul.tabs { border-bottom: 1px solid var(--cc-line) !important; padding: 0 !important; }
.wp-block-woocommerce-product-details ul.tabs li { border: 0 !important; background: none !important; }
.wp-block-woocommerce-product-details ul.tabs li a {
	font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none;
}
.wp-block-woocommerce-product-details ul.tabs li.active a { border-bottom: 1px solid var(--cc-ink); }

/* Mini-cart drawer */
.wc-block-mini-cart__drawer .components-modal__content,
.wc-block-mini-cart__drawer .wc-block-mini-cart__template-part {
	background: var(--wp--preset--color--cream);
}
.wc-block-mini-cart__title {
	font-family: var(--wp--preset--font-family--cormorant) !important;
	font-weight: 500 !important;
	font-size: 32px !important;
}
.wc-block-mini-cart__badge {
	background: var(--wp--preset--color--racing-green) !important;
	color: var(--wp--preset--color--cream) !important;
}

/* Store notices */
.wc-block-components-notice-banner { border-radius: 0 !important; }

/* Breadcrumbs */
.wp-block-woocommerce-breadcrumbs,
.woocommerce-breadcrumb {
	font-size: 12px !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.wp-block-woocommerce-breadcrumbs a { text-decoration: none; color: inherit; }

/* Sorting + result count */
.wc-block-catalog-sorting select,
.woocommerce-ordering select {
	border: 0;
	border-bottom: 1px solid var(--cc-ink);
	border-radius: 0;
	background: transparent;
	min-height: 44px;
	font-family: inherit;
}

/* ---------- Footer ---------- */
.cc-footer h2 { margin: 0 0 6px; }
.cc-footer .wp-block-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cc-footer .wp-block-list a { text-decoration: none; }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.cc-hide-mobile { display: none !important; }
	.cc-hero .wp-block-buttons { width: 100%; }
	.cc-hero .wp-block-button { flex: 1 1 100%; }
	.cc-hero .wp-block-button__link { width: 100%; }
}

/* Lookbook: alternate image left / right on desktop */
@media (min-width: 782px) {
	.cc-look.cc-reverse { flex-direction: row-reverse; }
}

/* Accessibility helper (also provided by core; repeated here for safety) */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Text alignment helpers (core provides these too; repeated so older/newer
   WordPress versions render identically) */
.has-text-align-center { text-align: center; }
.has-text-align-left { text-align: left; }
.has-text-align-right { text-align: right; }

/* Hero covers: keep the content inside the 1360px page grid even when the
   content is positioned bottom-left. */
.cc-hero .wp-block-cover__inner-container { width: 100% !important; }

/* Mobile: category tiles in a 2 × 2 grid, tighter story padding */
@media (max-width: 781px) {
	.cc-tiles.wp-block-columns { flex-wrap: wrap !important; }
	.wp-block-columns.cc-tiles:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: calc(50% - 10px) !important; flex-grow: 0; }
	.cc-tiles .wp-block-cover { min-height: 220px !important; }
	.cc-tiles .wp-block-heading { font-size: 20px !important; }
	.cc-tiles .cc-tile-label .cc-tracked { display: none; }
	.cc-story > .wp-block-column:last-child { padding: 48px 24px !important; }
	.cc-story .wp-block-cover { min-height: 320px !important; }
}

/* Timeline year column */
.cc-timeline > .wp-block-group > p:first-child { flex: 0 0 140px !important; }

@media (max-width: 781px) {
	.cc-timeline > .wp-block-group > p:first-child { flex-basis: 88px !important; }
	/* Shorter image blocks on phones (founder photo, lookbook, story) */
	.wp-block-columns .wp-block-cover { min-height: 380px !important; }
	.cc-tiles .wp-block-cover { min-height: 220px !important; }
	.cc-look.wp-block-columns { margin-bottom: 72px !important; }
}
