/* =========================================================
   NOTICE WIDGET — fixed round icon button + slide-in panel
   Appears on every page (included from includes/layout_end.php),
   always in the same position: right edge, vertically centered,
   styled as a round floating icon button (same idea as circular
   floating LINE/Instagram/contact buttons) so it reads as a single
   persistent shortcut rather than part of the page content.
   Right side is used deliberately:
     - it's the side people expect a floating contact/notice
       button to live on
     - on mobile it falls under a right-handed thumb naturally
     - the left edge is kept clear since the mobile hamburger
       menu already opens as a full-screen overlay
========================================================= */

.notice-tab {
    position: fixed;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    z-index: 950; /* above page content, below the panel/overlay */
    display: flex;
    align-items: center;
    gap: 0;
    border: none;
    cursor: pointer;
    background: none;
    padding: 0;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hidden while the hero (index.php) or page-header (every other page)
   is still in view, so it never overlaps that section — see
   assets/js/notice-widget.js, which toggles this class on scroll. */
.notice-tab.notice-tab-hidden {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
    pointer-events: none;
}

.notice-tab-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--dark-navy, #0d3b66);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: background 0.25s ease, transform 0.25s ease;
}

.notice-tab-text {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--dark-navy, #0d3b66);
    padding: 0;
    border-radius: 8px 0 0 8px;
    transition: max-width 0.3s ease, padding 0.3s ease;
}

.notice-tab:hover .notice-tab-icon,
.notice-tab:focus-visible .notice-tab-icon {
    background: var(--primary-blue, #3498db);
    transform: scale(1.05);
}

/* On hover/focus (pointer devices), the label chip slides out to the
   left of the circle — the circle itself never moves position. */
@media (hover: hover) {
    .notice-tab:hover .notice-tab-text,
    .notice-tab:focus-visible .notice-tab-text {
        max-width: 220px;
        padding: 10px 16px;
        margin-right: -14px;
    }
}


/* Overlay behind the panel */
.notice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 20, 30, 0.45);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.notice-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-in panel */
.notice-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 400px;
    max-width: 90vw;
    background: #fff;
    z-index: 2000;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.notice-panel.open {
    transform: translateX(0);
}

.notice-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background: var(--dark-navy, #0d3b66);
    color: #fff;
    flex-shrink: 0;
}

.notice-panel-header h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.notice-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.notice-close:hover {
    color: var(--school-yellow, #f4d35e);
}

.notice-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* List view */
.notice-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notice-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f4;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notice-list-item:hover,
.notice-list-item:focus-visible {
    background: var(--light-bg, #f8f9fa);
    outline: none;
}

.notice-date {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-blue, #3498db);
}

.notice-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-main, #1a1c1e);
    line-height: 1.5;
}

.notice-arrow {
    flex-shrink: 0;
    font-size: 12px;
    color: #b0b8c1;
}

.notice-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-gray, #4a5568);
    font-size: 14px;
}

/* Detail view */
.notice-detail-view {
    padding: 8px 20px 24px;
}

.notice-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--primary-blue, #3498db);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0 18px;
}

.notice-back:hover {
    text-decoration: underline;
}

.notice-detail-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-blue, #3498db);
    margin-bottom: 8px;
}

.notice-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-navy, #0d3b66);
    line-height: 1.4;
    margin-bottom: 16px;
}

.notice-detail-content {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-main, #1a1c1e);
    word-break: break-word;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 576px) {
    /* Touch devices don't get a hover state, so the label chip never
       appears here anyway — just make sure the circle itself stays a
       comfortable tap target and doesn't hug the very edge. */
    .notice-tab {
        right: 12px;
    }

    .notice-tab-icon {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .notice-panel {
        width: 100%;
        max-width: 100%;
    }
}

