/* 
   مؤسسة المعيار العقارية - Almieyar Real Estate Est
   Exact CSS Design System matching PDF specifications
*/

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Reem+Kufi:wght@400;600;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
  --bg-color: #FAF8F5;
  --header-bg: #FAF8F5;
  --text-main: #684f37;
  --text-dark: #433324;
  --title-green: #5B7E4A;
  --nav-inactive: #A09789;
  --nav-active: #40362C;
  --footer-divider: #DED6C4;
  --icon-badge-bg: #B57D56;
  --icon-color: #B57D56;
  
  --font-main: 'Almarai', 'Tajawal', system-ui, sans-serif;
  --font-title: 'Reem Kufi', 'Tajawal', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh; /* لدعم متصفح سفاري في الآيباد والآيفون */
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-main);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base Layout for Equal Footer Distance */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh; /* لدعم شاشات الآيباد وتجنب مشاكل شريط سفاري */
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

/* Header & Navigation: Positioned at far left edge of the page */
header.site-header {
  width: 100%;
  padding: 25px 0 15px 0;
  display: flex;
  align-items: center;
  background-color: var(--header-bg);
  z-index: 100;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  direction: rtl; /* RTL flow */
}

nav.main-nav a {
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--nav-inactive);
  transition: all 0.25s ease;
  position: relative;
  padding-bottom: 4px;
}

nav.main-nav a:hover {
  color: var(--nav-active);
}

nav.main-nav a.active {
  color: var(--nav-active);
  font-weight: 800;
}

nav.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 2.5px;
  background-color: var(--nav-active);
  border-radius: 2px;
}

/* Main Content Structure */
main.site-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding-top: 10px;
  padding-bottom: 40px; /* Equal spacing container bottom */
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  width: 100%;
  min-height: 440px;
}

/* Right Side Content Area (RTL right) */
.text-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-left: 20px;
}

.brand-header-logo {
  align-self: flex-start;
  margin-bottom: 25px;
  width: 250px;
  max-width: 100%;
}

.brand-header-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.section-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--title-green);
  margin-bottom: 25px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.section-title .dots {
  letter-spacing: 2px;
}

.paragraph-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.paragraph-group p {
  font-size: 1.125rem;
  line-height: 1.9;
  color: var(--text-main);
  text-align: justify;
  text-justify: inter-word;
  word-spacing: -0.5px;
  font-weight: 400;
}

.illustration-column {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.illustration-card {
  width: 100%;
  max-width: 540px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.illustration-card img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  display: block;
  filter: sepia(0.12) contrast(1.02);
}

.logo-page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 480px;
  width: 100%;
}

.large-logo-wrapper {
  max-width: 560px;
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.large-logo-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.logo-page-kuwait-map {
  margin-top: 15px;
  width: 55px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

/* 
  Footer Section
  - RTL container
  - 1st child -> Right
  - 2nd child -> Center
  - 3rd child -> Left
*/
footer.site-footer {
  flex-shrink: 0;
  width: 100%;
  padding-top: 18px;
  padding-bottom: 25px;
  border-top: 1.5px solid var(--footer-divider);
  margin-top: auto; 
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text-dark);
  direction: rtl; /* Enforces Right-to-Left column layout */
}

/* 1. Address Column (Renders on FAR RIGHT in RTL) */
.footer-col-address {
  width: auto;
  direction: rtl;
}

/* Grid Layout for Address: Icons right, text center */
.address-grid {
  display: grid;
  grid-template-columns: 28px 1fr; /* Col 1 is Right (Icons), Col 2 is Left (Text) */
  gap: 12px 10px;
  align-items: center;
}

.grid-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 28px;
}

.location-pin-svg svg {
  width: 24px;
  height: 28px;
  fill: #B57D56;
}

.phone-icon-svg svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #B57D56;
  stroke-width: 2;
}

.grid-text {
  text-align: center; /* User requested: اجعل ترتب النص توسيط */
  display: flex;
  justify-content: center; /* Ensures content inside flex behaves centered */
}

.address-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #B26B43;
}

.address-details {
  font-size: 0.95rem;
  color: #8C6A4F;
}

.phone-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: ltr;
}

.phone-number {
  font-size: 1.05rem;
  font-weight: 700;
  color: #8C6A4F;
  direction: ltr;
  unicode-bidi: embed;
}

/* 2. Center Column (Renders in CENTER) */
.footer-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.kuwait-map-icon {
  width: 80px;
  height: auto;
  display: block;
}

.copyright-text {
  font-size: 0.85rem;
  color: #8C6A4F;
  direction: ltr;
  font-weight: 500;
}

.footer-col-social {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start; /* flex-start in RTL aligns items to the RIGHT */
  text-align: right;
  direction: rtl; /* Forces RTL so icons are on the right, text on the left */
}

.social-row, .email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
}

.social-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #B26B43;
}

.social-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #B57D56;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FAF8F5;
  flex-shrink: 0;
}

.badge-circle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Responsive Styles for iPad Landscape, iPad Portrait, Tablets & Mobile */
@media (max-width: 1100px) {
  .page-wrapper {
    padding: 0 25px;
  }
  nav.main-nav {
    gap: 22px;
  }
  nav.main-nav a {
    font-size: 1.15rem;
  }
  .content-grid {
    gap: 25px;
    grid-template-columns: 1.05fr 0.95fr;
  }
  .section-title {
    font-size: 2.4rem;
  }
  .illustration-card img {
    max-height: 340px;
  }
}

@media (max-width: 900px) {
  .page-wrapper {
    padding: 0 20px;
  }
  header.site-header {
    justify-content: center;
  }
  nav.main-nav {
    margin-right: 0;
    gap: 20px;
  }
  .content-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }
  .brand-header-logo {
    align-self: center;
    width: 220px;
  }
  .text-column {
    padding-left: 0;
    align-items: center;
    text-align: center;
  }
  .section-title {
    font-size: 2.2rem;
    justify-content: center;
  }
  .paragraph-group p {
    text-align: justify;
    text-align-last: center;
  }
  .footer-content {
    flex-direction: column;
    gap: 25px;
    align-items: center;
  }
  .footer-col-address, .footer-col-social {
    align-items: center;
    text-align: center;
  }
  .address-grid {
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 600px) {
  .page-wrapper {
    padding: 0 12px;
  }
  header.site-header {
    padding: 15px 0;
  }
  nav.main-nav {
    gap: 8px;
    width: 100%;
    justify-content: space-around;
    flex-wrap: wrap;
  }
  nav.main-nav a {
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .illustration-card img {
    max-height: 280px;
  }
}
