/* Site-wide layout: navigation, articles, legal pages, mobile */

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--header-shadow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-logo:hover {
    color: var(--accent-hover);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.site-nav a {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--accent);
    background: var(--surface-hover);
}

.ad-slot {
    display: none;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.ad-slot.is-active {
    display: block;
    min-height: 90px;
    margin: 1rem 0;
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    padding: 1rem 1.25rem;
}

.cookie-consent-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1 1 280px;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--prose);
}

.cookie-consent-text a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-consent-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cookie-consent-btn-primary {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.cookie-consent-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.cookie-consent-btn-secondary {
    color: var(--text);
    background: var(--card);
}

.cookie-consent-btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

body.cookie-consent-open {
    padding-bottom: 5.5rem;
}

.footer-cookie-settings {
    display: inline;
    margin-left: 0.35rem;
}

.footer-cookie-settings button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.footer-cookie-settings button:hover {
    color: var(--accent-hover);
}

.site-footer {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.footer-col h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 0.65rem;
}

.footer-col a {
    display: block;
    font-size: 0.88rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.2rem 0;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-disclaimer {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--banner-text);
    background: var(--banner-bg);
    border: 1px solid var(--banner-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.footer-disclaimer strong {
    color: var(--banner-strong);
}

.footer-disclaimer a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.footer-disclaimer a:hover {
    text-decoration: underline;
}

.footer-bottom {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.disclaimer-banner {
    background: var(--banner-bg);
    border: 1px solid var(--banner-border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    font-size: 0.88rem;
    color: var(--banner-text);
    margin: 1.25rem 0;
    line-height: 1.55;
}

.disclaimer-banner strong {
    color: var(--banner-strong);
}

.references-box {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    margin-top: 1.25rem;
}

.references-box h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    color: var(--text);
}

.references-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.references-box a {
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-word;
}

.seo-content,
.faq-section {
    margin-top: 2rem;
}

.seo-content.card,
.faq-section.card {
    padding: 1.5rem;
}

.seo-content h2,
.faq-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0;
}

.seo-content-body {
    margin-top: 0.85rem;
}

.seo-content-body p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--prose);
    margin-bottom: 0.85rem;
}

.seo-content-body p:last-child {
    margin-bottom: 0;
}

.seo-note {
    font-size: 0.85rem !important;
    color: var(--muted) !important;
    border-top: 1px solid var(--border);
    margin-top: 0.35rem !important;
    padding-top: 0.85rem;
}

.faq-section h2 {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.faq-list {
    margin-top: 0.25rem;
}

.faq-section details {
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
}

.faq-section details:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-section summary {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
    color: var(--text);
}

.faq-section summary::-webkit-details-marker {
    display: none;
}

.faq-section summary::before {
    content: "+";
    flex-shrink: 0;
    width: 1.25rem;
    color: var(--accent);
    font-weight: 700;
    text-align: center;
}

.faq-section details[open] summary::before {
    content: "−";
}

.faq-section details p {
    margin: 0.65rem 0 0 1.75rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--muted);
}

.hero-brand {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
}

.articles-preview {
    margin-top: 2rem;
}

.articles-preview h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.articles-preview .article-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.articles-preview .article-card {
    padding: 1rem;
}

.articles-preview .article-card h3 {
    font-size: 0.88rem;
}

.articles-preview .article-card p {
    font-size: 0.78rem;
}

.articles-preview .article-card .read-more {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.article-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.15rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.article-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.article-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.article-card p {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

.article-card .read-more {
    display: inline-block;
    margin-top: 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
}

/* Article & legal page content */
.content-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.content-page .card {
    padding: 1.75rem;
}

.content-page h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.content-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.prose h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.75rem 0 0.65rem;
    color: var(--text);
}

.prose h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.prose p,
.prose li {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--prose);
    margin-bottom: 0.85rem;
}

.prose ul,
.prose ol {
    padding-left: 1.35rem;
    margin-bottom: 1rem;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 1rem 0;
    overflow-x: auto;
    display: block;
}

.prose th,
.prose td {
    border: 1px solid var(--border);
    padding: 0.55rem 0.65rem;
    text-align: left;
}

.prose th {
    background: var(--surface-active);
    font-weight: 600;
}

.prose a {
    color: var(--accent);
}

.contact-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: var(--card);
    color: var(--text);
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

a.btn-primary,
.prose a.btn-primary {
    display: inline-block;
    text-decoration: none;
    color: #fff;
}

a.btn-primary:hover,
.prose a.btn-primary:hover {
    color: #fff;
}

.not-found-page {
    text-align: center;
}

.not-found-card .not-found-message {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--prose);
    margin-bottom: 1.5rem;
}

.not-found-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
}

.not-found-cta:hover,
.not-found-cta:focus-visible {
    color: #fff;
    background: var(--accent-hover);
}

.compare-card {
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.compare-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.compare-hint {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: fixed;
}

.compare-table th:nth-child(2),
.compare-table td:nth-child(2) {
    width: 38%;
}

.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
    width: 31%;
}

.compare-table th:nth-child(4),
.compare-table td:nth-child(4) {
    width: 31%;
}

.compare-table th,
.compare-table td {
    padding: 0.55rem 0.4rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.compare-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    background: var(--surface-subtle);
}

.compare-table .col-rank {
    width: 1.75rem;
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.compare-table .th-short {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.compare-table .net-col {
    font-weight: 700;
    color: var(--green);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.compare-table .ded-col {
    font-weight: 600;
    color: var(--deduction);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 0.8rem;
}

.gross-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-weight: 600;
    font-family: inherit;
    font-size: inherit;
    padding: 0.15rem 0;
    border-radius: 4px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: left;
    transition: color 0.15s;
}

.gross-btn:hover,
.gross-btn[aria-expanded="true"] {
    color: var(--accent);
}

.gross-btn .chevron {
    font-size: 0.6rem;
    color: var(--deduction);
    opacity: 1;
    flex-shrink: 0;
}

.gross-btn:hover .chevron,
.gross-btn[aria-expanded="true"] .chevron {
    color: var(--deduction);
}

.compare-detail-row td {
    background: var(--surface-subtle);
    padding: 0.65rem 0.5rem !important;
}

.compare-detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem 0.35rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.detail-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-val {
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    white-space: nowrap;
}

.detail-item.detail-total .detail-val {
    color: var(--deduction);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem;
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 1rem;
    }

    .site-header-inner {
        position: relative;
        flex-wrap: wrap;
    }

    .cookie-consent-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-actions {
        width: 100%;
    }

    .cookie-consent-btn {
        flex: 1 1 auto;
    }

    body.cookie-consent-open {
        padding-bottom: 9rem;
    }

    .page {
        padding: 1.25rem 1rem 2.5rem;
    }

    .input-row {
        flex-direction: column;
    }

    #calculateBtn {
        width: 100%;
    }

    .legend {
        grid-template-columns: 1fr;
    }

    .content-page .card {
        padding: 1.25rem;
    }

    .articles-preview .article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compare-card {
        padding: 1rem;
    }

    .compare-hint {
        font-size: 0.78rem;
        margin-bottom: 0.6rem;
    }

    .compare-table {
        font-size: 0.78rem;
    }

    .compare-table th,
    .compare-table td {
        padding: 0.45rem 0.3rem;
    }

    .compare-table th .th-short {
        display: none;
    }

    .compare-table .ded-col {
        font-size: 0.74rem;
    }

    .compare-detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem 0.3rem;
    }

    .detail-item.detail-total {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 0.35rem;
        border-top: 1px solid var(--border);
    }

    .detail-label {
        font-size: 0.65rem;
    }

    .detail-val {
        font-size: 0.76rem;
    }
}

@media (max-width: 520px) {
    .articles-preview .article-grid {
        grid-template-columns: 1fr;
    }

    .compare-table .col-rank {
        display: none;
    }

    .compare-table th:nth-child(2),
    .compare-table td:nth-child(2) {
        width: 40%;
    }

    .compare-table th:nth-child(3),
    .compare-table td:nth-child(3) {
        width: 32%;
    }

    .compare-table th:nth-child(4),
    .compare-table td:nth-child(4) {
        width: 28%;
    }

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