/* Homepage enhancement is enabled only after the existing phone-PWA detection and this stylesheet are ready. */
:root { --gi-pwa-home-ready: 1; }

@media (max-width: 1000px) {
    html.pwa-mobile-app.pwa-home-ready .home-page { min-width: 0; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month {
        grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); min-height: 0; margin: 0 auto 24px;
    }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-image { height: 104px; min-height: 0; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-image:not(:has(img)) { display: none; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-copy { min-width: 0; padding: 12px 14px; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-copy .content-label { font-size: .6875rem; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-copy h2 { margin: 4px 0 6px; font-size: 1.35rem; overflow-wrap: anywhere; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-copy > p:not(.content-label) {
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
        max-height: 4.35em; font-size: .875rem; line-height: 1.45;
    }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-actions { padding-top: 10px; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-actions .btn { min-height: 44px; }
    html.pwa-mobile-app.pwa-home-ready .home-region-month-actions .btn.secondary { display: none; }

    html.pwa-mobile-app.pwa-home-ready .home-section { width: calc(100% - 32px); max-width: none; min-width: 0; margin: 0 auto 24px; }
    html.pwa-mobile-app.pwa-home-ready .home-section-head { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; }
    html.pwa-mobile-app.pwa-home-ready .home-section-head h2 { min-width: 0; margin: 0; font-size: 1.125rem; line-height: 1.3; overflow-wrap: anywhere; }
    html.pwa-mobile-app.pwa-home-ready .home-section-head > a { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 44px; max-width: 110px; white-space: normal; font-size: .75rem; line-height: 1.4; }

    html.pwa-mobile-app.pwa-home-ready :is(.home-magazine-grid, .home-report-grid, .home-photo-grid) {
        display: grid; grid-template-columns: none; grid-auto-flow: column;
        grid-auto-columns: calc(100% - 44px); gap: 12px;
        width: 100%; min-width: 0; max-width: 100%; padding: 3px 0 10px; overflow-x: auto;
        scroll-snap-type: x proximity; scroll-padding-inline: 0; overscroll-behavior-x: contain;
        scrollbar-width: thin; scrollbar-color: var(--gi-line) transparent;
    }
    html.pwa-mobile-app.pwa-home-ready :is(.home-content-card, .home-photo-card) {
        min-width: 0; scroll-snap-align: start; transform: none; transition: none;
    }
    html.pwa-mobile-app.pwa-home-ready :is(.home-magazine-grid, .home-report-grid) .home-card-image {
        height: 156px; min-height: 0; aspect-ratio: auto;
    }
    html.pwa-mobile-app.pwa-home-ready :is(.home-magazine-grid, .home-report-grid) .home-card-image :is(.responsive-image, img) {
        width: 100%; height: 100% !important; aspect-ratio: auto; object-fit: cover; transform: none;
    }
    html.pwa-mobile-app.pwa-home-ready .home-card-copy { min-height: 0; padding: 10px 12px; }
    html.pwa-mobile-app.pwa-home-ready .home-card-copy > :not(h3) { display: none; }
    html.pwa-mobile-app.pwa-home-ready .home-card-copy h3 { min-height: 0; margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
    html.pwa-mobile-app.pwa-home-ready .home-card-copy h3 a { display: flex; align-items: center; min-height: 48px; }
    html.pwa-mobile-app.pwa-home-ready .home-photo-card { padding: 0; overflow: hidden; border: 1px solid var(--gi-line); border-radius: var(--gi-radius-md); background: #fff; box-shadow: var(--gi-shadow-sm); }
    html.pwa-mobile-app.pwa-home-ready .home-photo-card .responsive-image { height: 156px; aspect-ratio: auto; border-radius: 0; }
    html.pwa-mobile-app.pwa-home-ready .home-photo-card > img { height: 156px !important; aspect-ratio: auto !important; border: 0; border-radius: 0; }
    html.pwa-mobile-app.pwa-home-ready .home-photo-card img { transform: none; transition: none; }
    html.pwa-mobile-app.pwa-home-ready .home-photo-card > span { min-height: 68px; padding: 10px 12px; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
    html.pwa-mobile-app.pwa-home-ready :is(.home-card-grid, .home-photo-grid, .home-photo-card, .home-card-copy a):focus-visible { outline: 3px solid var(--gi-accent); outline-offset: -3px; }

    html.pwa-mobile-app.pwa-home-ready .home-poll-card { padding: 14px; border: 2px solid var(--gi-line); }
    html.pwa-mobile-app.pwa-home-ready .home-poll-card legend { margin-bottom: 12px; font-size: 1.125rem; overflow-wrap: anywhere; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-options { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-options label { min-height: 48px; padding: 10px; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-options input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-options span { min-width: 0; overflow-wrap: anywhere; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-actions { gap: 8px 14px; padding-top: 12px; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-actions .btn { width: 100%; min-height: 48px; }
    html.pwa-mobile-app.pwa-home-ready .home-poll-actions > a { display: inline-flex; align-items: center; min-height: 44px; }
    html.pwa-mobile-app.pwa-home-ready .home-events-section { display: none; }
}
