/*
Theme Name: Digital House
Theme URI: https://www.digitalhouseme.com/
Author: Digital House
Description: Bilingual (Arabic / English) block theme for the Digital House corporate website. All content is edited in the WordPress Site Editor and page editor — no code required.
Version: 1.0.3
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: digitalhouse
Tags: block-theme, full-site-editing, rtl-language-support, translation-ready
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(html[dir="rtl"], [lang|="ar"]) body,
:where(html[dir="rtl"]) :is(h1, h2, h3, h4, h5, h6, p, li, a, button, input, select, textarea, .wp-block-button__link) {
	font-family: var(--wp--preset--font-family--arabic);
	letter-spacing: 0 !important;
}
html[dir="rtl"] body { line-height: 1.85; }
html[dir="rtl"] :is(h1, h2, h3) { line-height: 1.35; }
::selection { background: var(--wp--preset--color--primary); color: #fff; }
img { height: auto; }

/* ---------- Header ---------- */
.dh-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); background: rgba(22, 22, 22, .92) !important; border-bottom: 1px solid rgba(255,255,255,.06); }
.admin-bar .dh-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .dh-header { top: 46px; } }
.dh-header .wp-block-image { margin: 0; }
.dh-header .wp-block-image img { display: block; }
.dh-header .wp-block-navigation a:hover { color: var(--wp--preset--color--coral); text-decoration: none; }
.dh-header .wp-block-navigation .current-menu-item > a,
.dh-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--coral); }
.dh-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--night) !important; color: #fff !important; padding: 2rem; }
.dh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 1.25rem; font-size: 1.35rem; }
.dh-header .wp-block-button__link { padding: .6rem 1.25rem; font-size: .9rem; }
@media (max-width: 600px) { .dh-header .dh-header-cta { display: none; } }

/* Polylang language switcher */
.dh-lang ul, ul.dh-lang { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem; }
.dh-lang a { display: inline-flex; align-items: center; min-height: 36px; padding: .25rem .85rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #fff; font-size: .9rem; font-weight: 600; text-decoration: none; }
.dh-lang a:hover { border-color: var(--wp--preset--color--coral); color: var(--wp--preset--color--coral); text-decoration: none; }
.dh-lang a[lang="ar"], .dh-lang [lang="ar"] { font-family: var(--wp--preset--font-family--arabic); }
.dh-lang a[lang="en-US"], .dh-lang a[lang="en"], .dh-lang [lang="en-US"] { font-family: var(--wp--preset--font-family--body); }

/* ---------- Block style: brand pattern ---------- */
.is-style-dh-pattern {
	background-color: var(--wp--preset--color--night);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.055' stroke-width='1.2'%3E%3Ccircle cx='0' cy='0' r='60'/%3E%3Ccircle cx='120' cy='0' r='60'/%3E%3Ccircle cx='0' cy='120' r='60'/%3E%3Ccircle cx='120' cy='120' r='60'/%3E%3Ccircle cx='60' cy='60' r='60'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 120px 120px;
}

/* ---------- Block style: cards ---------- */
.is-style-dh-card {
	background: var(--wp--preset--color--base);
	border: 1px solid rgba(35,35,35,.08);
	border-radius: 18px;
	box-shadow: var(--wp--preset--shadow--card);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.is-style-dh-card:hover { transform: translateY(-4px); border-color: rgba(219,57,59,.35); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 22px 44px -18px rgba(0,0,0,.22); }
.is-style-dh-card-dark {
	background: rgba(255,255,255,.035);
	border: 1px solid rgba(255,255,255,.09);
	border-radius: 18px;
	transition: border-color .25s ease, background .25s ease;
}
.is-style-dh-card-dark:hover { border-color: rgba(255,115,122,.5); background: rgba(255,255,255,.06); }
.is-style-dh-card .wp-block-image, .is-style-dh-card-dark .wp-block-image { margin-bottom: 0; }
.is-style-dh-card .wp-block-image img { border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .is-style-dh-card, .is-style-dh-card-dark { transition: none; } .is-style-dh-card:hover { transform: none; } }

/* ---------- Block style: eyebrow label ---------- */
.is-style-dh-eyebrow {
	display: inline-flex; align-items: center; gap: .6rem;
	font-size: .8rem !important; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.is-style-dh-eyebrow::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; flex: none; }
html[dir="rtl"] .is-style-dh-eyebrow { text-transform: none; letter-spacing: 0; font-size: .95rem !important; }

/* ---------- Block style: check list ---------- */
.is-style-dh-check { list-style: none; padding-inline-start: 0 !important; }
.is-style-dh-check li { position: relative; padding-inline-start: 1.9rem; margin-bottom: .6rem; }
.is-style-dh-check li::before {
	content: ""; position: absolute; inset-inline-start: 0; top: .5em; width: 1.05rem; height: 1.05rem; border-radius: 50%;
	background: var(--wp--preset--color--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.4 2.4L12 5.2' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat;
}

/* ---------- Block style: numbered step ---------- */
.is-style-dh-step-number {
	font-size: 2.75rem !important; font-weight: 800; line-height: 1 !important; margin: 0 !important;
	color: transparent; -webkit-text-stroke: 1.5px var(--wp--preset--color--primary);
}

/* ---------- Buttons: outline variation ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; border-color: currentColor; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: #fff; }

/* ---------- Red accent word in headings ---------- */
mark.has-primary-color, mark.has-coral-color { background: transparent !important; }

/* ---------- Hero ---------- */
.dh-hero.wp-block-cover { min-height: min(88vh, 760px); }
.dh-hero .wp-block-cover__image-background { object-position: center 40%; }

/* ---------- Media ---------- */
.dh-illustration img { border-radius: 0 !important; }
.dh-shot img { border-radius: 14px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }

/* ---------- Contact Form 7 ---------- */
.wpcf7 form { display: grid; gap: 1.1rem; }
.wpcf7 .dh-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) { .wpcf7 .dh-form-row { grid-template-columns: 1fr; } }
.wpcf7 label { display: block; font-weight: 600; font-size: .95rem; }
.wpcf7 label .dh-req { color: var(--wp--preset--color--primary); }
.wpcf7 .wpcf7-form-control-wrap { display: block; margin-top: .4rem; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 select, .wpcf7 textarea {
	width: 100%; box-sizing: border-box; padding: .85rem 1rem; font: inherit; color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--surface); border: 1.5px solid transparent; border-radius: 12px; transition: border-color .2s, background .2s;
}
.wpcf7 textarea { min-height: 150px; resize: vertical; }
.wpcf7 :is(input, select, textarea):focus { outline: none; border-color: var(--wp--preset--color--primary); background: #fff; }
.wpcf7 input[type="submit"] {
	justify-self: start; cursor: pointer; font: inherit; font-weight: 700; color: #fff; background: var(--wp--preset--color--primary);
	border: 0; border-radius: 999px; padding: .95rem 2.2rem; transition: background .2s;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--primary-dark); }
.wpcf7 .wpcf7-not-valid-tip { color: var(--wp--preset--color--primary-dark); font-size: .85rem; margin-top: .35rem; }
.wpcf7 .wpcf7-not-valid { border-color: var(--wp--preset--color--primary) !important; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: .9rem 1.1rem; border-radius: 12px; border-width: 1.5px; }
.wpcf7 form.sent .wpcf7-response-output { border-color: #2e7d4f; background: #eef8f1; color: #1d5636; }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border-color: var(--wp--preset--color--primary); background: #fdf0f0; }
.wpcf7 .wpcf7-spinner { margin-inline-start: .75rem; }

/* ---------- Footer ---------- */
.dh-footer a { color: rgba(255,255,255,.78); }
.dh-footer a:hover { color: var(--wp--preset--color--coral); text-decoration: none; }
.dh-footer .wp-block-list { list-style: none; padding-inline-start: 0; }
.dh-footer .wp-block-list li { margin-bottom: .45rem; }
.dh-footer .wp-block-social-links .wp-social-link { background: rgba(255,255,255,.08) !important; color: #fff !important; }
.dh-footer .wp-block-social-links .wp-social-link:hover { background: var(--wp--preset--color--primary) !important; }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.dh-hero.wp-block-cover { min-height: 78vh; }
	.wp-block-columns.dh-stack-reverse { flex-direction: column-reverse; }
}

/* ---------- Logos are never cropped or rounded (brand rule) ---------- */
.dh-header .wp-block-image img, .dh-footer .wp-block-image img, .wp-block-image.dh-logo img { border-radius: 0 !important; box-shadow: none !important; }
/* Email / long buttons stay on one line */
.wp-block-button__link[href^="mailto:"] { white-space: nowrap; }

/* No gap between page sections, header and footer */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Client logo tiles */
.wp-block-image.dh-client-logo img { border-radius: 16px; box-shadow: 0 0 0 1px rgba(35,35,35,.08); }

/* ---------- Header: keep one clean row at every width ---------- */
.dh-header > .wp-block-group { gap: var(--wp--preset--spacing--30); }
.dh-header > .wp-block-group > .wp-block-group { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.dh-header .wp-block-navigation { flex: 0 1 auto; }
.dh-header .wp-block-navigation__container { flex-wrap: nowrap !important; row-gap: 0; }
.dh-header .wp-block-navigation-item__content,
.dh-header .wp-block-button__link,
.dh-header .dh-lang a { white-space: nowrap; }
.dh-header .wp-block-buttons,
.dh-header .wp-block-button,
.dh-header .dh-lang,
.dh-header .wp-block-polylang-language-switcher { flex: 0 0 auto; width: auto; margin: 0; }
.dh-header .dh-lang ul, .dh-header ul.dh-lang { flex-wrap: nowrap; margin: 0; padding: 0; }
.dh-header .dh-lang li { margin: 0; padding: 0; list-style: none; }
.dh-header .dh-lang img { display: none; } /* no flags */
/* Medium screens: hide the header button; the menu still has Contact */
@media (max-width: 1100px) { .dh-header .dh-header-cta { display: none; } }
/* Tablet: switch to the menu icon earlier than WordPress' 600px default */
@media (min-width: 600px) and (max-width: 960px) {
	.dh-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
	.dh-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
}

/* ---------- 1.0.2 Mobile fixes ---------- */
/* The header's blur trapped the full-screen menu inside the header bar; drop it where the menu icon is used */
@media (max-width: 960px) {
	.dh-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--wp--preset--color--night) !important; }
}
/* Open menu: full screen, items stacked and centred */
.dh-header .wp-block-navigation__responsive-container.is-menu-open { position: fixed; inset: 0; z-index: 100000; overflow-y: auto; padding: 5rem 2rem 3rem; }
.dh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: center !important; padding-top: 0; }
.dh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { flex-direction: column !important; flex-wrap: wrap !important; align-items: center !important; justify-content: flex-start !important; gap: 1.5rem; font-size: 1.4rem; }
.dh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: center !important; text-align: center; }
.dh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { align-items: center !important; padding: .75rem 0 0 !important; gap: .9rem; font-size: 1.05rem; background: transparent !important; border: 0 !important; }
.dh-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container a { color: #C9C8C4; }
.dh-header .wp-block-navigation__responsive-container-close { top: 1.5rem; inset-inline-end: 1.5rem; color: #fff; }
.dh-header .wp-block-navigation__responsive-container-open { color: #fff; }

/* Phones: centre the page text */
@media (max-width: 781px) {
	main :is(h1, h2, h3, h4, h5, h6, p), .dh-footer :is(h1, h2, h3, h4, p) { text-align: center !important; }
	main .wp-block-buttons, .dh-footer .wp-block-buttons, .dh-footer .wp-block-social-links { justify-content: center !important; }
	main .wp-block-group.is-layout-flex:not(.is-vertical), .dh-footer .wp-block-group.is-layout-flex:not(.is-vertical) { justify-content: center !important; }
	main .wp-block-image, .dh-footer .wp-block-image { margin-inline: auto; text-align: center; }
	main .wp-block-image img, .dh-footer .wp-block-image img { margin-inline: auto; }
	main .wp-block-button { width: auto; }
	/* lists and form fields stay start-aligned so they stay readable */
	main :is(ul, ol), main :is(ul, ol) p, .wpcf7 :is(p, label) { text-align: start !important; }
	main ul, main ol { max-width: 32rem; margin-inline: auto; }
}
@media (max-width: 781px) {
	main .is-style-dh-eyebrow, .dh-footer .is-style-dh-eyebrow { display: flex; justify-content: center; }
}
.dh-header .is-menu-open .wp-block-navigation__responsive-close { position: static; }
.dh-header .is-menu-open .wp-block-navigation__responsive-container-close { position: fixed; top: 1.25rem; right: 1.25rem; left: auto; }
html[dir="rtl"] .dh-header .is-menu-open .wp-block-navigation__responsive-container-close { right: auto; left: 1.25rem; }

/* Phones: footer link lists centred too */
@media (max-width: 781px) {
	.dh-footer :is(ul, ol), .dh-footer :is(ul, ol) li, .dh-footer :is(ul, ol) p { text-align: center !important; }
	.dh-footer :is(ul, ol) { list-style: none; padding-inline: 0 !important; margin-inline: auto !important; }
	.dh-footer .wp-block-image img { max-width: 150px; }
}
