/*
Theme Name: RERA Rent Calculator
Theme URI: https://rerarentcalculator.com
Author: RERA Calculator
Author URI: https://rerarentcalculator.com
Description: A fast, clean, SEO-friendly WordPress theme built for the Dubai RERA rent calculator and property guides. Includes a built-in rent increase calculator, Yoast-ready markup, and hardened security. Mobile-first and lightweight.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rera
Tags: blog, custom-menu, featured-images, threaded-comments, translation-ready, seo-friendly
*/

/* ==================== DESIGN TOKENS ==================== */
:root {
  --green: #0b7a4b;
  --green-dark: #085d39;
  --green-soft: #eaf5ef;
  --sand: #f5f7f6;
  --card: #ffffff;
  --ink: #16211c;
  --ink-soft: #45514b;
  --muted: #6a756f;
  --line: #e2e6e4;
  --line-strong: #cdd4d0;
  --gold: #c9a24b;

  --font-head: "Poppins", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --wrap-narrow: 720px;
  --radius: 14px;
  --radius-sm: 9px;
}

/* ==================== RESET ==================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100vw; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; color: var(--ink); font-weight: 700; }

/* ==================== LAYOUT ==================== */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 20px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--green); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ==================== HEADER ==================== */
.site-header {
  background: var(--green);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}
.site-branding { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-logo-badge {
  background: #fff; color: var(--green);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 17px;
  flex-shrink: 0;
}
.site-title {
  font-family: var(--font-head); font-weight: 700; font-size: 19px;
  color: #fff; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title a { color: #fff; text-decoration: none; }
.site-description { font-size: 12px; color: rgba(255,255,255,0.8); margin: 0; }

/* Nav */
.main-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.main-nav a { color: rgba(255,255,255,0.92); font-size: 15px; font-weight: 500; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.main-nav .current-menu-item > a { color: #fff; font-weight: 600; }

.menu-toggle {
  display: none;
  background: rgba(255,255,255,0.15);
  border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 8px;
  font-size: 20px; cursor: pointer;
}

@media (max-width: 780px) {
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--green-dark); padding: 10px 20px 16px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav li { border-bottom: 1px solid rgba(255,255,255,0.1); }
  .main-nav a { display: block; padding: 12px 0; }
  .site-description { display: none; }
}

/* ==================== HERO (front page) ==================== */
.hero {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 46px 0 40px;
}
.hero h1 { color: #fff; font-size: 34px; margin: 0 0 12px; }
.hero p { color: rgba(255,255,255,0.9); font-size: 18px; max-width: 560px; margin: 0 auto; }

@media (max-width: 600px) {
  .hero { padding: 34px 0 30px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 16px; }
}

/* ==================== CALCULATOR ==================== */
.calc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin: -28px auto 34px;
  max-width: var(--wrap-narrow);
  box-shadow: 0 6px 24px rgba(11,122,75,0.08);
  position: relative;
}
.calc-field { margin-bottom: 18px; }
.calc-field label {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px;
  font-family: var(--font-head);
}
.calc-field .hint { font-weight: 400; color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.calc-field input {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit; color: var(--ink);
}
.calc-field input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }

.calc-btn {
  width: 100%; background: var(--green); color: #fff; border: none;
  padding: 15px; border-radius: var(--radius-sm);
  font-size: 17px; font-weight: 700; cursor: pointer; font-family: var(--font-head);
  transition: background 0.15s;
}
.calc-btn:hover { background: var(--green-dark); }
.calc-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.calc-result { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); display: none; }
.calc-result.show { display: block; }
.calc-result-main {
  background: var(--green-soft); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; margin-bottom: 16px;
}
.calc-result-label { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.calc-result-pct { font-size: 42px; font-weight: 800; color: var(--green); line-height: 1; font-family: var(--font-head); }
.calc-result-row {
  display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-row .val { font-weight: 700; }
.calc-result-note {
  background: #fff9e6; border: 1px solid #f0e2b0; border-radius: 8px;
  padding: 12px 14px; font-size: 13px; color: #7a6a2e; margin-top: 14px;
}

/* ==================== CONTENT ==================== */
.content-area { padding: 20px 0 50px; }
.entry-content { font-size: 17px; }
.entry-content > * { max-width: 100%; }
.entry-content p { margin: 0 0 18px; color: var(--ink-soft); }
.entry-content h2 { font-size: 25px; margin: 34px 0 14px; }
.entry-content h3 { font-size: 19px; margin: 24px 0 10px; }
.entry-content ul, .entry-content ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-soft); }
.entry-content li { margin-bottom: 8px; }
.entry-content img { border-radius: var(--radius-sm); margin: 20px 0; }
.entry-content a { text-decoration: underline; }
.entry-content blockquote {
  border-left: 4px solid var(--green); margin: 20px 0; padding: 8px 18px;
  background: var(--green-soft); border-radius: 0 8px 8px 0; color: var(--ink-soft);
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--green-soft); font-weight: 700; }
.entry-content code {
  background: #eef1f0; padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.9em;
}

/* ==================== POST CARDS (blog/archive) ==================== */
.page-title-block { text-align: center; padding: 36px 0 10px; }
.page-title-block h1 { font-size: 30px; margin: 0 0 8px; }
.page-title-block p { color: var(--muted); margin: 0; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px 0 40px;
}
.post-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow 0.18s, transform 0.18s;
}
.post-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.post-card-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--green-soft); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card-cat {
  font-size: 12px; font-weight: 700; color: var(--green);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.post-card-title { font-size: 19px; margin: 0 0 10px; line-height: 1.3; }
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--green); text-decoration: none; }
.post-card-excerpt { font-size: 15px; color: var(--muted); margin: 0 0 14px; flex: 1; }
.post-card-meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; }

/* ==================== SINGLE POST ==================== */
.single-header { padding: 34px 0 10px; }
.single-header .post-cat {
  font-size: 13px; font-weight: 700; color: var(--green);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.single-header h1 { font-size: 32px; margin: 10px 0 14px; line-height: 1.22; }
.single-meta { font-size: 14px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.single-featured { margin: 22px 0; }
.single-featured img { border-radius: var(--radius); width: 100%; }

@media (max-width: 600px) {
  .single-header h1 { font-size: 25px; }
  .entry-content h2 { font-size: 21px; }
}

/* ==================== SIDEBAR ==================== */
.layout-with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .layout-with-sidebar { grid-template-columns: 1fr; } }
.widget {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 22px;
}
.widget-title {
  font-size: 16px; font-family: var(--font-head); font-weight: 700;
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--green-soft);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.widget li:last-child { border-bottom: none; }

/* ==================== FAQ (schema-friendly) ==================== */
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; margin-bottom: 6px; font-family: var(--font-head); }
.faq-a { color: var(--ink-soft); font-size: 16px; }

/* ==================== BUTTONS / SHARED ==================== */
.btn {
  display: inline-block; background: var(--green); color: #fff;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-family: var(--font-head); border: none; cursor: pointer;
}
.btn:hover { background: var(--green-dark); text-decoration: none; color: #fff; }

/* ==================== PAGINATION ==================== */
.pagination { display: flex; gap: 8px; justify-content: center; padding: 20px 0 40px; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--ink); background: var(--card);
}
.pagination .page-numbers.current { background: var(--green); color: #fff; border-color: var(--green); }
.pagination a.page-numbers:hover { border-color: var(--green); text-decoration: none; }

/* ==================== COMMENTS ==================== */
.comments-area { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-body { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 16px; }
.comment-author { font-weight: 600; font-size: 15px; }
.comment-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 15px; margin-bottom: 12px;
}

/* ==================== FOOTER ==================== */
.site-footer { background: #16211c; color: #aeb8b3; padding: 40px 0 24px; margin-top: 30px; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 28px; }
@media (max-width: 700px) { .footer-cols { grid-template-columns: 1fr; gap: 22px; } }
.footer-col h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 5px 0; font-size: 14px; }
.footer-col a { color: #aeb8b3; }
.footer-col a:hover { color: #fff; }
.footer-brand-title { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 18px;
  text-align: center; font-size: 13px; color: #8a938e;
}

/* ==================== ACCESSIBILITY ==================== */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); word-wrap: normal;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==================== AD SLOTS ==================== */
.ad-slot {
  margin: 26px auto; text-align: center; max-width: 100%;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  background: #f0f2f1; border-radius: 8px; color: #b5bdb8; font-size: 13px;
  overflow: hidden;
}
.ad-slot:empty::before { content: "Advertisement"; }
