/* =====================================================
   SAYJOBCITY THEME — IMPROVEMENTS & REFINEMENTS v1.1
   Appended after base style.css via wp_enqueue_style
   ===================================================== */

/* =====================================================
   1. HEADER — MOBILE SPACING FIX
   ===================================================== */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 4px;
    gap: 0;
  }
  .site-logo {
    gap: 8px;
    flex-shrink: 0;
  }
  .logo-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
  .logo-name   { font-size: 16px; }
  .logo-tagline { font-size: 9px; }

  .header-actions {
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  /* give the hamburger a bit of breathing room from the logo */
  .mobile-menu-btn {
    display: flex;
    margin-left: 6px;
  }
}

/* =====================================================
   2. HERO — DESKTOP REFINEMENTS
   ===================================================== */
#hero {
  padding: 64px 0 56px;
}
.hero-title {
  font-size: 48px;
  letter-spacing: -1.2px;
  margin-bottom: 18px;
}
.hero-title .highlight {
  color: var(--primary);
  display: inline;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 30px;
}
.hero-search-form {
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(200,96,42,0.10);
  margin-bottom: 22px;
  max-width: 520px;
}
.hero-search-form input  { padding: 15px 18px; font-size: 15px; }
.hero-search-form button {
  padding: 15px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 0 10px 10px 0;
}

/* =====================================================
   3. HERO — MOBILE FULL REWRITE
   ===================================================== */
@media (max-width: 768px) {
  #hero { padding: 32px 0 28px; }

  .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* --- Illustration shows on mobile, sits above content --- */
  .hero-visual {
    display: flex !important;   /* override the previous display:none */
    order: -1;
    justify-content: center;
    margin-bottom: 24px;
  }
  .hero-calc-illustration {
    width: 280px;
    height: 220px;
  }
  .calc-main {
    width: 140px;
    height: 168px;
    padding: 10px;
    gap: 6px;
  }
  .calc-screen { padding: 8px; }
  .calc-screen-num  { font-size: 16px; }
  .calc-screen-text { font-size: 8px; }
  .calc-btn { height: 20px; font-size: 8px; border-radius: 4px; }
  .float-card { padding: 8px 10px; gap: 6px; }
  .fc-icon    { width: 26px; height: 26px; font-size: 13px; }
  .fc-label   { font-size: 10px; }
  .fc-value   { font-size: 9px; }
  .fc-percent { top: 10px; left: 0; }
  .fc-dollar  { top: 10px; right: 0; }
  .fc-chart   { bottom: 10px; right: 0; }

  /* --- Hero text --- */
  .hero-content { max-width: 100%; }
  .hero-title {
    font-size: 30px;
    letter-spacing: -0.5px;
    text-align: left;
    margin-bottom: 12px;
    line-height: 1.2;
  }
  .hero-desc {
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 100%;
  }

  /* --- Search bar mobile --- */
  .hero-search-form {
    display: flex;
    flex-direction: row;
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 18px;
  }
  .hero-search-form input  {
    flex: 1;
    padding: 13px 14px;
    font-size: 14px;
    min-width: 0;
  }
  .hero-search-form button {
    padding: 13px 18px;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 0 10px 10px 0;
    flex-shrink: 0;
  }
}

/* =====================================================
   4. HERO TRUST BADGES — 2×2 GRID ON MOBILE
   ===================================================== */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
@media (max-width: 768px) {
  .hero-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-top: 4px;
  }
  .hero-badge {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  .hero-badge .dot {
    width: 18px;
    height: 18px;
    font-size: 10px;
    flex-shrink: 0;
  }
}

/* =====================================================
   5. CATEGORIES GRID — MOBILE IMPROVEMENT
   ===================================================== */
@media (max-width: 768px) {
  #popular-categories { padding: 36px 0; }
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .category-card {
    padding: 16px 10px;
    border-radius: 10px;
  }
  .cat-icon  { width: 40px; height: 40px; font-size: 18px; margin-bottom: 8px; }
  .cat-name  { font-size: 12px; }
  .cat-desc  { display: none; }
  .cat-count { font-size: 11px; padding: 3px 8px; }
}
@media (max-width: 480px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card   { padding: 12px 8px; }
  .cat-icon        { width: 36px; height: 36px; font-size: 16px; }
}

/* =====================================================
   6. POPULAR CALCULATORS — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  #popular-calculators { padding: 36px 0; }
  .calculators-grid { grid-template-columns: 1fr; gap: 12px; }
  .calc-card        { padding: 16px; }
  .calc-card-header { gap: 12px; }
  .calc-card-icon   { width: 40px; height: 40px; font-size: 18px; }
  .calc-card-title  { font-size: 14px; }
  .calc-card-desc   { font-size: 12px; }
}
@media (min-width: 480px) and (max-width: 768px) {
  .calculators-grid { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   7. TRUST FEATURES — MOBILE 2-COL
   ===================================================== */
@media (max-width: 768px) {
  #trust-features { padding: 32px 0; }
  .features-grid  { grid-template-columns: 1fr 1fr; gap: 20px; }
  .feature-icon   { width: 46px; height: 46px; font-size: 20px; margin-bottom: 10px; }
  .feature-title  { font-size: 13px; }
  .feature-desc   { font-size: 12px; }
}

/* =====================================================
   8. RECENTLY ADDED — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  #recently-added { padding: 36px 0; }
  .recent-grid    { grid-template-columns: 1fr 1fr; gap: 10px; }
  .recent-calc-card { padding: 12px; gap: 10px; }
  .recent-icon    { width: 36px; height: 36px; font-size: 16px; }
  .recent-name    { font-size: 12px; }
  .recent-time    { font-size: 10px; }
}
@media (max-width: 360px) {
  .recent-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   9. NEWSLETTER — MOBILE FIX (button must never disappear)
   ===================================================== */
#newsletter-section { padding: 48px 0; }
.newsletter-inner {
  border-radius: 20px;
  padding: 48px 56px;
}
@media (max-width: 900px) {
  .newsletter-inner {
    flex-direction: column;
    text-align: center;
    padding: 36px 28px;
    gap: 24px;
  }
  .newsletter-content .nl-icon { margin: 0 auto 12px; }
  .newsletter-form-wrap { max-width: 100%; width: 100%; }
}
@media (max-width: 768px) {
  .newsletter-inner { padding: 28px 20px; border-radius: 14px; }
  .newsletter-content h2 { font-size: 20px; }
  .newsletter-content p  { font-size: 13px; }

  /* Key fix: stack the input + button vertically so button never hides */
  .newsletter-form {
    flex-direction: column;
    background: transparent;
    border: none;
    gap: 10px;
  }
  .newsletter-form input {
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    padding: 13px 16px;
    font-size: 14px;
    color: #fff;
    width: 100%;
  }
  .newsletter-form input::placeholder { color: rgba(255,255,255,0.65); }
  .newsletter-form button {
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 700;
    width: 100%;
    background: #fff;
    color: var(--primary);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* =====================================================
   10. FOOTER — MOBILE REORDER & IMPROVE
   ===================================================== */
@media (max-width: 768px) {
  .footer-main { padding: 36px 0 28px; }

  .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 24px 20px;
  }

  /* Brand col — full width on top */
  .footer-brand {
    grid-column: 1 / -1;
    text-align: center;
  }
  .footer-brand .footer-logo { justify-content: center; }
  .footer-brand .footer-desc { max-width: 320px; margin: 0 auto 16px; }
  .footer-brand .footer-social { justify-content: center; }

  /* Quick Links — left column */
  .footer-grid > .footer-col:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  /* Categories — right column */
  .footer-grid > .footer-col:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  /* Newsletter — full width at bottom */
  .footer-newsletter {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .footer-nl-form { max-width: 400px; }

  .footer-col h4 { font-size: 13px; margin-bottom: 10px; }
  .footer-links a { font-size: 13px; }

  .footer-bottom { padding: 14px 0; }
  .footer-bottom-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .footer-copyright { font-size: 12px; }
  .footer-bottom-links a { font-size: 12px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > .footer-col:nth-child(2),
  .footer-grid > .footer-col:nth-child(3) { grid-column: 1; }
  .footer-grid > .footer-col:nth-child(3) { grid-row: 3; }
  .footer-newsletter { grid-row: 4; }
}

/* =====================================================
   11. ALL CALCULATORS PAGE — IMPROVEMENTS
   ===================================================== */
.page-all-calcs { padding: 24px 0 56px; }
.page-all-calcs-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }

@media (max-width: 768px) {
  .calcs-layout { grid-template-columns: 1fr; gap: 16px; }
  .calcs-sidebar { position: static; }

  /* Horizontal scrollable category pills on mobile */
  .calcs-cat-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 10px;
    gap: 0;
  }
  .calcs-cat-list::-webkit-scrollbar { display: none; }
  .calcs-cat-item {
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
    padding: 10px 14px;
    white-space: nowrap;
  }
  .calcs-cat-item:last-child { border-right: none; }
  .cci-count { display: none; }

  .calcs-grid-3 { grid-template-columns: 1fr; gap: 12px; }

  .calcs-search-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .calcs-search-left { width: 100%; }
  .calcs-search-divider { display: none; }
  .calcs-search-right { width: 100%; justify-content: space-between; }

  .cant-find-box { display: none; } /* hide on mobile, shown in sidebar only on desktop */
}
@media (min-width: 480px) and (max-width: 768px) {
  .calcs-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   12. SINGLE TOOL PAGE — FULL MOBILE RESPONSIVENESS
   ===================================================== */

/* Desktop: keep 2-col layout */
/* Sidebar removed — layout is now stacked stf-sections */
.single-tool-layout {
  display: none;
}
@media (max-width: 1024px) {
  .single-tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { position: static !important; }
}

/* Calculator box — split on desktop, stack on mobile */
.calc-box-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 860px) {
  .calc-box-inner {
    grid-template-columns: 1fr;
  }
  .calc-form-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
@media (max-width: 768px) {
  .single-tool-page { padding: 8px 0 48px; }
  .tool-title { font-size: 22px; }
  .tool-title-row { flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .fav-btn { font-size: 12px; padding: 6px 12px; }
  .tool-desc { font-size: 13px; }

  .calc-box { border-radius: 12px; }
  .calc-form-col,
  .calc-results-col { padding: 20px 16px; }
  .calc-section-title { font-size: 14px; margin-bottom: 14px; }

  /* Inputs */
  .form-input { padding: 10px 12px; font-size: 14px; }
  .form-label { font-size: 12px; }
  .toggle-btn { font-size: 13px; padding: 8px; }

  /* Results */
  .result-highlight { padding: 14px 12px; }
  .result-highlight-value { font-size: 22px; }
  .result-highlight-icon { width: 36px; height: 36px; font-size: 16px; }
  .result-item-label { font-size: 12px; }
  .result-item-value { font-size: 14px; }

  /* Chart */
  .pb-chart-wrap { flex-direction: column; align-items: center; gap: 14px; }
  .donut-chart { width: 120px; height: 120px; }
  .pb-legend { flex-direction: row; flex-wrap: wrap; gap: 10px; justify-content: center; }

  /* Tabs */
  .tabs-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn  { white-space: nowrap; font-size: 13px; padding: 10px 14px; }

  /* Amortization table */
  .amort-table { font-size: 12px; }
  .amort-table th,
  .amort-table td { padding: 8px 8px; }

  /* Action buttons */
  .calc-actions { flex-direction: column; gap: 8px; }
  .calc-actions .btn { width: 100%; justify-content: center; }

  /* Content below calc */
  .tool-content-section h2 { font-size: 18px; }
  .tool-content-section h3 { font-size: 15px; }
  .tool-content-section p  { font-size: 14px; }
  .formula-box { padding: 14px 16px; }
  .formula-display { font-size: 15px; }

  /* Sidebar on mobile — shown below the main content */
  .tool-sidebar { gap: 12px; }
  .sidebar-box-header { padding: 12px 14px; }
  .sidebar-box-body   { padding: 12px 14px; }
  .sidebar-box-header h4 { font-size: 13px; }
  .share-icons { gap: 6px; justify-content: center; }
  .share-icon  { width: 40px; height: 40px; }
  .formula-display-box { font-size: 14px; padding: 12px; }
  .links-list a { font-size: 13px; }
}

/* =====================================================
   13. BLOG PAGE — DISTINCT LAYOUT IMPROVEMENTS
   ===================================================== */
.blog-page { padding: 24px 0 56px; }

/* Page intro bar */
.blog-page-header h1 { font-size: 30px; margin-bottom: 6px; }
.blog-page-header p  { font-size: 15px; color: var(--text-muted); max-width: 520px; }

/* Featured post — more visual weight */
.featured-post {
  border-radius: 16px;
  overflow: hidden;
  gap: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
}
.featured-post-img {
  height: 100%;
  min-height: 240px;
  border-radius: 0;
}
.featured-post-content {
  padding: 24px 26px;
}
.featured-post-title { font-size: 22px; }

/* Latest posts list */
.post-card {
  grid-template-columns: 120px 1fr;
  padding: 18px 0;
}
.post-card-img { height: 88px; border-radius: 10px; }
.post-card-title { font-size: 15px; }

/* Blog 3-col layout on desktop */
@media (min-width: 1024px) {
  .blog-layout {
    grid-template-columns: 210px 1fr 250px;
    gap: 28px;
  }
}

/* Blog mobile */
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 200px 1fr; }
  .blog-sidebar-right { display: none; }
}
@media (max-width: 768px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar-left { position: static; }
  .blog-sidebar-right { display: none; }

  .blog-page-header h1 { font-size: 24px; }
  .blog-header-row { flex-direction: column; gap: 14px; }
  .blog-search-form input { width: 100%; }

  .featured-post {
    grid-template-columns: 1fr;
  }
  .featured-post-img { height: 200px; border-radius: 0; }
  .featured-post-content { padding: 16px; }
  .featured-post-title { font-size: 18px; }
  .featured-post-excerpt { font-size: 13px; }

  .post-card { grid-template-columns: 90px 1fr; gap: 12px; }
  .post-card-img { height: 72px; }
  .post-card-title { font-size: 14px; }

  /* Category list horizontal scroll on mobile */
  .bs-box-body { padding: 6px 8px; }
  .bs-cat-item { padding: 8px; }
  .bs-cat-name { font-size: 13px; }

  .blog-nl-form { padding: 14px; }
  .blog-nl-form input { font-size: 13px; }
}

/* =====================================================
   14. SEARCH PAGE — IMPROVEMENTS
   ===================================================== */
@media (max-width: 768px) {
  .search-results-grid { grid-template-columns: 1fr; gap: 12px; }
}
@media (min-width: 480px) and (max-width: 768px) {
  .search-results-grid { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   15. CLEAN URL — SINGLE TOOL PAGE BREADCRUMB FIX
   (URLs: /emi-calculator/ instead of /tool/emi-calculator/)
   ===================================================== */
.breadcrumb-wrap { padding: 12px 0; }
.breadcrumb a, .breadcrumb .current { font-size: 13px; }

/* =====================================================
   16. SECTION HEADERS — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  .section-header { margin-bottom: 18px; }
  .section-title  { font-size: 18px; }
  .view-all-link  { font-size: 13px; }
}

/* =====================================================
   17. CONTAINER PADDING — TIGHTER ON MOBILE
   ===================================================== */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
}

/* =====================================================
   18. PAGINATION — MOBILE COMPACT
   ===================================================== */
@media (max-width: 480px) {
  .pagination-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pagination { gap: 4px; }
  .page-num { width: 32px; height: 32px; font-size: 12px; border-radius: 6px; }
}

/* =====================================================
   19. MOBILE MENU DRAWER — POLISHED
   ===================================================== */
.mobile-menu-drawer { padding: 16px 18px; }
.mobile-menu-header { margin-bottom: 18px; }
.mobile-nav-item > a { padding: 11px 12px; font-size: 15px; }
.mobile-submenu a    { padding: 8px 12px; font-size: 13.5px; }

/* =====================================================
   20. CARD HOVER — SMOOTH ON ALL PAGES
   ===================================================== */
.category-card, .calc-card, .tool-card, .recent-calc-card {
  will-change: transform;
}
.category-card:focus-visible,
.calc-card:focus-visible,
.tool-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* =====================================================
   21. FREE-TO-USE BAR — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  .free-to-use-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }
  .free-to-use-bar .btn { width: 100%; justify-content: center; }
}

/* =====================================================
   22. TABLET IMPROVEMENTS
   ===================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-title { font-size: 36px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .calculators-grid { grid-template-columns: repeat(2, 1fr); }
  .recent-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-newsletter { grid-column: 1 / -1; }
  .single-tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { position: static !important; }
  .calc-box-inner { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   23. DARK MODE — REFINED COLORS
   ===================================================== */
body.dark-mode .hero-badge {
  background: var(--bg-section);
  border-color: var(--border);
}
body.dark-mode .category-card { background: var(--bg-white); }
body.dark-mode .calc-main     { background: #0F172A; }
body.dark-mode .calc-screen   { background: #1E293B; }
body.dark-mode .calc-btn      { background: #1E293B; }
body.dark-mode .newsletter-inner {
  background: linear-gradient(135deg, #b0531f 0%, #7d3a16 100%);
}
body.dark-mode .sidebar-box   { background: var(--bg-white); }
body.dark-mode .bs-box        { background: var(--bg-white); }
body.dark-mode .tag-pill      { background: var(--bg-light); border-color: var(--border); }
body.dark-mode .form-input    { background: var(--bg-light); border-color: var(--border); color: var(--text-dark); }
body.dark-mode .toggle-btn    { background: var(--bg-light); color: var(--text-muted); }

/* =====================================================
   24. SECTION DIVIDERS — VISUAL SEPARATION
   ===================================================== */
#popular-categories  { border-top: 1px solid var(--border); }
#popular-calculators { border-top: 1px solid var(--border); }
#recently-added      { border-top: 1px solid var(--border); }
#trust-features      { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* =====================================================
   25. TYPOGRAPHY — REFINED
   ===================================================== */
h1, h2, h3 { letter-spacing: -0.3px; }
.section-title { letter-spacing: -0.4px; }
.hero-title    { letter-spacing: -1px; }
@media (max-width: 768px) {
  .hero-title { letter-spacing: -0.4px; }
}

/* =====================================================
   26. TOOL PAGE — STICKY SIDEBAR REFINEMENT
   ===================================================== */
@media (min-width: 1025px) {
  .tool-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    align-self: start;
    max-height: none;
    overflow: visible;
  }
}

/* =====================================================
   27. BLOG SIDEBAR — STICKY REFINEMENT
   ===================================================== */
@media (min-width: 1025px) {
  .blog-sidebar-left {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    max-height: calc(100vh - var(--header-height) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .blog-sidebar-right {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

/* =====================================================
   28. PRINT — CLEAN OUTPUT
   ===================================================== */
@media print {
  #site-header, #site-footer, .tool-sidebar,
  .blog-sidebar-left, .blog-sidebar-right,
  #newsletter-section, .mobile-menu-btn { display: none !important; }
  .single-tool-layout,
  .blog-layout { display: block; }
  body { font-size: 12pt; color: #000; background: #fff; }
}

/* =====================================================
   29. BLOG PAGE — FEATURED POST FULL FIX
   ===================================================== */
.featured-post {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 28px;
  text-decoration: none;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  background: var(--bg-white);
}
.featured-post:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.featured-post-img {
  height: 100%;
  min-height: 220px;
  border-radius: 0;
  background: var(--bg-section);
  overflow: hidden;
}
.featured-post-img img { width:100%;height:100%;object-fit:cover;display:block; }
.featured-post-img.no-image {
  display:flex;align-items:center;justify-content:center;font-size:52px;
}
.featured-post-content { padding: 28px 26px; }
.featured-post-title { font-size: 20px; line-height: 1.35; }
.featured-post-excerpt { font-size: 14px; line-height: 1.7; }

@media (max-width: 768px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-img { height: 200px; min-height: unset; }
  .featured-post-content { padding: 18px; }
  .featured-post-title { font-size: 17px; }
}

/* =====================================================
   30. BLOG POST CARD — IMPROVEMENTS
   ===================================================== */
.post-card {
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 18px 0;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  display: grid;
  transition: var(--transition);
}
.post-card:last-child { border-bottom: none; }
.post-card:hover .post-card-title { color: var(--primary); }
.post-card-img {
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-section);
}
.post-card-img img  { width:100%;height:100%;object-fit:cover; }
.post-card-img.no-image { display:flex;align-items:center;justify-content:center;font-size:28px; }
.post-card-title { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--text-dark); margin-bottom: 5px; transition: var(--transition); }
.post-card-excerpt { font-size: 13px; line-height: 1.55; color: var(--text-muted); margin-bottom: 8px; }
.post-card-cat { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 12px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

@media (max-width: 480px) {
  .post-card { grid-template-columns: 88px 1fr; gap: 12px; }
  .post-card-img { height: 70px; }
  .post-card-title { font-size: 14px; }
}

/* =====================================================
   31. LATEST POSTS TITLE
   ===================================================== */
.latest-posts-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.featured-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* =====================================================
   32. SINGLE BLOG POST — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  .single-post-page { padding: 20px 0 48px; }
  .post-feat-img { height: 220px; border-radius: 12px; }
  .post-article-title { font-size: 22px; line-height: 1.3; }
  .post-article-body h2 { font-size: 18px; }
  .post-article-body h3 { font-size: 16px; }
  .post-article-body p  { font-size: 14px; line-height: 1.75; }
  .post-article-body li { font-size: 14px; }
  .single-post-layout { grid-template-columns: 1fr; }
}

/* =====================================================
   33. ARCHIVE PAGE — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  .archive-page { padding: 20px 0 48px; }
  .archive-layout { grid-template-columns: 1fr; }
  .archive-header h1 { font-size: 22px; }
}

/* =====================================================
   34. 404 PAGE — MOBILE
   ===================================================== */
@media (max-width: 768px) {
  .no-results { padding: 48px 16px; }
  .no-results h3 { font-size: 18px; }
}

/* =====================================================
   35. BADGE COLOUR VARIANTS (blog categories)
   ===================================================== */
.badge-finance     { background: #f5e8df; color: #b0531f; }
.badge-construction{ background: #FFF7ED; color: #C2410C; }
.badge-health      { background: #FFF1F2; color: #BE123C; }
.badge-math        { background: #F5F3FF; color: #6D28D9; }
.badge-converters  { background: #F0FDFA; color: #0F766E; }
.badge-tips        { background: #FEF9C3; color: #854D0E; }

/* =====================================================
   36. SECTION SPACING — CONSISTENT
   ===================================================== */
#popular-categories,
#popular-calculators,
#recently-added { padding: 52px 0; }
#trust-features  { padding: 44px 0; }

@media (max-width: 768px) {
  #popular-categories,
  #popular-calculators,
  #recently-added { padding: 32px 0; }
  #trust-features  { padding: 28px 0; }
}

/* =====================================================
   37. HERO — DESKTOP ILLUSTRATION POLISH
   ===================================================== */
@media (min-width: 1025px) {
  .hero-inner { gap: 60px; }
  .hero-visual { justify-content: flex-end; }
  .hero-calc-illustration { width: 420px; height: 360px; }
  .calc-main { width: 210px; height: 252px; }
}

/* =====================================================
   38. FORM FOCUS RINGS — ACCESSIBILITY
   ===================================================== */
.form-input:focus,
.hero-search-form input:focus,
.footer-nl-form input:focus,
.newsletter-form input:focus,
.blog-nl-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200,96,42,0.12); }

/* =====================================================
   39. SKIP LINK — VISIBLE ON FOCUS
   ===================================================== */
.skip-link:focus {
  position:fixed;top:8px;left:8px;z-index:99999;
  background:var(--primary);color:#fff;
  padding:10px 18px;border-radius:8px;
  font-size:14px;font-weight:600;
  text-decoration:none;
  box-shadow:var(--shadow-lg);
}

/* =====================================================
   40. ANIMATIONS — REDUCED MOTION RESPECT
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  .float-card,
  .category-card, .calc-card, .tool-card,
  .recent-calc-card, .featured-post { animation: none !important; transition: none !important; transform: none !important; }
}

/* =====================================================
   41. TAG PILLS — DARK MODE
   ===================================================== */
body.dark-mode .tag-pill { color: var(--text-muted); }
body.dark-mode .tag-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* =====================================================
   42. NEWSLETTER SECTION — DESKTOP REFINEMENT
   ===================================================== */
@media (min-width: 901px) {
  .newsletter-inner { align-items: center; gap: 60px; }
  .newsletter-content { flex-shrink: 0; }
  .newsletter-form-wrap { max-width: 380px; }
  .newsletter-form { border-radius: var(--radius-md); overflow: hidden; }
}

/* =====================================================
   43. FOOTER NEWSLETTER FORM — MOBILE
   ===================================================== */
@media (max-width: 480px) {
  .footer-nl-form { flex-direction: column; border: none; border-radius: 0; gap: 8px; }
  .footer-nl-form input  { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; }
  .footer-nl-form button { border-radius: var(--radius-md); padding: 11px 18px; }
}

/* =====================================================
   44. ALL CALCULATORS — SIDEBAR DESKTOP STICKY
   ===================================================== */
@media (min-width: 769px) {
  .calcs-sidebar { position: sticky; top: calc(var(--header-height) + 16px); }
  .calcs-cat-list { flex-direction: column; display: flex; }
  .calcs-cat-item { border-right: none; border-bottom: 1px solid var(--border-light); white-space: normal; }
  .calcs-cat-item:last-child { border-bottom: none; }
  .cci-count { display: inline; }
}

/* =====================================================
   45. TOOL PAGE BREADCRUMB — SEO CLEAN URL DISPLAY
   ===================================================== */
.breadcrumb { font-size: 13px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); margin: 0 2px; }
.breadcrumb .current { color: var(--text-dark); font-weight: 500; }

/* =====================================================
   46. SIDEBAR — ICON-ONLY SHARE BUTTONS (IMAGE MATCH)
   ===================================================== */

/* Row of 5 circular icon-only share buttons */
.sb-share-icons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 2px;
  flex-wrap: nowrap;
}

.sb-sico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.sb-sico:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

/* Social brand colours */
.sb-sico-fb   { background: #1877F2; color: #fff; }
.sb-sico-tw   { background: #1DA1F2; color: #fff; }
.sb-sico-li   { background: #0A66C2; color: #fff; }
.sb-sico-wa   { background: #25D366; color: #fff; }
.sb-sico-copy {
  background: var(--bg-light, #F8FAFC);
  color: var(--text-muted, #64748B);
  border: 1.5px solid var(--border, #E2E8F0);
}
.sb-sico-copy:hover {
  background: var(--primary-light, #f5e8df);
  color: var(--primary, #c8602a);
  border-color: var(--primary, #c8602a);
}

/* Dark mode */
body.dark-mode .sb-sico-copy {
  background: #374151;
  border-color: #4B5563;
  color: #9CA3AF;
}

/* =====================================================
   47. RELATED TOOLS — FULL MOBILE RESPONSIVENESS FIX
   ===================================================== */

/* Make sure grid is properly defined on all sizes */
.related-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Tablet: still 2-col but smaller */
@media (max-width: 900px) {
  .related-tools-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* Mobile: single column, full width */
@media (max-width: 640px) {
  .related-tools-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .related-tool-card {
    padding: 12px 14px !important;
    gap: 10px;
  }
  .related-tool-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    flex-shrink: 0;
  }
  .related-tool-name {
    font-size: 13px !important;
    white-space: normal !important;
  }
  .related-tool-desc {
    white-space: normal !important;
  }
  .related-tool-arrow {
    opacity: 1 !important;
    display: flex;
  }
  .related-tools-section {
    margin-top: 24px;
    padding-top: 20px;
  }
  .related-tools-title {
    font-size: 16px !important;
  }
  .related-tools-subtitle {
    font-size: 12px !important;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .related-tool-card {
    padding: 10px 12px !important;
  }
  .related-tool-name { font-size: 12.5px !important; }
}

/* =====================================================
   48. SIDEBAR OVERALL LAYOUT — DESKTOP CLEAN FIX
   ===================================================== */

/* Ensure sidebar stacks cards properly */
.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Remove old sb-card margin conflicts */
.tool-sidebar .sb-card {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Desktop sticky */
@media (min-width: 1025px) {
  .tool-sidebar {
    position: sticky;
    top: calc(var(--header-height, 64px) + 16px);
    align-self: start;
    overflow: visible;
  }
}

/* On tablet/mobile sidebar shows below content */
@media (max-width: 1024px) {
  .tool-sidebar {
    position: static !important;
    gap: 12px;
  }
  .sb-share-icons-row {
    gap: 8px;
  }
  .sb-sico {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  .sb-sico {
    width: 36px;
    height: 36px;
  }
  .sb-sico svg {
    width: 16px;
    height: 16px;
  }
}
