/*
Theme Name: Almaeena
Theme URI: https://almaeena.net/
Author: Eworld
Author URI: https://eworld.co.in/
Description: Custom editorial theme for Khaled Almaeena — bilingual (English / Arabic, right-to-left aware), built for Elementor. Brand colours: Green Truth teal with gold.
Version: 1.1.4
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: almaeena
Tags: custom-logo, custom-menu, rtl-language-support, one-column, editor-style
*/

/* ================= Tokens ================= */
:root {
	--alm-deep: #0F3B3A;      /* ink green: header, hero, footer */
	--alm-green: #1E6B66;     /* Green Truth: links, actions */
	--alm-gold: #C9A23A;      /* focus, active states, the ring */
	--alm-paper: #F4F7F6;     /* page background */
	--alm-ink: #142423;       /* headings */
	--alm-body: #33413F;      /* running text */
	--alm-muted: #4C5F5D;
	--alm-mist: #D9E4E1;      /* rules, borders */
	--alm-on-deep: #E7F0EE;   /* text on ink green */
	--alm-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
	--alm-arabic: "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
	--alm-wrap: 75rem;
	--alm-gutter: clamp(1rem, 4vw, 2.5rem);
	--alm-measure: 42rem;
}

/* ================= Base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
	margin: 0;
	background: var(--alm-paper);
	color: var(--alm-body);
	font-family: var(--alm-serif);
	font-size: 1.125rem;
	line-height: 1.65;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
}
:lang(ar), [lang="ar"] { font-family: var(--alm-arabic); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--alm-green); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--alm-deep); }
:focus-visible { outline: 3px solid var(--alm-gold); outline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { color: var(--alm-ink); font-family: var(--alm-serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4.25rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.85rem); letter-spacing: -.01em; }
h3 { font-size: clamp(1.35rem, 1.2rem + .6vw, 1.65rem); }
h4 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
	overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto !important; clip-path: none; height: auto; width: auto; margin: 0; z-index: 100000;
	left: 1rem; top: 1rem; padding: .75rem 1rem; background: #fff; color: var(--alm-deep);
}
.alm-wrap { width: 100%; max-width: calc(var(--alm-wrap) + 2 * var(--alm-gutter)); margin-inline: auto; padding-inline: var(--alm-gutter); }

/* ================= Header ================= */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--alm-deep); color: var(--alm-on-deep);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.site-header__bar { display: flex; align-items: center; gap: 2rem; min-height: 4.75rem; }
.site-brand { display: flex; align-items: center; margin-right: auto; text-decoration: none; color: #fff; }
.site-brand img { display: block; width: auto; max-height: 2.1rem; }
.site-brand__name { font-size: 1.45rem; letter-spacing: .02em; font-weight: 600; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: .25rem; align-items: center; }
.site-nav li { position: relative; }
.site-nav a {
	display: block; padding: .55rem .8rem; color: var(--alm-on-deep);
	text-decoration: none; font-size: 1.0625rem; border-radius: 2px;
}
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a, .site-nav .current_page_item > a {
	color: #fff; box-shadow: inset 0 -2px 0 var(--alm-gold);
}
.site-nav .menu-item-has-children > a::after {
	content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em; vertical-align: .2em;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.site-nav .sub-menu {
	position: absolute; left: 0; top: 100%; min-width: 12rem; padding: .4rem;
	background: #fff; border-radius: 3px; box-shadow: 0 12px 30px rgba(15, 59, 58, .2);
	opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { color: var(--alm-ink); }
.site-nav .sub-menu a:hover { color: var(--alm-green); box-shadow: none; background: var(--alm-paper); }

.alm-button, .site-header__cta {
	display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.15rem;
	font-family: var(--alm-serif); font-size: 1.0625rem; line-height: 1.2; text-decoration: none;
	border: 1px solid var(--alm-gold); border-radius: 2rem; color: #fff; background: transparent; cursor: pointer;
}
.site-header__cta:hover { background: var(--alm-gold); color: var(--alm-deep); }

.site-header__toggle {
	display: none; align-items: center; gap: .55rem; padding: .55rem .9rem; font: inherit; font-size: 1rem;
	color: #fff; background: transparent; border: 1px solid rgba(231, 240, 238, .4); border-radius: 2rem; cursor: pointer;
}
.site-header__toggle-icon, .site-header__toggle-icon::before, .site-header__toggle-icon::after {
	display: block; width: 1.1rem; height: 1.5px; background: currentColor; position: relative; content: "";
}
.site-header__toggle-icon::before { position: absolute; top: -5px; }
.site-header__toggle-icon::after { position: absolute; top: 5px; }

@media (max-width: 960px) {
	.site-header__toggle { display: inline-flex; }
	.site-header__cta { display: none; }
	.site-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		background: var(--alm-deep); border-top: 1px solid rgba(231, 240, 238, .15);
		padding: .5rem var(--alm-gutter) 1.5rem; display: none; max-height: calc(100vh - 4.75rem); overflow-y: auto;
	}
	.site-nav.is-open { display: block; }
	.site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
	.site-nav a { padding: .85rem 0; font-size: 1.2rem; border-bottom: 1px solid rgba(231, 240, 238, .1); }
	.site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; background: transparent; box-shadow: none; padding: 0 0 0 1rem; }
	.site-nav .sub-menu a { color: var(--alm-on-deep); }
	.site-nav .sub-menu a:hover { background: transparent; color: #fff; }
	.site-nav .menu-item-has-children > a::after { display: none; }
	.site-nav__cta { display: block; margin-top: 1.25rem; }
	.site-nav__cta .alm-button { justify-content: center; width: 100%; }
}
@media (min-width: 961px) { .site-nav__cta { display: none; } }

/* ================= Page header band (non-Elementor pages, archives) ================= */
.page-band { background: var(--alm-deep); color: var(--alm-on-deep); padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.page-band h1 { color: #fff; margin: 0; }
.page-band p { max-width: var(--alm-measure); margin: .9rem 0 0; font-size: 1.2rem; }

.site-main { display: block; }
.content-area { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 7vw, 6rem); }

/* ================= Single article ================= */
.article-head { padding: clamp(3rem, 7vw, 5.5rem) 0 2rem; }
.article-head__inner, .article-body, .article-foot { max-width: var(--alm-measure); margin-inline: auto; }
.article-head__cat { display: inline-block; margin-bottom: 1rem; font-size: 1rem; text-decoration: none; color: var(--alm-green); }
.article-head__cat:hover { text-decoration: underline; }
.article-head h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.5rem); line-height: 1.1; }
.article-head__date { color: var(--alm-muted); font-size: 1rem; margin: 0; }
.article-head__rule { width: 4rem; height: 3px; background: var(--alm-gold); border: 0; margin: 1.75rem 0 0; }

.article-body { font-size: 1.1875rem; line-height: 1.72; padding-bottom: 2.5rem; }
.article-body > * + * { margin-top: 0; }
.article-body p { margin-bottom: 1.15em; }
.article-body h2, .article-body h3 { margin-top: 1.6em; }
.article-body h4 {
	font-size: 1rem; letter-spacing: .08em; color: var(--alm-green); margin-top: 2.5rem;
	padding-top: 1.25rem; border-top: 1px solid var(--alm-mist); font-weight: 600;
}
.article-body img { height: auto; border-radius: 2px; }
.article-body blockquote { margin: 1.75rem 0; padding: .25rem 0 .25rem 1.5rem; border-left: 3px solid var(--alm-gold); font-size: 1.3rem; color: var(--alm-ink); }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body a:empty { display: none; }

.is-arabic .article-head__inner, .is-arabic .article-body { direction: rtl; text-align: right; font-family: var(--alm-arabic); }
.is-arabic .article-head h1 { font-family: var(--alm-arabic); line-height: 1.5; font-weight: 600; font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem); }
.is-arabic .article-body { font-size: 1.25rem; line-height: 2.05; }
.is-arabic .article-body blockquote { border-left: 0; border-right: 3px solid var(--alm-gold); padding: .25rem 1.5rem .25rem 0; }
.is-arabic .article-body h4 { letter-spacing: 0; }
.is-arabic .article-head__rule { margin-right: 0; margin-left: auto; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1.25rem 0; border-top: 1px solid var(--alm-mist); border-bottom: 1px solid var(--alm-mist); }
.share__label { margin-right: .5rem; color: var(--alm-muted); font-size: 1rem; }
.share a, .share button {
	display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; font: inherit; font-size: .95rem;
	border: 1px solid var(--alm-mist); border-radius: 2rem; background: #fff; color: var(--alm-ink); text-decoration: none; cursor: pointer;
}
.share a:hover, .share button:hover { border-color: var(--alm-green); color: var(--alm-green); }

.more-articles { background: #fff; padding: clamp(3rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--alm-mist); }
.more-articles__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.more-articles__head h2 { margin: 0; font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 1.75rem 0 3.5rem; }
.post-nav a { text-decoration: none; display: block; }
.post-nav span { display: block; font-size: .95rem; color: var(--alm-muted); }
.post-nav strong { font-weight: 500; color: var(--alm-ink); font-size: 1.15rem; line-height: 1.3; display: block; }
.post-nav a:hover strong { color: var(--alm-green); text-decoration: underline; }
.post-nav__next { text-align: right; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } .post-nav__next { text-align: left; } }

/* ================= Footer (fallback when no Elementor footer is set) ================= */
.site-footer { background: var(--alm-deep); color: var(--alm-on-deep); }
.site-footer a { color: #fff; }
.footer-fallback { padding: clamp(3.5rem, 8vw, 6rem) 0 2rem; }
.footer-fallback__lead { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); color: #fff; line-height: 1.1; margin: 0 0 .75rem; }
.footer-fallback__mail { font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem); }
.footer-fallback__social { display: flex; gap: 1.5rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.site-footer__base { border-top: 1px solid rgba(231, 240, 238, .15); padding: 1.25rem 0; font-size: .95rem; }
.site-footer__base .alm-wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer__base nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }

/* ================= Archives, search, 404 ================= */
.archive-list { max-width: 52rem; }
.not-found { max-width: var(--alm-measure); }
.not-found .alm-search { margin-top: 1.5rem; }

/* ================= Elementor integration ================= */
.elementor-page .site-main > .elementor { width: 100%; }
.elementor-widget-text-editor { font-size: 1.125rem; line-height: 1.68; color: var(--alm-body); }
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.elementor-widget-heading .elementor-heading-title { font-family: var(--alm-serif); line-height: 1.15; }
.elementor-widget-heading h1.elementor-heading-title { line-height: 1.05; }
.alm-hero-name .elementor-heading-title { font-size: clamp(3rem, 1.9rem + 4.6vw, 5.75rem); letter-spacing: -.02em; line-height: 1.02; }
.alm-statement .elementor-heading-title { font-size: clamp(1.6rem, 1.15rem + 1.7vw, 2.55rem); line-height: 1.24; font-weight: 400; max-width: 30ch; }
p.elementor-heading-title { color: var(--alm-ink); }
.alm-on-deep p.elementor-heading-title { color: #fff; }
.alm-muted p { color: var(--alm-muted); font-size: 1rem; }
.alm-facts .elementor-widget-heading { margin-top: .75rem; }
.alm-facts .elementor-widget-heading:first-child { margin-top: 0; }
.alm-footer-lead .elementor-heading-title { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.75rem); }

/* Buttons built with the Elementor Button widget + class alm-btn */
.elementor-widget.alm-btn .elementor-button {
	background: var(--alm-green); color: #fff; border: 1px solid var(--alm-green); border-radius: 2rem;
	padding: .85rem 1.5rem; font-size: 1.0625rem; line-height: 1.2; font-weight: 500;
}
.elementor-widget.alm-btn .elementor-button:hover, .elementor-widget.alm-btn .elementor-button:focus-visible { background: var(--alm-deep); border-color: var(--alm-deep); color: #fff; }
.elementor-widget.alm-btn--outline .elementor-button { background: transparent; color: var(--alm-green); }
.elementor-widget.alm-btn--outline .elementor-button:hover { background: var(--alm-green); color: #fff; }
.alm-on-deep .elementor-widget.alm-btn .elementor-button { background: var(--alm-gold); border-color: var(--alm-gold); color: var(--alm-deep); }
.alm-on-deep .elementor-widget.alm-btn .elementor-button:hover { background: #fff; border-color: #fff; }
.alm-social .elementor-social-icon:hover { background-color: var(--alm-gold) !important; }
.alm-social .elementor-social-icon:hover svg, .alm-social .elementor-social-icon:hover i { fill: var(--alm-deep); color: var(--alm-deep); }
.elementor-button { font-family: var(--alm-serif); }
.alm-on-deep, .alm-on-deep p { color: var(--alm-on-deep); }
.alm-on-deep h1, .alm-on-deep h2, .alm-on-deep h3, .alm-on-deep .elementor-heading-title { color: #fff; }
.alm-on-deep .alm-video__title { color: #fff; }
.alm-on-deep a:not(.elementor-button) { color: #fff; }
.alm-kicker .elementor-heading-title { font-size: 1.05rem !important; font-style: italic; color: var(--alm-gold) !important; font-weight: 400; letter-spacing: .01em; }
.alm-lede p { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.45rem); line-height: 1.55; }
.alm-statement .elementor-heading-title { max-width: 26ch; }
.alm-newspaper img { box-shadow: 0 18px 40px rgba(15, 59, 58, .18); border-radius: 2px; }
.alm-gallery .gallery-item img { border-radius: 2px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.alm-gallery .gallery-item a { display: block; }
.alm-photo img { border-radius: 2px; }
.alm-form .wpcf7-form p { margin: 0 0 1rem; }

/* Contact Form 7 */
.wpcf7-form label { display: block; font-size: 1rem; color: var(--alm-ink); margin-bottom: .3rem; }
.wpcf7-form input[type="text"], .wpcf7-form input[type="email"], .wpcf7-form input[type="tel"], .wpcf7-form textarea {
	width: 100%; padding: .75rem .9rem; font: inherit; font-size: 1.05rem; color: var(--alm-ink);
	background: #fff; border: 1px solid #B9CBC7; border-radius: 2px;
}
.wpcf7-form input:focus, .wpcf7-form textarea:focus { outline: 3px solid var(--alm-gold); outline-offset: 1px; border-color: var(--alm-green); }
.wpcf7-form textarea { min-height: 9rem; }
.wpcf7-form .alm-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .wpcf7-form .alm-form__row { grid-template-columns: 1fr; } }
.wpcf7-submit {
	padding: .8rem 1.6rem; font: inherit; font-size: 1.1rem; border: 0; border-radius: 2rem; cursor: pointer;
	background: var(--alm-green); color: #fff;
}
.wpcf7-submit:hover { background: var(--alm-deep); }
.wpcf7-not-valid-tip { font-size: .95rem; color: #9B2C1F; }
.wpcf7 form .wpcf7-response-output { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .site-footer, .share, .more-articles { display: none; }
	body { background: #fff; }
}
