/* =============================
   Home Page Specific Styles
   ============================= */

/* General Section Padding */
.section-padding {
    padding: calc(var(--spacing-unit) * 8) 0; /* 64px top/bottom padding */
}

.section-title {
    text-align: center;
    font-size: 2em; /* Adjust as needed */
    margin-bottom: calc(var(--spacing-unit) * 5); /* 40px */
    color: var(--text-color);
    font-weight: 600;
}

.bg-light {
}

/* Removed original Hero Section styles */

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 4); /* 32px */
    align-items: stretch; /* Explicitly ensure items stretch vertically */
}

.service-item {
    text-align: center;
    padding: calc(var(--spacing-unit) * 3); /* 24px */
    background-color: var(--card-bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Add flex properties and height: 100% */
    display: flex;
    flex-direction: column;
    height: 100%; /* Make the item fill the height of the link */
    width: 100%; /* Ensure full width */
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.service-item i.fas {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 2.5);
}

.service-item h3 {
    font-size: 1.3em;
    margin-bottom: var(--spacing-unit);
    color: var(--text-color);
}

.service-item p {
    font-size: 0.95em;
    color: var(--light-text-color);
    margin-bottom: 0;
    flex-grow: 1; /* Allow paragraph to take remaining vertical space */
}

/* Style for the link wrapper around service items */
.service-item-link {
    text-decoration: none;
    color: inherit; /* Inherit text color from parent */
    display: block; /* Keep link as block, it's the grid item */
    height: 100%; /* Ensure link fills the grid cell height */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Match hover effect */
}

.service-item-link:hover {
    /* Reuse the hover effect from .service-item */
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

/* Recent Notice Section Styles */
.recent-notice-section {
    /* 기본 섹션 패딩 사용 */
}

/* Layout for image and list */
.notice-layout {
    display: flex;
    gap: calc(var(--spacing-unit) * 4); /* Adjust gap between columns */
    align-items: flex-start; /* Align items at the top */
}

.notice-image-column {
    flex: 0 0 30%; /* Adjust width of the image column (e.g., 30%) */
    /* Or use a fixed width: flex: 0 0 250px; */
}

.notice-image-column img {
    max-width: 100%;
    height: auto;
    display: block; /* Remove bottom space */
}

.notice-list-column {
    flex: 1; /* List column takes remaining space */
    background-color: #fff;
}

/* Existing styles for the list itself */
.notice-list-home ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 2px solid var(--text-color); /* 목록 상단 구분선 */
}

.notice-list-home li {
    border-bottom: 1px solid var(--border-color); /* 각 항목 구분선 */
}

.notice-list-home li:last-child {
    border-bottom: none; /* 마지막 항목 구분선 제거 */
}

.notice-list-home li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 1); /* 패딩 조정 */
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.notice-list-home li a:hover {
    background-color: var(--bg-light-color); /* 호버 시 배경색 변경 */
    color: var(--primary-color);
}

.notice-list-home .notice-title {
    font-size: 1em;
    font-weight: 500;
    flex-grow: 1; /* 제목이 남는 공간 차지 */
    margin-right: var(--spacing-unit); /* 날짜와의 간격 */
    /* 제목 길어질 경우 처리 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-list-home .notice-date {
    font-size: 0.85em;
    color: var(--light-text-color);
    flex-shrink: 0; /* 날짜 너비 줄어들지 않도록 */
}

/* Recent Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-unit);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 200px; /* Adjust height */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    font-size: 0.9em;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-caption {
    opacity: 1;
}

/* Recent Blog Section Styles */
.recent-blog-section {
    /* Optional: Add background or keep default */
}

.home-blog-grid {
    display: grid;
    /* Match gallery grid column sizing */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    /* Match gallery grid gap */
    gap: var(--spacing-unit); 
    align-items: stretch; /* Ensure cards in a row have same height */
}

.home-blog-card {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex; /* Use flex for card link */
}

.home-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.1);
}

.home-blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    width: 100%; /* Ensure link takes full width */
}

.home-blog-card-image-wrap {
    width: 100%;
    padding-top: 60%; /* Aspect ratio for image */
    position: relative;
    background-color: #e0e0e0;
    overflow: hidden;
}

.home-blog-card-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.home-blog-card:hover .home-blog-card-image-wrap img {
    transform: scale(1.05);
}

.home-blog-card-content {
    padding: calc(var(--spacing-unit) * 2.5);
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to take available space */
}

.home-blog-card-title {
    font-size: 1.2em; /* Slightly smaller than blog list page */
    font-weight: 600;
    margin: 0 0 calc(var(--spacing-unit) * 1.5) 0;
    line-height: 1.4;
    color: var(--text-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    /* min-height: calc(1.2em * 1.4 * 2); */
    flex-grow: 1; /* Allow title to take space, then excerpt */
    margin-bottom: calc(var(--spacing-unit) * 1.5);

    /* Add text truncation styles */
    display: block; /* Or inline-block, needed for text-overflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* width: 100%; */ /* Usually not needed if parent constrains width */
}

.home-blog-card-excerpt {
    font-size: 0.9em;
    color: var(--light-text-color);
    line-height: 1.6;
    margin-bottom: calc(var(--spacing-unit) * 2);
    flex-grow: 1; /* Push meta to the bottom */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit excerpt lines */
    -webkit-box-orient: vertical;
    min-height: calc(0.9em * 1.6 * 3); /* Reserve space */
}

.home-blog-card-meta {
    font-size: 0.8em;
    color: #868e96;
    margin-top: auto; /* Push to bottom */
    padding-top: calc(var(--spacing-unit) * 1.5);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-blog-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5);
}

.home-blog-card-meta i.fas {
    font-size: 0.9em;
}

/* Recent Testimonials Section */
.testimonials-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 3);
    align-items: stretch; /* Explicitly stretch items vertically */
}

/* Add styles for the anchor link wrapper */
.testimonial-card-link {
    display: flex; /* Make the link a flex container */
    text-decoration: none;
    color: inherit;
    height: 100%; /* Ensure link takes full height of grid cell */
}

.testimonial-item-home {
    background-color: var(--card-bg-color);
    padding: calc(var(--spacing-unit) * 3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex; /* Make the card content a flex container */
    flex-direction: column; /* Stack content vertically */
    width: 100%; /* Ensure it takes full width of the link */
    height: 100%; /* Ensure it takes full height available */
}

.testimonial-rating-home {
    color: var(--accent-color);
    font-size: 1.1em;
    margin-bottom: var(--spacing-unit);
    /* height: 1.2em; Optional: Fix height for rating line */
}

.testimonial-content-home {
    font-style: italic;
    color: var(--light-text-color);
    margin-bottom: var(--spacing-unit);
    padding-bottom: var(--spacing-unit);
    border-bottom: 1px dashed var(--border-color);
    flex-grow: 1; /* Allow content to take available vertical space */
    /* Add min-height if needed to prevent collapsing too much */
    min-height: 5em; /* Adjust as needed, roughly 3 lines */
}

.testimonial-author-home {
    font-size: 0.9em;
    font-weight: 500;
    text-align: right;
    color: var(--text-color);
    margin-bottom: 0;
    margin-top: auto; /* Push author to the bottom */
    padding-top: var(--spacing-unit); /* Add some space above author */
}
.main-swiper{
    height: calc(100vh - 64px);
}
.page-home{
    background-color: #e9ecef;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .main-content{
        
        padding: 20px 5px;
    }
    .section-padding { padding: calc(var(--spacing-unit) * 3) 0; }
    .section-title { font-size: 1.8em; margin-bottom: calc(var(--spacing-unit) * 4); }

    /* Adjust Swiper aspect ratio and text */
    .main-swiper {
        aspect-ratio: 16 / 8; /* Or adjust as needed */
    }
    .main-swiper .swiper-slide .hero-content {
        padding: 1.5rem; /* Reduce padding */
    }
    .main-swiper .swiper-slide .hero-content h1 { font-size: 2.0em; } /* Corrected font size rule */
    .main-swiper .swiper-slide .hero-content .subtitle { font-size: 1.0em; } /* Corrected font size rule */

    /* Adjust Services grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--spacing-unit) * 1);
    }
    .service-item {
        padding: calc(var(--spacing-unit) * 2.5);
    }
    .service-item i.fas {
        font-size: 2.5em;
        margin-bottom: calc(var(--spacing-unit) * 2);
    }
    .service-item h3 {
        font-size: 1.15em;
    }

    /* Adjust Gallery grid */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--spacing-unit) * 1);
    }
    .gallery-item img {
        height: 150px;
    }

    /* Adjust Blog grid */
    .home-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--spacing-unit) * 1);
    }
     .home-blog-card-content {
        padding: calc(var(--spacing-unit) * 2);
     }
     .home-blog-card-title {
        font-size: 1.1em;
     }
      .home-blog-card-excerpt {
        font-size: 0.85em;
     }

    /* Adjust Testimonials grid */
    .testimonials-row {
         grid-template-columns: repeat(2, 1fr); /* Show 2x2 grid on mobile */
         gap: calc(var(--spacing-unit) * 1); /* Adjust gap if needed */
    }

    /* Hide Notice Image Column and adjust layout */
    .notice-layout {
        flex-direction: column; /* Stack columns on mobile */
        gap: 0; /* Remove gap between stacked columns */
    }
    .notice-image-column {
        display: none; /* Hide the image column */
    }
    .notice-list-column {
        width: 100%; /* Explicitly set full width */
    }

    /* Make gallery captions visible by default on mobile */
    .gallery-item-caption {
        opacity: 1;
        /* Optional: Adjust background for better visibility when always shown */
        /* background-color: rgba(0, 0, 0, 0.6); */
    }
}

@media (max-width: 480px) {
    /* Adjust Swiper Hero text */
    .main-swiper .swiper-slide .hero-content h1 { font-size: 1.8em; }
    .main-swiper .swiper-slide .hero-content .subtitle { font-size: 1em; }
    .main-swiper .swiper-slide .hero-content .btn-lg { font-size: 1em; padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3); }

    /* Adjust service item */
    .service-item {
        padding: calc(var(--spacing-unit) * 2);
    }


}

/* Section Header Styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem; /* Adjust spacing as needed */
}

.section-header .section-title {
    margin-bottom: 0; /* Remove default bottom margin from title */
}

/* Adjust button size if needed */
.section-header .btn-sm {
    padding: 0.3rem 0.8rem; /* Smaller padding for btn-sm */
    font-size: 0.9rem; /* Slightly smaller font size */
}

/* Ensure grid/content below header has appropriate top margin */
.gallery-grid,
.home-blog-grid,
.testimonial-grid {
    margin-top: 0; /* Remove margin-top if header provides enough space */
    /* Or adjust margin-top if more space is needed */
}

/* Add some bottom margin back to the sections */
.recent-gallery-section,
.recent-blog-section,
.recent-testimonials-section {
    padding-bottom: 3rem; /* Restore or adjust padding */
}

/* Keep original title margin if header is not used (e.g., Services) */
.services-section .section-title {
    margin-bottom: 2rem; /* Keep original margin */
}

/* --- Main Swiper Styles --- */
.main-swiper-section.hero-like-swiper {
    width: 100%;
    margin-bottom: 0; /* Remove bottom margin if it replaces hero */
    position: relative; /* Needed for overlay content */
}

.main-swiper {
    width: 100%;
    aspect-ratio: 16 / 7;
    background-color: #333;
    position: relative; /* Needed for absolute positioning of hero-content */
    overflow: hidden; /* Hide overflowing content if necessary */
}

/* Add necessary styles for swiper-slide background images */
.main-swiper .swiper-slide {
    background-size: cover;
    background-position: center;
    /* Add other base slide styles if needed */
}

/* Remove styles targeting hero-content inside swiper-slide */
/*
.main-swiper .swiper-slide .hero-content {
    ...
}
.main-swiper .swiper-slide .hero-content h1 {
    ...
}
...
*/

/* Style the fixed hero content */
.main-swiper > .hero-content { /* Direct child selector */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10; /* Ensure it's above slides and overlay */
    width: 90%; /* Adjust width relative to swiper container */
    max-width: 800px; /* Keep max width constraint */
    text-align: center;
    color: white; /* Ensure text is white */
    padding: 1rem; /* Add some padding */
}

/* Apply styles to the text elements within the fixed hero content */
.main-swiper > .hero-content h1 {
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); /* Stronger shadow */
}

.main-swiper > .hero-content .subtitle {
    font-size: 1.2em;
    margin-bottom: calc(var(--spacing-unit) * 4);
    color: rgba(255, 255, 255, 0.95); /* More opaque */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.main-swiper > .hero-content .btn-lg {
    padding: calc(var(--spacing-unit) * 1.8) calc(var(--spacing-unit) * 4);
    font-size: 1.1em;
}
.main-swiper > .hero-content .btn-lg i {
    margin-left: var(--spacing-unit);
    transition: transform 0.2s ease;
}
.main-swiper > .hero-content .btn-lg:hover i {
    transform: translateX(4px);
}

/* Keep the slide overlay */
.main-swiper .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Adjust overlay opacity */
    z-index: 1; /* Below text content */
}

/* Swiper Pagination and Navigation */
.main-swiper .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

.main-swiper .swiper-pagination-bullet-active {
    background-color: var(--primary-color);
}

.main-swiper .swiper-button-next,
.main-swiper .swiper-button-prev {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: background-color 0.3s ease;
}
.main-swiper .swiper-button-next::after,
.main-swiper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

.main-swiper .swiper-button-next:hover,
.main-swiper .swiper-button-prev:hover {
     background-color: rgba(0, 0, 0, 0.6);
}

/* Services Section (Starts after Swiper) */
.services-section {
     /* padding-top: calc(var(--spacing-unit) * 8); Add padding-top if needed */
}

/* Adjust media queries if hero styles were inside */
@media (max-width: 768px) {
    /* Adjust Swiper aspect ratio for tablet */
    .main-swiper {
        aspect-ratio: 16 / 8; /* Or adjust as needed */
    }

    /* Adjust fixed hero content text sizes */
    .main-swiper > .hero-content {
        padding: 1.5rem;
    }
    .main-swiper > .hero-content h1 { font-size: 2.0em; } /* Reduce font size */
    .main-swiper > .hero-content .subtitle { font-size: 1.0em; } /* Reduce font size */
    /* ... other existing 768px adjustments ... */
}

@media (max-width: 480px) {
     /* Adjust Swiper aspect ratio for mobile */
    .main-swiper {
        aspect-ratio: 4 / 3; /* Or adjust as needed */
    }
    .main-swiper > .hero-content {
        padding: 1rem; /* Further reduce padding */
    }
    .main-swiper > .hero-content h1 { font-size: 1.6em; } /* Further reduce font size */
    .main-swiper > .hero-content .subtitle { font-size: 0.9em; } /* Further reduce font size */
    .main-swiper > .hero-content .btn-lg { font-size: 0.9em; padding: calc(var(--spacing-unit) * 1.2) calc(var(--spacing-unit) * 2.5); } /* Adjust button */

     /* ... other existing 480px adjustments ... */
}

/* Section Header Styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem; /* Adjust spacing as needed */
}

.section-header .section-title {
    margin-bottom: 0; /* Remove default bottom margin from title */
}

/* Adjust button size if needed */
.section-header .btn-sm {
    padding: 0.3rem 0.8rem; /* Smaller padding for btn-sm */
    font-size: 0.9rem; /* Slightly smaller font size */
}

/* Ensure grid/content below header has appropriate top margin */
.gallery-grid,
.home-blog-grid,
.testimonial-grid {
    margin-top: 0; /* Remove margin-top if header provides enough space */
    /* Or adjust margin-top if more space is needed */
}

/* Add some bottom margin back to the sections */
.recent-gallery-section,
.recent-blog-section,
.recent-testimonials-section {
    padding-bottom: 0; /* Restore or adjust padding */
}

/* Keep original title margin if header is not used (e.g., Services) */
.services-section .section-title {
    margin-bottom: 2rem; /* Keep original margin */
} 