/*
Theme Name:        SF Theme
Theme URI:         https://github.com/sf-theme
Author:            SF Studio
Author URI:        https://sfstudio.sa
Description:       A modern, full-site editing block theme built for performance, accessibility, and creative expression. Features a complete design system with fluid typography, and a rich pattern library.
Version:           1.0.0
Requires at least: 6.5
Tested up to:      7.0
Requires PHP:      8.1
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       sf-theme
Tags:              block-patterns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, rtl-language-support, sticky-post, template-editing, translation-ready, wide-blocks
*/

/* =========================================================
   SF THEME — GLOBAL STYLES
   All design tokens are injected via theme.json.
   This file handles layout, resets, and utility styles.
   ========================================================= */

/* =========================================================
   0. FORCE LIGHT MODE — يمنع الخلفية السوداء من النظام
   ========================================================= */
:root,
html,
body,
.wp-site-blocks,
.editor-styles-wrapper {
	color-scheme: light only !important;
	background-color: #E4F3EC !important;
	color: #072E48 !important;
}

/* يمنع أي عنصر من تطبيق الوضع الداكن */
* { color-scheme: light; }

/* حقول الفورم — المتصفح يطبق dark mode عليها بشكل مستقل */
input,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
select {
	color-scheme: light only !important;
	background-color: #ffffff !important;
	color: #072E48 !important;
}

/* ---------------------------------------------------------
   1. SMOOTH SCROLL & BOX MODEL RESET
   --------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	padding: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.7;
	color: var(--sf-color-text);
	background-color: var(--sf-color-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}


/* ---------------------------------------------------------
   2B. GRADIENT UTILITIES
   --------------------------------------------------------- */

/* Hero / Section backgrounds */
.sf-bg-gradient        { background: var(--sf-gradient-primary); }
.sf-bg-gradient-deep   { background: var(--sf-gradient-deep); }
.sf-bg-gradient-warm   { background: var(--sf-gradient-warm); }
.sf-bg-gradient-subtle { background: var(--sf-gradient-subtle); }
.sf-bg-gradient-v      { background: var(--sf-gradient-v); }

/* Gradient text */
.sf-text-gradient {
	background: var(--sf-gradient-deep);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* Primary CTA button with gradient */
.wp-block-button__link,
.sf-btn-primary,
.wp-element-button {
	transition:
		background 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.15s ease;
}

/* Gradient borders via pseudo-element */
.sf-gradient-border {
	position: relative;
	background: #fff;
	border-radius: var(--sf-radius-lg);
}
.sf-gradient-border::before {
	content: '';
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	background: var(--sf-gradient-primary);
	z-index: -1;
}

/* Card with gradient top border */
.sf-card-gradient-top {
	border-top: 3px solid transparent;
	border-image: var(--sf-gradient-primary) 1;
}

/* Section divider gradient line */
.sf-divider-gradient {
	height: 2px;
	border: none;
	background: var(--sf-gradient-primary);
	border-radius: 9999px;
	opacity: 0.6;
}

/* Sticky header blur tint matches bg gradient */
.sf-site-header {
	background: linear-gradient(
		180deg,
		rgba(228, 243, 236, 0.95) 0%,
		rgba(228, 243, 236, 0.85) 100%
	) !important;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

/* ---------------------------------------------------------
   2. FLUID TYPOGRAPHY — clamp() overrides
   --------------------------------------------------------- */
h1, .sf-h1 {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.25rem, 4vw + 1rem, var(--wp--preset--font-size--4xl));
	line-height: 1.1;
	letter-spacing: -0.03em;
	font-weight: 700;
}

h2, .sf-h2 {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.75rem, 3vw + 0.5rem, var(--wp--preset--font-size--3xl));
	line-height: 1.2;
	letter-spacing: -0.02em;
	font-weight: 700;
}

h3, .sf-h3 {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.375rem, 2vw + 0.25rem, var(--wp--preset--font-size--2xl));
	line-height: 1.3;
	letter-spacing: -0.015em;
	font-weight: 600;
}

h4, .sf-h4 {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.125rem, 1.5vw + 0.125rem, var(--wp--preset--font-size--xl));
	line-height: 1.4;
	font-weight: 600;
}

h5, h6 {
	font-family: var(--wp--preset--font-family--display);
	line-height: 1.5;
	font-weight: 600;
}

/* ---------------------------------------------------------
   3. FOCUS STYLES — Accessible + Branded
   --------------------------------------------------------- */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary-500);
	outline-offset: 3px;
	border-radius: 3px;
}

:focus:not(:focus-visible) {
	outline: none;
}

/* ---------------------------------------------------------
   4. LINKS & INTERACTIVE ELEMENTS — CSS Transitions
   --------------------------------------------------------- */
a {
	color: var(--sf-color-primary-dark);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition:
		color 0.2s ease,
		text-decoration-color 0.2s ease,
		opacity 0.2s ease;
}

a:hover {
	color: var(--sf-color-navy);
	text-decoration-color: transparent;
}

a:active {
	opacity: 0.75;
}

button,
.wp-block-button__link,
[role="button"] {
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.15s ease,
		opacity 0.2s ease;
	cursor: pointer;
}

button:hover,
.wp-block-button__link:hover {
	transform: translateY(-1px);
}

button:active,
.wp-block-button__link:active {
	transform: translateY(0);
}

/* ---------------------------------------------------------
   5. IMAGES & MEDIA
   --------------------------------------------------------- */
img,
video,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

figure {
	margin: 0;
}

/* ---------------------------------------------------------
   6. LAYOUT UTILITIES
   --------------------------------------------------------- */
.sf-container {
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--md);
}

.sf-container--wide {
	max-width: var(--wp--style--global--wide-size);
}

.sf-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------
   7. BLOCK — NAVIGATION
   --------------------------------------------------------- */
.wp-block-navigation a {
	text-decoration: none;
	font-weight: 500;
	font-size: var(--wp--preset--font-size--sm);
	letter-spacing: 0.01em;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.wp-block-navigation a:hover {
	opacity: 0.7;
}

.wp-block-navigation__submenu-container {
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
	border: 1px solid var(--wp--preset--color--neutral-200);
	overflow: hidden;
}

/* ---------------------------------------------------------
   8. BLOCK — BUTTONS
   --------------------------------------------------------- */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 1.5px;
}

.wp-block-button__link {
	border-radius: 8px;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--sm);
	letter-spacing: 0.02em;
	padding: 0.75em 1.5em;
}

/* ---------------------------------------------------------
   9. BLOCK — SEPARATOR
   --------------------------------------------------------- */
.wp-block-separator {
	border-color: var(--wp--preset--color--neutral-200);
	opacity: 1;
}

/* ---------------------------------------------------------
   11. HEADER LAYOUT
   --------------------------------------------------------- */
.sf-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	background-color: rgba(228, 243, 236, 0.90);
	border-bottom: 1px solid var(--wp--preset--color--neutral-200);
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ---------------------------------------------------------
   12. FOOTER
   --------------------------------------------------------- */
.sf-site-footer {
	background-color: var(--wp--preset--color--secondary-600);
	color: var(--wp--preset--color--neutral-300);
}

.sf-site-footer a {
	color: #AED3CD;
}

.sf-site-footer a:hover {
	color: #E4F3EC;
}

/* ---------------------------------------------------------
   13. SIDEBAR
   --------------------------------------------------------- */
.sf-sidebar {
	font-size: var(--wp--preset--font-size--sm);
}

.sf-sidebar .wp-block-heading {
	font-size: var(--wp--preset--font-size--xs);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 700;
	color: var(--wp--preset--color--neutral-500);
	margin-bottom: var(--wp--preset--spacing--sm);
}

/* ---------------------------------------------------------
   15. MOTION — Respect reduced motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------------------------------------------------------
   16. PRINT
   --------------------------------------------------------- */
@media print {
	.sf-site-header,
	.sf-site-footer,
	.sf-sidebar {
		display: none;
	}

	body {
		font-size: 12pt;
		color: #000;
		background: #fff;
	}
}
