/* ============================================
   Home Broadband Guide – Clean design system
   ============================================ */

:root {
    --color-bg: #f0f4f8;
    --color-surface: #ffffff;
    --color-primary: #0d3b4c;
    --color-primary-light: #1a5c73;
    --color-accent: #e8a838;
    --color-accent-hover: #d49428;
    --color-text: #2d3748;
    --color-text-muted: #5a6c7d;
    --color-border: #e2e8f0;
    --color-success: #0d9488;
    --color-speed-download: #0d9488;
    --color-speed-upload: #0369a1;
    --shadow-sm: 0 1px 3px rgba(13, 59, 76, 0.08);
    --shadow-md: 0 4px 12px rgba(13, 59, 76, 0.1);
    --shadow-lg: 0 8px 24px rgba(13, 59, 76, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset and base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 48px;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
}

/* Top bar and breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 14px;
    color: var(--color-text-muted);
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    margin: 0 -24px 32px;
    padding-left: 24px;
    padding-right: 24px;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: var(--color-accent);
}

.breadcrumbs span {
    color: #fff;
    font-weight: 600;
}

/* Main content */
main {
    padding-bottom: 24px;
}

/* Section card (shared) */
.section-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

/* Typography */
h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

h3:first-child {
    margin-top: 0;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 16px;
}

p {
    margin-bottom: 14px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-text);
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

ul li {
    margin-bottom: 10px;
    line-height: 1.75;
}

/* Intro paragraph */
main > p:first-of-type {
    font-size: 17px;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

/* ========== Providers section ========== */
.providers-section {
    background: linear-gradient(180deg, #f8fafc 0%, #f0f4f8 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0 32px;
    box-shadow: var(--shadow-sm);
}

.providers-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.providers-table thead {
    background: var(--color-primary);
    color: #fff;
}

.providers-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.providers-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
}

.providers-table tbody tr:last-child td {
    border-bottom: none;
}

.providers-table tbody tr:hover {
    background: #f8fafc;
}

.btn-check-packages {
    display: inline-block;
    padding: 10px 18px;
    background: var(--color-accent);
    color: var(--color-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-check-packages:hover {
    background: var(--color-accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

/* Provider teaser (e.g. "Save up to £202.08 on your broadband*") */
.offer-teaser {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 400;
}

/* Action cell: button + terms */
.provider-action {
    vertical-align: top;
    overflow: visible;
}

/* Expandable T&Cs: open in overlay so page doesn’t shift */
.offer-terms {
    margin-top: 10px;
    font-size: 13px;
    position: relative;
}

.offer-terms summary {
    cursor: pointer;
    color: var(--color-primary-light);
    list-style: none;
    display: inline-block;
    padding: 6px 0;
    min-height: 44px;
    line-height: 32px;
    box-sizing: border-box;
    user-select: none;
}

.offer-terms summary::-webkit-details-marker,
.offer-terms summary::marker {
    display: none;
}

.offer-terms summary::before {
    content: '';
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-right: 6px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.offer-terms[open] summary::before {
    transform: rotate(-135deg);
}

.offer-terms summary:hover {
    text-decoration: underline;
}

/* Float terms content so it doesn’t push layout */
.offer-terms-full {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    padding: 12px;
    min-width: 260px;
    max-width: 420px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary-light);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-muted);
    z-index: 20;
}

/* ========== Speed section ========== */
.speed-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0 32px;
}

.speed-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.speed-box:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.speed-box:first-child {
    border-left: 4px solid var(--color-speed-download);
}

.speed-box:last-child {
    border-left: 4px solid var(--color-speed-upload);
}

.speed-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.speed-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

/* ========== Content block (Types of broadband + stats) ========== */
.content-block.section-card {
    background: #fafbfc;
}

.content-block h3 {
    margin-top: 20px;
}

.content-block h3:first-child {
    margin-top: 0;
}

/* ========== Other areas section ========== */
.other-areas-section.section-card {
    background: linear-gradient(180deg, #f8fafc 0%, #f0f4f8 100%);
}

.other-areas-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 16px;
    margin-top: 8px;
}

.other-areas-column {
    list-style: none;
    margin: 0;
    padding: 0;
}

.other-areas-column li {
    margin-bottom: 6px;
}

.other-areas-column a {
    color: var(--color-primary-light);
    text-decoration: none;
    font-size: 15px;
    display: block;
    padding: 4px 0;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.other-areas-column a:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px 32px;
    }

    .breadcrumbs {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
        margin-bottom: 24px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .section-card,
    .providers-section {
        padding: 20px 18px;
        margin-bottom: 24px;
    }

    .speed-section {
        grid-template-columns: 1fr;
        margin-bottom: 24px;
    }

    .speed-box {
        padding: 22px 20px;
    }

    .speed-value {
        font-size: 1.75rem;
    }

    .other-areas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 12px;
    }

    .providers-table th,
    .providers-table td {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-check-packages {
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .other-areas-grid {
        grid-template-columns: 1fr;
    }

    .providers-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .providers-table thead {
        display: none;
    }

    .providers-table tr {
        display: block;
        margin-bottom: 16px;
        padding: 16px;
        background: #f8fafc;
        border-radius: var(--radius-sm);
        border: 1px solid var(--color-border);
    }

    .providers-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-border);
    }

    .providers-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
    }

    .providers-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-text-muted);
        font-size: 13px;
    }

    .providers-table td:last-child::before {
        content: '';
    }

    .providers-table td:last-child {
        justify-content: flex-start;
    }
}

/* Add data-label for mobile table (optional enhancement – table doesn't have it yet, so mobile will still show as rows) */
@media (max-width: 480px) {
    .providers-table td::before {
        display: none;
    }

    .providers-table td {
        display: block;
        padding: 6px 0;
    }

    .providers-table td:first-child {
        font-weight: 600;
        color: var(--color-primary);
        padding-bottom: 4px;
    }
}

/* Print */
@media print {
    body {
        background: #fff;
    }

    .container {
        box-shadow: none;
        padding: 0;
    }

    .breadcrumbs {
        background: #eee;
        color: #333;
    }

    .breadcrumbs a {
        color: #333;
    }

    .btn-check-packages {
        display: none;
    }

    .section-card,
    .providers-section {
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .speed-box:hover {
        transform: none;
    }
}
