/* ============= MOBILE-ONLY ELEMENTS (hidden on desktop) ============= */

.nav-mobile-actions,
.mobile-drawer,
.drawer-overlay,
.news-load-more-wrap,
.release-chevron,
.label-short,
.weekday-short,
.unit-short,
.footer-short {
    display: none;
}

.release-content .indicator-period::before {
    content: "(";
}

.release-content .indicator-period::after {
    content: ")";
}


/* ============= GLOBAL ============= */

@media (max-width: 992px) {
    /* Header */
    .nav-container {
        width: 100%;
        height: 62px;
        padding: 0 10px 0 16px;
        flex-direction: row;
    }

    .nav-links {
        display: none;
    }

    .logo {
        font-size: 1.5em;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .nav-mobile-actions {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .nav-icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: none;
        background: transparent;
        color: #222;
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
    }

    .nav-icon-btn .bi-list {
        font-size: 1.75rem;
    }

    /* Drawer */
    .drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.35);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0s linear 0.2s;
        z-index: 5000;
    }

    .drawer-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.2s ease, visibility 0s linear 0s;
    }

    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(80vw, 340px);
        background: #dddddd;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
        overflow-y: auto;
        z-index: 5001;
    }

    .mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.25s ease, visibility 0s linear 0s;
    }

    body.drawer-open {
        overflow: hidden;
    }

    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        height: 62px;
        padding: 0 10px 0 20px;
        border-bottom: 1px solid #c4c4c4;
    }

    .drawer-title {
        font-family: "Inter", sans-serif;
        font-size: 1.15rem;
        font-weight: 600;
        color: #222;
    }

    .drawer-search {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 46px;
        margin: 18px 20px;
        padding: 0 14px;
        border: 1px solid #222;
        transition: background-color 0.2s ease;
    }

    .drawer-search:focus-within {
        background: #fff;
    }

    .drawer-search i {
        font-size: 1.1rem;
        color: #222;
    }

    .drawer-search input {
        flex: 1;
        min-width: 0;
        border: none;
        outline: none;
        background: transparent;
        font-family: "Inter", sans-serif;
        font-size: 1rem; /* 16px stops iOS zooming on focus */
        color: #222;
    }

    .drawer-search input::placeholder {
        color: #444;
    }

    .drawer-links {
        display: flex;
        flex-direction: column;
    }

    .drawer-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #c4c4c4;
        font-family: "Inter", sans-serif;
        font-size: 1rem;
        color: #222;
        text-decoration: none;
    }

    .drawer-links a.active {
        font-weight: 600;
    }

    .drawer-links a i {
        font-size: 0.9rem;
        color: #6b7280;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .main-content {
        padding: 0 14px;
        margin: 0;
    }

    /* Footer */
    .footer {
        justify-content: center;
        padding: 24px 16px;
        background: transparent;
        box-shadow: none;
    }

    .footer-full,
    .footer-right {
        display: none;
    }

    .footer-short {
        display: inline;
    }

    .footer-left {
        font-size: 0.85rem;
        color: #6b7280;
    }
}


/* ============= HOME ============= */

@media (max-width: 992px) {
    .home-grid {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 0 16px 16px;
        gap: 16px;
    }

    .news-feed {
        margin-left: 0;
    }

    /* Indicator cards */
    .indicator-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .indicator-card {
        aspect-ratio: auto;
        padding: 12px;
    }

    .indicator-header {
        min-height: 0;
        gap: 6px;
        margin-bottom: 4px;
    }

    .indicator-title-row {
        gap: 6px;
    }

    .indicator-header h3 {
        font-size: 0.88rem;
    }

    .indicator-title-row .indicator-period {
        font-size: 0.7rem;
    }

    .indicator-value-wrapper {
        flex-wrap: wrap;
        gap: 6px;
    }

    .indicator-trend {
        font-size: 1rem;
    }

    .indicator-value {
        font-size: 1.4rem;
    }

    .indicator-chart {
        min-height: 0;
        padding-top: 6px;
    }

    .indicator-chart img {
        height: 84px;
    }
}

@media (max-width: 768px) {
    .home-grid {
        padding: 0 0 8px;
    }

    /* Upcoming releases */
    .data-release-homepage {
        padding: 16px 14px;
        box-shadow: none;
    }

    .data-release-hdr {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .data-release-homepage .panel-title {
        font-size: 0.85rem;
        letter-spacing: 0.08em;
    }

    .release-link {
        font-size: 0.85rem;
    }

    .label-long {
        display: none;
    }

    .label-short {
        display: inline;
    }

    .release-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .date-group:nth-child(n+4) {
        display: none;
    }

    .date-group {
        display: grid;
        grid-template-columns: 56px 1fr;
        column-gap: 12px;
        height: auto;
        border: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .date-group.today {
        border: none;
    }

    .date-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 0;
        border-bottom: none;
        border-radius: 6px;
        background: #e5e7eb;
    }

    .date-group.today .date-header {
        box-shadow: inset 0 0 0 2px #1C69A8;
    }

    .full-date {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .date-month,
    .weekday-short {
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #6b7280;
        line-height: 1.3;
    }

    .date-day {
        font-size: 1.45rem;
        font-weight: 500;
        color: #1e293b;
        line-height: 1.15;
    }

    .weekday {
        line-height: 1;
    }

    .weekday-long {
        display: none;
    }

    .weekday-short {
        display: inline;
    }

    .release-content {
        padding: 0;
        gap: 0;
    }

    .indicator-item {
        display: block;
        position: relative;
        padding: 14px 24px 14px 0;
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0;
        background: transparent;
    }

    .indicator-item:hover {
        background: transparent;
    }

    .release-content .indicator-name,
    .release-content .indicator-period {
        font-size: 0.92rem;
        font-weight: 400;
        color: #1a202c;
    }

    .release-content .indicator-period::before {
        content: "·\00a0";
    }

    .release-content .indicator-period::after {
        content: none;
    }

    .release-chevron {
        display: block;
        position: absolute;
        top: 50%;
        right: 2px;
        transform: translateY(-50%);
        font-size: 0.8rem;
        color: #6b7280;
    }

    /* News feed */
    .news-feed {
        padding: 14px;
        background: #f4f5f7;
        border: 1px solid #e2e5e9;
        box-shadow: none;
    }

    .news-feed-hrd-container {
        display: flex;
        align-items: center;
        gap: 8px;
        padding-bottom: 10px;
        border-bottom: 2px solid #3a3d45;
    }

    .news-feed-hrd-container .bi {
        font-size: 1.05rem;
        color: #1f2937;
    }

    .news-feed-hdr {
        font-size: 0.85rem;
        letter-spacing: 0.08em;
        color: #1f2937;
    }

    .news-item-pagination,
    .news-logo,
    .headline-icon {
        display: none;
    }

    .news-item {
        padding: 14px 0;
        border-bottom: 1px solid #e2e5e9;
    }

    .news-item:hover {
        background: transparent;
    }

    .news-item.is-collapsed {
        display: none;
    }

    .news-source-name {
        font-weight: 500;
        color: #4b5563;
        letter-spacing: 0.02em;
    }

    .headline {
        display: block;
        margin-top: 6px;
        font-size: 0.98rem;
        line-height: 1.45;
    }

    .news-load-more-wrap {
        display: block;
        padding-top: 14px;
    }

    .news-load-more {
        display: block;
        width: 100%;
        padding: 12px;
        border: 1px solid #c9ccd1;
        border-radius: 4px;
        background: #fff;
        font-family: "Inter", sans-serif;
        font-size: 0.92rem;
        font-weight: 500;
        color: #111827;
        cursor: pointer;
    }

    .news-load-more:disabled {
        color: #6b7280;
        cursor: default;
    }
}

@media (max-width: 576px) {
    .indicator-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .unit-long {
        display: none;
    }

    .unit-short {
        display: inline;
    }
}
