/* ===================================================================
   home.css - 16px基準 rem 升級版 (最終成品)
   =================================================================== */

/* --- 1. 首頁專用變數 & 頁面樣式 --- */
:root {
    --index-img: 6.25rem; /* 100px -> 6.25rem */
}

body {
    background-color: #061c36;
}

/* --- 2. 服務項目總覽區塊 (Services Overview) --- */
.services-overview {
    padding: 5rem 1.25rem; /* 80px, 20px */
    text-align: center;
    background-color: #f8f9fa;
    color: #333;
    min-height: calc(var(--index-img) - 6.25rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.section-title {
    font-size: 2.5rem; /* 2.5rem (@16px) -> 40px -> 2.5rem (不變) */
    margin-bottom: 3.125rem; /* 50px -> 3.125rem */
    font-weight: bold;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr)); /* 250px -> 15.625rem */
    gap: 1.875rem; /* 30px -> 1.875rem */
    width: 100%;
    max-width: 75rem; /* 1200px -> 75rem */
    margin: 0 auto;
}

.service-card {
    background-color: #ffffff;
    padding: 2.1875rem 1.875rem; /* 35px, 30px */
    border-radius: 0.5rem; /* 8px -> 0.5rem */
    box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.08); /* 4px, 15px */
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-0.625rem); /* -10px -> -0.625rem */
    box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.12); /* 8px, 25px */
}

.service-card h3 {
    font-size: 1.5rem; /* 1.6rem -> 1.5rem (24px) 保持一致 */
    margin-top: 0;
    margin-bottom: 0.9375rem; /* 15px -> 0.9375rem */
}

.service-card p {
    font-size: 1rem; /* 1rem (@16px) -> 1rem (不變) */
    color: #555;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1.25rem; /* 20px -> 1.25rem */
}

.card-button {
    display: inline-block;
    padding: 0.75rem 1.5rem; /* 12px, 24px */
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 0.3125rem; /* 5px -> 0.3125rem */
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.card-button:hover {
    background-color: #0056b3;
}


/* --- 3. 圖片輪播界面 (Carousel) --- */
.carousel-container {
    margin-top: calc(var(--header-height) + 2.5rem); /* 40px -> 2.5rem */
    position: relative;
    width: 100%;
    height: calc(var(--index-img) - 6.25rem); /* 100px -> 6.25rem */
    background-color: #ffffff;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #fff;
    background: rgba(51, 51, 51, 0.726);
    padding: 1.25rem; /* 20px -> 1.25rem */
    border-radius: 1.25rem; /* 20px -> 1.25rem */
    z-index: 2;
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.5); /* 2px, 10px */
    text-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.24);
}

.carousel-content h1 {
    font-size: 3rem; /* 3em (@16px) -> 48px -> 3rem */
    margin: 0;
    white-space: nowrap;
}

.carousel-content p {
    font-size: 2rem; /* 2em (@16px) -> 32px -> 2rem */
    margin: 0;
    white-space: nowrap;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 2;
}

.carousel-controls button {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #fff;
    font-size: 2rem; /* 2rem (@16px) -> 32px -> 2rem (不變) */
    cursor: pointer;
    padding: 0.625rem; /* 10px -> 0.625rem */
    transition: background 0.3s ease;
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.1);
}

.carousel-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.2);
}

.carousel-content a {
    display: inline-block;
    padding: 0.375rem 0.75rem; /* 6px, 12px */
    margin: 0.625rem; /* 10px -> 0.625rem */
    background: #2424249d;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.625rem; /* 10px -> 0.625rem */
    font-size: 1rem; /* 1rem (@16px) -> 1rem (不變) */
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.281);
    border: 1px solid #ccc; /* 保留 px */
    font-weight: bold;
}

.carousel-content a:hover {
    background: #ffffffbb;
    transform: scale(1.05);
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.479);
    border: 1px solid #ffffff;
}

.dots {
    position: absolute;
    bottom: 1.25rem; /* 20px -> 1.25rem */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.625rem; /* 10px -> 0.625rem */
    z-index: 2;
}

.dot {
    width: 0.625rem; /* 10px -> 0.625rem */
    height: 0.625rem;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background-color: red;
}


/* --- 4. 首頁專用響應式設計 --- */
@media (max-width: 870px) {
    .carousel-container {
        height: calc(var(--index-img) - 7.5rem); /* 120px -> 7.5rem */
    }
}