/*
Theme Name: SOVA
Theme URI: https://sova.test
Author: SOVA
Description: Arabic (RTL) WooCommerce theme for the SOVA bag store. Bold black type, cobalt accent, built for selling bags.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sova
Tags: e-commerce, rtl-language-support, custom-logo, custom-menu
WC requires at least: 9.0
WC tested up to: 11.2
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	--ink: #000;
	--paper: #fff;
	--concrete: #ececea;
	--cobalt: #1f3dff;
	--cobalt-deep: #0f26c9;
	--stone: #66665f;
	--line: #d6d6d1;
	--alert: #c8102e;

	--font-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
	--font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

	--fs-sm: 0.875rem;
	--fs-base: 1rem;
	--fs-md: 1.125rem;
	--fs-lg: 1.375rem;
	--fs-xl: clamp(1.75rem, 3.2vw, 2.5rem);
	--fs-hero: clamp(2.75rem, 7vw, 6.5rem);

	--container: 1320px;
	--gutter: clamp(16px, 3vw, 32px);
	--rule: 2px solid var(--ink);
	--header-h: 72px;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-base);
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--cobalt); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }

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

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

::selection { background: var(--cobalt); color: var(--paper); }

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

.skip-link:focus {
	position: fixed !important;
	top: 12px; inset-inline-start: 12px;
	width: auto; height: auto;
	clip: auto;
	z-index: 1000;
	padding: 12px 20px;
	background: var(--ink);
	color: var(--paper);
	border-radius: 999px;
}

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(760px + 2 * var(--gutter)); }

/* ==========================================================================
   Buttons & forms
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 28px;
	border: 2px solid var(--cobalt);
	border-radius: 999px;
	background: var(--cobalt);
	color: var(--paper);
	font-family: var(--font-body);
	font-size: var(--fs-base);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.btn--ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
	width: 100%;
	min-height: 52px;
	padding: 10px 16px;
	border: 2px solid var(--line);
	border-radius: 0;
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	transition: border-color .15s;
}
input:focus,
textarea:focus,
select:focus { border-color: var(--ink); outline: none; }
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 0; }

label { font-weight: 600; }

.search-form { display: flex; gap: 8px; }
.search-form__input { flex: 1; }
.search-form__btn { flex: none; }

/* ==========================================================================
   Announcement + header
   ========================================================================== */

.announcement {
	background: var(--cobalt);
	color: var(--paper);
	font-size: var(--fs-sm);
	font-weight: 500;
	text-align: center;
	padding-block: 8px;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--paper);
	border-bottom: var(--rule);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.site-header__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 32px;
	min-height: var(--header-h);
}

.wordmark {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 1.75rem;
	letter-spacing: 0.02em;
	color: var(--ink);
	text-decoration: none;
	line-height: 1;
}
.wordmark:hover { color: var(--cobalt); }
.custom-logo { max-height: 48px; width: auto; }

.site-nav .menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav .menu a {
	display: block;
	padding-block: 8px;
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}
.site-nav .menu a:hover,
.site-nav .current-menu-item > a,
.site-nav .current-product_cat-ancestor > a {
	text-decoration: underline;
	text-decoration-color: var(--cobalt);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.45em;
}
.site-nav .sub-menu { display: none; }

.site-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}
.icon-btn:hover { background: var(--concrete); color: var(--ink); }

.sova-cart-count {
	position: absolute;
	top: 2px;
	inset-inline-start: 0;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--cobalt);
	color: var(--paper);
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}
.sova-cart-count[data-count="0"] { display: none; }

.menu-toggle { display: none; }
.menu-toggle .icon--close { display: none; }
.menu-toggle[aria-expanded="true"] .icon--menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon--close { display: block; }

.site-search { border-top: 1px solid var(--line); padding-block: 16px; background: var(--paper); }

@media (max-width: 960px) {
	.site-header__inner { grid-template-columns: auto 1fr auto; gap: 8px; }
	.menu-toggle { display: inline-grid; grid-column: 1; grid-row: 1; }
	.site-brand { justify-self: center; grid-column: 2; grid-row: 1; }
	.site-actions { grid-column: 3; grid-row: 1; }
	.site-nav {
		display: none;
		grid-column: 1 / -1;
		grid-row: 2;
		padding-bottom: 16px;
	}
	.site-nav.is-open { display: block; }
	.site-nav .menu { flex-direction: column; gap: 0; }
	.site-nav .menu a {
		padding-block: 12px;
		border-top: 1px solid var(--line);
		font-family: var(--font-display);
		font-size: var(--fs-lg);
		font-weight: 700;
	}
	.wordmark { font-size: 1.5rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	min-height: min(76vh, 700px);
	border-bottom: var(--rule);
}

.hero__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 28px;
	padding-block: clamp(48px, 7vw, 112px);
	padding-inline-start: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
	padding-inline-end: clamp(24px, 4vw, 64px);
}

.hero__title {
	margin: 0;
	font-size: var(--fs-hero);
	font-weight: 900;
	line-height: 1.12;
	max-width: 8.5em;
	text-wrap: balance;
}

.hero__lead {
	margin: 0;
	max-width: 34em;
	font-size: var(--fs-md);
	color: var(--stone);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__visual {
	position: relative;
	display: grid;
	place-items: center;
	background: var(--cobalt);
	color: var(--paper);
	overflow: hidden;
	border-inline-start: var(--rule);
}
.hero__visual--photo { background: var(--concrete); }
.hero__visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hero__art { width: min(62%, 360px); }

/* The one orchestrated moment: the bag is stitched together on load. */
@media (prefers-reduced-motion: no-preference) {
	.hero__art .bag-art__handle,
	.hero__art .bag-art__body {
		stroke-dasharray: 1;
		stroke-dashoffset: 1;
		animation: sova-draw 1.1s cubic-bezier(.6, 0, .2, 1) forwards;
	}
	.hero__art .bag-art__handle { animation-delay: .65s; animation-duration: .6s; }
	.hero__art .bag-art__stitch,
	.hero__art .bag-art__clasp {
		opacity: 0;
		animation: sova-fade .4s ease-out 1.2s forwards;
	}
}
@keyframes sova-draw { to { stroke-dashoffset: 0; } }
@keyframes sova-fade { to { opacity: 1; } }

@media (max-width: 860px) {
	.hero { grid-template-columns: 1fr; min-height: 0; }
	.hero__text { padding-inline: var(--gutter); }
	.hero__visual { min-height: 300px; border-inline-start: 0; border-top: var(--rule); }
	.hero__art { width: min(52%, 220px); }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding-block: clamp(48px, 7vw, 96px); }
.section--ruled { border-top: var(--rule); }

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: clamp(24px, 3vw, 40px);
}
.section__title { margin: 0; font-size: var(--fs-xl); font-weight: 800; }
.section__link { color: var(--ink); font-weight: 600; text-decoration-thickness: 2px; }
.section__link:hover { color: var(--cobalt); }

/* Category grid — black hairlines are the gap between tiles */
.cat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2px;
	background: var(--ink);
	border: var(--rule);
}
.cat-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 2px;
	min-height: clamp(140px, 16vw, 210px);
	padding: clamp(16px, 2vw, 28px);
	background: var(--paper);
	color: var(--ink);
	text-decoration: none;
	overflow: hidden;
	transition: background-color .15s, color .15s;
}
.cat-tile:hover { background: var(--cobalt); color: var(--paper); }
.cat-tile__name {
	position: relative;
	font-family: var(--font-display);
	font-size: clamp(1.25rem, 2.2vw, 1.75rem);
	font-weight: 800;
	line-height: 1.3;
}
.cat-tile__count { position: relative; font-size: var(--fs-sm); opacity: .7; }

/* Category with a cover photo: photo on top, name underneath */
.cat-tile--photo { justify-content: flex-start; min-height: 0; padding: 0 0 clamp(14px, 1.6vw, 22px); }
.cat-tile__img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin-bottom: clamp(12px, 1.4vw, 18px);
	background: var(--concrete);
}
.cat-tile--photo .cat-tile__name,
.cat-tile--photo .cat-tile__count { padding-inline: clamp(14px, 1.6vw, 22px); }

@media (max-width: 760px) {
	.cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Promises */
.promises { border-top: var(--rule); }
.promises__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.promise { padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 40px); }
.promise:first-child { padding-inline-start: 0; }
.promise + .promise { border-inline-start: var(--rule); }
.promise__title { margin: 0 0 6px; font-size: var(--fs-lg); font-weight: 800; }
.promise__text { margin: 0; color: var(--stone); }

@media (max-width: 760px) {
	.promises__grid { grid-template-columns: 1fr; }
	.promise { padding-inline: 0; }
	.promise + .promise { border-inline-start: 0; border-top: 1px solid var(--line); }
}

/* Empty state */
.empty-state {
	padding: clamp(32px, 5vw, 64px);
	background: var(--concrete);
	text-align: center;
}
.empty-state p { font-size: var(--fs-md); font-weight: 600; }
.empty-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.empty-state .search-form { max-width: 480px; margin-inline: auto; }

/* ==========================================================================
   Content pages
   ========================================================================== */

.site-main { min-height: 50vh; }
.site-main:not(.home) { padding-block: clamp(32px, 5vw, 64px); }

.entry-header,
.page-header { margin-bottom: clamp(24px, 3vw, 40px); }
.entry-title { margin: 0; font-size: var(--fs-xl); font-weight: 800; }
.entry-meta { margin: 8px 0 0; color: var(--stone); font-size: var(--fs-sm); }
.entry-thumb { margin: 0 0 32px; }

.entry-content { font-size: var(--fs-md); }
.entry-content > * { margin-block: 0 1.1em; }
.entry-content h2 { font-size: var(--fs-lg); margin-top: 1.6em; }
.entry-content h3 { font-size: var(--fs-md); margin-top: 1.4em; }
.entry-content ul,
.entry-content ol { padding-inline-start: 1.4em; }
.entry-content blockquote {
	margin-inline: 0;
	padding-inline-start: 20px;
	border-inline-start: 4px solid var(--cobalt);
	font-family: var(--font-display);
	font-weight: 700;
}
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th,
.entry-content td { padding: 10px; border-bottom: 1px solid var(--line); text-align: start; }

.post-list { border-top: var(--rule); }
.post-item { padding-block: 24px; border-bottom: 1px solid var(--line); }
.post-item__title { margin: 0; font-size: var(--fs-lg); }
.post-item__title a { color: var(--ink); text-decoration: none; }
.post-item__title a:hover { color: var(--cobalt); }
.post-item__excerpt p { margin: 8px 0 0; color: var(--stone); }

.nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.nav-links .page-numbers,
.nav-links a {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 2px solid var(--ink);
	border-radius: 999px;
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}
.nav-links .current { background: var(--ink); color: var(--paper); }

.not-found { text-align: center; }
.not-found__code {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(6rem, 20vw, 12rem);
	font-weight: 900;
	line-height: 1;
	color: var(--cobalt);
}
.not-found .search-form { max-width: 480px; margin: 24px auto; }

.comments { margin-top: 48px; padding-top: 32px; border-top: var(--rule); }
.comment-list { padding: 0; list-style: none; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	margin-top: 0;
	background: var(--ink);
	color: var(--paper);
}
.site-footer a { color: var(--paper); text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; text-decoration-color: var(--cobalt); text-decoration-thickness: 2px; }

.site-footer__grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, 1fr);
	gap: 40px;
	padding-block: clamp(48px, 6vw, 80px);
}
.site-footer__brand p { max-width: 30em; margin-top: 16px; color: rgba(255, 255, 255, .7); }
.wordmark--footer { color: var(--paper); font-size: 2.5rem; }
.wordmark--footer:hover { color: var(--paper); }

.footer-title { margin: 0 0 12px; font-size: var(--fs-md); font-weight: 700; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: rgba(255, 255, 255, .78); }
.footer-contact a { display: inline-flex; align-items: center; gap: 8px; }
.footer-contact .icon { width: 18px; height: 18px; }

.social-links { display: flex; gap: 4px; margin: 12px 0 0; padding: 0; list-style: none; }
.site-footer .icon-btn { color: var(--paper); }
.site-footer .icon-btn:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }

.site-footer__bottom {
	padding-block: 20px;
	border-top: 1px solid rgba(255, 255, 255, .18);
	font-size: var(--fs-sm);
	color: rgba(255, 255, 255, .6);
}
.site-footer__bottom p { margin: 0; }

@media (max-width: 860px) {
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
	.site-footer__brand { grid-column: 1 / -1; }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
