/* =============================================================
   Edvanz Design System — Child Theme Styles
   Tokens per 05_build_plan.md §5 and 03_brand_and_design.md
   ============================================================= */

/* ---------- DESIGN TOKENS ---------- */
:root {
	/* Brand */
	--brand-deep:   #293678;
	--brand-mid:    #2878BE;
	--brand-light:  #68BCE2;
	--action:       #2094F8;
	--action-hover: #1877D2;

	/* Text */
	--text-primary:   #000000;
	--text-secondary: #515960;
	--text-muted:     #8E8E8E;
	--text-on-brand:  #FFFFFF;

	/* Functional */
	--error:   #ED4956;
	--success: #10B981;
	--warning: #F59E0B;
	--border:  #DBDBDB;

	/* Backgrounds */
	--bg-base: #FFFFFF;
	--bg-tint: #F0F7FC;
	--bg-dark: #293678;

	/* Spacing (8px base) */
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 16px;
	--space-4: 24px;
	--space-5: 32px;
	--space-6: 48px;
	--space-7: 64px;
	--space-8: 96px;
	--space-9: 128px;

	/* Layout */
	--container-max:       1140px;
	--section-pad-desktop: 96px;
	--section-pad-mobile:  64px;

	/* Type */
	--font-en: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* ---------- BODY ---------- */
body {
	font-family: var(--font-en);
	color: var(--text-secondary);
	background: var(--bg-base);
}

h1, h2, h3, h4, h5, h6 {
	color: var(--text-primary);
	font-family: var(--font-en);
}

/* ---------- ARABIC / RTL ADJUSTMENTS ---------- */
html[lang^="ar"] body,
html[dir="rtl"] body {
	font-family: var(--font-ar);
	line-height: 1.7; /* +0.1 over English per design system */
}
html[lang^="ar"] h1, html[dir="rtl"] h1,
html[lang^="ar"] h2, html[dir="rtl"] h2,
html[lang^="ar"] h3, html[dir="rtl"] h3,
html[lang^="ar"] h4, html[dir="rtl"] h4,
html[lang^="ar"] h5, html[dir="rtl"] h5,
html[lang^="ar"] h6, html[dir="rtl"] h6 {
	font-family: var(--font-ar);
}
html[lang^="ar"] h1, html[dir="rtl"] h1 { line-height: 1.25; }
html[lang^="ar"] h2, html[dir="rtl"] h2 { line-height: 1.35; }
html[lang^="ar"] h3, html[dir="rtl"] h3 { line-height: 1.4;  }
html[lang^="ar"] h4, html[dir="rtl"] h4 { line-height: 1.45; }

/* ---------- BUTTONS ---------- */
.wp-block-button__link,
.ast-button,
button.edvanz-btn-primary,
.edvanz-btn-primary {
	background-color: var(--action);
	color: var(--text-on-brand) !important;
	padding: 14px 28px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 16px;
	line-height: 1;
	border: none;
	text-decoration: none;
	display: inline-block;
	transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
	cursor: pointer;
}
.wp-block-button__link:hover,
.ast-button:hover,
button.edvanz-btn-primary:hover,
.edvanz-btn-primary:hover {
	background-color: var(--action-hover);
	color: var(--text-on-brand) !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(32, 148, 248, 0.25);
	text-decoration: none;
}
.wp-block-button__link:active,
.edvanz-btn-primary:active {
	transform: translateY(0);
	box-shadow: none;
}
.wp-block-button__link:disabled,
.edvanz-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.edvanz-btn-secondary {
	background-color: transparent;
	color: var(--brand-deep) !important;
	border: 2px solid var(--brand-deep);
	padding: 12px 26px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 16px;
	text-decoration: none;
	display: inline-block;
	transition: all 150ms ease;
}
.edvanz-btn-secondary:hover {
	background-color: var(--brand-deep);
	color: var(--text-on-brand) !important;
	transform: translateY(-1px);
	text-decoration: none;
}

/* ---------- SECTIONS & BACKGROUNDS ---------- */
.edvanz-section {
	padding-top:    var(--section-pad-desktop);
	padding-bottom: var(--section-pad-desktop);
}
.edvanz-section--tint { background-color: var(--bg-tint); }
.edvanz-section--dark {
	background-color: var(--bg-dark);
	color: var(--text-on-brand);
}
.edvanz-section--dark h1,
.edvanz-section--dark h2,
.edvanz-section--dark h3,
.edvanz-section--dark h4,
.edvanz-section--dark h5,
.edvanz-section--dark h6 {
	color: var(--text-on-brand);
}
.edvanz-section--dark a {
	color: var(--brand-light);
}
.edvanz-section--dark a:hover {
	color: var(--text-on-brand);
}
@media (max-width: 768px) {
	.edvanz-section {
		padding-top:    var(--section-pad-mobile);
		padding-bottom: var(--section-pad-mobile);
	}
}

/* ---------- CARDS ---------- */
.edvanz-card {
	background: var(--bg-base);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 32px;
	transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.edvanz-card:hover {
	border-color: var(--brand-light);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(41, 54, 120, 0.08);
}
.edvanz-section--tint .edvanz-card {
	background: var(--bg-base);
}
.edvanz-section:not(.edvanz-section--tint):not(.edvanz-section--dark) .edvanz-card {
	background: var(--bg-tint);
	border: none;
}

/* ---------- FLUENT FORMS OVERRIDES ---------- */
.fluentform .ff-el-input--label label,
.fluentform label {
	color: var(--text-primary);
	font-weight: 500;
	font-size: 14px;
	margin-bottom: 6px;
}
.fluentform input[type="text"],
.fluentform input[type="email"],
.fluentform input[type="tel"],
.fluentform input[type="url"],
.fluentform select,
.fluentform textarea {
	height: 48px;
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0 12px;
	background: var(--bg-base);
	font-size: 16px;
	line-height: 1.5;
	transition: border-color 150ms ease, box-shadow 150ms ease;
	font-family: inherit;
}
.fluentform textarea {
	height: auto;
	min-height: 120px;
	padding: 12px;
}
.fluentform input:focus,
.fluentform select:focus,
.fluentform textarea:focus {
	border: 2px solid var(--action);
	outline: none;
	box-shadow: 0 0 0 3px rgba(32, 148, 248, 0.15);
}
.fluentform .ff-el-is-error input,
.fluentform .ff-el-is-error select,
.fluentform .ff-el-is-error textarea {
	border-color: var(--error);
}
.fluentform .error,
.fluentform .ff-el-is-error label {
	color: var(--error);
	font-size: 13px;
	margin-top: 4px;
}
.fluentform .ff-btn-submit {
	background: var(--action);
	color: var(--text-on-brand);
	padding: 14px 28px;
	border-radius: 8px;
	border: none;
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	transition: background-color 150ms ease, transform 150ms ease;
}
.fluentform .ff-btn-submit:hover {
	background: var(--action-hover);
	transform: translateY(-1px);
}
.fluentform label .ff-el-is-required,
.fluentform .ff_required {
	color: var(--error);
}

/* ---------- WAITLIST COUNTER TYPOGRAPHY ---------- */
.edvanz-counter {
	font-family: var(--font-en);
	font-weight: 700;
	color: var(--brand-deep);
	font-size: 48px;
	line-height: 1;
	display: inline-block;
}
html[dir="rtl"] .edvanz-counter {
	font-family: var(--font-ar);
}
@media (max-width: 768px) {
	.edvanz-counter { font-size: 36px; }
}

/* ---------- LANGUAGE SWITCHER (Polylang) ---------- */
.main-header-menu > .lang-item,
.main-header-menu > .current-menu-item.lang-item {
	font-size: 14px;
}
.main-header-menu > .lang-item a {
	color: var(--text-secondary);
	padding: 4px 10px;
}
.main-header-menu > .lang-item.current-lang a,
.main-header-menu > .current-menu-item.lang-item a {
	color: var(--text-primary);
	font-weight: 600;
}
.edvanz-lang-switcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
}
.edvanz-lang-switcher a {
	color: var(--text-secondary);
	text-decoration: none;
	padding: 4px 8px;
}
.edvanz-lang-switcher a.current-lang,
.edvanz-lang-switcher a[aria-current="true"] {
	color: var(--text-primary);
	font-weight: 600;
}
.edvanz-lang-switcher .separator {
	color: var(--border);
}

/* ---------- LINKS ---------- */
a {
	color: var(--action);
	text-decoration: none;
	transition: color 150ms ease;
}
a:hover {
	color: var(--action-hover);
	text-decoration: underline;
}

/* ---------- WHATSAPP BUTTON (brand exception) ---------- */
.edvanz-btn-whatsapp {
	background: #25D366;
	color: #FFFFFF !important;
	padding: 14px 28px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 16px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	transition: background-color 150ms ease, transform 150ms ease;
}
.edvanz-btn-whatsapp:hover {
	background: #1DB954;
	color: #FFFFFF !important;
	transform: translateY(-1px);
	text-decoration: none;
}
.edvanz-btn-whatsapp svg {
	flex-shrink: 0;
}

/* ---------- UTILITY CLASSES ---------- */
.edvanz-text-primary   { color: var(--text-primary); }
.edvanz-text-secondary { color: var(--text-secondary); }
.edvanz-text-muted     { color: var(--text-muted); }
.edvanz-bg-tint        { background-color: var(--bg-tint); }
.edvanz-bg-dark        { background-color: var(--bg-dark); color: var(--text-on-brand); }

/* ---------- RTL — arrow icons and directional mirroring ---------- */
html[dir="rtl"] .edvanz-arrow-icon {
	transform: scaleX(-1);
}
html[dir="rtl"] .edvanz-btn-whatsapp svg {
	transform: scaleX(-1);
}

/* ---------- ACCESSIBILITY ---------- */
@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;
	}
}

/* Focus visible (keyboard navigation) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--action);
	outline-offset: 2px;
}

/* ---------- FOOTER ---------- */
.site-footer {
	background-color: var(--bg-dark);
	color: var(--text-on-brand);
}
.site-footer a {
	color: var(--brand-light);
}
.site-footer a:hover {
	color: var(--text-on-brand);
}

/* ---------- END ---------- */

/* ============================================================
   Language switcher in header
   ============================================================ */
.edvanz-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}
.edvanz-lang-switcher .edvanz-lang-link {
    color: var(--edvanz-color-text, #0a1a2f);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}
.edvanz-lang-switcher .edvanz-lang-link:hover {
    color: var(--edvanz-color-primary, #0A5EB0);
    background-color: rgba(10, 94, 176, 0.08);
}

/* ============================================================
   Footer — minimal
   ============================================================ */
.site-footer {
    background-color: #f5f7fa !important;
    border-top: 1px solid #e5e9ef;
    padding: 16px 0;
}
.edvanz-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #5a6573;
    text-align: center;
    line-height: 1.6;
}
.edvanz-footer-link {
    color: #5a6573;
    text-decoration: none;
    transition: color 0.2s ease;
}
.edvanz-footer-link:hover {
    color: var(--edvanz-color-primary, #0A5EB0);
    text-decoration: underline;
}
.edvanz-footer-separator {
    color: #c5ccd6;
    user-select: none;
}
.edvanz-footer-copyright {
    font-weight: 500;
    color: #3a4555;
}

/* Stack on mobile */
@media (max-width: 600px) {
    .edvanz-footer {
        flex-direction: column;
        gap: 6px;
    }
    .edvanz-footer-separator {
        display: none;
    }
}

/* ============================================================
   WhatsApp floating button (FAB)
   ============================================================ */
.edvanz-whatsapp-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}
.edvanz-whatsapp-fab:hover,
.edvanz-whatsapp-fab:focus {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55);
    background-color: #1ebe5a;
    color: #ffffff;
}
.edvanz-whatsapp-fab svg {
    width: 28px;
    height: 28px;
}

/* RTL: put it on the bottom-left for Arabic */
.edvanz-whatsapp-fab--rtl {
    right: auto;
    left: 24px;
}

/* Tooltip on hover */
.edvanz-whatsapp-fab::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 50%;
    right: calc(100% + 12px);
    transform: translateY(50%);
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.edvanz-whatsapp-fab--rtl::before {
    right: auto;
    left: calc(100% + 12px);
}
.edvanz-whatsapp-fab:hover::before,
.edvanz-whatsapp-fab:focus::before {
    opacity: 1;
}

/* Mobile: smaller button, slightly closer to corner */
@media (max-width: 600px) {
    .edvanz-whatsapp-fab {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }
    .edvanz-whatsapp-fab--rtl {
        left: 16px;
    }
    .edvanz-whatsapp-fab svg {
        width: 24px;
        height: 24px;
    }
    /* Hide tooltip on mobile — button is self-explanatory */
    .edvanz-whatsapp-fab::before {
        display: none;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .edvanz-whatsapp-fab {
        transition: none;
    }
    .edvanz-whatsapp-fab:hover,
    .edvanz-whatsapp-fab:focus {
        transform: none;
    }
}

/* ============================================================
   FIX: Gutenberg outline button text visibility
   Issue: WordPress outline style had invisible text on default state
   ============================================================ */
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background),
.wp-block-button.is-style-outline--1 .wp-block-button__link,
.wp-block-button.is-style-outline--2 .wp-block-button__link {
    color: var(--brand-deep, #0A5EB0) !important;
    background-color: transparent !important;
    border: 2px solid var(--brand-deep, #0A5EB0) !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline--1 .wp-block-button__link:hover,
.wp-block-button.is-style-outline--2 .wp-block-button__link:hover {
    background-color: var(--brand-deep, #0A5EB0) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

/* RTL buttons: same styling works */
html[dir="rtl"] .wp-block-button.is-style-outline .wp-block-button__link {
    /* inherit — no RTL-specific overrides needed */
}

   ============================================================ */

body:not(.wp-admin):not(.block-editor-page) {
    background-color: #fdfbf6;
    background-image: radial-gradient(
        ellipse at center,
        #ffffff 0%,
        #fefcf8 40%,
        #fdfbf6 100%
    );
    background-attachment: fixed;
    background-size: cover;
}

/* Content containers stay crisp white so text reads sharply */
.site-content,
.entry-content,
.ast-container,
.site-main,
article.post,
article.page {
    background-color: transparent;
}

/* Header + footer get a slight tint so they're defined */
.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}
/* WARM-BG-V1-END */

/* COOL-BG-V2-START */
/* Stronger blue-tinted background with clearer gradient */

body:not(.wp-admin):not(.block-editor-page) {
    background-color: #e8f0fb;
    background-image: linear-gradient(
        135deg,
        #ffffff 0%,
        #eaf2fc 50%,
        #dceaf8 100%
    );
    background-attachment: fixed;
    min-height: 100vh;
}

.site-content,
.entry-content,
.ast-container,
.site-main,
article.post,
article.page {
    background-color: transparent;
}

.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}
/* COOL-BG-V2-END */


/* MOBILE-FIX-V2-START */
/* ============================================================
   Mobile fixes v2:
   - Tighter spacing between header and page title
   - Smooth gradient on mobile (no banding)
   ============================================================ */

/* Smooth mobile gradient — no tiling, no banding */
@media (max-width: 768px) {
    body:not(.wp-admin):not(.block-editor-page) {
        background-attachment: scroll;
        background-size: 100% 100%;  /* cover full page, not just viewport */
        background-repeat: no-repeat;
        min-height: 100vh;
    }
}

/* Mobile H1 sizing + tighter top spacing */
@media (max-width: 768px) {
    h1.entry-title,
    .entry-header h1,
    .ast-article-single h1:first-child,
    article h1:first-of-type,
    .wp-block-post-title,
    main h1:first-of-type {
        font-size: 28px !important;
        line-height: 1.2 !important;
        margin-top: 16px !important;     /* reduced from 32px */
        margin-bottom: 12px !important;
        padding: 0 8px;
    }
    
    .entry-content h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-top: 20px !important;
    }
    
    .entry-content h2 {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-top: 20px !important;
        margin-bottom: 10px !important;
    }
    
    /* Tighter top padding on content area */
    .site-content,
    .ast-container {
        padding-top: 8px !important;     /* reduced from 16px */
    }
}

/* Tiny screens (iPhone SE, etc.) */
@media (max-width: 400px) {
    h1.entry-title,
    .entry-header h1,
    .wp-block-post-title,
    main h1:first-of-type {
        font-size: 24px !important;
        padding: 0 4px;
    }
}
/* MOBILE-FIX-V2-END */

/* MOBILE-LANG-V1-START */
/* ============================================================
   Show language switcher inline on mobile header (not hidden)
   ============================================================ */

@media (max-width: 921px) {
    /* Force the HTML-1 header module to stay visible on mobile */
    .ast-header-html-1 {
        display: flex !important;
        align-items: center;
        order: 99;              /* push to the right */
        margin-right: 12px;
        padding: 0;
    }
    
    /* Compact styling on mobile */
    .ast-header-html-1 .edvanz-lang-switcher {
        font-size: 13px;
        gap: 4px;
    }
    
    .ast-header-html-1 .edvanz-lang-switcher a {
        padding: 6px 10px;
        border: 1px solid var(--brand-deep, #0A5EB0);
        border-radius: 6px;
        color: var(--brand-deep, #0A5EB0) !important;
        font-weight: 600;
        min-width: 44px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .ast-header-html-1 .edvanz-lang-switcher a:hover,
    .ast-header-html-1 .edvanz-lang-switcher a:active {
        background-color: var(--brand-deep, #0A5EB0);
        color: #fff !important;
    }
    
    /* Make sure the ast-builder-html-element renders */
    .ast-header-html-1 .ast-builder-html-element,
    .ast-header-html-1 .ast-header-html {
        display: inline-flex;
    }
}

/* Very small screens — even more compact */
@media (max-width: 400px) {
    .ast-header-html-1 .edvanz-lang-switcher a {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 40px;
    }
}
/* MOBILE-LANG-V1-END */

/* MOBILE-HEADER-SPACING-V1-START */
/* ============================================================
   Tighten spacing between language switcher and hamburger on mobile
   ============================================================ */
@media (max-width: 921px) {
    /* Remove extra margin from HTML-1 module on mobile */
    .ast-header-html-1 {
        margin: 0 !important;
        padding: 0 4px !important;
    }
    
    /* Remove extra margin from mobile menu toggle */
    .ast-button-wrap,
    .main-header-bar .ast-button-wrap,
    .ast-mobile-header-wrap .ast-button-wrap {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Tighten the right zone flex gap */
    .site-header-section-right,
    .ast-mobile-header-wrap .site-header-primary-section-right {
        gap: 4px !important;
    }
    
    /* Kill any default element margins inside the zone */
    .ast-mobile-header-wrap .ast-builder-layout-element {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
/* MOBILE-HEADER-SPACING-V1-END */
