/*
Theme Name:        Idreamatrix
Theme URI:         https://example.com/
Description:       A clean, fast property portal theme built for the Idreamatrix Properties plugin. Bayut-style home page with search, property types, featured listings, locations, a WhatsApp button and a sticky header. Edit everything in Appearance → Customize → Property Site.
Version:           1.0.0
Requires at least: 6.0
Requires PHP:      7.4
Author:            Idreamatrix
Text Domain:       idxt
License:           GPL-2.0-or-later
Tags:              real-estate, custom-logo, custom-menu, featured-images, one-column, two-columns
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--brand: #28b16d;
	--brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
	--brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
	--ink: #111827;
	--text: #374151;
	--muted: #6b7280;
	--line: #e5e7eb;
	--bg: #ffffff;
	--bg-alt: #f6f7f9;
	--dark: #0f1a17;
	--radius: 12px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
	--shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .08);
	--font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--header-h: 72px;

	/* Hand the theme's colours to the plugin. */
	--idx-primary: var(--brand);
	--idx-text: var(--ink);
	--idx-muted: var(--muted);
	--idx-line: var(--line);
	--idx-bg: var(--bg-alt);
	--idx-radius: var(--radius);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.nav-open { overflow: hidden; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 3.4vw, 40px); }
h2 { font-size: clamp(22px, 2.4vw, 28px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=search], input[type=tel], input[type=url], input[type=number], input[type=password], textarea, select {
	width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 800px; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; background: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.ico { display: inline-block; vertical-align: middle; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #f1f5f4; color: var(--ink); }
.btn-outline-white { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn .ico { width: 18px; height: 18px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.link-arrow .ico { width: 18px; height: 18px; transition: transform .15s; }
.link-arrow:hover .ico { transform: translateX(3px); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.admin-bar .site-header { top: 32px; }
.site-header.is-scrolled { box-shadow: 0 4px 20px rgba(16,24,40,.07); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { flex: none; display: flex; align-items: center; }
.brand .custom-logo { max-height: 46px; width: auto; display: block; }
.brand-text { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -.02em; }
.brand-text:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark .ico { width: 20px; height: 20px; }

.main-nav { flex: 1; }
.main-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav .menu > li { position: relative; }
.main-nav .menu a { display: block; padding: 8px 14px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: 15px; }
.main-nav .menu a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { background: var(--bg-alt); color: var(--brand); }
.main-nav .sub-menu { list-style: none; margin: 0; padding: 6px; position: absolute; top: 100%; left: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { font-weight: 500; }
.nav-mobile-extra { display: none; }

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header-phone { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 15px; }
.header-phone .ico { color: var(--brand); width: 18px; height: 18px; }
.header-cta { padding: 10px 18px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.nav-toggle .when-open { display: none; }
.nav-open .nav-toggle .when-open { display: inline-flex; }
.nav-open .nav-toggle .when-closed { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; padding: 88px 0 72px; color: #fff; background:
	linear-gradient(180deg, rgba(5,20,15,.55) 0%, rgba(5,20,15,.35) 50%, rgba(5,20,15,.7) 100%),
	var(--hero-img, radial-gradient(1200px 500px at 80% -10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent), linear-gradient(135deg, #0d2b22 0%, #14463a 55%, #0e3a4a 100%));
	background-size: cover; background-position: center; overflow: hidden; }
.hero:not(.has-image)::after { content: ""; position: absolute; inset: 0; 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%3Cpath d='M20 70 50 45l30 25v30H20z' fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='2'/%3E%3C/svg%3E"); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-title { color: #fff; font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 12px; }
.hero-sub { color: rgba(255,255,255,.88); font-size: clamp(16px, 1.6vw, 19px); max-width: 640px; margin: 0 auto 32px; }
.hero .idx-search { max-width: 1040px; margin: 0 auto; }
.hero .idx-tabs { background: rgba(255,255,255,.14); backdrop-filter: blur(8px); border-radius: 12px 12px 0 0; padding: 5px; }
.hero .idx-tab span { padding: 9px 26px; font-size: 15px; }
.hero .idx-search-fields { border-radius: 0 14px 14px 14px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.hero-stats { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 28px 0 0; font-size: 15px; color: rgba(255,255,255,.9); }
.hero-stats li { display: inline-flex; align-items: center; gap: 6px; }
.hero-stats strong { color: #fff; font-size: 18px; }
.hero-stats .ico { width: 18px; height: 18px; color: #8ff0bd; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head.center { justify-content: center; text-align: center; }
.notice-box { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }

/* Property types */
.type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.type-tile { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.type-tile:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.type-icon { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.type-icon .ico { width: 24px; height: 24px; }
.type-tile strong { font-size: 15px; }
.type-tile span:last-child { font-size: 13px; color: var(--muted); }

/* Why us */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.why-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; }
.why-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.why-icon .ico { width: 24px; height: 24px; }
.why-item h3 { margin-bottom: 6px; }
.why-item p { margin: 0; color: var(--muted); font-size: 15px; }

/* CTA band */
.cta-band { background: linear-gradient(120deg, var(--brand-dark), var(--brand)); color: #fff; padding: 48px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; color: rgba(255,255,255,.9); max-width: 620px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   Plugin integration (listing grid, cards, property pages)
   ========================================================================== */
.idx-grid.alignwide, .idx-hero.alignwide, .idx-locations.alignwide { max-width: none; }
.idx-wrap { max-width: 1240px; padding: 28px 20px 72px; }
.idx-card { border-radius: var(--radius); }
.idx-card-price { letter-spacing: -.01em; }
.idx-btn { font-family: var(--font); }
.idx-searchbar .idx-search-fields { background: #fff; }
.idx-archive-head h1 { font-size: clamp(24px, 2.6vw, 30px); }
.idx-single-title { font-weight: 700; }
.idx-section h2 { font-weight: 700; }
.idx-agent-card { border-radius: 16px; }
.idx-location-chip { border-radius: var(--radius); }
.idx-location-chip strong { font-weight: 700; }
.single-property .float-wa { display: none; }

/* ==========================================================================
   Pages & blog
   ========================================================================== */
.page-hero { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 48px 0 40px; }
.page-hero h1 { margin: 0; }
.page-hero-desc { color: var(--muted); margin-top: 8px; }
.site-main { padding-top: 40px; padding-bottom: 72px; }
.layout-sidebar { display: block; }
.layout-sidebar:has(.sidebar) { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
.sidebar { padding-top: 40px; }
.widget { margin-bottom: 28px; }
.widget-title { font-size: 16px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.entry-content { font-size: 17px; line-height: 1.75; }
.entry-content > * { max-width: 760px; }
.entry-content > .alignwide { max-width: 1200px; }
.entry-content > .alignfull { max-width: none; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content img { border-radius: 10px; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--brand); color: var(--ink); font-size: 1.1em; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.wp-block-button__link { background: var(--brand); border-radius: 10px; padding: 12px 22px; font-weight: 600; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.post-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .2s; }
.post-card:hover { box-shadow: var(--shadow); }
.post-card-media { display: block; aspect-ratio: 16 / 9; background: var(--bg-alt); overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--line); }
.post-card-placeholder .ico { width: 48px; height: 48px; }
.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card-body p { color: var(--muted); font-size: 15px; }
.post-card-body .link-arrow { margin-top: auto; }
.post-card-title { font-size: 19px; margin-bottom: 8px; }
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--brand); }
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.post-cover { margin: 0 0 28px; }
.post-cover img { border-radius: var(--radius); width: 100%; }
.post-tags a { display: inline-block; background: var(--bg-alt); padding: 4px 10px; border-radius: 6px; font-size: 13px; margin: 0 6px 6px 0; color: var(--text); }
.post-navigation { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 20px; }
.post-navigation span { display: block; font-size: 13px; color: var(--muted); }
.post-navigation .nav-next { text-align: right; margin-left: auto; }

.pagination, .nav-links { margin-top: 36px; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.search-form { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.error-404 { text-align: center; padding: 96px 20px; }
.error-code { display: block; font-size: 96px; font-weight: 800; color: var(--brand); line-height: 1; letter-spacing: -.04em; }
.error-404 p:last-child { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.comments { margin-top: 48px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { border-bottom: 1px solid var(--line); padding: 16px 0; }
.comment-form input[type=submit] { background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 12px 22px; font-weight: 600; cursor: pointer; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--dark); color: rgba(255,255,255,.72); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; padding-top: 64px; padding-bottom: 48px; }
.site-footer h3 { color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { color: #fff; }
.brand-light { color: #fff; margin-bottom: 14px; }
.brand-light:hover { color: #fff; }
.footer-about p { max-width: 340px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .ico { width: 18px; height: 18px; color: var(--brand); margin-top: 3px; }
.social { display: flex; gap: 10px; }
.social a { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; }
.social a:hover { background: var(--brand); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: 14px; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.float-wa { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(37,211,102,.45); transition: transform .15s; }
.float-wa:hover { transform: scale(1.06); color: #fff; }
.float-wa .ico { width: 30px; height: 30px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.header-phone span { display: none; }
	.why-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
	:root { --header-h: 64px; }
	.site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
	.nav-toggle { display: inline-flex; }
	.header-cta, .header-phone { display: none; }
	.main-nav { position: fixed; inset: var(--header-h) 0 0 0; background: #fff; padding: 16px 20px 32px; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; }
	.admin-bar .main-nav { top: calc(var(--header-h) + 46px); }
	.nav-open .main-nav { transform: none; }
	.main-nav .menu { flex-direction: column; gap: 2px; }
	.main-nav .menu a { padding: 14px 12px; font-size: 17px; border-bottom: 1px solid var(--line); border-radius: 0; }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; border: 0; box-shadow: none; padding: 0 0 0 16px; }
	.nav-mobile-extra { display: grid; gap: 10px; margin-top: 24px; }
	.layout-sidebar:has(.sidebar) { grid-template-columns: 1fr; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; }
	.hero { padding: 56px 0 44px; }
	.hero .idx-search-fields { border-radius: 0 0 14px 14px; }
	.section { padding: 48px 0; }
	.section-head { align-items: center; }
	.type-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.type-tile { grid-template-columns: 1fr; padding: 14px; }
	.type-icon { grid-row: auto; margin-bottom: 8px; }
	.why-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 48px; }
	.cta-actions, .cta-actions .btn { width: 100%; }
	.float-wa { width: 52px; height: 52px; right: 14px; bottom: 14px; }
}
