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;
}

.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: transform 0.3s ease;
}

.img-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.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: 400px;
    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: 10px;
    right: 20px;
    width: 80%;
    text-align: right;
    line-height: 1.6;
    text-shadow: 0.5px 0.5px 0px rgba(255, 255, 255, 0.8);
}

/* --- 手機版排版修正 --- */
@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;
        line-height: 1 !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;
    }

    .about-text-frame .content h4 {
        position: absolute !important;
        bottom: 15px;
        right: 20px;

        width: 90% !important;
        font-size: 0.85rem !important;
        text-align: right;
        margin: 0 !important;
        line-height: 1.4 !important;
    }
}