/*
Theme Name: Daleel Albait – دليل البيت
Theme URI: https://daleelalbait.com
Author: Daleel Albait
Description: قالب عربي بسيط وسريع لموقع دليل البيت، مصمم للعمل مع إضافة Daleel Directory و Elementor. يدعم الاتجاه من اليمين لليسار، القوائم، الشعار المخصص، وصفحات الشركات وأنواع الخدمات.
Version: 5.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: daleelalbait
Tags: rtl-language-support, custom-logo, custom-menu, featured-images, one-column
*/

:root {
  --bg: #fcfcfc;
  --bg-soft: #ffffff;
  --surface: #f2f2f0;
  --text: #111111;
  --muted: #6b7280;
  --border: #ececea;
  --dark: #111111;
  --on-dark: #ffffff;
  --card: #ffffff;
  --logo-ink: #017931;
  --shadow: 0 10px 30px rgba(20,20,20,.06);
  --accent: #ff7800;
  --brand-green: #017931;
  /* Identity palette */
  --green: #017931;
  --green-dark: #014a1e;
  --lime: #d5f466;
  --yellow: #ffd130;
  --navy: #253a69;
  --beige: #e1d4ba;
  --maroon: #6b3d3d;
  --orange-100: #fff1e0;
  --orange-200: #ffd9b3;
  --orange-300: #ffab5c;
  --orange-900: #7a3800;
  --yellow-100: #fff3c2;
  --d-accent: var(--accent);
  --radius: 16px;
  --container: 1140px;
  --header-h: 72px;
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

/* ---------- Dark mode ---------- */
:root[data-theme="dark"] {
  --bg: #121316;
  --bg-soft: #17181c;
  --surface: #23252b;
  --card: #1b1d22;
  --text: #f3f4f6;
  --muted: #a2a6ae;
  --border: #2c2f36;
  --dark: #f3f4f6;
  --on-dark: #16181c;
  --logo-ink: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* The plugin's components follow the theme (beats the plugin's own defaults on specificity) */
:root .daleel {
  --d-text: var(--text);
  --d-muted: var(--muted);
  --d-surface: var(--surface);
  --d-border: var(--border);
  --d-dark: var(--dark);
  --d-accent: var(--accent);
  --d-card: var(--card);
  --d-mix: var(--card);
}
:root .daleel .daleel-btn-dark,
:root .daleel .daleel-chips-filter .daleel-chip-plain.on,
:root .daleel .daleel-page.on { color: var(--on-dark) !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  text-align: start; /* direction comes from <html dir>: rtl in Arabic, ltr in English */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.site-main { flex: 1; }
img, video, iframe { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1em; }
.daleel, .daleel * { font-family: inherit; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.section { padding-block: 40px 64px; }
.section-sm { padding-block: 0 48px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.screen-reader-text, .skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 100; background: var(--dark); color: #fff; padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn, .wp-block-button__link, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 10px 20px;
  font: inherit; font-size: .92rem; font-weight: 600; line-height: 1.4;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: opacity .15s, transform .15s;
}
.btn:hover, input[type=submit]:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn-dark, input[type=submit] { background: var(--dark); color: var(--on-dark); }
.btn-dark:hover { color: var(--on-dark); }
.btn-light { background: var(--surface); color: var(--text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.admin-bar .site-header { top: 32px; }
.site-header-inner { display: flex; align-items: center; gap: 32px; min-height: var(--header-h); }
.site-brand { flex: none; }
.site-logo { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text); line-height: 1; }
.site-logo:hover { color: var(--text); }
.site-logo span { font-size: 1.65rem; font-weight: 700; letter-spacing: -.5px; }
.site-logo img { display: block; height: 46px; width: auto; }
.site-footer .site-logo img { height: 40px; }
.custom-logo-link img { max-height: 48px; width: auto; display: block; }

.site-nav { flex: 1; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 500; padding-block: 8px; display: block; }
.site-nav a:hover { color: var(--text); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--accent); font-weight: 700; }
.site-nav li { position: relative; }
.site-nav .sub-menu {
  display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 200px; flex-direction: column; gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow);
}
.site-nav .sub-menu a { padding: 8px 12px; border-radius: 8px; }
.site-nav .sub-menu a:hover { background: var(--surface); }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: flex; }

.site-header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.site-nav .nav-cta { display: none; } /* stronger than ".site-nav a", which would show it on desktop */
/* Phones: logo + language + mode + search + menu fit in one row; "Add your business" moves into the menu */
@media (max-width: 560px) {
  .site-header-actions { gap: 4px; }
  .site-header-actions .icon-btn { width: 36px; height: 36px; }
  .site-header-actions .lang-switch { width: auto; padding-inline: 10px; }
  .site-cta { display: none; }
  .nav-cta { display: flex; margin-top: 14px; }
  .site-nav a.nav-cta, .site-nav a.nav-cta:hover { display: flex; justify-content: center; padding: 12px 20px; border-bottom: 0; background: var(--dark); color: var(--on-dark); font-weight: 600; }
  .site-header .site-logo svg.brand-logo { height: 34px; }
  .site-header .site-logo svg.brand-logo-en { height: 24px; }
}
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--surface);
  cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Page content ---------- */
.page-header { margin-bottom: 28px; }
.page-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 0 0 6px; }
.section-title { font-size: 1.2rem; margin-bottom: 16px; }
.entry-content > * + * { margin-top: 1em; }
.entry-content h2 { font-size: 1.5rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content blockquote { margin: 1.5em 0; padding: 12px 20px; border-inline-start: 4px solid var(--dark); background: var(--surface); border-radius: 0 12px 12px 0; }
.entry-content img { border-radius: 12px; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: start; }
.entry-content-wide { width: 100%; }
.entry-content-wide > *:not(.elementor):not(.alignfull) { max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
.alignwide { max-width: 1280px; margin-inline: auto; }
.alignfull { width: 100%; max-width: none; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { border-radius: var(--radius); width: 100%; }
.entry-tags a { display: inline-block; background: var(--surface); border-radius: 999px; padding: 2px 12px; font-size: .85rem; text-decoration: none; margin-inline-end: 4px; }

/* ---------- Posts grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.post-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.post-card-thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.post-card-body { padding: 18px 20px 20px; }
.post-card-title { font-size: 1.1rem; margin: 0 0 6px; }
.post-card-title a { text-decoration: none; }
.post-card-excerpt { color: var(--muted); font-size: .92rem; margin: 0; }

.pagination, .nav-links { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.page-numbers { min-width: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; text-align: center; text-decoration: none; }
.page-numbers.current { background: var(--dark); color: #fff; border-color: var(--dark); }
.post-navigation .nav-links { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 20px; }
.post-navigation a { text-decoration: none; font-weight: 600; }

/* ---------- Company page ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.company-head { margin-bottom: 26px; }
.company-head-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.company-head-tags a { text-decoration: none; }
.company-head-tags a:hover .daleel-tag { filter: brightness(.95); outline: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.company .page-title { margin: 0 0 6px; }
.company-place { color: var(--muted); margin: 0; font-size: .95rem; }

.company-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; }
.company-block + .company-block { margin-top: 28px; }
.company-block h2 { font-size: 1.05rem; margin: 0 0 12px; }
.company-block .entry-content { font-size: 1rem; line-height: 1.9; }
.company-map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 9; background: var(--surface); }
.company-map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Panels */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 26px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 10px; }

/* Sticky contact card */
.contact-card {
  position: sticky; top: calc(var(--header-h) + 20px);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.contact-card h2 { font-size: 1rem; margin: 0 0 4px; }
.contact-main { justify-content: center; gap: 8px; }
.contact-wa { background: #25a244; color: #fff; justify-content: center; }
.contact-wa:hover { color: #fff; }
.contact-copy { justify-content: center; }
.contact-link {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: .9rem; text-decoration: none; cursor: pointer; text-align: start;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }
.contact-link svg { width: 18px; height: 18px; flex: none; }
.contact-note { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }
.contact-copy.is-done { background: color-mix(in srgb, var(--accent) 18%, var(--card)); color: var(--accent); }
/* Section heading with a link on the far side */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-head .section-title { margin: 0; }

/* Other companies: a plain band, slightly darker than the page */
.company-related {
  margin: 48px 0 -64px; padding-block: 36px 44px;
  background: var(--surface); border-top: 1px solid var(--border);
  /* stretches edge to edge without causing horizontal scroll */
  box-shadow: 0 0 0 100vmax var(--surface); clip-path: inset(0 -100vmax);
}
.company-related .section-title { font-size: 1.15rem; }
.company-related .daleel-card { background: var(--card); }
@media (max-width: 900px) {
  .company-layout { grid-template-columns: 1fr; gap: 28px; }
  .contact-card { position: static; }
}
/* ---------- Forms ---------- */
input[type=text], input[type=search], input[type=email], input[type=url], input[type=tel], input[type=password], input[type=number], textarea, select {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--text); }
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form input[type=search] { flex: 1; min-width: 0; }
.empty-state { background: var(--surface); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state .search-form { margin: 16px auto 0; }
.big-404 { font-size: clamp(4rem, 14vw, 7rem); font-weight: 700; line-height: 1; margin: 0 0 8px; letter-spacing: -2px; }

/* ---------- Comments ---------- */
.comments { border-top: 1px solid var(--border); padding-top: 32px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-form label { display: block; font-weight: 500; margin-bottom: 4px; }
.comment-form textarea, .comment-form input:not([type=submit]):not([type=checkbox]) { width: 100%; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 40px; }
.site-footer-top {
  display: grid; grid-template-columns: 1.6fr repeat(2, minmax(0, .8fr)); gap: 28px 40px;
  padding-block: 32px 24px; align-items: start;
}
.footer-brand p { color: var(--muted); font-size: .9rem; margin: 10px 0 0; max-width: 340px; }
.footer-social { list-style: none; display: flex; gap: 8px; margin: 14px 0 0; padding: 0; }
.footer-social a {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }
.footer-social svg { width: 19px; height: 19px; }
.footer-social svg[fill="currentColor"] { width: 16px; height: 16px; } /* solid logos (X) look heavier than the outline icons */
.footer-col h2 { font-size: .92rem; margin: 0 0 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.footer-col a:hover { color: var(--accent); }
.site-footer-bottom {
  border-top: 1px solid var(--border); padding-block: 14px; color: var(--muted); font-size: .85rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-cta { font-size: .85rem; padding: 8px 18px; }
.footer-credit::before { content: "·"; margin-inline: 6px; }
.footer-credit a { color: var(--text); font-weight: 500; text-decoration: none; }
.footer-credit a:hover { color: var(--accent); }
.footer-credit a, .footer-updated a { white-space: nowrap; }
/* Phones: copyright, credit and "last added" each on their own line, no stray separator dots */
@media (max-width: 640px) {
  .site-footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; padding-block: 16px 20px; line-height: 1.6; }
  .footer-credit { display: block; margin-top: 2px; }
  .footer-credit::before { content: none; }
}
/* The grey "other companies" band sits directly on the footer, with no empty strip between them */
body:has(.company-related) .site-footer { margin-top: 0; }
/* On tall screens the band grows down to the footer instead of leaving empty page below it */
body:has(.company-related) .site-main { display: flex; flex-direction: column; }
.company:has(.company-related) { flex: 1; display: flex; flex-direction: column; }
.company:has(.company-related) > .company-related { flex: 1; }

@media (max-width: 860px) {
  .site-footer-top { grid-template-columns: 1fr 1fr; gap: 24px 28px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .site-footer-top { grid-template-columns: 1fr; }
}

/* Logo colours follow the mode */
.site-logo svg.brand-logo { display: block; height: 46px; width: auto; }
.site-footer .site-logo svg.brand-logo { height: 40px; }
/* English logo: a wide wordmark, so it is set lower to carry the same visual weight as the Arabic one */
.site-logo svg.brand-logo-en { height: 36px; }
.site-footer .site-logo svg.brand-logo-en { height: 30px; }
.site-logo .st1 { fill: var(--logo-ink); }
.site-logo .st0 { fill: var(--accent); }

/* Light / dark switch */
.theme-toggle { border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ---------- Front page ---------- */
.is-front .daleel-hero { padding-block: clamp(48px, 10vh, 110px) 64px; }
.daleel { --d-accent: var(--accent); --d-surface: var(--surface); --d-border: var(--border); }
.home-section { padding-block: 32px; }
/* Breathing room between the hero and the categories */
.home-cats { padding-block: clamp(48px, 7vw, 88px) 32px; }

/* Hero — centred headline + wide search */
.home-hero { padding-block: clamp(44px, 7vw, 86px) 8px; text-align: center; }
.home-hero-inner { max-width: 760px; }
.home-badge {
  display: inline-block; background: var(--yellow); color: var(--green-dark);
  font-size: .82rem; font-weight: 700; padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.home-title { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.4; font-weight: 700; letter-spacing: -.4px; margin: 0 0 12px; }
.hl { display: inline-block; background: var(--dark); color: var(--on-dark); border-radius: 999px; padding: 0 .38em .08em; line-height: 1.25; }
.home-subtitle { color: #555; font-size: 1.05rem; margin: 0 0 28px; }
.home-search.daleel-search {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 999px; padding: 7px;
  max-width: 620px; margin-inline: auto; box-shadow: var(--shadow);
}
.home-search.daleel-search:focus-within { border-color: var(--text); }
.home-search.daleel-search input[type=text] { padding: 12px 18px; font-size: 1.05rem; }
.home-search .daleel-search-text-btn { padding: 12px 30px; }
.home-quick {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  margin: 18px 0 0; color: var(--muted); font-size: .9rem;
}
.home-quick a {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px;
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
.home-quick a:hover { border-color: var(--accent); color: var(--accent); }

/* Hero link */
.home-link {
  display: inline-block; font-weight: 700; font-size: .95rem; color: var(--text);
  text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px;
}
.home-link:hover { color: var(--accent); }
/* Category tiles on the cream background */
.daleel-cats-title { font-weight: 700; }

/* "Add your business" banner: orange panel + steps card */
.home-cta {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center;
  background: var(--accent); color: #fff; border-radius: 28px; padding: 40px clamp(24px, 4vw, 48px);
}
.home-cta h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.45; margin: 0 0 10px; }
.home-cta p { margin: 0 0 20px; opacity: .92; font-size: .95rem; }
.home-cta .hl { background: var(--dark); color: var(--on-dark); }
.home-cta-btn { background: #fff; color: #111; padding: 12px 26px; font-weight: 700; }
.home-cta-btn:hover { color: #111; }

.home-steps { list-style: none; margin: 0; padding: 22px; background: var(--card); color: var(--text); border-radius: 20px; }
.home-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.home-step + .home-step { border-top: 1px dashed var(--border); }
.home-step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent);
  font-weight: 700; font-size: .85rem; line-height: 1;
}
.home-step strong { display: block; font-size: .95rem; }
.home-step span span, .home-step > span > span { color: var(--muted); font-size: .82rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); }
.icon-btn:hover { background: var(--surface); color: var(--text); }
/* Language switch: "EN" on Arabic pages, "عربي" on English pages */
.lang-switch { width: auto; min-width: 40px; padding-inline: 12px; border-radius: 999px; border: 1px solid var(--border); font-size: .85rem; font-weight: 600; text-decoration: none; letter-spacing: .02em; }
.lang-switch:hover { border-color: var(--text); }

@media (max-width: 900px) {
  .home-hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .home-art { max-width: 380px; }
  .home-cta { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .art-card strong { font-size: 1.6rem; }
  .art-card .daleel-icon { width: 34px; height: 34px; }
  .art-card { border-radius: 18px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .company-layout { grid-template-columns: 1fr; }
  .company-related { position: static; }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .site-header-inner { gap: 12px; }
  .site-logo span { font-size: 1.4rem; }
  .site-logo img { height: 36px; }
  .nav-toggle { display: inline-flex; }
  .site-cta { padding: 8px 14px; font-size: .85rem; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: var(--card);
    border-bottom: 1px solid var(--border); box-shadow: 0 16px 30px rgba(0,0,0,.06);
    padding: 8px 16px 16px; display: none;
  }
  .admin-bar .site-nav { top: calc(var(--header-h) + 46px); }
  .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .site-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding: 0; padding-inline-start: 16px; }
  .section { padding-block: 28px 48px; }
  .company-logo img { width: 64px; height: 64px; object-fit: contain; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Dark mode: lift the service colours so dark hues stay readable */
:root[data-theme="dark"] .daleel .daleel-tag {
  background: color-mix(in srgb, var(--c) 26%, var(--card));
  color: color-mix(in srgb, var(--c) 45%, #ffffff);
}
:root[data-theme="dark"] .daleel .daleel-chips-filter .daleel-chip:not(.on) {
  background: color-mix(in srgb, var(--c) 26%, var(--card));
  color: var(--text) !important;
}
:root[data-theme="dark"] .daleel .daleel-cat:hover { box-shadow: 0 8px 22px rgba(0,0,0,.5); }
:root[data-theme="dark"] .home-cta-btn { background: #fff; color: #16181c; }

/* Dark mode: calmer — muted colour accents instead of solid fills */
:root[data-theme="dark"] .daleel .daleel-cat-icon {
  background: color-mix(in srgb, var(--c) 20%, var(--card));
  color: color-mix(in srgb, var(--c) 55%, #ffffff);
}
:root[data-theme="dark"] .daleel .daleel-btn-wa {
  background: color-mix(in srgb, var(--d-wa) 72%, #0e1013);
  color: #eef8f1 !important;
}
:root[data-theme="dark"] .daleel .daleel-chip { background: color-mix(in srgb, var(--c) 30%, var(--card)); border-color: transparent; color: var(--text) !important; }
/* The active plain chip ("All") keeps the inverted look so its text stays readable */
:root[data-theme="dark"] .daleel .daleel-chips-filter .daleel-chip-plain.on { background: var(--dark); border-color: var(--dark); color: var(--on-dark) !important; }
:root[data-theme="dark"] .home-quick a:hover { border-color: var(--border); color: var(--text); }

/* The orange banner becomes a quiet panel with one orange accent */
:root[data-theme="dark"] .home-cta { background: var(--bg-soft); border: 1px solid var(--border); }
:root[data-theme="dark"] .home-cta h2 { color: var(--text); }
:root[data-theme="dark"] .home-cta p { color: var(--muted); opacity: 1; }
:root[data-theme="dark"] .home-steps { border: 1px solid var(--border); }
:root[data-theme="dark"] .home-cta .hl { background: var(--accent); color: #16181c; }
:root[data-theme="dark"] .home-cta-btn { background: var(--accent); color: #16181c; box-shadow: none; }

/* Softer edges overall */
:root[data-theme="dark"] .daleel .daleel-card,
:root[data-theme="dark"] .post-card { box-shadow: none; }
:root[data-theme="dark"] .home-search.daleel-search { box-shadow: none; }
.footer-updated { color: var(--muted); }
.footer-updated a { color: var(--text); font-weight: 600; text-decoration: none; }
.footer-updated a:hover { color: var(--accent); }

/* Working hours */
.hours-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hours-head h2 { margin: 0; }
.hours-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hours-list li { display: flex; gap: 8px; font-size: .95rem; }
.hours-list li::before { content: "•"; color: var(--accent); }
.hours-note { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }
/* Description: two lines, then "read more" */
.about-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.about-text.is-open { display: block; }
.read-more {
  margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 700; color: var(--accent);
}
.read-more:hover { text-decoration: underline; }
:root[data-theme="dark"] .daleel .daleel-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.5); }

/* Company logo in the page header (shown only when the company has one) */
.company-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.company-head-main { flex: 1 1 320px; }
.company-logo {
  margin: 0; flex: none; width: clamp(120px, 18vw, 190px); aspect-ratio: 4 / 3;
  display: grid; place-items: center;
}
.company-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
/* Logos have no box, except in dark mode where dark logo text needs a light plate to stay readable */
:root[data-theme="dark"] .company-logo { background: #f7f7f5; border-radius: 18px; padding: 12px; }
:root[data-theme="dark"] .daleel-logo img { background: #f7f7f5; border-radius: 10px; padding: 4px; }
@media (max-width: 640px) {
  .company-head { gap: 16px; }
  .company-logo { width: 110px; }
}

/* English pages: company names and descriptions that are still in Arabic keep their own direction
   (punctuation on the right side) while lining up with the English layout */
:root:not([dir=rtl]) .company-head .page-title,
:root:not([dir=rtl]) .about-text,
:root:not([dir=rtl]) .daleel-card-title,
:root:not([dir=rtl]) .daleel .daleel-desc,
:root:not([dir=rtl]) .footer-updated a { unicode-bidi: plaintext; text-align: left; }

/* Verified badge: lighter green on dark backgrounds */
:root[data-theme="dark"] .daleel-verified { color: #5fd08d; }
/* Subscribed card on the grey "other companies" band and in dark mode */
.company-related .daleel-card.is-featured { background: color-mix(in srgb, #ffd130 9%, var(--card)); }
:root[data-theme="dark"] .daleel .daleel-card.is-featured { background: color-mix(in srgb, #ffd130 7%, var(--card)); border-color: color-mix(in srgb, #ffd130 45%, var(--border)); }

/* "كلمات مرتبطة" on the company page: the words people search with, as small links */
.company-keywords h2 { font-size: 1rem; }
.keyword-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-list a {
  display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: .85rem; text-decoration: none;
  color: var(--muted); background: var(--card); border: 1px solid var(--border); transition: color .15s, border-color .15s;
}
.keyword-list a::before { content: "#"; opacity: .5; margin-inline-end: 2px; }
.keyword-list a:hover { color: var(--text); border-color: var(--accent); }
.keyword-list.is-collapsed .is-extra { display: none; }
.keyword-more button {
  font: inherit; font-size: .8rem; padding: 5px 10px; border: 0; background: none; cursor: pointer;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.keyword-more button:hover { color: var(--text); }
