/* =========================================
   1. 首頁 Header (大圖橫幅)
   ========================================= */
header {
    background-image: url('../images/大聖堂2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    min-height: 40vh;
    padding-right: 5%;
    padding-bottom: 10px;
    text-align: right;
    line-height: 0.05;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
}

.line {
    width: 300px;
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #ffffff, transparent);
    margin: 10px 0;
    align-self: flex-end;
}

/* =========================================
   2. 主要內容容器 (About 區塊)
   ========================================= */
.about-flex-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 95%;
    max-width: 1600px;
    margin: 60px auto;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 3%;
    gap: 60px;
}

/* 左側圖片框架 */
.img-frame {
    flex: 1 1 50%;
    width: 50%;
    box-sizing: border-box;
    background: #fdfaf5;
    padding: 15px;
    border: 1px solid #D2C1A5;
    box-shadow: 8px 8px 0px #D2C1A5, 15px 15px 25px rgba(0, 0, 0, 0.15);
    transform: rotate(-1.5deg);
    transition: all 0.3s ease;
}

.img-frame:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 12px 12px 0px #D2C1A5, 20px 20px 35px rgba(0, 0, 0, 0.2);
}

.img-wrapper {
    position: relative;
    line-height: 0;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid #eee;
}

/* 右側文字框架 */
.about-text-frame {
    flex: 1 1 50%;
    width: 50%;
    box-sizing: border-box;
    font-weight: 450;
    background: radial-gradient(circle, #F5F1E6 0%, #f4eee1 100%);
    padding: 10px 40px 30px 40px;
    border: 1px solid #D2C1A5;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-height: 425px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.about-text-frame .content h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    color: #5C4033;
    border-bottom: 2px solid #D2C1A5;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    text-align: left;
}

.about-text-frame .content h3 {
    color: #5C4033;
    margin: 0 0 10px 0;
    padding-bottom: 0px;
    text-align: left;
}

.about-text-frame .content h4 {
    font-family: "Kaiti", "STKaiti", "標楷體", serif;
    color: #8A7B63;
    font-size: 1.03rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 1px;
    margin: 0;

    position: absolute;
    bottom: 20px;
    right: 40px;

    width: max-content;
    max-width: 85%;
    text-align: left;
    line-height: 1.6;
    text-shadow: 0.5px 0.5px 0px rgba(255, 255, 255, 0.8);
}

/* =========================================
   過渡斷點 - 平板與分割視窗 (Tablet & Split-Screen)
   當視窗小於 1100px 時，提早將左右排列改為上下疊加，避免文字擠壓
   ========================================= */
@media (max-width: 1200px) {
    .about-flex-container,
    .secret-flex-container {
        flex-direction: column; /* 提早變成上下排列 */
        align-items: center;
        gap: 40px; 
    }

    .img-frame,
    .about-text-frame,
    .secret-text-frame {
        width: 90%; /* 寬度放寬，讓內容有足夠空間 */
        flex: none;
    }

    .img-frame {
        transform: rotate(0deg); /* 螢幕變窄時取消旋轉，避免干擾排版 */
    }
}

/* =========================================
   3. 響應式設計 - 手機板 (Mobile)
   ========================================= */
@media (max-width: 768px) {
    header {
        min-height: 12vh !important;
        padding-right: 20px !important;
        padding-bottom: 10px !important;
        line-height: 1.2 !important;
        position: relative !important;
        display: block !important;
        background-attachment: scroll;
    }

    .titles-wrapper {
        position: absolute;
        bottom: 25px;
        right: 25px;
        text-align: right;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        z-index: 10;
    }

    header h1 {
        font-size: 1.2rem !important;
        padding-bottom: 2px !important;
        margin: 0 !important;
    }

    header p {
        font-size: 0.8rem !important;
        margin: 0 !important;
        margin-top: -2px !important;
    }

    .line {
        width: 100px !important;
        margin: 5px 0 !important;
        height: 1px !important;
        align-self: flex-end;
    }

    .about-flex-container {
        flex-direction: column;
        align-items: center;
        padding: 20px 15px;
        gap: 20px;
        margin: 20px auto;
    }

    .img-frame {
        width: 95%;
        transform: rotate(0deg);
        flex: none;
    }

    .about-text-frame {
        padding: 25px 25px 60px 25px !important;
        min-height: auto !important;
        position: relative !important;
        width: 100%;
        flex: none;
        font-size: 0.9rem; 
    }

    .about-text-frame .content h4 {
        position: absolute !important;
        bottom: 15px;
        right: 25px;
        padding-top: 10px;
        width: max-content;
        max-width: 85%;
        font-size: 0.9rem !important;
        text-align: left !important;
        margin: 0 !important;
        line-height: 1.4 !important;
        font-size: 0.9rem; 
    }
}

/* =========================================
   4. 響應式設計 - 超寬螢幕 (Ultra-Wide / 2K+)
   ========================================= */
@media (min-width: 1921px) {
    header {
        min-height: 50vh; 
    }

    .about-flex-container {
        max-width: 1800px; 
        gap: 80px;         
        margin: 80px auto;
    }

    .about-text-frame {
        padding: 30px 60px 120px 60px !important; 
        font-size: 1.15rem; 
    }

    .about-text-frame .content h4 {
        font-size: 1.2rem;
        right: 60px; 
        bottom: 30px;
        width: max-content;
        max-width: 85%;
    }
}

/* =========================================
   響應式設計 - 4K 超高解析度 (2561px+)
   ========================================= */
@media (min-width: 2561px) {
    header {
        min-height: 55vh; 
    }

    .about-flex-container {
        max-width: 2400px; 
        gap: 120px;        
        margin: 120px auto;
    }

    .about-text-frame {
        padding: 40px 80px 150px 80px !important; 
        font-size: 1.5rem; 
    }

    .about-text-frame .content h4 {
        font-size: 1.55rem;
        right: 80px; 
        bottom: 40px;
        width: max-content;
        max-width: 85%;
    }
}