/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Author: Your Name
Author URI: http://example.com
Description: Child theme for the Astra theme
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
*/
/* 字體調整 */
@font-face {
    font-family: 'Open Huninn';
    src: url('fonts/jf-openhuninn-2.0.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body, h1, h2, h3, h4, h5, h6, p, a, span, div {
    font-family: 'Open Huninn', '微軟正黑體', 'Microsoft JhengHei', sans-serif !important;
}
/* 選單 樣式 */
/* 增加選單文字大小 */
.menu-item a {
    font-size: 16px; /* 調整為適合的大小 */
}

/* 調整子選單樣式 */
.sub-menu {
    min-width: 200px; /* 確保子選單有足夠的寬度 */
}

.sub-menu .menu-item {
    padding: 3px 15px; /* 子選單項目的內邊距 */
}

/* 懸停效果 */
.menu-item:hover > a {
    background-color: #f0f0f0; /* 懸停背景色 */
}

/* 響應式調整 */
@media (max-width: 768px) {
    .menu-item a {
        font-size: 14px; /* 在小屏幕上稍微減小字體 */
    }
    
    .menu-item {
        padding: 8px 0; /* 在小屏幕上減少內邊距 */
    }
}
/* 我的班級 頁面樣式 */
.my-classes-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.my-classes-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
}

.my-classes-intro {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.my-classes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.class-item {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.class-item h3 {
    margin-top: 0;
    color: #333;
}

.class-item .button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.class-item .button:hover {
    background-color: #005177;
}

.announcement-item, .contact-book-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ast-archive-description {
    margin-bottom: 40px;
}

.ast-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.ast-button:hover {
    background-color: #005177;
}

/* 班級首頁的 公告 置頂樣式 */
.pinned-announcement {
    position: relative;
}
.announcement-title {
    display: flex;
    align-items: center;
}

.announcement-title .new-badge,
.announcement-title .pinned-badge {
    margin-right: 5px;
}
/* 班級首頁的 公告、聯絡事項、行事曆 的樣式 */
.announcements-list, .contact-books-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.announcement-item, .contact-book-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}
.announcement-date, .contact-book-date {
    flex: 0 0 100px;
    font-weight: bold;
}
.announcement-title, .contact-book-title {
    flex: 1;
    margin: 0 20px;
}
.announcement-author, .contact-book-author {
    flex: 0 0 150px;
}
.announcement-tag, .contact-book-tag {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-right: 10px;
}
.new-badge, .pinned-badge {
    margin-right: 10px;
    padding: 2px 5px;
    color: white;
    border-radius: 3px;
    font-size: 0.8em;
}

.new-badge {
    background-color: #28a745;
    animation: blink 1s linear infinite;
}

.pinned-badge {
    background-color: #FF69B4; /* 桃紅色 */
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
.more-announcements, .more-contact-books {
    display: flex;
    justify-content: flex-end;
    margin-top: 0px;
}
.more-announcements a, .more-contact-books a {
    padding: 10px 20px;
    background-color: #0077b6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}
@media (max-width: 768px) {
    .announcement-author, .contact-book-author {
        display: none;
    }
    .announcement-title, .contact-book-title {
        margin: 0 10px;
        display: flex;
        align-items: center;
        flex-wrap: nowrap; /* 禁止換行 */
        overflow: hidden; /* 隱藏溢出的內容 */
    }
    .announcement-title a, .contact-book-title a {
        white-space: nowrap; /* 禁止換行 */
        overflow: hidden; /* 隱藏超出的內容 */
        text-overflow: ellipsis; /* 超出顯示省略號 */
        flex-shrink: 1; /* 允許 a 標籤縮小 */
        min-width: 0; /* 修正 flexbox 的寬度問題 */
    }
    .announcement-date, .contact-book-date {
        flex: 0 0 10px;
        font-weight: bold;
    }
    .pinned-badge {
        white-space: nowrap; /* 禁止換行 */
        margin-right: 8px; /* 調整距離 */
    }
}
/* 行事曆 */
.custom-calendar {
    max-width: 800px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.calendar-header {
    text-align: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 24px;
}

.calendar-header a {
    text-decoration: none;
    color: #0073aa;
    margin: 0 10px;
}

.tribe-events-calendar {
    width: 100%;
    border-collapse: collapse;
}

.tribe-events-calendar th,
.tribe-events-calendar td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    vertical-align: top;
}

.tribe-events-calendar th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.tribe-events-calendar td.weekend {
    background-color: #f0f0f0;
}

.tribe-events-calendar td.empty {
    background-color: #fafafa;
}

.tribe-events-calendar .day-number {
    display: block;
    text-align: center;
    padding-top: 5px;
}

.tribe-events-calendar .has-events .day-number {
    color: red;
}

.tribe-events-calendar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.tribe-events-calendar li {
    font-size: 0.8em;
    margin-bottom: 2px;
}

.tribe-events-calendar a {
    color: #333;
    text-decoration: none;
}

.tribe-events-calendar a:hover {
    text-decoration: underline;
}

.important-events {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

.important-events h3 {
    margin-top: 0;
}

.important-events ul {
    list-style-type: none;
    padding: 0;
}

.important-events li {
    margin-bottom: 10px;
}
@media (max-width: 768px) {
    .tribe-events-calendar .event-list {
        display: none;
    }
    .tribe-events-calendar .event-dots {
        display: flex;
        justify-content: center;
        margin-top: 5px;
    }
    .tribe-events-calendar .event-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        margin: 0 2px;
    }
}

@media (min-width: 769px) {
    .tribe-events-calendar .event-dots {
        display: none;
    }
}

/* 班級公告 頁面的樣式 */
.announcements-container, .contact-books-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.announcements-title, .contact-books-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}
.admin-notice {
    background-color: #ffd700;
    color: #333;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}
.announcements-table, .contact-books-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}
.announcements-table th,
.announcements-table td,
.contact-books-table th,
.contact-books-table td {
    padding: 15px;
    text-align: left;
}
.announcements-table th, .contact-books-table th {
    background-color: #4a4a4a;
    color: #fff;
    font-weight: bold;
}
.announcements-table tr, .contact-books-table tr {
    background-color: #fff;
    transition: all 0.3s ease;
}
.announcements-table tr:hover, .contact-books-table tr:hover {
    background-color: #f0f0f0;
}
.announcements-table td, .contact-books-table td {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}
.announcements-table td:first-child, .contact-books-table td:first-child {
    border-left: 1px solid #ddd;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}
.announcements-table td:last-child, .contact-books-table td:last-child {
    border-right: 1px solid #ddd;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}
.announcements-table a, .contact-books-table a {
    color: #1e88e5;
    text-decoration: none;
    font-weight: bold;
}
.announcements-table a:hover, .contact-books-table a:hover {
    text-decoration: underline;
}
.ast-pagination {
    margin-top: 20px;
    text-align: center;
}
.ast-pagination a,
.ast-pagination span {
    color: #333;
    padding: 8px 12px;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 4px;
    transition: all 0.3s ease;
}
.ast-pagination a:hover {
    background-color: #f0f0f0;
}
.ast-pagination .current {
    background-color: #1e88e5;
    color: #fff;
    border-color: #1e88e5;
}
table, td, th {
    border: 0px solid var(--ast-border-color);
}
@media (max-width: 768px) {
    .ast-container, .ast-container-fluid {
        padding-left: 0px;
        padding-right: 0px;
    }
}

/* 默認顯示完整日期 */
.full-date {
    display: inline;
}
.short-date {
    display: none;
}

/* 在小屏幕上顯示短日期 */
@media (max-width: 768px) {
    .full-date {
        display: none;
    }
    .short-date {
        display: inline;
    }
}

/* 班級課表的樣式 */
.class-timetable {
    width: 100%;
    border-collapse: collapse;
}
.class-timetable th, .class-timetable td {
    border: 1px solid #ddd;
    padding: 5px;
    text-align: center;
}
.class-timetable th {
    background-color: #f2f2f2;
}
.period-name {
    font-weight: bold;
}
.period-time {
    font-size: 0.8em;
    color: #666;
}
@media (max-width: 600px) {
    .class-timetable {
        font-size: 0.9em;
    }
    .period-time {
        font-size: 0.7em;
    }
}

/* 課表管理的樣式 */
.timetable-info .full-info,
.timetable-info .short-info,
.timetable-info .no-info {
    display: none;
}

/* 媒體查詢 */
@media screen and (min-width: 783px) {
    .timetable-info .full-info,
    .timetable-info .no-info {
        display: inline;
    }
}

@media screen and (max-width: 782px) {
    .timetable-info .short-info,
    .timetable-info .no-info {
        display: inline;
    }
}

/* 404頁面 的樣式 */
.error-404 {
    text-align: center;
    padding: 50px 20px;
    font-family: Arial, sans-serif;
}

.error-404 .page-title {
    font-size: 120px;
    color: #e74c3c;
    margin: 0;
}

.error-404 h2 {
    font-size: 36px;
    margin-top: 0;
}

.error-404 p {
    font-size: 18px;
    margin-bottom: 30px;
}

.error-404 .button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.error-404 .button:hover {
    background-color: #2980b9;
}

.ghost-404 {
    width: 200px;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 50% 50% 0 0;
    position: relative;
    margin: 0 auto 30px;
    overflow: hidden;
}

.eye {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 60px;
    overflow: hidden;
}

.pupil {
    width: 20px;
    height: 20px;
    background-color: #000;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.eye-left {
    left: 50px;
}

.eye-right {
    right: 50px;
}

/* 班級相簿清單 的樣式 */
.album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.album-item {
    position: relative;
    overflow: hidden;
}

.album-frame {
    position: relative;
    padding-bottom: 100%; /* 保持正方形比例 */
    border: 1px solid #ddd; /* 添加邊框代替相框圖片 */
    border-radius: 10px; /* 輕微圓角效果 */
    overflow: hidden; /* 確保內容不會超出邊框 */
}

.album-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease-in-out;
}

.album-frame:hover .album-cover {
    transform: scale(1.1); /* 鼠標懸停時輕微放大效果 */
}

.image-count {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px;
    text-align: center;
    font-size: 12px;
    border-radius: 5px;
}

.album-info h3 {
    margin: 10px 0 0;
    font-size: 16px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 班級相簿清單 響應式設計 */
@media (max-width: 768px) {
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .album-grid {
        grid-template-columns: 1fr;
    }
}

/* 班級首頁 相簿預覽的樣式 */
.album-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.album-preview-item {
    text-align: center;
}

.album-preview-cover {
    position: relative;
    padding-bottom: 100%; /* 保持正方形比例 */
    overflow: hidden;
}

.album-preview-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.album-preview-title {
    margin: 10px 0 5px;
    font-size: 16px;
}

.album-preview-date {
    color: #666;
    font-size: 14px;
    margin: 0 0 5px;
}

.album-preview-count {
    font-size: 14px;
    margin: 0;
}

.view-all-albums {
    text-align: center;
    margin-top: 20px;
}

.view-all-albums .button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.view-all-albums .button:hover {
    background-color: #005177;
}
@media (max-width: 768px) {
    .album-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}