/**
 * TopLine Rate Pages Styles
 * Styles for individual rate pages (Savings, Checking, Certificates, Loans, Business, Mortgage)
 * Content width matches header .container-wide (1400px, 35px gutters).
 */

:root {
    --topline-rates-max-width: 1400px;
    --topline-rates-gutter: 35px;
    --rate-table-border: #f2f4f6;
    --rate-table-border-header: #eceff3;
    --rate-table-border-outer: #e8ebef;
    --rate-table-header-bg: #f8f9fa;
}

/* Elementor: let the widget use full section width, then align inner shell to nav */
.elementor-widget-topline_rate_page_content {
    width: 100%;
    max-width: 100%;
}

.elementor-widget-topline_rate_page_content > .elementor-widget-container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.topline-rate-page-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    width: 100%;
    max-width: var(--topline-rates-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--topline-rates-gutter);
    padding-right: var(--topline-rates-gutter);
    box-sizing: border-box;
}

.topline-rate-page-content .rate-section {
    width: 100%;
    max-width: 100%;
}

/* Rate Section */
.rate-section {
    margin-bottom: 48px;
}

.rate-section:last-child {
    margin-bottom: 0;
}

.rate-section__title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #0C2333;
    margin: 0 0 16px 0;
    padding-bottom: 0;
    border-bottom: none;
    letter-spacing: -0.02em;
}

.rate-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
    font-style: italic;
}

.rate-highlight {
    font-size: 18px;
    font-weight: 600;
    color: #5AA9AC;
    margin: 0 0 16px 0;
}

/* Rate Table Wrapper */
.topline-rate-page-content .rate-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 16px;
    border-radius: 20px;
    box-shadow: none;
    border: 1px solid var(--rate-table-border-outer);
    -webkit-overflow-scrolling: touch;
}

.rate-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 16px;
    border-radius: 20px;
    box-shadow: none;
    border: 1px solid var(--rate-table-border-outer);
    -webkit-overflow-scrolling: touch;
}

.rate-table-wrapper--multi {
    margin-bottom: 24px;
}

/* Rate Table */
.rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}

.topline-rate-page-content .rate-table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Rounded outer corners (rate pages only) */
.topline-rate-page-content .rate-table thead tr:first-child th:first-child {
    border-top-left-radius: 20px;
}

.topline-rate-page-content .rate-table thead tr:first-child th:last-child {
    border-top-right-radius: 20px;
}

.topline-rate-page-content .rate-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 20px;
}

.topline-rate-page-content .rate-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 20px;
}

.rate-table thead {
    background: var(--rate-table-header-bg);
    color: #0c2333;
}

.rate-table thead th {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #0c2333;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    border: 1px solid var(--rate-table-border);
    vertical-align: middle;
    background: var(--rate-table-header-bg);
}

.rate-table--multi thead th {
    text-align: center;
}

.rate-table--multi thead th[rowspan] {
    text-align: center;
    vertical-align: bottom;
    padding-bottom: 14px;
    border-right: 1px solid var(--rate-table-border-header);
}

.rate-table--multi thead tr:first-child th {
    border-bottom: 1px solid var(--rate-table-border-header);
}

.rate-table--multi thead tr:first-child th[colspan] {
    text-align: center;
}

.rate-table--multi thead tr:nth-child(2) th {
    border-top: 1px solid var(--rate-table-border-header);
}

.rate-table tbody tr {
    transition: background-color 0.15s ease;
}

.rate-table tbody td {
    border: 1px solid var(--rate-table-border);
    background: #fff;
}

.rate-table tbody tr:last-child td {
    border-bottom: 1px solid var(--rate-table-border);
}

.rate-table tbody tr:hover {
    background-color: #f9fafb;
}


.rate-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    text-align: center;
}

.rate-table--multi tbody td {
    text-align: center;
}

.rate-table--multi tbody td:first-child {
    text-align: center;
    font-weight: 500;
}

/* Account Type Column — same white surface as rate cells */
.rate-table .account-type {
    font-weight: 600;
    color: #0C2333;
    text-align: center;
    background: #fff;
}

.rate-table tbody tr:hover .account-type {
    background: #f9fafb;
}

/* APY Highlight */
.rate-table .apy {
    font-weight: 700;
    color: #5AA9AC;
}

/* Disclaimers and Notes */
.topline-rate-page-content .rate-disclaimer,
.topline-rate-page-content div.rate-disclaimer,
.topline-rate-page-content .rate-note,
.rate-disclaimer,
div.rate-disclaimer,
.rate-note {
    font-size: 14px;
    line-height: 1.4em;
    color: #838383;
    margin: 16px 0 8px 0;
}

.topline-rate-page-content .rate-note,
.rate-note {
    margin: 8px 0;
}

/* Insurance Section */
.rate-section--insurance {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 24px 32px;
    border-radius: 12px;
    border-left: 4px solid #5AA9AC;
    margin-top: 48px;
}

.insurance-note {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    margin: 0 0 12px 0;
}

/* Reset WYSIWYG / Elementor paragraph styles inside disclosures */
.topline-rate-page-content .rate-disclaimer,
.topline-rate-page-content .rate-disclaimer *,
.topline-rate-page-content .rate-note,
.topline-rate-page-content .rate-note *,
.rate-disclaimer,
.rate-disclaimer *,
.rate-note,
.rate-note * {
    font-size: 14px !important;
    line-height: 1.4em !important;
    color: #838383 !important;
}

.topline-rate-page-content .rate-note a,
.topline-rate-page-content .rate-note a * {
    color: #838383 !important;
    text-decoration: underline;
    font-weight: 400 !important;
}

.topline-rate-page-content .rate-note a:hover,
.topline-rate-page-content .rate-note a:hover * {
    color: #5AA9AC !important;
}

.rate-note a {
    color: #838383;
    text-decoration: underline;
    font-weight: 400;
}

.rate-note a:hover {
    color: #5AA9AC;
}

/* Footnote markers (*, **, †) — single line-height, not stacked superscripts */
.topline-rate-page-content .rate-disclaimer sup,
.topline-rate-page-content .rate-disclaimer sup.rate-footnote-ref,
.topline-rate-page-content .rate-note sup,
.topline-rate-page-content .rate-note sup.rate-footnote-ref {
    font-size: 0.75em;
    line-height: 0;
    vertical-align: super;
    top: 0;
    position: relative;
    font-weight: 400;
    color: #838383;
}

.insurance-note,
.insurance-note * {
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

.rate-disclaimer p,
.rate-note p,
.insurance-note p {
    margin: 0 !important;
    padding: 0 !important;
}

.rate-disclaimer p + p,
.rate-note p + p,
.insurance-note p + p {
    margin-top: 8px !important;
}

/* Hide empty insurance section */
.rate-section--insurance:empty,
.rate-section--insurance:has(.insurance-note:empty) {
    display: none;
}

.insurance-note:empty {
    display: none;
}

.fair-lending {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Mortgage Page Specific */
.mortgage-intro {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

.mortgage-intro h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 16px;
}

.mortgage-intro p {
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 12px;
}

.mortgage-intro p:last-child {
    margin-bottom: 0;
}

.mortgage-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.mortgage-option {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mortgage-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mortgage-option h3 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0C2333;
    margin: 0 0 12px 0;
}

.mortgage-option p {
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
}

/* CTA Section */
.rate-section--cta {
    text-align: center;
    padding: 40px 0;
}

.mortgage-cta,
.loan-cta,
.business-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn--primary {
    background: #C62726;
    color: #fff !important;
    border: 2px solid #C62726;
}

.btn--primary:hover {
    background: #a82020;
    border-color: #a82020;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 39, 38, 0.3);
}

.btn--secondary {
    background: transparent;
    color: #0C2333;
    border: 2px solid #0C2333;
    border-radius: 50px;
}

.btn--secondary:hover {
    background: #0C2333;
    color: #fff;
    transform: translateY(-1px);
}

/* Tablet: match header container padding */
@media (max-width: 1024px) {
    .topline-rate-page-content {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .topline-rate-page-content {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .rate-section__title {
        font-size: 20px;
    }
    
    .rate-table {
        font-size: 13px;
    }
    
    .rate-table thead th {
        padding: 12px 10px;
        font-size: 11px;
    }
    
    .rate-table tbody td {
        padding: 12px 10px;
    }
    
    .mortgage-intro {
        padding: 24px;
    }
    
    .mortgage-options {
        grid-template-columns: 1fr;
    }
    
    .rate-section--insurance {
        padding: 20px 24px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .mortgage-cta,
    .loan-cta,
    .business-cta {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .rate-table thead th,
    .rate-table tbody td {
        padding: 10px 8px;
    }
    
    .rate-table {
        font-size: 12px;
    }
    
    .rate-table .account-type {
        min-width: 100px;
    }
}

/* Mobile horizontal scroll for rate tables */
@media (max-width: 767px) {
    .topline-rate-page-content .rate-table-wrapper,
    .rate-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 20px;
        position: relative;
        width: 100%;
        max-width: 100%;
    }
    
    .topline-rate-page-content .rate-table-wrapper--multi,
    .rate-table-wrapper--multi {
        overflow-x: auto;
    }
    
    .topline-rate-page-content .rate-table,
    .rate-table {
        width: max-content;
        min-width: 520px;
        position: relative;
    }
    
    .topline-rate-page-content .rate-table--multi,
    .rate-table--multi {
        min-width: 640px;
        width: max-content;
    }

    .topline-rate-page-content .rate-table thead th {
        white-space: nowrap;
    }
}

/* Print Styles */
@media print {
    .topline-rate-page-content {
        max-width: none;
        padding: 0;
    }
    
    .rate-table-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .rate-table thead,
    .rate-table thead th {
        background: var(--rate-table-header-bg) !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .rate-section--cta {
        display: none;
    }
    
    .btn {
        display: none;
    }
}
