:root {
    --gb-claret: #7f1d1d;
    --gb-claret-bright: #991b1b;
    --gb-oxford: #1e293b;
    --gb-paper: #fcfbf9;
    --gb-white: #ffffff;
    --gb-ink: #111827;
    --gb-body: #374151;
    --gb-muted: #6b7280;
    --gb-rule: #e5e7eb;
    --gb-gold: #b45309;
}

/* 1. Ironclad Anti-Overflow Reset */
*, *::before, *::after {
    box-sizing: border-box;
}
html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    margin: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--gb-paper);
    color: var(--gb-ink);
    line-height: 1.68;
    font-size: 16px;
}
main, section, article, aside, nav, header, footer, div {
    min-width: 0;
}
img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}
p, h1, h2, h3, h4, li, td, th, code, a, span {
    overflow-wrap: anywhere;
    word-break: break-word;
}
code {
    background: #f3f4f6;
    color: var(--gb-oxford);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}
a {
    color: var(--gb-claret-bright);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.gb-frame {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 2. Broadsheet Masthead Header */
.gb-dateline {
    background: var(--gb-oxford);
    color: #d1d5db;
    font-size: 12px;
    padding: 7px 0;
    border-bottom: 2px solid var(--gb-claret);
}
.gb-dateline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.gb-dateline a {
    color: #f3f4f6;
    margin-left: 14px;
}
.gb-masthead {
    background: var(--gb-white);
    border-bottom: 1px solid var(--gb-rule);
    padding: 20px 0;
}
.gb-mast-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.gb-title-link {
    color: var(--gb-ink) !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}
.gb-crest {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--gb-claret);
    color: #ffffff;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 800;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gb-gazette-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.18rem, 2.2vw, 1.5rem);
    font-weight: 700;
    display: block;
    line-height: 1.18;
    color: var(--gb-ink);
}
.gb-gazette-tag {
    font-size: 12.5px;
    color: var(--gb-muted);
    display: block;
    line-height: 1.3;
}
.gb-finder {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 330px;
}
.gb-finder input {
    border: 1px solid #d1d5db;
    background: var(--gb-paper);
    color: var(--gb-ink);
    padding: 9px 13px;
    border-radius: 6px;
    font-size: 14px;
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
}
.gb-finder button {
    background: var(--gb-claret);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}
.gb-finder button:hover {
    background: var(--gb-claret-bright);
}

/* 3. Editorial Desks Nav (Wrapped on Desktop, Touch Swipe on Mobile) */
.gb-desks {
    background: #ffffff;
    border-bottom: 2px solid var(--gb-ink);
    position: sticky;
    top: 0;
    z-index: 30;
}
.gb-desk-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 10px 0;
}
.gb-desk-list li {
    flex-shrink: 0;
}
.gb-desk-list a {
    display: inline-block;
    padding: 6px 13px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gb-body);
    background: #f9fafb;
    border: 1px solid var(--gb-rule);
    white-space: nowrap;
    text-decoration: none !important;
    transition: all 0.15s ease;
}
.gb-desk-list a:hover {
    background: #fef2f2;
    color: var(--gb-claret);
    border-color: #fecaca;
}
.gb-desk-list a.active {
    background: var(--gb-claret);
    color: #ffffff;
    border-color: var(--gb-claret);
}

/* 4. Lead Editorial Banner */
.gb-lead-box {
    background: #ffffff;
    border: 1px solid var(--gb-rule);
    border-top: 4px solid var(--gb-claret);
    border-radius: 10px;
    padding: 28px 32px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.025);
}
.gb-edition-tag {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gb-claret);
    margin-bottom: 6px;
}
.gb-lead-box h1 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    color: var(--gb-ink);
    line-height: 1.25;
}
.gb-lead-box p {
    margin: 0;
    color: var(--gb-body);
    max-width: 800px;
    font-size: clamp(0.92rem, 1.4vw, 1rem);
}

/* 5. Symmetrical Broadsheet Card Grid (3 Col Desktop -> 2 Col Tablet -> 1 Col Mobile) */
.gb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 20px 0 48px;
}
.gb-card {
    background: var(--gb-white);
    border: 1px solid var(--gb-rule);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.gb-card:hover {
    border-color: #fca5a5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(127, 29, 29, 0.07);
}
.gb-card-top {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    margin-bottom: 12px;
    min-width: 0;
}
.gb-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--gb-rule);
    background: #f3f4f6;
}
.gb-card-meta {
    min-width: 0;
    flex: 1;
}
.gb-desk-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gb-claret);
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gb-card h2 {
    font-family: Georgia, serif;
    margin: 0;
    font-size: 16.5px;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gb-card h2 a {
    color: var(--gb-ink);
}
.gb-card p {
    font-size: 13.8px;
    color: var(--gb-body);
    margin: 0 0 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gb-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 11px;
    border-top: 1px solid #f3f4f6;
    font-size: 13px;
    font-weight: 600;
    margin-top: auto;
}
.gb-card-pub {
    color: var(--gb-muted);
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* 6. Handbook Detail View (Strict minmax(0, 1fr)!) */
.gb-crumbs {
    font-size: 13px;
    color: var(--gb-muted);
    margin: 18px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.gb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
    margin-bottom: 50px;
}
.gb-article {
    background: #ffffff;
    border: 1px solid var(--gb-rule);
    border-radius: 12px;
    padding: 30px;
    min-width: 0;
    max-width: 100%;
}
.gb-app-intro {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gb-ink);
    margin-bottom: 22px;
}
.gb-app-intro img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    border: 1px solid var(--gb-rule);
    flex-shrink: 0;
    object-fit: cover;
}
.gb-article h1 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 4px 0 6px;
    font-size: clamp(1.32rem, 2.4vw, 1.78rem);
    color: var(--gb-ink);
    line-height: 1.26;
}
.gb-mobile-cta {
    display: none;
    margin: 0 0 20px;
}

.gb-checkpoints {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}
.gb-check-card {
    background: #fcfbf9;
    border: 1px solid var(--gb-rule);
    border-top: 3px solid var(--gb-claret);
    border-radius: 8px;
    padding: 14px;
}
.gb-check-card strong {
    display: block;
    font-family: Georgia, serif;
    font-size: 14.5px;
    color: var(--gb-claret);
    margin-bottom: 5px;
}
.gb-check-card p {
    margin: 0;
    font-size: 13.5px;
    color: var(--gb-body);
}

.gb-subhead {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.15rem, 1.9vw, 1.32rem);
    color: var(--gb-ink);
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gb-rule);
}

/* Bounded Screenshot Carousel */
.gb-screens {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 14px;
}
.gb-screens img {
    height: 220px;
    width: auto;
    max-width: 78vw;
    border-radius: 10px;
    border: 1px solid var(--gb-rule);
    flex-shrink: 0;
    object-fit: cover;
}

.gb-aside {
    position: sticky;
    top: 68px;
    min-width: 0;
}
.gb-dossier {
    background: #ffffff;
    border: 1px solid var(--gb-rule);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
}
.gb-play-btn {
    display: block;
    text-align: center;
    background: var(--gb-claret);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 15px;
    padding: 13px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(127, 29, 29, 0.22);
}
.gb-play-btn:hover {
    background: var(--gb-claret-bright);
}

.gb-footer {
    background: var(--gb-oxford);
    color: #d1d5db;
    padding: 38px 0 28px;
    font-size: 13.5px;
    margin-top: 40px;
}
.gb-footer a {
    color: #fca5a5;
}
.gb-foot-cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 28px;
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================================= */
@media (max-width: 1024px) {
    .gb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .gb-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .gb-aside {
        position: static;
    }
    .gb-mobile-cta {
        display: block;
    }
}

@media (max-width: 820px) {
    .gb-mast-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .gb-finder {
        max-width: 100%;
    }
    .gb-desk-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .gb-desk-list::-webkit-scrollbar {
        display: none;
    }
    .gb-checkpoints {
        grid-template-columns: minmax(0, 1fr);
    }
    .gb-foot-cols {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }
}

@media (max-width: 640px) {
    .gb-frame {
        padding: 0 14px;
    }
    .gb-lead-box {
        padding: 20px 18px;
        margin: 16px 0;
    }
    .gb-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
    .gb-article {
        padding: 18px 15px;
    }
    .gb-app-intro {
        gap: 13px;
    }
    .gb-app-intro img {
        width: 64px;
        height: 64px;
    }
    .gb-screens img {
        height: 190px;
    }
}
