/* ════════════════════════════════════════════════════════════════
   MOBILE-FIX.CSS  v2.3.0
   Loaded LAST — fixes all mobile overflow, lists, tables, favicon
   ════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   CORE: Stop EVERY element from overflowing viewport
   No overflow:hidden on body/html — that cuts content
   ══════════════════════════════════════════════════════════════ */

/* Universal box-sizing */
*, *::before, *::after { box-sizing: border-box; }

/* Lock page width — the ONLY correct way on all Android browsers */
html {
    max-width: 100%;
    overflow-x: hidden;  /* on html = safe, does not cut content */
}

/* Body: never wider than screen, content always readable */
body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Nothing ever wider than its parent */
img, video, iframe, embed, object, canvas, audio, svg {
    max-width: 100% !important;
    height: auto;
}

/* ══════════════════════════════════════════════════════════════
   FIX: alignfull / alignwide breaking mobile
   These use calc(50% - 50vw) / 100vw which overflows viewport
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .alignfull {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .alignwide {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   FIX: Ticker bar — white-space:nowrap causes overflow
   Contain it strictly
   ══════════════════════════════════════════════════════════════ */
.ticker-bar {
    max-width: 100%;
    overflow: hidden !important;
    contain: layout;
}
.ticker-inner {
    max-width: 100%;
    overflow: hidden !important;
}
.ticker-track {
    overflow: hidden !important;
    flex: 1;
    min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   FIX: Container never wider than viewport
   ══════════════════════════════════════════════════════════════ */
.container {
    max-width: 100%;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

/* ══════════════════════════════════════════════════════════════
   FIX: Single post grid — min-width:0 on all children
   Without this, 1fr column grows to fit table content
   ══════════════════════════════════════════════════════════════ */
.single-content-wrap > * {
    min-width: 0;
    max-width: 100%;
}
.single-content,
.single-article-body {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ══════════════════════════════════════════════════════════════
   FIX 1 — BULLET POINTS & NUMBERED LISTS
   ul { list-style: none } on line 56 breaks all post lists
   Restore ONLY inside article content
   ══════════════════════════════════════════════════════════════ */
.single-article-body ul,
.single-content ul,
.entry-content ul,
.wp-block-list:where(:not(.is-style-none)) {
    list-style: disc !important;
    padding-left: 1.5em !important;
    margin-top: 0.5em !important;
    margin-bottom: 1em !important;
}

.single-article-body ol,
.single-content ol,
.entry-content ol {
    list-style: decimal !important;
    padding-left: 1.5em !important;
    margin-top: 0.5em !important;
    margin-bottom: 1em !important;
}

/* Nested lists */
.single-article-body ul ul,
.single-content ul ul,
.entry-content ul ul   { list-style: circle !important; margin-bottom: 0.25em !important; }

.single-article-body ul ol,
.single-content ul ol,
.entry-content ul ol   { list-style: lower-alpha !important; }

.single-article-body ol ul,
.single-content ol ul,
.entry-content ol ul   { list-style: disc !important; }

/* List items — display:list-item overrides any grid/flex reset */
.single-article-body li,
.single-content li,
.entry-content li {
    display: list-item !important;
    margin-bottom: 6px;
    line-height: 1.75;
}

/* Gutenberg list block */
ul.wp-block-list  { list-style: disc !important;    padding-left: 1.5em !important; }
ol.wp-block-list  { list-style: decimal !important; padding-left: 1.5em !important; }
.wp-block-list li { display: list-item !important; }

/* ══════════════════════════════════════════════════════════════
   FIX 2 — TABLES: Responsive horizontal scroll
   ══════════════════════════════════════════════════════════════ */

/* Gutenberg figure.wp-block-table */
figure.wp-block-table {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,.09);
    scrollbar-width: thin;
    scrollbar-color: var(--primary, #0d9488) #e2e8f0;
}
figure.wp-block-table::-webkit-scrollbar       { height: 5px; }
figure.wp-block-table::-webkit-scrollbar-track  { background: #e2e8f0; border-radius: 0 0 12px 12px; }
figure.wp-block-table::-webkit-scrollbar-thumb  { background: var(--primary,#0d9488); border-radius: 4px; }
figure.wp-block-table > table {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-width: max-content;
}

/* JS-wrapped table: .tge-table-outer */
.tge-table-outer {
    display: block;
    min-width: 0;
    max-width: 100%;
    margin: 24px 0;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,.09);
    position: relative;
}
.tge-table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px 12px 0 0;
    scrollbar-width: none;
}
.tge-table-scroll::-webkit-scrollbar { display: none; }
.tge-table-scroll > table {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-width: max-content;
}

/* Scroll thumb */
.tge-scroll-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 0 0 12px 12px;
    display: none;
}
.tge-table-outer.is-overflowing .tge-scroll-bar { display: block; }

.tge-scroll-thumb {
    height: 100%;
    min-width: 30px;
    background: var(--primary, #0d9488);
    border-radius: 4px;
    position: relative;
    cursor: grab;
}
.tge-scroll-thumb:active { cursor: grabbing; }

/* Swipe hint - mobile only */
.tge-swipe-hint {
    display: none;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    padding: 5px 0 2px;
}
@media (max-width: 680px) {
    .tge-table-outer.is-overflowing .tge-swipe-hint { display: block; }
}

/* Table design */
.single-article-body table,
.single-content table,
.entry-content table,
figure.wp-block-table table,
.tge-table-scroll table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 15px;
    line-height: 1.6;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.09);
    margin: 24px 0;
}
/* thead */
.single-article-body thead th,
.single-content thead th,
.entry-content thead th,
figure.wp-block-table thead th {
    background: var(--primary, #0d9488);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border: none;
}
/* tbody */
.single-article-body tbody tr,
.single-content tbody tr,
.entry-content tbody tr,
figure.wp-block-table tbody tr { border-bottom: 1px solid #e2e8f0; }
.single-article-body tbody tr:last-child,
.single-content tbody tr:last-child,
.entry-content tbody tr:last-child,
figure.wp-block-table tbody tr:last-child { border-bottom: none; }
.single-article-body tbody tr:nth-child(even),
.single-content tbody tr:nth-child(even),
.entry-content tbody tr:nth-child(even),
figure.wp-block-table tbody tr:nth-child(even) { background: #f8fafc; }
.single-article-body tbody tr:hover,
.single-content tbody tr:hover,
.entry-content tbody tr:hover { background: #f0fdfa; }
/* cells */
.single-article-body td,
.single-content td,
.entry-content td,
figure.wp-block-table td {
    padding: 11px 16px;
    color: #334155;
    font-size: 14px;
    vertical-align: top;
    border: none;
}
.single-article-body td:first-child,
.single-content td:first-child,
.entry-content td:first-child { font-weight: 600; color: #1e293b; }
/* tfoot */
.single-article-body tfoot td,
.single-content tfoot td,
.entry-content tfoot td {
    background: #f1f5f9; font-weight: 700;
    border-top: 2px solid #e2e8f0; padding: 11px 16px;
}
@media (max-width: 600px) {
    .single-article-body thead th,
    .single-content thead th,
    .entry-content thead th { padding: 9px 10px; font-size: 11px; }
    .single-article-body td,
    .single-content td,
    .entry-content td      { padding: 9px 10px; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════
   FIX 3 — SINGLE POST MOBILE LAYOUT
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .single-content-wrap {
        grid-template-columns: 1fr !important;
        padding: 24px 16px 48px;
        gap: 24px;
    }
    .single-sidebar {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    /* Layout */
    .single-content-wrap { padding: 16px 14px 40px !important; gap: 18px; }
    .single-title-bar    { padding: 18px 0 14px; }
    .single-title-inner  { padding: 0 14px; }
    .single-title-bar h1 { font-size: clamp(20px, 5.5vw, 30px); line-height: 1.25; margin-bottom: 10px; }
    .post-meta           { font-size: 13px; flex-wrap: wrap; gap: 6px; }

    /* Featured image */
    .single-featured-img     { margin-bottom: 18px; border-radius: 8px; }
    .single-featured-img img { max-height: 260px; border-radius: 8px; object-fit: cover; }

    /* Article body */
    .single-article-body,
    .single-content { font-size: 15px; line-height: 1.75; }
    .single-article-body h2,
    .single-content h2       { font-size: clamp(17px, 4.5vw, 22px); }
    .single-article-body h3,
    .single-content h3       { font-size: clamp(15px, 4vw, 19px); }
    .single-article-body p,
    .single-content p        { margin-bottom: 14px; }

    /* Sidebar */
    .single-sidebar { display: flex !important; flex-direction: column; gap: 14px; }

    /* Gutenberg blocks */
    .wp-block-columns       { flex-direction: column !important; }
    .wp-block-column        { width: 100% !important; min-width: 0 !important; flex-basis: 100% !important; margin-left: 0 !important; }
    .wp-block-embed         { overflow: hidden; max-width: 100%; }
    .wp-block-embed__wrapper iframe { width: 100% !important; }
    figure.wp-block-image   { max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }

    /* Header mobile menu open: must not overflow */
    .primary-nav.open {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 420px) {
    .single-content-wrap { padding: 12px 10px 32px !important; }
    .single-title-inner  { padding: 0 10px; }
    .single-article-body,
    .single-content      { font-size: 14px; }
    .single-featured-img img { max-height: 210px; }
    .container { padding-left: 12px; padding-right: 12px; }
}

/* ══════════════════════════════════════════════════════════════
   FIX 5 — Mobile menu toggle (☰) invisible on narrow phones (iPhone)
   Root cause: .header-inner is a single-row flex with no wrap.
   Logo text + Subscribe button + toggle together are wider than
   narrow iPhone viewports (375–430px). The toggle button (last
   item) gets squeezed off to the right — and since body has
   overflow-x:hidden (needed for the overflow fix above), the
   pushed-off part is clipped instead of scrollable, so it just
   disappears. Wider Android phones had just enough room, which is
   why it only showed up on iPhone screens.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
    }
    .site-branding,
    .site-name-wrap {
        min-width: 0;
        overflow: hidden;
    }
    .site-name-wrap .site-title {
        display: block;
        max-width: 40vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-actions {
        flex-shrink: 0;
    }
    .menu-toggle {
        flex-shrink: 0;
        margin-left: 6px;
    }
}

/* On the narrowest iPhones there still isn't room for the
   Subscribe button alongside the logo + toggle — hide it there
   only, so the toggle always stays visible and tappable. */
@media (max-width: 480px) {
    .btn-subscribe {
        display: none;
    }
}
