
/* =========================================================
   CALC SITE TEMPLATES 1.4
   ========================================================= */

.cst-single-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Breadcrumb: deliberately separated from the header */
.cst-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 28px 0 34px;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
}

.cst-breadcrumbs a {
    color: #2563d9;
    text-decoration: none;
}

.cst-breadcrumbs a:hover {
    text-decoration: underline;
}

.cst-breadcrumbs strong {
    color: #334155;
    font-weight: 600;
}

.cst-crumb-sep {
    color: #a7b0bd;
    font-size: 19px;
}

.cst-crumb-chip {
    color: #2563d9 !important;
}

/* EXACTLY TWO VISUAL CONTAINERS */
.cst-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    align-items: start;
}

.cst-main-container,
.cst-sidebar-container {
    background: #ffffff;
    border: 1px solid #e4e9f1;
    border-radius: 18px;
    box-shadow: 0 7px 25px rgba(28, 45, 75, 0.055);
}

.cst-main-container {
    min-width: 0;
    padding: 34px;
}

.cst-sidebar-container {
    padding: 24px;
}

/* Main heading */
.cst-calculator-header {
    margin-bottom: 26px;
}

.cst-eyebrow {
    display: block;
    margin-bottom: 10px;
    color: #1554d1;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .15em;
    line-height: 1.3;
    text-transform: uppercase;
}

.cst-calculator-header h1 {
    margin: 0 0 14px;
    color: #173f7a;
    font-size: clamp(38px, 4.2vw, 58px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.cst-calculator-intro {
    max-width: 850px;
    margin: 0;
    color: #536174;
    font-size: 17px;
    line-height: 1.7;
}

/* Content area: your calculator + SEO content */
.cst-content {
    color: #334155;
    font-size: 16px;
    line-height: 1.75;
}

.cst-content > :first-child {
    margin-top: 0;
}

.cst-content h2 {
    margin-top: 38px;
    color: #17233b;
    font-size: 30px;
    line-height: 1.25;
}

.cst-content h3 {
    margin-top: 30px;
    color: #17233b;
    font-size: 22px;
}

.cst-content img {
    max-width: 100%;
    height: auto;
}

.cst-content table {
    width: 100%;
    border-collapse: collapse;
}

.cst-content th,
.cst-content td {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
}

/* Sidebar */
.cst-sidebar-container {
    position: sticky;
    top: 24px;
}

.cst-sidebar-title {
    margin: 0 0 17px;
    color: #173f7a;
    font-size: 20px;
    line-height: 1.3;
}

.cst-ad-section {
    padding-bottom: 25px;
    border-bottom: 1px solid #e7ebf1;
}

.cst-widget {
    width: 100%;
    margin: 0;
}

.cst-widget-title {
    display: none;
}

/* 300x250 placeholder for when no widget/ad is configured */
.cst-ad-placeholder {
    width: 300px;
    max-width: 100%;
    height: 250px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 16px;
    font-weight: 600;
}

.cst-categories-section {
    padding-top: 25px;
}

.cst-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cst-category-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #edf0f4;
}

.cst-category-list li:last-child {
    border-bottom: 0;
}

.cst-category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 2px;
    color: #27364a;
    font-size: 15px;
    text-decoration: none;
}

.cst-category-list a:hover {
    color: #1554d1;
}

.cst-category-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cst-folder-icon {
    color: #64748b;
    font-size: 18px;
    line-height: 1;
}

.cst-category-count {
    min-width: 27px;
    height: 24px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f4f8;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.cst-no-category {
    color: #64748b;
    font-size: 13px;
}

/* Related calculators at bottom of LEFT container */
.cst-related-section {
    margin-top: 48px;
    padding-top: 30px;
    border-top: 1px solid #e7ebf1;
}

.cst-related-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.cst-related-heading h2 {
    margin: 0;
    color: #17233b;
    font-size: 28px;
    line-height: 1.2;
}

.cst-view-category {
    color: #1554d1;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.cst-view-category:hover {
    text-decoration: underline;
}

.cst-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cst-related-card {
    min-width: 0;
    min-height: 175px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #17233b;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cst-related-card:hover {
    transform: translateY(-2px);
    border-color: #cbd8ed;
    box-shadow: 0 9px 22px rgba(30, 52, 88, .08);
}

.cst-related-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #edf3ff;
    color: #1554d1;
    font-size: 19px;
    font-weight: 800;
}

.cst-related-title {
    color: #17233b;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
}

.cst-related-desc {
    margin-top: 6px;
    color: #718096;
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cst-related-link {
    margin-top: auto;
    padding-top: 12px;
    color: #1554d1;
    font-size: 12px;
    font-weight: 750;
}

/* =========================================================
   CATEGORY PAGE
   ========================================================= */

.cst-category-hero {
    border-bottom: 1px solid #e3e9f2;
    background: linear-gradient(135deg, #f4f8ff, #eef5ff 55%, #eaf8f4);
}

.cst-category-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 58px;
}

.cst-category-hero .cst-breadcrumbs {
    margin-bottom: 45px;
}

.cst-category-hero h1 {
    margin: 0 0 15px;
    color: #173f7a;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.cst-category-description {
    max-width: 800px;
    color: #536174;
    font-size: 17px;
    line-height: 1.75;
}

.cst-category-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 55px 24px 80px;
}

.cst-category-section-head {
    margin-bottom: 25px;
}

.cst-category-section-head h2 {
    margin: 0 0 7px;
    color: #17233b;
    font-size: 31px;
}

.cst-category-section-head p {
    margin: 0;
    color: #667386;
}

.cst-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.cst-pagination {
    margin-top: 35px;
}

.cst-pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cst-pagination a,
.cst-pagination span {
    display: block;
    padding: 9px 13px;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    text-decoration: none;
}

.cst-pagination .current {
    border-color: #1554d1;
    background: #1554d1;
    color: #fff;
}

.cst-category-info {
    margin-top: 60px;
    padding: 35px;
    border-radius: 16px;
    background: #f7f9fc;
}

.cst-category-info h2 {
    margin-top: 0;
    color: #17233b;
}

.cst-category-info p {
    color: #526174;
    line-height: 1.75;
}

.cst-empty {
    padding: 35px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    text-align: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1050px) {
    .cst-two-column {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .cst-main-container {
        padding: 28px;
    }

    .cst-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cst-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .cst-two-column {
        grid-template-columns: 1fr;
    }

    .cst-sidebar-container {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
        gap: 25px;
    }

    .cst-ad-section {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .cst-categories-section {
        padding-top: 0;
        border-left: 1px solid #e7ebf1;
        padding-left: 25px;
    }
}

@media (max-width: 640px) {
    .cst-single-wrap {
        padding: 0 15px 55px;
    }

    .cst-breadcrumbs {
        margin-top: 22px;
        margin-bottom: 24px;
        font-size: 13px;
    }

    .cst-two-column {
        gap: 18px;
    }

    .cst-main-container,
    .cst-sidebar-container {
        border-radius: 14px;
    }

    .cst-main-container {
        padding: 20px;
    }

    .cst-sidebar-container {
        display: block;
        padding: 20px;
    }

    .cst-calculator-header h1 {
        font-size: 36px;
    }

    .cst-calculator-intro {
        font-size: 15px;
    }

    .cst-related-heading {
        display: block;
    }

    .cst-view-category {
        display: inline-block;
        margin-top: 10px;
    }

    .cst-related-grid {
        grid-template-columns: 1fr;
    }

    .cst-category-grid {
        grid-template-columns: 1fr;
    }

    .cst-category-hero-inner {
        padding: 20px 15px 45px;
    }

    .cst-category-hero .cst-breadcrumbs {
        margin-bottom: 35px;
    }

    .cst-category-hero h1 {
        font-size: 36px;
    }

    .cst-category-content {
        padding: 42px 15px 55px;
    }

    .cst-category-info {
        padding: 25px 20px;
        margin-top: 45px;
    }
}


/* =========================================================
   ALL CALCULATORS PAGE
   ========================================================= */

.cst-all-calculators-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 55px 24px 80px;
}

.cst-all-hero {
    margin-bottom: 48px;
    padding: 48px;
    border: 1px solid #e1e8f2;
    border-radius: 20px;
    background: linear-gradient(135deg, #f4f8ff, #eef5ff 60%, #effaf6);
}

.cst-all-hero h1 {
    margin: 0 0 14px;
    color: #173f7a;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.cst-all-hero p {
    max-width: 760px;
    margin: 0;
    color: #536174;
    font-size: 17px;
    line-height: 1.7;
}

.cst-all-category {
    margin-bottom: 42px;
    padding: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(28,45,75,.045);
}

.cst-all-category-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.cst-all-category-heading h2 {
    margin: 0;
    color: #17233b;
    font-size: 29px;
    line-height: 1.2;
}

.cst-all-calculator-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cst-no-calculators {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 850px) {
    .cst-all-calculator-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .cst-all-calculators-page {
        padding: 35px 15px 55px;
    }

    .cst-all-hero {
        padding: 30px 22px;
        border-radius: 15px;
    }

    .cst-all-category {
        padding: 20px;
        border-radius: 14px;
    }

    .cst-all-category-heading {
        display: block;
    }

    .cst-all-category-heading .cst-view-category {
        display: inline-block;
        margin-top: 10px;
    }

    .cst-all-calculator-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   FULL-WIDTH CATEGORY ARCHIVE
   ========================================================= */

body.taxonomy-calculator-category .site-content,
body.tax-calculator-category .site-content,
body:has(.cst-category-page) .site-content {
    width: 100%;
    max-width: 100%;
}

body:has(.cst-category-page) .content-area {
    width: 100%;
    max-width: none;
    float: none;
}

.cst-category-page {
    width: 100%;
}

.cst-category-hero,
.cst-category-content {
    width: 100%;
}

.cst-category-hero-inner,
.cst-category-content {
    box-sizing: border-box;
}

.cst-category-info {
    display: none !important;
}


/* =========================================================
   FORCE TRUE FULL-WIDTH CATEGORY ARCHIVE
   GeneratePress can keep the content area at ~66% even when
   the sidebar is disabled by a layout/Element setting.
   Force the outer grid itself to one column.
   ========================================================= */

body:has(.cst-category-page) .site-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
}

body:has(.cst-category-page) .site-content,
body:has(.cst-category-page) .content-area,
body:has(.cst-category-page) .site-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    float: none !important;
    flex: 0 0 100% !important;
}

body:has(.cst-category-page) .site-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body:has(.cst-category-page) .inside-article {
    width: 100% !important;
    max-width: none !important;
}

body:has(.cst-category-page) .cst-category-page {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Keep the actual content nicely centered instead of stretching text
   edge-to-edge. */
body:has(.cst-category-page) .cst-category-hero-inner,
body:has(.cst-category-page) .cst-category-content {
    width: min(1180px, calc(100% - 48px)) !important;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 600px) {
    body:has(.cst-category-page) .cst-category-hero-inner,
    body:has(.cst-category-page) .cst-category-content {
        width: calc(100% - 30px) !important;
    }
}


/* =========================================================
   v2.3 - OVERRIDE GENERATEPRESS SIDEBAR WIDTH
   ========================================================= */

/* New GeneratePress grid layout */
body.cst-full-width-calculators .site.grid-container,
body.cst-full-width-calculators .site-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* Classic GeneratePress layout */
body.cst-full-width-calculators .site-content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

body.cst-full-width-calculators #primary,
body.cst-full-width-calculators .content-area,
body.cst-full-width-calculators .site-main {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    left: auto !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Hide GeneratePress sidebars completely on these pages. */
body.cst-full-width-calculators #right-sidebar,
body.cst-full-width-calculators #left-sidebar,
body.cst-full-width-calculators .widget-area,
body.cst-full-width-calculators .is-right-sidebar,
body.cst-full-width-calculators .is-left-sidebar {
    display: none !important;
    width: 0 !important;
    flex: 0 0 0 !important;
}

/* Prevent old theme CSS from limiting the category wrapper. */
body.cst-full-width-calculators .inside-article,
body.cst-full-width-calculators .entry-content,
body.cst-full-width-calculators .cst-category-page {
    width: 100% !important;
    max-width: none !important;
}

/* Keep the actual category content centered and readable. */
body.cst-full-width-calculators .cst-category-hero-inner,
body.cst-full-width-calculators .cst-category-content {
    width: min(1180px, calc(100% - 48px)) !important;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 600px) {
    body.cst-full-width-calculators .cst-category-hero-inner,
    body.cst-full-width-calculators .cst-category-content {
        width: calc(100% - 30px) !important;
    }
}
