/* Minimal Grid System for Magazine Layout */
.container-full { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; max-width: 1200px; }
.row { display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; box-sizing: border-box; }
.row > * { box-sizing: border-box; }
.col-12, .col-md-6, .col-lg-3, .col-lg-4, .col-lg-8, .col-md-4 { position: relative; width: 100%; padding-right: 15px; padding-left: 15px; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.text-center { text-align: center; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.pl-lg-5 { padding-left: 0; }

@media (min-width: 768px) {
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .pl-lg-5 { padding-left: 3rem; }
}
@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

/* Row gutters */
.row-50 { margin-right: -25px; margin-left: -25px; }
.row-50 > [class*="col"] { padding-right: 25px; padding-left: 25px; }

/* Magazine Styles extracted from Reference */
.magazine-badge {
    display: inline-block;
    background-color: #a63e27;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.magazine-article-title {
    font-family: "Times New Roman", Times, serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #151515;
    margin-bottom: 15px;
}
.magazine-article-title.font-italic {
    font-style: italic;
}
.magazine-article-title a {
    color: inherit;
    text-decoration: none;
}
.magazine-article-title a:hover {
    color: #a63e27;
}

.magazine-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.magazine-author {
    font-size: 12px;
    color: #888;
    font-style: italic;
    display: flex;
    align-items: center;
}

/* Sidebar Specifics */
.sidebar-article-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.sidebar-article-item:last-child {
    border-bottom: none;
}
.sidebar-article-content {
    flex: 1;
    padding-right: 15px;
}
.sidebar-article-image {
    width: 120px;
    flex-shrink: 0;
}
.sidebar-article-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}
.sidebar-article-title {
    font-family: "Times New Roman", Times, serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
}
.sidebar-article-title a {
    color: inherit;
    text-decoration: none;
}
.sidebar-article-title a:hover {
    color: #a63e27;
}
.sidebar-article-author {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* Bottom Grid */
.bottom-article-item {
    margin-bottom: 30px;
}
.bottom-article-image {
    margin-bottom: 20px;
    overflow: hidden;
}
.bottom-article-image img {
    width: 100%;
    transition: transform 0.3s ease;
}
.bottom-article-item:hover .bottom-article-image img {
    transform: scale(1.05);
}

/* Culture Lounge Locations Grid */
.location-separator {
    border-top: 2px solid #a63e27;
    margin: 60px 0 40px;
}

.location-card {
    margin-bottom: 30px;
}

.location-img {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
}

.location-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 3/2;
    transition: transform 0.3s ease;
}

.location-card:hover .location-img img {
    transform: scale(1.05);
}

.location-category {
    color: #a63e27;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.location-title {
    font-family: "Times New Roman", Times, serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #151515;
    margin-bottom: 8px;
}
.location-title a {
    color: inherit;
    text-decoration: none;
}
.location-title a:hover {
    color: #a63e27;
}

.location-address {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    font-style: italic;
}

.location-intro {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* Button */
.button-link {
    font-family: 'Times New Roman', serif;
    font-size: 18px;
    color: #151515;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}
.button-link:hover {
    color: #a63e27 !important;
    border-bottom-color: #a63e27 !important;
}

/* Featured Article Card */
.featured-article-card .featured-article-image {
    overflow: hidden;
    border-radius: 4px;
}
.featured-article-card img {
    width: 100%;
    transition: transform 0.3s ease;
}
.featured-article-card:hover img {
    transform: scale(1.03);
}

/* Pagination */
.pagination { display: flex; padding-left: 0; list-style: none; border-radius: 0.25rem; }
.page-item { display: block; }
.page-link { position: relative; display: block; padding: 0.5rem 0.75rem; margin-left: -1px; line-height: 1.25; color: #007bff; background-color: #fff; border: 1px solid #dee2e6; }
.page-item:first-child .page-link { margin-left: 0; border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; }
.page-item:last-child .page-link { border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; }
.page-item.active .page-link { z-index: 1; color: #fff; background-color: #a63e27; border-color: #a63e27; }
.page-item.disabled .page-link { color: #6c757d; pointer-events: none; cursor: auto; background-color: #fff; border-color: #dee2e6; }

/* 文化活動 / 新聞資訊（Culture Lounge 活動）/ 老古文化使命 內頁：白底只包文字容器（820px 置中），圖片區塊與外圍留花紋 */
.activity-body {
    margin-bottom: 48px;
}

.activity-body .activity-text-container {
    background: #fff;
    padding: 40px;
}

@media (max-width: 768px) {
    .activity-body .activity-text-container {
        padding: 24px 20px;
    }
}

/* 書名搜尋框（書籍分類頁、書籍列表頁） */
.book-search {
    display: flex;
    max-width: 420px;
    margin: 0 0 30px auto;
}

.book-search input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    border: 1px solid #cfc6b8;
    border-right: 0;
    background: #fff;
    color: #333;
    border-radius: 0;
}

.book-search input[type="search"]:focus {
    outline: 2px solid #bf311a;
    outline-offset: -2px;
}

.book-search button {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 22px;
    font-size: 15px;
    letter-spacing: 1px;
    color: #fff;
    background: #bf311a;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.book-search button:hover {
    background: #a32913;
}

@media (max-width: 768px) {
    .book-search {
        max-width: none;
        margin: 0 20px 24px;
    }
}

/* 內頁編輯器內文：圖片隨容器縮放、不因編輯器寫死的高度變形；同一段落多張圖改為並排等分 */
.activity-text-container img {
    max-width: 100%;
    height: auto !important;
}

.activity-text-container p:has(> img ~ img) {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.activity-text-container p:has(> img ~ img) > img {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    object-fit: cover;
}

/* 時間軸輪播（文化活動 / Culture Lounge 據點）：右側導覽改為靠右（版型原為距右 15%），文字區跟著貼近時間線
   --tl-right：導覽距右邊界；--tl-nav-w：導覽最大寬度（日期短、據點名稱長） */
.tl-right {
    --tl-right: 6%;
    --tl-nav-w: 90px;
}

.tl-right.lounge-spots {
    --tl-nav-w: 160px;
}

@media screen and (min-width: 768px) {
    .tl-right .timeline .swiper-pagination {
        right: var(--tl-right) !important;
        max-width: var(--tl-nav-w);
    }

    .tl-right .timeline .swiper-button-prev,
    .tl-right .timeline .swiper-button-next {
        right: var(--tl-right);
    }

    /* 導覽寬 + 時間線（導覽左側 30px）+ 間距 50px */
    .tl-right .timeline .swiper-slide-content {
        right: calc(var(--tl-right) + var(--tl-nav-w) + 80px);
    }
}
