/*
Theme Name:   Hello Elementor Child — Imadaldin
Theme URI:    https://imadaldin.com
Author URI:   https://codebrillo.com
Description:  Child theme for imadaldin.com. Carries the permalink structure, RTL/Arabic
              typography, imported-content fixes and helper shortcodes. All page layouts
              (header, footer, blog, archives, single listing) are built in Elementor
              Theme Builder — deliberately not in PHP.
Author:       CodeBrillo
Version:      1.3.1
Template:     hello-elementor
Text Domain:  hello-elementor-child
IMAD-BUILD:   1.3.1
*/

/* =============================================================
   1. Arabic typography
   Elementor Global Fonts still governs headings/body. This is the
   safety net so Arabic never falls back to a Latin-only face.
   ============================================================= */
:root {
  --imad-font-ar: "Tajawal", "Cairo", "Segoe UI", Tahoma, sans-serif;
}

body,
body.rtl,
.elementor-widget-text-editor,
.elementor-widget-theme-post-content {
  font-family: var(--imad-font-ar);
}

/* Arabic numerals and Latin fragments inside Arabic text keep their shape */
body.rtl :is(h1, h2, h3, h4, h5, h6) {
  line-height: 1.6;      /* Arabic needs more leading than Latin defaults */
  word-spacing: 0.02em;
}

body.rtl p,
body.rtl li {
  line-height: 2;
}

/* =============================================================
   2. Imported content from the old site
   The 364 listings and 26 posts were authored in a Quill editor.
   Their markup carries ql-* classes and inline styles that mean
   nothing to WordPress. These rules make them render correctly.
   ============================================================= */
.entry-content .ql-direction-rtl,
.elementor-widget-theme-post-content .ql-direction-rtl {
  direction: rtl;
  text-align: right;
}

.entry-content .ql-align-right,
.elementor-widget-theme-post-content .ql-align-right { text-align: right; }

.entry-content .ql-align-center,
.elementor-widget-theme-post-content .ql-align-center { text-align: center; }

.entry-content .ql-align-justify,
.elementor-widget-theme-post-content .ql-align-justify { text-align: justify; }

/* Quill wraps runs in spans with background-color:transparent — harmless but
   it blocks inheritance of link colours in some themes. Neutralise it. */
.entry-content span[style*="background-color: transparent"],
.elementor-widget-theme-post-content span[style*="background-color: transparent"] {
  background: none !important;
}

/* Quill emits <p><br></p> as spacing. Collapse the doubles. */
.entry-content p:empty,
.elementor-widget-theme-post-content p:empty { display: none; }

/* Editing artefact left in one document by Quill — never meant to render. */
.ql-cursor { display: none !important; }

/* 26 images live inside imported post bodies with no width attributes.
   Without this they overflow the column on phones. */
.entry-content img,
.elementor-widget-theme-post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
  border-radius: 8px;
}

/* Long Arabic URLs and unbroken strings must not force horizontal scroll. */
.entry-content,
.elementor-widget-theme-post-content { overflow-wrap: anywhere; }

/* Lists inside imported content sit flush in RTL without this */
body.rtl .entry-content :is(ul, ol),
body.rtl .elementor-widget-theme-post-content :is(ul, ol) {
  padding-right: 1.5em;
  padding-left: 0;
}

/* =============================================================
   3. Header menu — hamburger on phones only (breakpoint 767px)
   Essential Addons Simple Menu widget.
   ============================================================= */
@media (min-width: 768px) {
  .eael-simple-menu-toggle { display: none !important; }
  .eael-simple-menu        { display: flex !important; }
}

@media (max-width: 767px) {
  .eael-simple-menu-toggle { display: block !important; }
  .eael-simple-menu        { display: none; }
  .eael-simple-menu--open  { display: block !important; }
}

/* =============================================================
   4. Service + area filter (shortcode: [imad_filter])
   Intentionally minimal so Elementor styling can take over.
   ============================================================= */
.imad-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.imad-filter select,
.imad-filter button {
  flex: 1 1 200px;
  padding: 14px 16px;
  font: inherit;
  font-family: var(--imad-font-ar);
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
}

.imad-filter button {
  flex: 0 0 auto;
  cursor: pointer;
  border: 0;
  background: #2a4759;   /* the old site's brand colour */
  color: #fff;
  font-weight: 700;
  padding-inline: 32px;
}

.imad-filter button:hover { filter: brightness(1.1); }

@media (max-width: 767px) {
  .imad-filter { flex-direction: column; }
  .imad-filter select,
  .imad-filter button { flex: 1 1 auto; width: 100%; }
}

/* =============================================================
   5. Contact buttons (shortcodes: [imad_whatsapp] [imad_call])
   ============================================================= */
.imad-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-family: var(--imad-font-ar);
}

.imad-btn--whatsapp { background: #25d366; color: #fff; }
.imad-btn--call     { background: #2a4759; color: #fff; }
.imad-btn:hover     { filter: brightness(1.08); color: #fff; }

/* =============================================================
   6. Small RTL corrections for Elementor defaults
   ============================================================= */
body.rtl .elementor-icon-list-item > a { flex-direction: row-reverse; }
body.rtl .elementor-widget-breadcrumbs { text-align: right; }
