/* =============================================================
   byte-range-requests.css
   Scoped entirely to .brr-page — does NOT affect any global styles
   ============================================================= */

/* ── Variables ────────────────────────────────────────────── */
.brr-page {
    --brr-blue:       #2563eb;
    --brr-blue-light: #eff6ff;
    --brr-blue-mid:   #dbeafe;
    --brr-accent:     #1d4ed8;
    --brr-green:      #16a34a;
    --brr-green-bg:   #f0fdf4;
    --brr-text:       #0f172a;
    --brr-text-body:  #374151;
    --brr-text-muted: #6b7280;
    --brr-border:     #e5e7eb;
    --brr-bg-soft:    #f9fafb;
    --brr-bg-card:    #ffffff;
    --brr-radius:     12px;
    --brr-radius-lg:  20px;
    --brr-max-w:      900px;
    --brr-shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --brr-shadow-md:  0 4px 16px rgba(0,0,0,.08);
    --brr-shadow-lg:  0 10px 40px rgba(0,0,0,.10);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Layout helpers ───────────────────────────────────────── */
.brr-page .brr-container {
    max-width: var(--brr-max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Hero section ─────────────────────────────────────────── */
.brr-page .brr-hero {
    background: linear-gradient(135deg, #f0f5ff 0%, #e8f4fd 50%, #f5f0ff 100%);
    border-bottom: 1px solid var(--brr-border);
    padding: 60px 0 52px;
}

.brr-page .brr-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--brr-text-muted);
    margin-bottom: 28px;
}

.brr-page .brr-breadcrumb a {
    color: var(--brr-text-muted);
    text-decoration: none;
    transition: color .2s;
}

.brr-page .brr-breadcrumb a:hover {
    color: var(--brr-blue);
}

.brr-page .brr-breadcrumb .sep {
    color: #d1d5db;
}

.brr-page .brr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brr-blue-mid);
    color: var(--brr-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.brr-page .brr-badge svg {
    width: 12px;
    height: 12px;
}

.brr-page .brr-hero h1 {
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    color: var(--brr-text);
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 18px;
}

.brr-page .brr-hero h1 .highlight {
    color: var(--brr-blue);
}

.brr-page .brr-hero-sub {
    font-size: 18px;
    line-height: 1.65;
    color: var(--brr-text-body);
    max-width: 680px;
    margin: 0;
}

/* ── Main content wrapper ─────────────────────────────────── */
.brr-page .brr-content {
    padding: 56px 0 80px;
}

/* section spacing */
.brr-page .brr-content section {
    margin-bottom: 60px;
}

/* ── Section headings ─────────────────────────────────────── */
.brr-page .brr-content h2 {
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 800;
    color: var(--brr-text);
    letter-spacing: -.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--brr-border);
}

.brr-page .brr-content h2 .h2-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--brr-blue-mid);
    border-radius: 8px;
    flex-shrink: 0;
}

.brr-page .brr-content h2 .h2-icon svg {
    width: 18px;
    height: 18px;
    color: var(--brr-accent);
    stroke: var(--brr-accent);
}

.brr-page .brr-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--brr-text);
    margin: 28px 0 12px;
}

/* ── Body text ────────────────────────────────────────────── */
.brr-page .brr-content p {
    font-size: 17px;
    line-height: 1.75;
    color: var(--brr-text-body);
    margin: 0 0 20px;
}

.brr-page .brr-content ul,
.brr-page .brr-content ol {
    padding-left: 22px;
    margin: 0 0 20px;
}

.brr-page .brr-content li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--brr-text-body);
    margin-bottom: 10px;
}

/* ── Quick Answer box ─────────────────────────────────────── */
.brr-page .brr-quick-answer {
    background: linear-gradient(135deg, var(--brr-blue-light), #f0f9ff);
    border: 1.5px solid var(--brr-blue-mid);
    border-left: 4px solid var(--brr-blue);
    border-radius: var(--brr-radius);
    padding: 28px 32px;
    margin-bottom: 0;
}

.brr-page .brr-quick-answer .qa-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--brr-blue);
    margin-bottom: 14px;
}

.brr-page .brr-quick-answer .qa-label svg {
    width: 14px;
    height: 14px;
}

.brr-page .brr-quick-answer .qa-text {
    font-size: 17px;
    line-height: 1.7;
    color: var(--brr-text-body);
    margin: 0;
    font-weight: 500;
}

/* ── Code blocks ──────────────────────────────────────────── */
.brr-page .brr-code-block {
    background: #0f172a;
    border-radius: var(--brr-radius);
    overflow: hidden;
    margin: 24px 0;
    box-shadow: var(--brr-shadow-md);
}

.brr-page .brr-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.brr-page .brr-code-header .code-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .04em;
}

.brr-page .brr-code-dots {
    display: flex;
    gap: 6px;
}

.brr-page .brr-code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #334155;
}

.brr-page .brr-code-dots span:first-child { background: #ef4444; }
.brr-page .brr-code-dots span:nth-child(2) { background: #f59e0b; }
.brr-page .brr-code-dots span:last-child   { background: #22c55e; }

.brr-page pre.brr-code {
    margin: 0;
    padding: 20px 24px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.75;
    color: #e2e8f0;
    white-space: pre;
}

.brr-page pre.brr-code .c-key   { color: #7dd3fc; font-weight: 600; }
.brr-page pre.brr-code .c-val   { color: #86efac; }
.brr-page pre.brr-code .c-comment { color: #475569; font-style: italic; }
.brr-page pre.brr-code .c-status { color: #fbbf24; font-weight: 700; }

/* ── Steps list ───────────────────────────────────────────── */
.brr-page .brr-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brr-page .brr-steps li {
    counter-increment: step;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--brr-text-body);
    margin: 0;
    background: var(--brr-bg-card);
    border: 1px solid var(--brr-border);
    border-radius: var(--brr-radius);
    padding: 16px 20px;
    box-shadow: var(--brr-shadow-sm);
}

.brr-page .brr-steps li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--brr-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    border-radius: 50%;
    margin-top: 2px;
}

/* ── Benefits grid ────────────────────────────────────────── */
.brr-page .brr-benefit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 0 0 20px;
}

.brr-page .brr-benefit-card {
    background: var(--brr-bg-card);
    border: 1px solid var(--brr-border);
    border-radius: var(--brr-radius);
    padding: 22px 20px;
    box-shadow: var(--brr-shadow-sm);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.brr-page .brr-benefit-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--brr-shadow-md);
    border-color: var(--brr-blue);
}

.brr-page .brr-benefit-card .bc-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.brr-page .brr-benefit-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brr-text);
    margin: 0 0 8px;
}

.brr-page .brr-benefit-card p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--brr-text-muted);
    margin: 0;
}

/* ── Warning / info callout ───────────────────────────────── */
.brr-page .brr-callout {
    display: flex;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: var(--brr-radius);
    padding: 20px 24px;
    margin: 24px 0;
}

.brr-page .brr-callout-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.brr-page .brr-callout-body p {
    font-size: 15px;
    margin: 0;
    color: #78350f;
}

.brr-page .brr-callout-body strong {
    color: #92400e;
}

/* ── Real-world example card ──────────────────────────────── */
.brr-page .brr-example-card {
    background: var(--brr-bg-soft);
    border: 1px solid var(--brr-border);
    border-radius: var(--brr-radius-lg);
    padding: 32px;
    margin: 0 0 20px;
}

.brr-page .brr-example-card + .brr-example-card {
    margin-top: 16px;
}

.brr-page .brr-example-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--brr-green);
    background: var(--brr-green-bg);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.brr-page .brr-example-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--brr-text);
    margin: 0 0 10px;
}

.brr-page .brr-example-card p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--brr-text-body);
    margin: 0;
}

/* ── Mistakes list ────────────────────────────────────────── */
.brr-page .brr-mistakes {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.brr-page .brr-mistakes li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: var(--brr-radius);
    padding: 16px 20px;
    font-size: 16px;
    line-height: 1.65;
    color: #991b1b;
    margin: 0;
}

.brr-page .brr-mistakes li::before {
    content: '✕';
    font-size: 13px;
    font-weight: 900;
    color: #ef4444;
    background: #fee2e2;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── FAQ accordion ────────────────────────────────────────── */
.brr-page .brr-faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.brr-page .brr-faq-item {
    background: var(--brr-bg-card);
    border: 1px solid var(--brr-border);
    border-radius: var(--brr-radius);
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}

.brr-page .brr-faq-item.open {
    border-color: var(--brr-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.07);
}

.brr-page .brr-faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    color: var(--brr-text);
    font-family: inherit;
    line-height: 1.45;
    transition: background .15s;
}

.brr-page .brr-faq-q:hover {
    background: var(--brr-bg-soft);
}

.brr-page .brr-faq-q .faq-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--brr-blue);
    transition: transform .25s ease;
}

.brr-page .brr-faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.brr-page .brr-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .2s;
    padding: 0 22px;
}

.brr-page .brr-faq-item.open .brr-faq-a {
    max-height: 400px;
    padding: 4px 22px 20px;
}

.brr-page .brr-faq-a p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--brr-text-body);
    margin: 0;
}

/* ── Related terms ────────────────────────────────────────── */
.brr-page .brr-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 0 0 20px;
}

.brr-page .brr-related-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    background: var(--brr-bg-card);
    border: 1px solid var(--brr-border);
    border-radius: var(--brr-radius);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--brr-shadow-sm);
    transition: transform .2s, border-color .2s, box-shadow .2s;
}

.brr-page .brr-related-card:hover {
    transform: translateY(-3px);
    border-color: var(--brr-blue);
    box-shadow: var(--brr-shadow-md);
}

.brr-page .brr-related-card .rc-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brr-text);
}

.brr-page .brr-related-card .rc-desc {
    font-size: 13px;
    color: var(--brr-text-muted);
    line-height: 1.5;
}

.brr-page .brr-related-card svg {
    width: 16px;
    height: 16px;
    color: var(--brr-blue);
    margin-top: 4px;
}

/* ── CTA section ──────────────────────────────────────────── */
.brr-page .brr-cta {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 60%, #7c3aed 100%);
    border-radius: var(--brr-radius-lg);
    padding: 52px 40px;
    text-align: center;
    color: #fff;
    margin-bottom: 0;
}

.brr-page .brr-cta h2 {
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
    margin: 0 0 14px;
    border: none;
    padding: 0;
    display: block;
}

.brr-page .brr-cta p {
    font-size: 17px;
    color: rgba(255,255,255,.85);
    margin: 0 0 28px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.brr-page .brr-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #ffffff;
    color: var(--brr-accent);
    font-size: 16px;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.brr-page .brr-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
}

/* ── Technical breakdown table ────────────────────────────── */
.brr-page .brr-table-wrap {
    overflow-x: auto;
    border-radius: var(--brr-radius);
    border: 1px solid var(--brr-border);
    margin: 0 0 20px;
}

.brr-page .brr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: var(--brr-bg-card);
}

.brr-page .brr-table thead {
    background: var(--brr-blue-mid);
}

.brr-page .brr-table th {
    padding: 12px 18px;
    text-align: left;
    font-weight: 700;
    color: var(--brr-accent);
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brr-page .brr-table td {
    padding: 13px 18px;
    color: var(--brr-text-body);
    border-top: 1px solid var(--brr-border);
    vertical-align: top;
    line-height: 1.6;
}

.brr-page .brr-table tr:hover td {
    background: var(--brr-bg-soft);
}

.brr-page .brr-table code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: var(--brr-blue-light);
    color: var(--brr-accent);
    padding: 2px 7px;
    border-radius: 5px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .brr-page .brr-hero { padding: 40px 0 36px; }

    .brr-page .brr-benefit-grid,
    .brr-page .brr-related-grid {
        grid-template-columns: 1fr;
    }

    .brr-page .brr-cta {
        padding: 36px 24px;
    }

    .brr-page .brr-quick-answer {
        padding: 22px 20px;
    }

    .brr-page pre.brr-code {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .brr-page .brr-container {
        padding: 0 16px;
    }

    .brr-page .brr-steps li {
        flex-direction: column;
    }

    .brr-page .brr-benefit-grid {
        grid-template-columns: 1fr;
    }
}
