/* ================================================= */
/* SINGLE-COLUMN STYLES FOR ARTICLE PAGES            */
/* ================================================= */

/* Main Article Page Container */
.article-page-main {
    padding: 4rem 0;
    background-color: var(--light);
}

.article-page-main .container {
    max-width: 840px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 3rem 4rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Article Header (Hero equivalent) */
.article-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.article-category {
    display: inline-block;
    background-color: var(--primary);
    color: var(--white);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Article Body */
.article-body h2 {
    font-size: 2.2rem;
    color: var(--dark);
    margin-top: 3.5rem;
    margin-bottom: 1.8rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.article-body h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    border-radius: 2px;
}

.article-body h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}

.article-body p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.article-body strong {
    color: var(--dark);
    font-weight: 700;
}

.article-body a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    transition: text-decoration-color 0.3s ease;
}

.article-body a:hover {
    text-decoration-color: var(--primary);
}

/* Legal Grid */
.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.legal-item {
    background-color: var(--light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.legal-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.legal-item h3 {
    margin-top: 0;
    font-size: 1.35rem;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.legal-item p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Step-by-Step List (Cards) */
.steps-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.step-card {
    display: flex;
    align-items: flex-start;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.step-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-right: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.step-content h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.6rem;
    color: var(--dark);
}

.step-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Formula Block Styling */
.formula {
    display: block;
    background-color: var(--light);
    padding: 1.2rem;
    border-radius: 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--dark);
    margin-top: 1.2rem;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    overflow-x: auto;
    line-height: 1.5;
}

/* Example Box */
.example-box {
    background: var(--light);
    border: 1px solid var(--border);
    padding: 1.5rem 2rem 2rem 2rem;
    margin: 3rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.example-box > p {
    font-size: 1.15rem;
    color: var(--dark);
    margin-top: 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.calculation-step {
    padding: 1rem 0;
    margin-top: 1rem;
}

.calculation-step .formula-text {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0 0 0.5rem 0;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.calculation-step .calculation-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark);
    margin: 0;
    line-height: 1.6;
}

.calculation-step.final-total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--primary);
}

.calculation-step.final-total .calculation-text {
    font-size: 1.4rem;
    font-weight: 700;
}

.calculation-step.final-total .calculation-text strong {
    color: var(--primary);
}


/* Related Guides Section Wrapper */
.related-guides-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.related-guides {
    background-color: var(--light);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.related-guides h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 1.6rem;
}

.related-guides ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-guides li {
    margin-bottom: 0.75rem;
}

.related-guides li a {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--primary-dark);
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.related-guides li a:hover {
    border-color: var(--primary);
    color: var(--dark);
    transform: translateX(5px);
}

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border);
}

.faq-section h2 {
    font-size: 2.2rem;
    color: var(--dark);
    text-align: center;
    margin-top: 0;
    margin-bottom: 2.5rem;
}

.faq-accordion .faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.faq-question {
    padding: 1.5rem;
}
.faq-answer {
    padding: 0 1.5rem;
}
.faq-item.active .faq-answer {
    padding-bottom: 1.5rem;
}

/* CTA Box for Calculator Link */
.cta-box {
    background-color: #eef7ff;
    border: 1px solid #dbeafe;
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
}

.cta-box p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.7;
}

.cta-box a {
    font-weight: 700;
}

/* Important Rules List */
.rules-list {
    list-style: none;
    padding-left: 0;
    margin: 2.5rem 0;
}

.rules-list li {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 2.5rem;
}

.rules-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--primary);
    font-weight: bold;
}

.rules-list li strong {
    color: var(--dark);
    display: block;
    font-size: 1.2rem;
}

/* Wrapper for horizontally scrolling tables */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin: 2.5rem 0;
}

/* === NEW AND UPDATED STYLES === */

/* Improved Excel Table UI */
.excel-table {
    width: 100%;
    border-collapse: collapse;
    /* remove margin from here as it's on the wrapper now */
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.excel-table thead tr {
    background-color: var(--light);
    color: var(--dark);
    text-align: left;
}

.excel-table th {
    padding: 16px 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.excel-table td {
    padding: 16px 15px;
}

.excel-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.excel-table tbody tr:last-of-type {
    border-bottom: none;
}

.excel-table tbody tr:hover {
    background-color: #eef7ff;
}

.excel-table .text-center {
    text-align: center;
}

/* Author Section and Card */
.author-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border);
}

.author-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: var(--light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.author-photo {
    flex-shrink: 0;
}

.author-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.author-name {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    color: var(--dark);
}

.author-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary);
    font-style: italic;
}

.author-bio {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.author-social {
    display: flex;
    gap: 1rem;
}

.author-social a {
    color: var(--text-light);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.author-social a:hover {
    color: var(--primary);
    transform: scale(1.1);
}
/* === END OF NEW AND UPDATED STYLES === */

/* Responsive Adjustments */
@media (max-width: 768px) {
    .article-page-main {
        padding: 0;
    }
    .article-page-main .container {
        padding: 2rem 1.5rem;
        border-radius: 0;
        box-shadow: none;
    }
    .article-header h1 {
        font-size: 2.2rem;
    }
    .article-subtitle {
        font-size: 1.1rem;
    }
    .article-body h2, .faq-section h2 {
        font-size: 1.8rem;
    }
    .article-body h3 {
        font-size: 1.3rem;
    }
    .article-body p, .example-box > p {
        font-size: 1rem;
    }
    .step-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .step-number {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    .rules-list li {
        padding-left: 2rem;
        font-size: 1rem;
    }
    .rules-list li::before {
        font-size: 1.2rem;
    }
    .calculation-step .formula-text {
        font-size: 0.85rem;
    }
    .calculation-step .calculation-text {
        font-size: 1.05rem;
    }
    .calculation-step.final-total .calculation-text {
        font-size: 1.2rem;
    }
    .excel-table {
        font-size: 0.9rem;
    }
    .excel-table th, .excel-table td {
        padding: 10px 8px;
    }
    .author-card {
        flex-direction: column;
        text-align: center;
    }
    .author-social {
        justify-content: center;
    }
}