/*
Theme Name: The Vinyl Frontier
Theme URI: https://thevinylfrontierbarry.com
Author: Second Spark Digital Community CIC
Description: A lively, WooCommerce-ready theme for The Vinyl Frontier record shop in Barry.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vinyl-frontier
*/

/* ---------- Tokens ---------- */
:root {
	--ink: #0d1020;
	--ink-2: #161a33;
	--panel: #1f2447;
	--cream: #f7f2e8;
	--paper: #ffffff;
	--text: #1b1d2e;
	--muted: #5a5e78;
	--amber: #ffb81c;
	--amber-dark: #e29a00;
	--teal: #26d9b9;
	--pink: #ff4f8b;
	--violet: #8a7bff;
	--radius: 14px;
	--max: 1200px;
	--shadow: 0 8px 24px rgba(13, 16, 32, 0.12);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.6;
	color: var(--text);
	background: var(--cream);
}

img { max-width: 100%; height: auto; }

a { color: #0a6a59; }
a:hover { color: #c21f5b; }

:focus-visible {
	outline: 3px solid var(--amber);
	outline-offset: 2px;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.1rem); font-weight: 800; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.container.narrow { max-width: 760px; }

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

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--amber);
	color: var(--ink);
	padding: 0.6rem 1rem;
	z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn,
.button,
.wp-element-button,
button.single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	display: inline-block;
	background: var(--amber);
	color: var(--ink);
	border: 0;
	border-radius: 999px;
	padding: 0.7em 1.4em;
	font: inherit;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s, background 0.15s;
}
.btn:hover,
.button:hover,
.wp-element-button:hover,
button.single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--amber-dark);
	color: var(--ink);
	transform: translateY(-1px);
}
.btn-ghost {
	background: transparent;
	color: #fff;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------- Header ---------- */
.site-header {
	background: var(--ink);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.7rem 0;
}

.site-title {
	color: #fff;
	text-decoration: none;
	font-weight: 900;
	font-size: 1.45rem;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.site-title span,
.footer-title span { color: var(--amber); }
.site-title:hover { color: #fff; }

.custom-logo { max-height: 56px; width: auto; display: block; }

.header-search { flex: 1; max-width: 460px; }

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-left: auto;
}

.account-link { color: #fff; text-decoration: none; font-weight: 600; }
.account-link:hover { color: var(--amber); }

.cart-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--amber);
	color: var(--ink);
	font-weight: 800;
	text-decoration: none;
	padding: 0.45em 0.9em;
	border-radius: 999px;
}
.cart-link:hover { background: var(--amber-dark); color: var(--ink); }
.cart-count {
	background: var(--ink);
	color: #fff;
	border-radius: 999px;
	min-width: 1.5em;
	text-align: center;
	font-size: 0.85em;
	padding: 0 0.4em;
}

/* Search forms (core and WooCommerce) */
.search-form,
.woocommerce-product-search {
	display: flex;
	width: 100%;
	margin: 0;
}
.search-form label { flex: 1; }
.search-field,
.woocommerce-product-search .search-field,
input[type="search"] {
	width: 100%;
	border: 0;
	border-radius: 999px 0 0 999px;
	padding: 0.65em 1.1em;
	font: inherit;
	background: #fff;
	color: var(--text);
	min-width: 0;
}
.search-submit,
.woocommerce-product-search button[type="submit"] {
	border: 0;
	border-radius: 0 999px 999px 0;
	background: var(--teal);
	color: var(--ink);
	font: inherit;
	font-weight: 800;
	padding: 0 1.2em;
	cursor: pointer;
}
.search-submit:hover,
.woocommerce-product-search button[type="submit"]:hover { background: #1bb99d; }

/* Navigation */
.primary-nav { background: var(--ink-2); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.primary-nav .menu > li { position: relative; }
.primary-nav a {
	display: block;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	padding: 0.7rem 0.9rem;
}
.primary-nav a:hover,
.primary-nav li:focus-within > a { color: var(--amber); }

.primary-nav .sub-menu {
	display: none;
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 230px;
	max-height: 70vh;
	overflow-y: auto;
	background: var(--ink-2);
	border-radius: 0 0 var(--radius) var(--radius);
	box-shadow: var(--shadow);
	padding: 0.4rem 0;
	z-index: 20;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: block; }
.primary-nav .sub-menu a { font-weight: 500; padding: 0.4rem 1rem; }

.nav-toggle {
	display: none;
	width: 44px; height: 44px;
	border: 0;
	border-radius: 10px;
	background: var(--panel);
	cursor: pointer;
	position: relative;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
	content: "";
	position: absolute;
	left: 11px; right: 11px;
	height: 3px;
	border-radius: 2px;
	background: #fff;
}
.nav-toggle-bars { top: 20px; }
.nav-toggle-bars::before { top: -8px; left: 0; right: 0; }
.nav-toggle-bars::after { top: 8px; left: 0; right: 0; }

/* ---------- Hero ---------- */
.hero {
	background:
		radial-gradient(circle at 85% 15%, rgba(138, 123, 255, 0.45), transparent 50%),
		radial-gradient(circle at 10% 90%, rgba(255, 79, 139, 0.25), transparent 45%),
		var(--ink);
	color: #fff;
	padding: clamp(2.5rem, 6vw, 5rem) 0;
	overflow: hidden;
}
.hero-grid {
	display: grid;
	grid-template-columns: 1.2fr 0.8fr;
	gap: 2rem;
	align-items: center;
}
.eyebrow {
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.8rem;
	font-weight: 800;
	color: var(--ink);
	background: var(--teal);
	padding: 0.3em 0.8em;
	border-radius: 999px;
	margin: 0 0 1rem;
}
.hero h1 { color: #fff; }
.hero .lead { font-size: 1.2rem; max-width: 34em; color: #e3e5f5; }
.hero-search { max-width: 460px; margin: 1.5rem 0; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0; }

.hero-art { display: flex; justify-content: center; }
.record {
	width: min(100%, 380px);
	aspect-ratio: 1;
	border-radius: 50%;
	background:
		radial-gradient(circle, var(--amber) 0 14%, var(--pink) 14% 30%, transparent 30%),
		repeating-radial-gradient(circle, #07070f 0 3px, #14142b 3px 5px);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 6px #0a0a16;
	position: relative;
	animation: spin 20s linear infinite;
}
.record::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: conic-gradient(from 20deg, transparent 0 20%, rgba(255, 255, 255, 0.12) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.12) 75%, transparent 80%);
}
.record::after {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: 5%; aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding: clamp(2rem, 4vw, 3.5rem) 0; }
.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.2rem;
}
.section-head h2 { margin: 0; }
.more-link { font-weight: 700; white-space: nowrap; }

.format-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 1rem;
}
.format-tile {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1.3rem 1.1rem;
	border-radius: var(--radius);
	background: var(--ink);
	color: #fff;
	text-decoration: none;
	border-bottom: 5px solid var(--c, var(--amber));
	transition: transform 0.15s, box-shadow 0.15s;
}
.format-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: #fff; }
.format-tile:nth-child(6n+1) { --c: var(--amber); }
.format-tile:nth-child(6n+2) { --c: var(--teal); }
.format-tile:nth-child(6n+3) { --c: var(--pink); }
.format-tile:nth-child(6n+4) { --c: var(--violet); }
.format-tile:nth-child(6n+5) { --c: var(--amber); }
.format-tile:nth-child(6n+6) { --c: var(--teal); }
.format-name { font-size: 1.2rem; font-weight: 900; }
.format-note { font-size: 0.9rem; color: #c9cce6; }

/* Banners */
.banner-row { padding: 0.5rem 0 1rem; }
.banner-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
.banner {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: clamp(1.4rem, 3vw, 2.2rem);
	border-radius: var(--radius);
	color: #fff;
	text-decoration: none;
	transition: transform 0.15s;
}
.banner:hover { transform: translateY(-3px); color: #fff; }
.banner-gift { background: linear-gradient(135deg, #ff4f8b, #8a7bff); }
.banner-sell { background: linear-gradient(135deg, #0d1020, #2b3070); }
.banner-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 800; opacity: 0.9; }
.banner-title { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 900; line-height: 1.1; }
.banner-text { opacity: 0.95; }

/* Newsletter */
.newsletter { background: var(--ink-2); color: #fff; text-align: center; }
.newsletter h2 { color: #fff; }
.newsletter input[type="email"],
.newsletter input[type="text"] {
	padding: 0.7em 1em;
	border-radius: 999px;
	border: 0;
	font: inherit;
	min-width: 240px;
}

/* Visit */
.visit { background: var(--cream); }
.visit-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	align-items: start;
}
.visit address { font-style: normal; font-weight: 700; margin-bottom: 1rem; }
.visit-points ul {
	list-style: none;
	margin: 0;
	padding: 1.4rem;
	background: var(--paper);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.visit-points li { padding: 0.5rem 0 0.5rem 1.8rem; position: relative; font-weight: 600; }
.visit-points li::before {
	content: "";
	position: absolute;
	left: 0; top: 0.9rem;
	width: 0.9rem; height: 0.9rem;
	border-radius: 50%;
	background: radial-gradient(circle, var(--ink) 0 20%, var(--amber) 22%);
}

/* ---------- WooCommerce product grids ---------- */
ul.products,
.woocommerce ul.products {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1.2rem;
}
ul.products::before,
ul.products::after { display: none !important; }

ul.products li.product,
.woocommerce ul.products li.product {
	float: none;
	width: auto;
	margin: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border-radius: var(--radius);
	padding: 0.8rem;
	box-shadow: 0 2px 10px rgba(13, 16, 32, 0.08);
	transition: transform 0.15s, box-shadow 0.15s;
}
ul.products li.product:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

ul.products li.product a { text-decoration: none; color: inherit; }
ul.products li.product img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 10px;
	margin: 0 0 0.7rem;
	display: block;
	background: #ddd;
}
ul.products li.product .woocommerce-loop-product__title {
	font-size: 1rem;
	font-weight: 800;
	margin: 0 0 0.3rem;
	padding: 0;
}
ul.products li.product .price {
	display: block;
	font-weight: 900;
	color: var(--ink);
	margin-bottom: 0.7rem;
}
ul.products li.product .price del { color: var(--muted); font-weight: 500; margin-right: 0.3em; }
ul.products li.product .price ins { text-decoration: none; color: #c21f5b; }
ul.products li.product .button { margin-top: auto; text-align: center; font-size: 0.95rem; }

.onsale,
span.onsale {
	position: absolute;
	top: 1.2rem; left: 1.2rem;
	z-index: 2;
	background: var(--pink);
	color: #fff;
	font-weight: 800;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0.3em 0.8em;
	border-radius: 999px;
	min-height: 0; min-width: 0; line-height: 1.4;
}

/* Shop pages */
.content-area { padding: 2rem 0 3rem; }
.woo-area .woocommerce-products-header__title,
.woo-area .page-title { margin-bottom: 0.4em; }
.woocommerce-breadcrumb { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; }
.woocommerce-result-count { color: var(--muted); }
.woocommerce-ordering select,
select, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
	font: inherit;
	padding: 0.55em 0.8em;
	border: 1px solid #c9c4b6;
	border-radius: 10px;
	background: #fff;
}

.woocommerce div.product { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.woocommerce div.product div.images,
.woocommerce div.product div.summary { float: none; width: auto; margin: 0; }
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related,
.woocommerce div.product .upsells { grid-column: 1 / -1; }
.woocommerce div.product .product_title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.woocommerce div.product p.price,
.woocommerce div.product span.price { font-size: 1.6rem; font-weight: 900; color: var(--ink); }
.woocommerce div.product form.cart .button { font-size: 1.05rem; }
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background: #fff;
	border-left: 5px solid var(--teal);
	border-radius: 10px;
	padding: 1rem 1.2rem;
	margin-bottom: 1.2rem;
	list-style: none;
}
.woocommerce-error { border-left-color: var(--pink); }

.woocommerce table.shop_table { border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; width: 100%; }
.woocommerce table.shop_table th,
.woocommerce table.shop_table td { padding: 0.8rem 1rem; border-bottom: 1px solid #eee; }

/* ---------- Content ---------- */
.entry { margin-bottom: 2.5rem; }
.entry-title a { text-decoration: none; }
.entry-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.entry-content > * { max-width: 100%; }
.entry-content img { border-radius: 10px; }
.pagination { margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--ink);
	color: #d4d7ee;
	padding-top: 3rem;
}
.site-footer a { color: var(--amber); }
.site-footer a:hover { color: #fff; }
.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: 2rem;
}
.footer-title { color: #fff; font-size: 1.5rem; }
.footer-heading { color: #fff; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer address { font-style: normal; margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.social { display: flex; gap: 1rem; margin-top: 1rem !important; }
.footer-base {
	margin-top: 2rem;
	padding: 1.2rem 0;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.9rem;
}
.footer-base p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.hero-grid,
	.banner-grid,
	.visit-grid { grid-template-columns: 1fr; }
	.hero-art { order: -1; }
	.hero-search { display: none; }
	.record { width: min(60%, 240px); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.woocommerce div.product { grid-template-columns: 1fr; }

	.header-inner { flex-wrap: wrap; }
	.header-search { order: 3; flex: 1 1 100%; max-width: none; }
	.account-link { display: none; }
	.nav-toggle { display: block; }

	.primary-nav { display: none; }
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; gap: 0; }
	.primary-nav a { padding: 0.8rem 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
	.primary-nav .sub-menu {
		display: none;
		position: static;
		max-height: none;
		box-shadow: none;
		background: transparent;
		padding-left: 1rem;
	}
	.primary-nav li:hover > .sub-menu,
	.primary-nav li:focus-within > .sub-menu { display: none; }
	.primary-nav li.is-open > .sub-menu { display: block; }
}

@media (max-width: 520px) {
	body { font-size: 16px; }
	.footer-grid { grid-template-columns: 1fr; }
	ul.products,
	.woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
	ul.products li.product { padding: 0.55rem; }
	.section-head { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
	.record { animation: none; }
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
