/* ==========================================================================
 * responsive.css — fluid/mobile layout layer for the LBRY block explorer.
 *
 * main.css is a fixed-1200px float layout with zero media queries; this layer
 * converts every fixed-width container to `min(1200px, 100% - 24px)`, stacks
 * the two-column float rows below 1000px, and switches tables to wrap/scroll
 * below 760px. Thin override layer ONLY — no markup changes, load LAST
 * (Layout/default.ctp). Palette rules live in hot-candy.css. Card: mobile
 * reskin, 2026-12-04.
 * ========================================================================== */

/* ---------- fluid containers (all breakpoints) ---------- */
.main,
.header,
footer .content,
.claims-head,
.claims-grid,
.claims-body,
.block-head,
.block-info,
.block-nav,
.all-blocks,
.block-size-chart-container,
.tx-head,
.tx-time,
.realtime-head,
.realtime-main,
.stats-head,
.stats-main .richlist,
.tx-summary,
.tx-details,
.tx-details-layout,
.address-head,
.address-subhead,
.recent-transactions,
.pagination,
.home-container-cell .recent-blocks,
.home-container-cell .recent-claims,
.stats {
    width: min(1200px, calc(100% - 24px));
    margin-left: auto;
    margin-right: auto;
}

/* ---------- stacked columns + full-width controls (<= 1000px) ---------- */
@media (max-width: 1000px) {
    .block-summary,
    .block-transactions { width: auto; float: none; margin: 0 0 24px 0; }

    .claims-body .claim-info { width: auto; float: none; margin-bottom: 24px; }
    .claims-body .claim-metadata { width: auto; float: none; margin-left: 0; }

    .realtime-main .realtime-blocks,
    .realtime-main .realtime-tx { width: auto; float: none; margin: 0 0 24px 0; }

    .address-qr { float: none; display: block; margin: 0 auto 16px auto; }
    .address-summary { width: auto; float: none; margin-left: 0; }

    .tx-details-layout { display: block; }
    .tx-details-layout .inputs,
    .tx-details-layout .outputs,
    .tx-details-layout .divider { display: block; width: auto; }
    .tx-details-layout .divider { padding-top: 8px; padding-bottom: 16px; }
    .tx-details-layout .divider img { width: 48px; }

    /* KPI boxes: 4-across becomes 2x2; kill the border on every 2nd box */
    .stats .box,
    .tx-summary .box,
    .tx-summary .box.p15,
    .tx-summary .box.p25,
    .address-summary .box { width: 50%; }
    .stats .box:nth-child(even),
    .tx-summary .box:nth-child(even),
    .address-summary .box:nth-child(even) { border-right-color: transparent; }

    .home-container-cell .search-input { width: calc(100% - 24px); }
    .home-container-cell .ctls { width: auto; }

    /* header search drops under the title, goes full width */
    .header .search { float: none; clear: both; padding-top: 12px; }
    .header .search .input-group { width: auto; }
    .header .search .input-group input { width: calc(100% - 4px); }
}

/* ---------- phone (<= 760px) ---------- */
@media (max-width: 760px) {
    .header { padding: 12px 0 24px 0; }
    .home-container-cell > .main > .title { font-size: 200%; width: auto; }
    .home-container-cell .ctls .links { position: static; display: block; margin-top: 12px; }
    .home-container-cell .recent-blocks,
    .home-container-cell .recent-claims { padding: 16px 12px 24px 12px; }

    /* absolute-positioned corner links would collide with headings */
    .all-blocks-link, .claim-explorer-link,
    .recent-transactions .results-meta, .all-blocks .results-meta,
    .block-size-chart-container .block-size-data-links {
        position: static; display: inline-block; margin: 4px 0 8px 0;
    }

    /* tables: let cells wrap, drop fixed widths, allow horizontal scroll as a
       backstop for the wide tx/address tables */
    .table { font-size: 80%; }
    .table tbody tr td, .table thead tr th { padding: 6px 4px; }
    .table tbody tr td { white-space: normal; }
    .w50, .w80, .w100, .w125, .w150, .w200, .w225, .w250, .w275, .w300, .w350,
    .w200 > div, .w250 > div, .w275 > div, .w300 > div { width: auto; }
    .all-blocks, .recent-transactions, .block-transactions,
    .stats-main .richlist { overflow-x: auto; padding: 16px 12px; }

    .claims-grid .claim-grid-item { width: 100%; height: auto; margin-right: 0; margin-bottom: 24px; }
    .claims-grid .claim-grid-item .desc { height: auto; }
    .claims-grid .claim-grid-item .half-width { width: 100%; float: none; }

    .block-size-chart-container { height: auto; }
    .block-size-chart-container .chart { height: 300px; }

    .tx-time .created-time, .tx-time .conf-time { width: auto; float: none; display: block; margin-bottom: 4px; }
    footer .content .page-time { position: static; padding: 4px 0 0 0; }

    .address-head .tag-address-container .form-group .col,
    .address-head .tag-address-container .form-group .col input,
    .address-head .tag-address-container .form-group .col textarea { width: 100%; }

    .pagination .pages .page-number { width: auto; min-width: 28px; }
}

/* ---------- home-page overflow fixes (QA pass 2026-12-04) ---------- */
/* long atomic numbers (difficulty 1291543340795.10, price) don't wrap and
   blew the layout viewport to ~513px on a 390px phone */
@media (max-width: 1000px) {
    .stats .box .value, .tx-summary .box .value,
    .address-summary .box .value, .block-summary .value {
        overflow-wrap: anywhere;
    }
}
@media (max-width: 760px) {
    /* the home recent-blocks/claims tables need a scroll container, same as
       .all-blocks got above — without it their min-content width propagates
       to <body> and Chrome shrinks the whole viewport instead of scrolling */
    .home-container-cell .recent-blocks,
    .home-container-cell .recent-claims { overflow-x: auto; }
}

/* ---------- home-page overflow fixes (QA pass 2) ---------- */
/* .home-container is display:table — table cells propagate min-content and
   defeat the scroll-container fix, so on phones the whole page became ~500px
   wide. Block layout stops the propagation; vertical centering is lost and
   that is fine at phone sizes. */
@media (max-width: 760px) {
    .home-container { display: block; height: auto; }
    .home-container-cell { display: block; padding: 24px 0 48px 0; }
    .home-container-cell .recent-claims .claim-box {
        width: calc(50% - 4px); height: auto; margin-bottom: 8px;
    }
    .home-container-cell .recent-claims .claim-box .desc { height: auto; min-height: 60px; }
}

/* ---------- long hash headings (QA pass 3) ---------- */
/* a 64-char txid is one atomic word; at 200% font it demanded ~640px and
   blew the phone viewport to 703px */
@media (max-width: 1000px) {
    .tx-head h3, .tx-time h3, .block-head h3, .claims-head h3,
    .realtime-head h3, .stats-head h3, .address-head h3 {
        overflow-wrap: anywhere; word-break: break-all;
    }
    .tx-details-layout .inputs .input, .tx-details-layout .outputs .output {
        overflow-wrap: anywhere;
    }
}
