/* ==========================================================================
   Sistem Theme - Custom styles extending Bootstrap 5
   ========================================================================== */

:root {
	--sistem-primary: #0d6efd;
	--sistem-secondary: #6c757d;
	--sistem-accent: #198754;
	--sistem-header-height: 64px;
}

/* ---- Buttons --------------------------------------------------------- */
.btn-accent {
	--bs-btn-bg: var(--sistem-accent);
	--bs-btn-border-color: var(--sistem-accent);
	--bs-btn-hover-bg: color-mix(in srgb, var(--sistem-accent) 85%, #000);
	--bs-btn-hover-border-color: color-mix(in srgb, var(--sistem-accent) 85%, #000);
	--bs-btn-color: #fff;
	--bs-btn-hover-color: #fff;
}

/* Use the theme primary variable for Bootstrap's .btn-primary */
.btn-primary {
	--bs-btn-bg: var(--sistem-primary);
	--bs-btn-border-color: var(--sistem-primary);
	--bs-btn-hover-bg: color-mix(in srgb, var(--sistem-primary) 85%, #000);
	--bs-btn-hover-border-color: color-mix(in srgb, var(--sistem-primary) 85%, #000);
}

.bg-primary {
	background-color: var(--sistem-primary) !important;
}

.text-primary {
	color: var(--sistem-primary) !important;
}

.link-primary {
	color: var(--sistem-primary) !important;
}

.border-primary {
	border-color: var(--sistem-primary) !important;
}

/* ---- Header / Navbar ------------------------------------------------- */
.site-header {
	transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.has-sticky-header .site-header {
	position: sticky;
	top: 0;
	z-index: 1030;
	backdrop-filter: saturate(180%) blur(6px);
}

.site-header.is-scrolled {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.navbar-brand img {
	max-height: 40px;
	width: auto;
}

.custom-logo-link img {
	max-height: 40px;
	width: auto;
}

.site-title {
	font-size: 1.25rem;
	text-decoration: none;
}

.navbar-nav .nav-link {
	font-weight: 500;
}

/* Offcanvas adjustments for mobile */
.offcanvas-body .search-form {
	width: 100%;
}

/* ---- Hero ------------------------------------------------------------ */
.sistem-hero {
	background-attachment: fixed;
	background-repeat: no-repeat;
}

@media (max-width: 767.98px) {
	.sistem-hero {
		background-attachment: scroll;
		min-height: 60vh !important;
	}
}

/* ---- Cards / Posts --------------------------------------------------- */
.card-img-top-link {
	display: block;
	overflow: hidden;
}

.card-img-top {
	transition: transform 0.4s ease;
}

.card:hover .card-img-top {
	transform: scale(1.05);
}

.entry-meta a,
.entry-footer a {
	color: inherit;
	text-decoration: none;
}

.entry-footer a:hover {
	text-decoration: underline;
}

/* ---- Accessibility: focus states ------------------------------------ */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
.form-control:focus,
.btn:focus-visible {
	outline: 3px solid rgba(13, 110, 253, 0.5);
	outline-offset: 2px;
}

/* ---- Block editor (Gutenberg) front-end polish ---------------------- */
.wp-block-image img {
	height: auto;
}

.wp-block-quote {
	border-left: 4px solid var(--sistem-primary);
	padding-left: 1rem;
}

.wp-block-pullquote {
	border-top: 3px solid var(--sistem-primary);
	border-bottom: 3px solid var(--sistem-primary);
	padding: 1.5rem 0;
}

.wp-block-code {
	background: #f6f8fa;
	border: 1px solid #e1e4e8;
	border-radius: 6px;
	padding: 1rem;
}

.wp-block-table table {
	--bs-table-accent-bg: transparent;
}

/* Make wide/full alignments respect container on large screens */
@media (min-width: 1200px) {
	.alignwide {
		margin-left: -60px;
		margin-right: -60px;
	}
}

/* ---- WooCommerce overrides ------------------------------------------ */
.woocommerce .woocommerce-breadcrumb {
	font-size: 0.875rem;
	color: var(--bs-secondary-color);
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	text-align: center;
}

.woocommerce .products .product .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce .woocommerce-button {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--sistem-primary);
	--bs-btn-border-color: var(--sistem-primary);
	border-radius: var(--bs-border-radius);
}

.woocommerce .quantity .qty {
	width: 4rem;
}

.woocommerce .woocommerce-MyAccount-navigation ul {
	list-style: none;
	padding: 0;
}

.woocommerce .woocommerce-MyAccount-navigation li {
	padding: 0.25rem 0;
}

.woocommerce .woocommerce-MyAccount-navigation li.is-active a {
	font-weight: 700;
	color: var(--sistem-primary);
}

/* Shop sidebar placement */
.layout-left-sidebar #secondary,
.woocommerce .shop-sidebar {
	/* controlled by template markup order */
}

/* ---- Footer ---------------------------------------------------------- */
.site-footer a {
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

.site-footer .widget-title {
	letter-spacing: 0.05em;
}

/* ---- Back to top button --------------------------------------------- */
#sistem-back-to-top {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	width: 44px;
	height: 44px;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1040;
	opacity: 0.9;
}

#sistem-back-to-top.show {
	display: flex;
}

/* ---- Dark scheme support -------------------------------------------- */
.scheme-dark {
	color-scheme: dark;
}

.scheme-dark body,
body.scheme-dark {
	background-color: #1a1d20;
	color: #f8f9fa;
}

/* When dark scheme is active, soften card backgrounds */
.scheme-dark .card {
	background-color: #212529;
	border-color: #343a40;
}

.scheme-dark .bg-body-tertiary {
	background-color: #212529 !important;
}

.scheme-dark .text-muted {
	color: #adb5bd !important;
}

/* ---- Print ----------------------------------------------------------- */
@media print {
	.site-header,
	.site-footer,
	.site-sidebar,
	#sistem-back-to-top,
	.comments-area {
		display: none !important;
	}
}

/* ---- Reduced motion -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
