/* ==========================================================================
   KiwwwiCommerce - Main Stylesheet
   ========================================================================== */

/* Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

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

body {
	font-family: var(--wp--preset--font-family--system);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
	color: var(--wp--preset--color--text);
	background-color: var(--wp--preset--color--surface);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

a:hover:not(.button):not(.wp-element-button):not([class*="__btn"]):not([class*="-btn"]):not([role="button"]) {
	color: var(--wp--preset--color--highlight);
}

/* Layout
   ========================================================================== */
.container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1400px);
	margin-inline: auto;
	padding-inline: 1rem;
}

@media (min-width: 768px) {
	.container {
		padding-inline: 2rem;
	}
}

.site-main {
	min-height: 60vh;
	padding-block: 2rem;
}

/* Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
	line-height: 1.2;
	font-weight: 700;
	color: var(--kw--color--heading, var(--wp--preset--color--primary));
}

h1 { font-size: var(--wp--preset--font-size--xx-large); }
h2 { font-size: var(--wp--preset--font-size--x-large); }
h3 { font-size: var(--wp--preset--font-size--large); }

/* Buttons — base + variants
   ========================================================================== */

/* .button = Primary Color fill (add to cart, checkout, proceed, place order) */
.button,
button[type="submit"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s, transform 0.15s;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
}

.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
	opacity: 0.9;
	color: var(--wp--preset--color--surface);
}

/* .button--secondary = Secondary Color fill (view cart, continue shopping, back) */
.button--secondary {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--surface);
}

/* Small variant */
.button--sm {
	padding: 0.375rem 1rem;
	font-size: 0.8125rem;
}

/* Full width */
.button--block {
	width: 100%;
	justify-content: center;
}

/* Pill shape */
.button--pill {
	border-radius: 999px;
}

/* Forms
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
textarea,
select {
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 4px;
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
}

/* Post Grid
   ========================================================================== */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
}

/* Page Header
   ========================================================================== */
.page-header {
	margin-bottom: 2rem;
}

.page-title {
	margin-bottom: 0.5rem;
}

.archive-description {
	color: var(--wp--preset--color--text-light);
}

/* Post Card
   ========================================================================== */
.post-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.post-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-card__image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.post-card__content {
	padding: 1.25rem;
}

.post-card__title {
	font-size: 1.125rem;
	margin-bottom: 0.5rem;
}

.post-card__title a {
	color: var(--wp--preset--color--primary);
}

.post-card__meta {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--text-light);
	margin-bottom: 0.5rem;
}

/* Pagination
   ========================================================================== */
.nav-links {
	display: flex;
	justify-content: center;
	gap: 0.25rem;
	margin-top: 2rem;
}

.nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 4px;
	font-size: 0.875rem;
	color: var(--wp--preset--color--text);
}

.nav-links .page-numbers.current {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--primary);
}

/* Error 404
   ========================================================================== */
.error-404 {
	text-align: center;
	padding-block: 4rem;
}

/* Utility
   ========================================================================== */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute;
	height: 1px;
	width: 1px;
	overflow: hidden;
}
