/* ============================================================
   StampDutyMalaysia.com — Main Stylesheet
   Design: Refined financial/legal aesthetic — emerald & slate
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  --emerald-deep: #064e3b;
  --emerald-mid:  #059669;
  --emerald-light:#d1fae5;
  --gold:         #d97706;
  --gold-light:   #fef3c7;
  --slate-900:    #0f172a;
  --slate-700:    #334155;
  --slate-500:    #64748b;
  --slate-200:    #e2e8f0;
  --slate-100:    #f1f5f9;
  --white:        #ffffff;
  --radius:       12px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:    0 12px 48px rgba(6,78,59,.14);
  --transition:   .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--slate-700);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1,h2,h3,h4 { font-family: 'DM Serif Display', serif; color: var(--slate-900); line-height: 1.18; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p  { color: var(--slate-700); }
a  { color: var(--emerald-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--emerald-deep); }

/* ── Layout ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 72px 0; }
.section--alt { background: var(--slate-100); }

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 38px; height: 38px; background: var(--emerald-deep);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 22px; height: 22px; fill: var(--white); }
.logo-text { font-family: 'DM Serif Display', serif; font-size: 1.15rem; color: var(--slate-900); }
.logo-text span { color: var(--emerald-mid); }

nav { display: flex; align-items: center; gap: 28px; }
nav a { font-size: .93rem; font-weight: 500; color: var(--slate-700); }
nav a:hover { color: var(--emerald-mid); }
nav a.active { color: var(--emerald-mid); }

.nav-cta {
  background: var(--emerald-deep); color: var(--white) !important;
  padding: 9px 20px; border-radius: 8px; font-weight: 600; font-size: .88rem;
}
.nav-cta:hover { background: var(--emerald-mid) !important; color: var(--white) !important; }

.hamburger { display: none; background: none; border: none; cursor: pointer; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--slate-700); margin: 5px 0; transition: var(--transition); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--emerald-deep) 0%, #065f46 60%, #047857 100%);
  padding: 80px 0 0;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; position: relative; z-index: 1; }
.hero-content { padding-bottom: 80px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #a7f3d0;
  font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 100px; border: 1px solid rgba(255,255,255,.18);
  margin-bottom: 20px;
}
.hero h1 { color: var(--white); margin-bottom: 18px; }
.hero p { color: rgba(255,255,255,.8); font-size: 1.08rem; margin-bottom: 32px; max-width: 480px; }
.hero-stats { display: flex; gap: 32px; }
.hero-stat strong { display: block; font-size: 1.55rem; font-family: 'DM Serif Display', serif; color: var(--white); }
.hero-stat span { font-size: .8rem; color: rgba(255,255,255,.65); }

/* ── CALCULATOR CARD ── */
.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: -40px;
  position: relative; z-index: 2;
}
.calc-header {
  background: var(--slate-900);
  padding: 20px 28px;
  display: flex; align-items: center; gap: 12px;
}
.calc-header h2 { color: var(--white); font-size: 1.05rem; margin: 0; font-family: 'DM Sans', sans-serif; font-weight: 600; }
.calc-dot { width: 10px; height: 10px; border-radius: 50%; }
.calc-dot.red   { background: #ef4444; }
.calc-dot.amber { background: #f59e0b; }
.calc-dot.green { background: #10b981; }
.calc-dots { display: flex; gap: 6px; margin-right: 8px; }

.calc-body { padding: 28px; }

/* Tabs */
.calc-tabs { display: flex; gap: 4px; background: var(--slate-100); border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.calc-tab {
  flex: 1; padding: 10px 8px; text-align: center; font-size: .84rem; font-weight: 600;
  border: none; background: transparent; border-radius: 8px; cursor: pointer;
  color: var(--slate-500); transition: var(--transition); white-space: nowrap;
}
.calc-tab.active { background: var(--white); color: var(--emerald-deep); box-shadow: var(--shadow-sm); }

/* Form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--slate-700); }
.form-group input, .form-group select {
  padding: 11px 14px; border: 1.5px solid var(--slate-200); border-radius: 9px;
  font-family: 'DM Sans', sans-serif; font-size: .95rem; color: var(--slate-900);
  transition: border-color var(--transition);
  background: var(--white);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--emerald-mid);
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
.input-prefix { position: relative; }
.input-prefix span {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-weight: 600; color: var(--slate-500); font-size: .93rem; pointer-events: none;
}
.input-prefix input { padding-left: 36px; }

.checkbox-row { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--emerald-mid); cursor: pointer; }
.checkbox-row label { font-size: .87rem; color: var(--slate-700); cursor: pointer; }

.btn-calculate {
  width: 100%; padding: 14px; background: var(--emerald-deep); color: var(--white);
  border: none; border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 1rem; font-weight: 700; cursor: pointer; letter-spacing: .02em;
  transition: var(--transition); margin-top: 8px;
}
.btn-calculate:hover { background: var(--emerald-mid); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(6,78,59,.25); }
.btn-calculate:active { transform: translateY(0); }

/* Results */
.results { display: none; margin-top: 20px; }
.results.visible { display: block; animation: slideUp .35s ease; }
@keyframes slideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.results-divider { height: 1px; background: var(--slate-200); margin: 18px 0; }
.result-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); margin-bottom: 12px; }

.result-line { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--slate-200); }
.result-line:last-child { border-bottom: none; }
.result-line .label { font-size: .9rem; color: var(--slate-700); }
.result-line .value { font-weight: 600; color: var(--slate-900); font-size: .95rem; }
.result-line .value.exempt { color: var(--emerald-mid); font-size: .84rem; }
.result-line.total { background: var(--emerald-light); border-radius: 9px; padding: 12px 14px; margin-top: 10px; border: none; }
.result-line.total .label { font-weight: 700; color: var(--emerald-deep); }
.result-line.total .value { font-size: 1.15rem; color: var(--emerald-deep); font-weight: 800; }

.exemption-banner {
  background: var(--gold-light); border: 1px solid #fbbf24; border-radius: 9px;
  padding: 10px 14px; margin-top: 14px; font-size: .85rem; color: #92400e;
  display: flex; gap: 8px; align-items: flex-start;
}
.exemption-banner svg { flex-shrink: 0; margin-top: 2px; }

.breakdown-toggle { 
  font-size: .82rem; color: var(--emerald-mid); cursor: pointer; font-weight: 600; 
  display: flex; align-items: center; gap: 4px; margin-top: 10px; background: none; border: none;
  padding: 0; font-family: inherit;
}
.breakdown-table { display: none; width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .84rem; }
.breakdown-table.visible { display: table; }
.breakdown-table th { background: var(--slate-100); padding: 8px 10px; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-500); }
.breakdown-table td { padding: 7px 10px; border-bottom: 1px solid var(--slate-200); }
.breakdown-table tr:last-child td { border: none; }

/* ── FEATURES ── */
.features-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.feature-card {
  padding: 28px 24px; background: var(--white);
  border: 1.5px solid var(--slate-200); border-radius: var(--radius);
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--emerald-mid); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon {
  width: 48px; height: 48px; background: var(--emerald-light);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 24px; height: 24px; stroke: var(--emerald-deep); }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { font-size: .9rem; }

/* ── RATES TABLE ── */
.rates-table { width: 100%; border-collapse: collapse; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.rates-table th { background: var(--emerald-deep); color: var(--white); padding: 14px 18px; text-align: left; font-size: .88rem; letter-spacing: .04em; }
.rates-table td { padding: 13px 18px; border-bottom: 1px solid var(--slate-200); font-size: .92rem; }
.rates-table tr:nth-child(even) td { background: var(--slate-100); }
.rates-table tr:last-child td { border-bottom: none; }
.badge-exemption { background: var(--emerald-light); color: var(--emerald-deep); font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 100px; }

/* ── FAQ ── */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item { border: 1.5px solid var(--slate-200); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-question {
  width: 100%; text-align: left; padding: 18px 22px; background: var(--white);
  border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: .97rem; font-weight: 600; color: var(--slate-900);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: var(--transition);
}
.faq-question:hover { background: var(--slate-100); }
.faq-question .chevron { width: 20px; height: 20px; transition: transform var(--transition); flex-shrink: 0; }
.faq-item.open .faq-question .chevron { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner { padding: 0 22px 18px; font-size: .93rem; line-height: 1.7; }

/* ── BLOG ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.blog-card {
  background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius); overflow: hidden; transition: var(--transition);
  display: flex; flex-direction: column;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--emerald-mid); }
.blog-card-thumb {
  height: 190px;
  background: linear-gradient(135deg, var(--emerald-deep), #065f46);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden;
}
.blog-card-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M0 0h20v20H0zM20 20h20v20H20z'/%3E%3C/g%3E%3C/svg%3E");
}
.blog-thumb-title { color: var(--white); font-family: 'DM Serif Display', serif; font-size: 1.3rem; text-align: center; position: relative; z-index: 1; line-height: 1.3; }
.blog-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.blog-meta { display: flex; gap: 12px; margin-bottom: 10px; font-size: .78rem; color: var(--slate-500); }
.blog-tag { background: var(--emerald-light); color: var(--emerald-deep); padding: 2px 9px; border-radius: 100px; font-weight: 600; }
.blog-card h3 { font-size: 1.05rem; margin-bottom: 9px; line-height: 1.35; }
.blog-card p { font-size: .88rem; flex: 1; }
.blog-card-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 16px; font-weight: 600; font-size: .88rem; color: var(--emerald-mid); }
.blog-card-link svg { width: 15px; transition: transform var(--transition); }
.blog-card:hover .blog-card-link svg { transform: translateX(3px); }

/* ── CTA BANNER ── */
.cta-banner {
  background: linear-gradient(135deg, var(--emerald-deep), #047857);
  border-radius: var(--radius-lg); padding: 56px 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  position: relative; overflow: hidden;
}
.cta-banner::before { content: ''; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; background: rgba(255,255,255,.05); border-radius: 50%; }
.cta-banner h2 { color: var(--white); margin-bottom: 10px; }
.cta-banner p { color: rgba(255,255,255,.8); max-width: 420px; }
.btn-white { background: var(--white); color: var(--emerald-deep); padding: 14px 30px; border-radius: 10px; font-weight: 700; font-size: .97rem; white-space: nowrap; transition: var(--transition); border: none; cursor: pointer; }
.btn-white:hover { background: var(--emerald-light); color: var(--emerald-deep); transform: translateY(-1px); }

/* ── FOOTER ── */
footer { background: var(--slate-900); color: rgba(255,255,255,.7); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand p { font-size: .9rem; margin-top: 12px; line-height: 1.7; max-width: 280px; }
.footer-col h4 { color: var(--white); font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; font-family: 'DM Sans', sans-serif; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: .88rem; color: rgba(255,255,255,.6); transition: var(--transition); }
.footer-col a:hover { color: var(--emerald-mid); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: .83rem; }
.footer-disclaimer { margin-top: 24px; padding: 14px 18px; background: rgba(255,255,255,.05); border-radius: 9px; font-size: .8rem; color: rgba(255,255,255,.5); border-left: 3px solid var(--emerald-mid); }

/* ── BLOG POST PAGE ── */
.blog-hero { background: linear-gradient(135deg, var(--emerald-deep), #065f46); padding: 72px 0 48px; }
.blog-hero h1 { color: var(--white); max-width: 760px; }
.blog-hero .meta { display: flex; gap: 20px; margin-top: 16px; font-size: .88rem; color: rgba(255,255,255,.7); flex-wrap: wrap; }
.blog-hero .meta span { display: flex; align-items: center; gap: 5px; }

.blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; padding: 56px 0; align-items: start; }
.blog-content { max-width: none; }
.blog-content h2 { font-size: 1.55rem; margin: 36px 0 14px; }
.blog-content h3 { font-size: 1.15rem; margin: 26px 0 10px; }
.blog-content p { margin-bottom: 16px; line-height: 1.8; }
.blog-content ul, .blog-content ol { margin: 14px 0 14px 22px; }
.blog-content li { margin-bottom: 8px; line-height: 1.7; font-size: .97rem; }
.blog-content .callout { background: var(--emerald-light); border-left: 4px solid var(--emerald-mid); padding: 16px 20px; border-radius: 0 9px 9px 0; margin: 20px 0; }
.blog-content .callout strong { color: var(--emerald-deep); }
.blog-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .92rem; }
.blog-content table th { background: var(--emerald-deep); color: var(--white); padding: 11px 14px; text-align: left; }
.blog-content table td { padding: 10px 14px; border-bottom: 1px solid var(--slate-200); }
.blog-content table tr:nth-child(even) td { background: var(--slate-100); }

.blog-sidebar { position: sticky; top: 88px; }
.sidebar-widget { background: var(--slate-100); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.sidebar-widget h4 { font-size: .88rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-500); margin-bottom: 14px; font-family: 'DM Sans', sans-serif; }
.sidebar-widget ul { list-style: none; }
.sidebar-widget li { border-bottom: 1px solid var(--slate-200); padding: 10px 0; font-size: .9rem; }
.sidebar-widget li:last-child { border: none; padding-bottom: 0; }
.sidebar-calc-cta { background: var(--emerald-deep); border-radius: var(--radius); padding: 22px; text-align: center; }
.sidebar-calc-cta h4 { color: var(--white); margin-bottom: 10px; font-size: 1rem; }
.sidebar-calc-cta p { color: rgba(255,255,255,.8); font-size: .88rem; margin-bottom: 16px; }
.sidebar-calc-cta .btn-white { display: block; text-align: center; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .83rem; color: rgba(255,255,255,.6); margin-bottom: 20px; }
.breadcrumb a { color: rgba(255,255,255,.7); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb svg { width: 12px; opacity: .6; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-content { padding-bottom: 40px; }
  .calc-card { margin-bottom: 0; }
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  nav { display: none; }
  nav.open { display: flex; flex-direction: column; position: fixed; inset: 68px 0 0; background: var(--white); padding: 28px 24px; gap: 4px; z-index: 99; }
  nav.open a { padding: 14px 0; border-bottom: 1px solid var(--slate-200); font-size: 1.05rem; }
  .hamburger { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; padding: 36px 28px; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .rates-table { font-size: .82rem; }
  .rates-table th, .rates-table td { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .calc-tab { font-size: .76rem; padding: 9px 4px; }
  .container { padding: 0 16px; }
}

/* ── Print ── */
@media print {
  header, footer, .hero-content, .features-grid, .faq-list, .cta-banner { display: none; }
  .calc-card { box-shadow: none; }
}
