:root {
    --text-muted: #777;
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --tag-bg: rgba(30, 115, 190, 0.08);
    --code-bg: #f5f5f5;
    --text-light: #999;
}

/* ============================================
   Calculator Cards Layout
   ============================================ */

/* Search Section */
.search-section {
    margin-bottom: 32px;
}

.search-box-large {
    position: relative;
    max-width: 480px;
}

.search-box-large .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.search-box-large input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.search-box-large input:focus {
    border-color: #1e73be;
    box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.1);
}

/* Category Section */
.category-section {
    margin-bottom: 36px;
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8e8;
}

.section-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
}

.section-count {
    font-size: 0.85rem;
    color: #888;
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

/* Individual Card */
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px;
    text-decoration: none !important;
    color: #333 !important;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: #1e73be;
    box-shadow: 0 4px 16px rgba(30, 115, 190, 0.12);
    transform: translateY(-2px);
}

.card:active {
    transform: translateY(0);
}

/* Card Icon */
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e73be, #155a9b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* Card Body */
.card-body {
    flex: 1;
}

.card-body h3 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

.card-body .desc {
    font-size: 0.82rem;
    color: #777;
    line-height: 1.45;
}

/* Category Badge */
.cat-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.72rem;
    color: #1e73be;
    background: rgba(30, 115, 190, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    align-self: flex-start;
}

/* Category-specific icon colors */
.category-section:nth-child(2) .card-icon { background: linear-gradient(135deg, #1e73be, #155a9b); }
.category-section:nth-child(3) .card-icon { background: linear-gradient(135deg, #7b1fa2, #4a148c); }
.category-section:nth-child(4) .card-icon { background: linear-gradient(135deg, #00897b, #004d40); }
.category-section:nth-child(5) .card-icon { background: linear-gradient(135deg, #e65100, #bf360c); }
.category-section:nth-child(6) .card-icon { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.category-section:nth-child(7) .card-icon { background: linear-gradient(135deg, #c62828, #b71c1c); }
.category-section:nth-child(8) .card-icon { background: linear-gradient(135deg, #f57c00, #e65100); }
.category-section:nth-child(9) .card-icon { background: linear-gradient(135deg, #283593, #1a237e); }
.category-section:nth-child(10) .card-icon { background: linear-gradient(135deg, #00695c, #004d40); }
.category-section:nth-child(11) .card-icon { background: linear-gradient(135deg, #4a148c, #311b92); }
.category-section:nth-child(12) .card-icon { background: linear-gradient(135deg, #b71c1c, #880e4f); }
.category-section:nth-child(13) .card-icon { background: linear-gradient(135deg, #1b5e20, #0d5302); }
.category-section:nth-child(14) .card-icon { background: linear-gradient(135deg, #37474f, #263238); }
.category-section:nth-child(15) .card-icon { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.category-section:nth-child(16) .card-icon { background: linear-gradient(135deg, #5d4037, #3e2723); }
.category-section:nth-child(17) .card-icon { background: linear-gradient(135deg, #e65100, #bf360c); }

/* No results message */
#noResults {
    text-align: center;
    padding: 48px 0;
    color: #888;
}
#noResults p {
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 12px;
    }

    .card {
        padding: 14px;
    }

    .card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 10px;
    }

    .card-body h3 {
        font-size: 0.9rem;
    }

    .card-body .desc {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ============================================
   Subpage Layout Fixes
   ============================================ */

.inside-article {
    padding: 0;
}

.separate-containers .inside-article {
    padding: 20px 40px 0 40px;
}

.page-template-template-subpage .entry-header {
    display: none;
}

/* Subpage: full-width content (override GeneratePress sidebar) */
.page-template-template-subpage .site-content .content-area {
    width: 100% !important;
}

.page-template-template-subpage .is-left-sidebar,
.page-template-template-subpage .is-right-sidebar {
    display: none !important;
}

/* Subpage main container padding */
.page-template-template-subpage .site-content > main.container {
    padding-left: 40px;
    padding-right: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Force flex column for GeneratePress grid */
.site.grid-container {
    display: flex;
    flex-direction: column !important;
}

.site-content {
    flex: 1;
}

/* Mobile */
@media (max-width: 768px) {
    .separate-containers .inside-article {
        padding: 15px;
    }

    .page-template-template-subpage .site-content > main.container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ============================================
   Articles Page Layout
   ============================================ */
.articles-hero {
    background: linear-gradient(135deg, #1e73be, #155a9b);
    color: #fff;
    padding: 48px 40px;
    border-radius: 12px;
    margin-bottom: 32px;
}
.articles-hero h1 {
    margin: 0 0 12px 0;
    font-size: 1.8rem;
    color: #fff;
}
.articles-hero p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
}
.blog-main .section-title {
    margin: 32px 0 16px 0;
    font-size: 1.25rem;
    color: #222;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 8px;
}
.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.article-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.article-list li:last-child {
    border-bottom: none;
}
.article-list li a {
    display: block;
    font-weight: 600;
    color: #1e73be;
    text-decoration: none;
    margin-bottom: 4px;
}
.article-list li a:hover {
    text-decoration: underline;
}
.article-list li span {
    display: block;
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}
.blog-sidebar {
    padding-left: 20px;
    border-left: 1px solid #e8e8e8;
}
.sidebar-box {
    margin-bottom: 24px;
}
.sidebar-box h3 {
    font-size: 0.95rem;
    margin: 0 0 10px 0;
    color: #222;
}
.sidebar-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-box ul li {
    padding: 6px 0;
}
.sidebar-box ul li a {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
}
.sidebar-box ul li a:hover {
    color: #1e73be;
}

@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }    .blog-sidebar {
        padding-left: 0;
        border-left: none;
        padding-top: 24px;
        border-top: 1px solid #e8e8e8;
    }
    .blog-sidebar .sidebar-box {
        margin-bottom: 16px;
    }
    .articles-hero {
        padding: 32px 20px;
    }
}

/* Subpage content area fixes */
.inside-article {
    padding: 0;
}

/* Ensure content fills width */
.separate-containers .inside-article {
    padding: 20px 40px 0 40px;
}

/* Subpage specific header spacing for content that has its own heading */
.page-template-template-subpage .entry-header {
    display: none;
}

/* Subpage: full-width content (override GeneratePress sidebar) */
.page-template-template-subpage .site-content .content-area {
    width: 100% !important;
}

.page-template-template-subpage .is-left-sidebar,
.page-template-template-subpage .is-right-sidebar {
    display: none !important;
}

/* Subpage main container padding */
.page-template-template-subpage .site-content > main.container {
    padding-left: 40px;
    padding-right: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Force flex column for GeneratePress grid */
.site.grid-container {
    display: flex;
    flex-direction: column !important;
}

.site-content {
    flex: 1;
}

/* Mobile */
@media (max-width: 768px) {
    .separate-containers .inside-article {
        padding: 15px;
    }

    .page-template-template-subpage .site-content > main.container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

    .blog-sidebar {
        padding-left: 0;
        border-left: none;
        padding-top: 24px;
        border-top: 1px solid #e8e8e8;
    }
    .blog-sidebar .sidebar-box {
        margin-bottom: 16px;
    }
    .articles-hero {
        padding: 32px 20px;
    }
}

/* Subpage content area fixes */
.inside-article {
    padding: 0;
}

/* Ensure content fills width */
.separate-containers .inside-article {
    padding: 20px 40px 0 40px;
}

/* Subpage specific header spacing for content that has its own heading */
.page-template-template-subpage .entry-header {
    display: none;
}

/* Subpage: full-width content (override GeneratePress sidebar) */
.page-template-template-subpage .site-content .content-area {
    width: 100% !important;
}

.page-template-template-subpage .is-left-sidebar,
.page-template-template-subpage .is-right-sidebar {
    display: none !important;
}

/* Subpage main container padding */
.page-template-template-subpage .site-content > main.container {
    padding-left: 40px;
    padding-right: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Force flex column for GeneratePress grid */
.site.grid-container {
    display: flex;
    flex-direction: column !important;
}

.site-content {
    flex: 1;
}

/* Mobile */
@media (max-width: 768px) {
    .separate-containers .inside-article {
        padding: 15px;
    }

    .page-template-template-subpage .site-content > main.container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

    .blog-sidebar {
        padding-left: 0;
        border-left: none;
        padding-top: 24px;
        border-top: 1px solid #e8e8e8;
    }
    .blog-sidebar .sidebar-box {
        margin-bottom: 16px;
    }
    .articles-hero {
        padding: 32px 20px;
    }
}

/* Subpage content area fixes */
.inside-article {
    padding: 0;
}
.separate-containers .inside-article {
    padding: 20px 40px 0 40px;
}
.page-template-template-subpage .entry-header {
    display: none;
}
.page-template-template-subpage .site-content .content-area {
    width: 100% !important;
}
.page-template-template-subpage .is-left-sidebar,
.page-template-template-subpage .is-right-sidebar {
    display: none !important;
}
.page-template-template-subpage .site-content > main.container {
    padding-left: 40px;
    padding-right: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.site.grid-container {
    display: flex;
    flex-direction: column !important;
}
.site-content {
    flex: 1;
}
@media (max-width: 768px) {
    .separate-containers .inside-article {
        padding: 15px;
    }
    .page-template-template-subpage .site-content > main.container {
        padding-left: 20px;
        padding-right: 20px;
    }
}


/* Subpages: fix flex-direction to column (articles has hero + container as siblings) */
.page-template-template-subpage .site-content {
    flex-direction: column !important;
}

/* ============================================
   Page Hero (shared: converters, downloads, etc.)
   ============================================ */
.page-hero {
  background: linear-gradient(135deg, #1e73be, #155a9b);
  color: #fff;
  border-radius: 12px;
  padding: 36px 40px;
  margin-bottom: 28px;
}

/* ============================================
   Converters Page
   ============================================ */
.converters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.converter-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: default;
}

.converter-card:hover {
  border-color: #1e73be;
  box-shadow: 0 4px 16px rgba(30, 115, 190, 0.12);
  transform: translateY(-2px);
}

.conv-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1e73be, #155a9b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.converter-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #222;
}

.converter-card p {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #777;
  line-height: 1.5;
}

.conv-tag {
  display: inline-block;
  font-size: 0.72rem;
  color: #1e73be;
  background: rgba(30, 115, 190, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* ============================================
   Downloads Page
   ============================================ */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.download-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.download-card:hover {
  border-color: #1e73be;
  box-shadow: 0 4px 16px rgba(30, 115, 190, 0.12);
  transform: translateY(-2px);
}

.dl-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dl-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  color: #fff;
}

.dl-type.zip  { background: linear-gradient(135deg, #f57c00, #e65100); }
.dl-type.pdf  { background: linear-gradient(135deg, #dc3545, #a71d2a); }
.dl-type.xlsx { background: linear-gradient(135deg, #217346, #165a36); }
.dl-type.md   { background: linear-gradient(135deg, #2c3e50, #1a252f); }
.dl-type.html { background: linear-gradient(135deg, #e44d26, #a84124); }
.dl-type.txt  { background: linear-gradient(135deg, #555, #333); }

.dl-header h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #222;
  flex: 1;
}

.download-card p {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: #777;
  line-height: 1.5;
  flex: 1;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #1e73be;
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s;
  align-self: flex-start;
}

.dl-btn:hover {
  background: #155a9b;
}

.dl-btn.hl {
  background: #2e7d32;
}

.dl-btn.hl:hover {
  background: #1b5e20;
}

@media (max-width: 768px) {
  .converters-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }
  .downloads-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-hero {
    padding: 24px 20px;
  }
  .page-hero h1 {
    font-size: 1.5rem;
  }
}

/* ============================================
   Site Footer — match homepage dark theme
   ============================================ */
.site-footer,
.footer-widgets,
.footer-widgets-container,
.inside-footer-widgets {
  background: #212529 !important;
  color: rgba(255, 255, 255, 0.55);
}

.site-footer {
  padding: 48px 24px 0;
  border-top: none;
}

.site-footer .footer-widgets-container.grid-container {
  max-width: 1200px;
}

.site-footer .footer-col {
  background: transparent;
  padding: 0;
}

.site-footer .footer-col h4 {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.site-footer .footer-brand-name {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.site-footer .footer-brand-accent {
  color: #0d6efd;
}

.site-footer .footer-brand-desc {
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 10px 0 18px;
  max-width: 340px;
}

.site-footer .footer-contact {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.site-footer .footer-contact-item {
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.78rem;
}

.site-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer .footer-links li {
  margin-bottom: 8px;
}

.site-footer .footer-links a {
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer .footer-links a:hover {
  color: #0d6efd;
}

.site-footer .footer-contact-email {
  color: #f59e0b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer .footer-contact-email:hover {
  color: #fbbf24;
}

/* Site info / copyright bar */
.site-footer .site-info,
.site-info {
  background: #212529 !important;
  color: rgba(255, 255, 255, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px 0;
  margin-top: 32px;
}

.site-footer .site-info .inside-site-info,
.inside-site-info.grid-container {
  max-width: 1200px;
  background: transparent !important;
}

.site-footer .copyright-bar,
.copyright-bar {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.76rem;
  text-align: center;
  background: transparent !important;
}

.site-footer .copyright-bar a,
.copyright-bar a {
  color: rgba(255, 255, 255, 0.40);
}

.site-footer .copyright-bar a:hover,
.copyright-bar a:hover {
  color: #0d6efd;
}

@media (max-width: 900px) {
  .site-footer .footer-widgets-container.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .site-footer .footer-brand-col {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .site-footer .footer-widgets-container.grid-container {
    grid-template-columns: 1fr;
  }
  .site-footer .footer-brand-col {
    grid-column: span 1;
  }
}
