/* Public all-news dialog only; do not change shared modal or page typography. */
html:has(#newsModalOverlay[aria-hidden="false"]),
body:has(#newsModalOverlay[aria-hidden="false"]) {
    overflow: hidden;
}

#newsModalOverlay {
    --news-modal-gutter: max(clamp(12px, 3vmin, 32px), env(safe-area-inset-top, 0px), env(safe-area-inset-right, 0px), env(safe-area-inset-bottom, 0px), env(safe-area-inset-left, 0px));
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: var(--news-modal-gutter);
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1111;
    font-size: clamp(16px, 1vw + 12px, 20px);
    line-height: 1.65;
    transition: opacity 0.16s ease;
}

#newsModalOverlay *,
#newsModalOverlay *::before,
#newsModalOverlay *::after {
    box-sizing: border-box;
}

#newsModalOverlay .modal-content {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: clamp(14px, 2vw, 22px);
    overflow: hidden;
    transform: none;
    transition: opacity 0.16s ease;
}

#newsModalOverlay .modal-header {
    flex: 0 0 auto;
    min-height: 64px;
    margin: 0;
    padding: 12px clamp(14px, 2.2vw, 28px);
    gap: 12px;
    border-bottom: 1px solid rgba(var(--rgb-secondary), 0.25);
}

#newsModalOverlay .modal-title {
    min-width: 0;
    font-size: clamp(18px, 1vw + 14px, 22px);
    line-height: 1.4;
}

#newsModalOverlay #newsCloseBtn {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 -6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

#newsModalOverlay #newsCloseBtn:hover {
    background: rgba(var(--rgb-secondary), 0.08);
}

#newsModalOverlay .modal-body {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 12px clamp(14px, 2.2vw, 28px) 20px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--rgb-secondary), 0.5) transparent;
    font-size: inherit;
}

#newsModalOverlay .booking-section {
    min-width: 0;
    margin: 0;
}

#newsModalOverlay #allAnnouncementList {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#newsModalOverlay #allAnnouncementList > li {
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(var(--rgb-secondary), 0.12);
    border-radius: 10px;
    color: var(--color-secondary);
    font-size: inherit;
    list-style: none;
}

#newsModalOverlay #allAnnouncementList > li:nth-child(even) {
    background: rgba(var(--rgb-secondary-light), 0.05);
}

#newsModalOverlay .news-list-item {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.65;
    text-align: start;
    overflow-wrap: anywhere;
    cursor: pointer;
}

#newsModalOverlay .news-list-item:hover {
    background: rgba(var(--rgb-secondary), 0.06);
    color: var(--color-primary);
}

#newsModalOverlay #allAnnouncementList > .news-list-state {
    padding: 32px 16px;
    border: 0;
    text-align: center;
}

#newsModalOverlay .news-list-retry {
    margin-top: 16px;
    font: inherit;
}

#newsModalOverlay .teacher-phone-footer-control {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 20px;
    height: auto;
    margin: 0;
    padding: 16px clamp(14px, 2.2vw, 28px);
    border-top: 1px solid rgba(var(--rgb-secondary), 0.16);
    box-shadow: 0 -6px 16px rgba(var(--rgb-neutral-dark), 0.04);
}

#newsModalOverlay .count-text,
#newsModalOverlay .count-text p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    white-space: nowrap;
}

#newsModalOverlay .teacher-phone-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    gap: 6px;
    font-size: 16px;
    line-height: 1.4;
}

#newsModalOverlay .teacher-phone-pagination button {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(var(--rgb-neutral-dark), 0.12);
}

#newsModalOverlay #newsCloseBtn:focus-visible,
#newsModalOverlay .news-list-item:focus-visible,
#newsModalOverlay .teacher-phone-pagination button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    #newsModalOverlay .teacher-phone-footer-control {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-block: 12px;
    }

    #newsModalOverlay .teacher-phone-pagination {
        justify-content: center;
    }

    #newsModalOverlay .teacher-phone-pagination button {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    #newsModalOverlay .news-list-item {
        padding: 14px 12px;
    }
}

@media (max-height: 480px) {
    #newsModalOverlay .modal-header {
        min-height: 48px;
        padding-block: 4px;
    }

    #newsModalOverlay .teacher-phone-footer-control {
        padding-block: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #newsModalOverlay,
    #newsModalOverlay .modal-content,
    #newsModalOverlay button {
        transition: none;
    }
}
