/* Custom Styling for PakSalaryTax */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

@layer utilities {
  .font-display {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }
}

/* Article & Content Styling */
.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #334155;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

/* Ensure any table inside article body is fully contained and never overflows */
.article-body table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.article-body .table-responsive-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: white;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.article-body > table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: white;
}

.article-body h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.article-body h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 1.5rem;
  margin-bottom: 0.625rem;
}

.article-body p {
  margin-bottom: 1.125rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-body ul {
  list-style-type: disc;
}

.article-body ol {
  list-style-type: decimal;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  color: #059669;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.15s ease;
}

.article-body a:hover {
  color: #047857;
}

/* Prevent prose link styles from overriding solid action buttons */
.article-body a.btn,
.article-body a.inline-flex,
a.btn,
.btn-primary,
.calculate-now-btn {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Mobile Dropdown Menu Link Text Contrast */
#mobileMenu a {
  color: #1e293b;
  text-decoration: none !important;
}

#mobileMenu a:hover {
  color: #0f172a;
}

#desktopServicesMenu.\!opacity-100 {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#mobileMenu a[class*="bg-emerald-50"],
#mobileMenu a[class*="bg-primary-50"],
#mobileMenu a[class*="bg-emerald-100"] {
  color: #064e3b !important; /* High-contrast deep dark emerald */
}

#mobileMenu a.calculate-now-btn,
#mobileMenu a[href*="#calculator"] {
  color: #ffffff !important;
  background-color: #059669 !important;
}

/* Calculator Columns Equal Height on Desktop */
@media (min-width: 1024px) {
  #calculator .grid.lg\:grid-cols-12 {
    align-items: stretch !important;
  }
  #calculator .grid.lg\:grid-cols-12 > div {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
  }
}

/* Mobile-Specific Typography & Layout Scaling */
@media (max-width: 640px) {
  /* Headings downscale for mobile screens */
  h1 {
    font-size: 1.25rem !important; /* ~20px */
    line-height: 1.3 !important;
  }

  h2 {
    font-size: 1.0625rem !important; /* ~17px */
    line-height: 1.35 !important;
  }

  h3 {
    font-size: 0.9375rem !important; /* ~15px */
    line-height: 1.35 !important;
  }

  /* Article cards titles and excerpts on mobile (Images 4 & 5) */
  article h2,
  article h3 {
    font-size: 0.875rem !important; /* 14px */
    line-height: 1.35 !important;
  }

  .article-body {
    font-size: 0.875rem;
    line-height: 1.65;
  }

  .article-body h2 {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
    margin-top: 1.15rem;
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
  }

  .article-body h3 {
    font-size: 0.9375rem !important;
    line-height: 1.35 !important;
    margin-top: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .article-body p {
    margin-bottom: 0.875rem;
  }

  .article-body ul, .article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.125rem;
  }

  .callout-box {
    padding: 0.875rem 1rem !important;
    font-size: 0.8125rem !important;
    margin: 1rem 0 !important;
  }

  /* Compact button & badge sizing on small screens */
  .quick-amount-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  /* Table styling */
  .table-responsive-container {
    margin: 1rem 0 !important;
    border-radius: 0.625rem !important;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem 0.625rem !important;
    font-size: 0.75rem !important;
  }

  /* Form inputs mobile styling */
  input, select, textarea {
    font-size: 0.875rem !important;
  }
}

/* Callout Boxes */
.callout-box {
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  border-left: 4px solid #059669;
  background-color: #ecfdf5;
  color: #064e3b;
}

.callout-box.info {
  border-left-color: #0284c7;
  background-color: #f0f9ff;
  color: #0c4a6e;
}

.callout-box.warning {
  border-left-color: #d97706;
  background-color: #fffbeb;
  color: #78350f;
}

/* Data Tables */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: white;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: white;
}

.data-table th {
  background-color: #f8fafc;
  color: #0f172a;
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
  white-space: normal;
}

.data-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.data-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .data-table th,
  .data-table td {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Article SEO Enhancements: Images, Figures, Table of Contents & FAQs */
.article-body figure {
  margin: 1.75rem 0;
  text-align: center;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  display: block;
  margin: 0 auto;
}

.article-body figcaption {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.625rem;
  font-style: italic;
  text-align: center;
}

.toc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #059669;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.toc-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0 !important;
  margin-bottom: 0.75rem !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-box ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
}

.toc-box li {
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem;
}

.toc-box a {
  color: #0f766e;
  text-decoration: none;
  transition: color 0.15s ease;
}

.toc-box a:hover {
  color: #059669;
  text-decoration: underline;
}

.case-study-box {
  background: linear-gradient(to bottom right, #f0fdf4, #f8fafc);
  border: 1px solid #bbf7d0;
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.calc-cta-banner,
.article-body .calc-cta-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%) !important;
  color: #ffffff !important;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem;
  margin: 2rem 0;
  text-align: center;
  border: 1px solid #10b981;
  box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.25);
}

.calc-cta-banner h3,
.article-body .calc-cta-banner h3 {
  color: #ffffff !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.calc-cta-banner p,
.article-body .calc-cta-banner p {
  color: #d1fae5 !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  margin-bottom: 1.25rem !important;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.calc-cta-banner a,
.calc-cta-banner a.inline-flex,
.article-body .calc-cta-banner a,
.article-body .calc-cta-banner a.inline-flex {
  background-color: #ffffff !important;
  color: #065f46 !important;
  font-weight: 800 !important;
  font-size: 0.875rem !important;
  padding: 0.75rem 1.75rem !important;
  border-radius: 0.75rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.12), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.2s ease-in-out !important;
}

.calc-cta-banner a:hover,
.calc-cta-banner a.inline-flex:hover,
.article-body .calc-cta-banner a:hover,
.article-body .calc-cta-banner a.inline-flex:hover {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2) !important;
}

.faq-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-bottom: 0.875rem;
  overflow: hidden;
  background: #ffffff;
}

.faq-question {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #0f172a;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.faq-answer {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.6;
}

/* Print Stylesheet for Tax Slip */
@media print {
  header, footer, nav, .ad-banner, #mobileMenu, #quickAmountSection, #faqSection, .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }

  .print-only {
    display: block !important;
  }

  #resultsCard {
    border: 2px solid #000 !important;
    box-shadow: none !important;
  }
}
