/* ==========================================================================
   IPLSA — Events page stylesheet
   沿用舊版 events 頁面的視覺規格，並延伸「年度分節 + 精選照片」所需樣式。
   取代舊檔：/events/modalimg.css
   ========================================================================== */

/* ---------- 舊版固有規格（保持一致） ---------- */
h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }

#headimg:hover { box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); }

.image-container {
    display: flex;
    align-items: center; /* 確保整體垂直居中 */
}
.image-container img { width: 350px; }
#headimg2 img { position: relative; top: 10px; }

#footer { padding: 30px; }
#footer a { text-decoration: none; }

/* ---------- 語言切換器 ---------- */
#langSwitch .nav-link { padding: .5rem .6rem; }
#langSwitch .nav-link.is-active {
    font-weight: 700;
    color: #212529;
    text-decoration: underline;
}

/* ---------- 頁面主體 ---------- */
#events-app { padding-bottom: 10px; }

/* 年度快捷導覽 */
.year-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}
.year-jump a {
    display: inline-block;
    padding: 3px 11px;
    border: 1px solid #dee2e6;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #495057;
    text-decoration: none;
    transition: all .15s ease-in-out;
}
.year-jump a:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    text-decoration: none;
}

/* 年度分節 */
.events-year { margin-bottom: 26px; }
.events-year > h2 {
    margin-top: 30px;
    padding-bottom: 6px;
    border-bottom: 2px solid #dee2e6;
}
.events-year:first-child > h2 { margin-top: 6px; }

/* 表格：沿用 bootstrap .table.table-bordered，只微調欄寬與行距 */
.events-table { margin-bottom: 14px; }
.events-table > thead > tr > th { white-space: nowrap; }
.events-table td.period-cell {
    width: 150px;
    white-space: nowrap;
    font-weight: 600;
    vertical-align: top;
    background-color: #f8f9fa;
}
.events-table td.events-cell { vertical-align: top; }
.events-table td.events-cell ul {
    margin: 0;
    padding-left: 20px;
}
.events-table td.events-cell li { margin-bottom: 3px; }
.events-table td.events-cell li:last-child { margin-bottom: 0; }
.events-table .ev-date { color: #6c757d; }

/* 空年度/空期間的提示 */
.events-empty { color: #6c757d; font-style: italic; }

/* ---------- 精選照片（每年度一組） ---------- */
.featured-photos { margin: 4px 0 26px; }
.featured-photos .featured-title {
    font-size: 16px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 4px;
}
.featured-photos .featured-hint { font-size: 13px; color: #adb5bd; }
.photo-grid { margin-top: 6px; }
.photo-item { margin-bottom: 18px; }
.photo-item .photo-caption {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.45;
    color: #343a40;
}
.photo-item .photo-caption .photo-date {
    display: block;
    color: #6c757d;
    font-size: 13px;
}

/* 相關文件（每年度可附 PDF 等下載） */
.year-downloads { margin: 0 0 26px; }
.year-downloads .downloads-title {
    font-size: 16px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 4px;
}
.year-downloads .downloads-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.year-downloads .downloads-list li { margin-bottom: 4px; }
.year-downloads .downloads-list a {
    color: #0056b3;
    text-decoration: none;
}
.year-downloads .downloads-list a:hover { text-decoration: underline; }

/* 沿用舊版燈箱（.modalImg / .modalImgBg / #modalImgCaption / .btnClose） */
.modalImg {
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    max-width: 300px;
    margin-top: 10px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
.modalImg:hover { opacity: 0.7; }

.modalImgBg {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}
.modalImgContent {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1000px;
}
#modalImgCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    min-height: 60px;
}
.modalImgContent,
#modalImgCaption {
    animation-name: zoom;
    animation-duration: 0.6s;
}
@keyframes zoom {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}
.btnClose {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}
.btnClose:hover,
.btnClose:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
body.modal-open-lock { overflow: hidden; }

/* ---------- 回應式 ---------- */
@media only screen and (max-width: 700px) {
    .modalImgContent { width: 100%; }
    .image-container img { width: 50%; }
    .events-table td.period-cell {
        width: auto;
        white-space: normal;
    }
}

/* 列印 */
@media print {
    .year-jump, #langSwitch, .navbar { display: none !important; }
    .events-year { page-break-inside: auto; }
    .events-year > h2 { page-break-after: avoid; }
}
