/*
Theme Name: Eleganto Case
Theme URI: https://elegantocase.com
Author: Eleganto Case
Description: Slim phone cases in twelve finishes, cut per model
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: elegantocase
*/
/* Eleganto Case — the swatch book.
   Colour comes from the product, never from the page. Square blocks, mono labels. */

:root {
	--paper: #f3f1ec;
	--ink: #121316;
	--muted: #5b5d63;
	--line: rgba(18, 19, 22, .16);
	--cobalt: #24418f;
	--pad: clamp(1.25rem, 5vw, 4rem);
	--ease: cubic-bezier(.22, 1, .36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: "Archivo", "Segoe UI", system-ui, sans-serif;
	font-size: 16px;
	line-height: 24px;
	-webkit-font-smoothing: antialiased;
	text-wrap: pretty;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0 0 16px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.035em; text-wrap: balance; }

/* ---------- text roles ---------- */

.d1 { font-size: clamp(3rem, 8vw, 7.5rem); line-height: .9; letter-spacing: -.045em; }
.d2 { font-size: clamp(2rem, 5vw, 4.5rem); line-height: .94; letter-spacing: -.04em; }
.h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.1; letter-spacing: -.03em; }
.h4 { font-size: 20px; line-height: 26px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.6; }
.body { font-size: 16px; line-height: 26px; }
.small { font-size: 14px; line-height: 22px; color: var(--muted); }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

.pad { padding-inline: var(--pad); }
.sec { padding: 96px var(--pad); }
.sec-tight { padding: 64px var(--pad); }
.rule { border-top: 1px solid var(--line); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 12px 16px; z-index: 90; }
.skip:focus { left: 16px; top: 16px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- bar ---------- */

.bar {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 14px var(--pad);
	background: color-mix(in srgb, var(--paper) 88%, transparent);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}

.brand { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -.03em; white-space: nowrap; }
.brand span { color: var(--muted); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: 14px; line-height: 20px; font-weight: 500; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.cart { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 500; }
.cart b { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500; min-width: 20px; height: 20px; display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.bars { display: block; width: 18px; height: 12px; position: relative; }
.bars i { position: absolute; left: 0; width: 18px; height: 1.5px; background: currentColor; transition: transform .5s var(--ease), top .5s var(--ease); }
.bars i:first-child { top: 0; }
.bars i:last-child { top: 10px; }
.nav-open .bars i:first-child { top: 5px; transform: rotate(45deg); }
.nav-open .bars i:last-child { top: 5px; transform: rotate(-45deg); }

/* ---------- buttons + chips ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 22px;
	background: var(--ink);
	color: var(--paper);
	border: 1px solid var(--ink);
	border-radius: 999px;
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	transition: transform .5s var(--ease), opacity .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-on { background: var(--on); color: var(--c); border-color: var(--on); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-family: "IBM Plex Mono", monospace;
	font-size: 12px;
	line-height: 18px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .3s var(--ease), color .3s var(--ease);
}
.chip:hover { background: currentColor; }


/* ---------- tiles ---------- */

.tile {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	padding: 24px;
	background: var(--c, var(--paper));
	color: var(--on, var(--ink));
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.tile-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tile img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.tile-name { font-size: clamp(1.5rem, 2.6vw, 2.25rem); line-height: 1; font-weight: 600; letter-spacing: -.035em; }
.tile-foot { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.tile:hover .tile-name { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* ---------- hero ---------- */

.hero {
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	align-items: center;
	gap: 40px;
	padding: 88px var(--pad) 64px;
	background: var(--c);
	color: var(--on);
	min-height: 88svh;
}
.hero h1 { max-width: 12ch; }
.hero .lead { max-width: 46ch; margin-top: 24px; opacity: .9; }
.hero .chips { margin-top: 32px; }
.hero-figure { margin: 0; align-self: stretch; display: flex; }
.hero-figure img { width: 100%; height: 100%; max-height: 640px; object-fit: cover; }
.hero-note { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; }

/* ---------- swatchbook ---------- */

.swatch-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--ink); border: 1px solid var(--ink); }
.mosaic .tile { min-height: 0; }

/* CSS-only model filter */
.filter { position: absolute; opacity: 0; pointer-events: none; }
.filter-label { cursor: pointer; }
.swatchbook:has(#f-iphone:checked) .tile[data-phone="galaxy"],
.swatchbook:has(#f-galaxy:checked) .tile[data-phone="iphone"] { display: none; }
.swatchbook:has(#f-iphone:checked) .filter-label[for="f-iphone"],
.swatchbook:has(#f-galaxy:checked) .filter-label[for="f-galaxy"] { background: var(--ink); color: var(--paper); }
.swatchbook:has(#f-all:checked) .filter-label[for="f-all"] { background: var(--ink); color: var(--paper); }

/* ---------- spec table ---------- */

.spec { display: grid; grid-template-columns: 220px 1fr; gap: 0; border-top: 1px solid var(--line); }
.spec dt,
.spec dd { margin: 0; padding: 20px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 18px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.spec dd { font-size: 16px; line-height: 26px; }

/* ---------- bands ---------- */

.band { position: relative; margin: 0; }
.band img { width: 100%; height: clamp(320px, 56vw, 720px); object-fit: cover; }
.band-cap {
	position: absolute;
	left: var(--pad);
	bottom: 32px;
	right: var(--pad);
	display: flex;
	justify-content: space-between;
	gap: 24px;
	align-items: end;
	color: var(--paper);
}
.band-cap p { max-width: 30ch; margin: 0; font-size: clamp(1.25rem, 2.4vw, 2rem); line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }

/* ---------- reviews ---------- */

.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); }
.review { background: var(--paper); padding: 32px 24px; display: flex; flex-direction: column; gap: 16px; }
.review p { font-size: 18px; line-height: 28px; margin: 0; }
.review .who { margin-top: auto; }

/* ---------- faq ---------- */

.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0; font-size: 18px; line-height: 26px; font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { position: relative; width: 12px; height: 12px; flex: none; }
.faq .plus::before,
.faq .plus::after { content: ""; position: absolute; background: currentColor; }
.faq .plus::before { left: 0; top: 5px; width: 12px; height: 1.5px; }
.faq .plus::after { left: 5px; top: 0; width: 1.5px; height: 12px; }
.faq details[open] .plus { transform: rotate(45deg); }
.faq p { margin: 0 0 20px; color: var(--muted); max-width: 68ch; }

/* ---------- product page ---------- */

.buy { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start; padding: 32px var(--pad) 64px; }
.buy-media { margin: 0; background: var(--c); }
.buy-media img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.buy-panel { position: sticky; top: 88px; }
.buy-panel h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1; margin-bottom: 12px; }
.price { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; }
.buy-block { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.buy-block .mono { display: block; margin-bottom: 12px; color: var(--muted); }
.models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.model { position: relative; }
.model input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.model span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line); font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 18px; letter-spacing: .06em; text-transform: uppercase; }
.model input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.model input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.add { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.add select { padding: 14px 12px; border: 1px solid var(--line); border-radius: 0; background: transparent; }
.add .btn { flex: 1; }
.stock { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.stock i { width: 7px; height: 7px; border-radius: 50%; background: #2f7d4f; }

.strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; background: var(--ink); border-block: 1px solid var(--ink); }
.strip a { display: block; background: var(--c); aspect-ratio: 1; }

/* ---------- story ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split figure { margin: 0; }
.split img { width: 100%; }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.values div { border-top: 1px solid var(--ink); padding-top: 16px; }

/* ---------- help ---------- */

.help-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: start; }
.help-grid h3 { margin-bottom: 12px; }
.help-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.help-item:first-of-type { border-top: 1px solid var(--line); }

form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 18px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
input, select, textarea { padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; background: transparent; font-family: "Archivo", sans-serif; font-size: 16px; }
textarea { min-height: 140px; resize: vertical; }

/* ---------- closing ---------- */

.close { background: var(--ink); color: var(--paper); padding: 96px var(--pad); }
.close h2 { max-width: 18ch; }
.close .chips { margin-top: 32px; }

/* ---------- footer ---------- */

.foot { padding: 64px var(--pad) 32px; }
.foot-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot a { display: block; font-size: 14px; line-height: 24px; color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .mark { margin-top: 48px; font-size: clamp(3rem, 14vw, 12rem); line-height: .8; font-weight: 600; letter-spacing: -.05em; color: var(--line); white-space: nowrap; }
.foot-bot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- 404 ---------- */

.notfound { min-height: 70svh; display: grid; place-items: center; text-align: center; padding: 96px var(--pad); }

/* ---------- motion ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
	* { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
	.hero { grid-template-columns: 1fr; min-height: 0; }
	.hero-figure img { max-height: 440px; }
	.mosaic { grid-template-columns: repeat(2, 1fr); }
	.buy, .split, .help-grid { grid-template-columns: 1fr; gap: 32px; }
	.buy-panel { position: static; }
	.reviews, .values { grid-template-columns: 1fr; }
	.strip { grid-template-columns: repeat(3, 1fr); }
	.foot-top { grid-template-columns: 1fr 1fr; }
	.spec { grid-template-columns: 160px 1fr; }
}

@media (max-width: 768px) {
	.nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
	.nav {
		position: fixed;
		inset: 0;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		gap: 24px;
		padding: 0 var(--pad);
		background: var(--paper);
		opacity: 0;
		pointer-events: none;
		transition: opacity .3s var(--ease);
	}
	.nav a { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
	.menu-open .nav { opacity: 1; pointer-events: auto; }
	.hero { padding-top: 56px; }
	.mosaic { grid-template-columns: 1fr; }
	.mosaic .tile { min-height: 0; }
	.sec { padding: 56px var(--pad); }
	.spec { grid-template-columns: 1fr; }
	.spec dt { padding-bottom: 0; border-bottom: 0; }
	.spec dd { padding-top: 4px; }
	.band-cap { flex-direction: column; align-items: flex-start; gap: 8px; bottom: 20px; }
	.foot .mark { font-size: clamp(2.5rem, 16vw, 6rem); }
}

/* dense mosaic for the shop and the "also in" strip */
.mosaic.dense{grid-template-columns:repeat(4,1fr)}
.mosaic.dense .tile{min-height:0}

/* finish filter, CSS only */
.swatchbook:has(#s-matte:checked) .tile:not([data-finish~="matte"]),
.swatchbook:has(#s-leather:checked) .tile:not([data-finish~="leather"]),
.swatchbook:has(#s-clear:checked) .tile:not([data-finish~="clear"]),
.swatchbook:has(#s-signature:checked) .tile:not([data-finish~="signature"]){display:none}
.swatchbook:has(#s-matte:checked) .filter-label[for="s-matte"],
.swatchbook:has(#s-leather:checked) .filter-label[for="s-leather"],
.swatchbook:has(#s-clear:checked) .filter-label[for="s-clear"],
.swatchbook:has(#s-signature:checked) .filter-label[for="s-signature"],
.swatchbook:has(#s-all:checked) .filter-label[for="s-all"]{background:var(--ink);color:var(--paper)}

a.mono{text-decoration:underline;text-underline-offset:4px}
@media (max-width:1024px){.mosaic.dense{grid-template-columns:repeat(2,1fr)}}
@media (max-width:768px){.mosaic.dense{grid-template-columns:1fr}.mosaic.dense .tile{min-height:0}}

/* ---------- woocommerce surfaces ---------- */

.woo-wrap{max-width:920px}
.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{background:var(--ink);color:var(--paper);border:1px solid var(--ink);border-radius:999px;font-family:inherit;font-weight:600;font-size:15px;padding:12px 22px}
.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover{background:transparent;color:var(--ink)}
.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt{background:var(--cobalt);border-color:var(--cobalt);color:#fff}
.woocommerce a.button.alt:hover{background:var(--ink);border-color:var(--ink)}
.woocommerce table.shop_table,.woocommerce .cart_totals table{border:1px solid var(--line);border-radius:0}
.woocommerce table.shop_table th,.woocommerce table.shop_table td{border-color:var(--line)}
.woocommerce-message,.woocommerce-info,.woocommerce-error{border-top:0;border-left:1px solid var(--line);background:transparent;color:var(--ink);padding:16px}
.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea,.woocommerce select{border:1px solid var(--line);border-radius:0;padding:12px 14px;background:transparent}
.woocommerce .quantity .qty{border:1px solid var(--line);border-radius:0;padding:10px}
.woocommerce h1,.woocommerce h2,.woocommerce h3{font-family:inherit}

/* product form stacks its own rows */
.buy form.cart{display:block}
.buy .models{grid-template-columns:repeat(4,1fr)}
@media (max-width:768px){.buy .models{grid-template-columns:repeat(2,1fr)}}
