/* Main Layout Grid System */
.main-layout-container {
    width: 100%;
}

.main-layout-section {
    width: 100%;
    position: relative;
}

/* 12-Column Grid */
.main-layout-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Full Width Layout */
.main-layout-full {
    width: 100%;
    max-width: 100%;
}

/* Grid Elements */
.main-layout-element {
    position: relative;
    min-height: 50px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* main-layout-grid 내부 갤러리 슬라이더 컨테이너 너비 제한 */
.main-layout-grid .gallery-slider-container,
.main-layout-grid .gallery-slider-wrapper,
.main-layout-grid .widget-gallery,
.main-layout-grid .widget-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Full Width Element */
.main-layout-element-full {
    width: 100%;
    max-width: 100%;
}

/* Placeholder Styles */
.placeholder,
.empty-layout,
.error {
    padding: 40px 20px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

.error {
    background: #fee;
    color: #c00;
}

/* 위젯 스타일 */
.widget-wrapper {
    padding: 20px 0;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 2px solid #4eb5fe;
    padding-bottom: 12px;
}

.widget-header .widget-title {
    font-size: 24px !important;
    font-weight: bold;
    margin: 0;
}

.widget-more {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.widget-more:hover {
    color: #333;
}

/* Slider Styles */
.main-slide-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.main-slider {
    position: relative;
    width: 100%;
    height: 400px;
}

.slide-item {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-item.active {
    display: block;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    padding: 30px;
}

.slide-caption h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.slide-caption p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.slide-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.slide-prev,
.slide-next {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.slide-prev:hover,
.slide-next:hover {
    background: rgba(255, 255, 255, 0.5);
}

.slide-dots {
    display: flex;
    gap: 8px;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.slide-dot.active,
.slide-dot:hover {
    background: white;
}

/* Widget Styles */
.widget-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px 10px 24px;
    border:#ddd solid 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.widget-container h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 10px;
}

.widget-content {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Banner Styles */
.banner-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.banner-slider {
    position: relative;
    width: 100%;
}

.banner-slide {
    display: none;
    width: 100%;
}

.banner-slide.active {
    display: block;
}

.banner-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.banner-prev,
.banner-next {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.banner-dots {
    display: flex;
    gap: 5px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.banner-dot.active,
.banner-dot:hover {
    background: white;
}

/* ============================================
   반응형 디자인
   ============================================ */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
    .main-layout-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
        padding: 0 15px;
    }

    .main-layout-element[data-col-span="12"] {
        grid-column: 1 / -1;
    }

    .main-layout-element[data-col-span="6"] {
        grid-column: span 6;
    }

    .main-layout-element[data-col-span="4"] {
        grid-column: span 6;
    }

    .main-layout-element[data-col-span="3"] {
        grid-column: span 3;
    }

    .widget-wrapper {
        padding: 15px 0;
    }

    .widget-container {
        padding: 18px 20px 8px 20px;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .main-layout-container {
        width: 100%;
        overflow-x: hidden;
    }

    .main-layout-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }

    .main-layout-element {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* 모바일에서 main-layout-grid 내부 갤러리 슬라이더 컨테이너 너비 제한 */
    .main-layout-grid .gallery-slider-container,
    .main-layout-grid .gallery-slider-wrapper,
    .main-layout-grid .widget-gallery,
    .main-layout-grid .widget-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .main-layout-section {
        padding: 20px 0;
    }

    .main-slider {
        height: 250px !important;
    }

    .slide-caption {
        padding: 20px 15px;
    }

    .slide-caption h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .slide-caption p {
        font-size: 12px;
    }

    .slide-controls {
        bottom: 15px;
        gap: 12px;
    }

    .slide-prev,
    .slide-next {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .slide-dot {
        width: 8px;
        height: 8px;
    }

    .widget-wrapper {
        padding: 12px 0;
    }

    .widget-container {
        padding: 15px;
        border-radius: 6px;
    }

    .widget-container h3 {
        font-size: 18px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .widget-content {
        font-size: 13px;
    }

    .banner-container {
        border-radius: 6px;
    }

    .banner-controls {
        bottom: 8px;
        gap: 8px;
    }

    .banner-prev,
    .banner-next {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .banner-dot {
        width: 6px;
        height: 6px;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .main-layout-grid {
        gap: 10px;
        padding: 0 10px;
    }

    .main-layout-section {
        padding: 15px 0;
    }

    .main-slider {
        height: 250px !important;
    }

    .slide-caption {
        padding: 15px 10px;
    }

    .slide-caption h3 {
        font-size: 16px;
    }

    .slide-caption p {
        font-size: 11px;
    }

    .slide-prev,
    .slide-next {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .widget-wrapper {
        padding: 10px 0;
    }

    .widget-container {
        padding: 12px;
        border-radius: 4px;
    }

    .widget-container h3 {
        font-size: 16px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .widget-content {
        font-size: 12px;
    }

    .banner-prev,
    .banner-next {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}