/**
 * Services Section - Rideal.co.jp Inspired Design
 * rideal.co.jpのプログラムセクションを参考にしたデザイン
 */

/* Force 1 column layout for service-item */
.service-item {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    margin-bottom: 80px !important;
    align-items: center !important;
}

/* Override Previous Styles */
.services-grid .service-card {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
}

.services-grid .service-icon,
.services-grid .service-content h3,
.services-grid .service-content small,
.services-grid .service-content p:not(dd),
.services-grid .service-link {
    display: none !important;
}

/* Services Section Container */
.services-section {
    padding: 100px 0;
    background: #fff;
}

.services-section .section-label {
    color: #D4A574 !important;
}

.services-section .section-title {
    color: #ffffff !important;
}

.services-section .section-subtitle {
    color: #cccccc !important;
}

.services-section .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Services Grid */
.services-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    margin: 60px 0 30px;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
}

.services-grid.col4 {
    margin-top: 30px;
}

/* Service cards in horizontal layout */
.services-grid .service-card {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 300px;
}

.services-grid.col4 .service-card {
    flex: 0 0 calc(25% - 22.5px);
    min-width: 250px;
}

/* Service Card */
.service-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: #ffffff !important;
    transition: transform 0.3s ease;
    box-shadow: none;
}

.service-card > a {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Service Image Container */
.service-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: #000;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s ease;
    opacity: 0.7;
    transform: none !important;
}

.service-card:hover .service-image img {
    transform: none !important;
    opacity: 0.6;
}

/* Service Category Badge */
.service-cat {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    z-index: 2;
    border-radius: 2px;
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
}

/* Service English Name */
.service-eng {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    z-index: 2;
    letter-spacing: 0.05em;
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Service Content */
.service-content {
    padding: 30px;
    background: #ffffff !important;
    min-height: 150px;
    transition: background 0.3s ease;
    text-align: left;
}

.service-card:hover .service-content {
    background: #ffffff !important;
}

.service-content dt {
    margin-bottom: 20px;
}

.service-content dt span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    letter-spacing: 0.05em;
    position: relative;
    display: inline-block;
    background: transparent;
    padding: 12px 25px;
    border: 1px solid #333;
    border-radius: 0;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.service-card:hover .service-content dt span {
    background: #333;
    color: #fff;
    transform: none;
}

.service-content dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    text-align: left;
}

/* Hover Effect Overlay */
.service-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.service-card:hover .service-image::before {
    opacity: 0.8;
}

/* No Arrow Icon */

/* Specific Category Colors */
.service-cat {
    background: #fff;
    color: #333;
}

.service-card:nth-child(1) .service-cat,
.service-card:nth-child(2) .service-cat {
    background: rgba(102, 126, 234, 0.9);
    color: #fff;
}

.service-card:nth-child(3) .service-cat {
    background: rgba(65, 184, 131, 0.9);
    color: #fff;
}

.services-grid.col4 .service-card .service-cat {
    background: rgba(212, 165, 116, 0.9);
    color: #fff;
}

/* Animation Classes */
.service-card.wow {
    visibility: hidden;
}

.service-card.animated {
    visibility: visible;
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
.services-grid::-webkit-scrollbar {
    height: 8px;
}

.services-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.services-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.services-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Remove scroll on desktop if all items fit */
@media (min-width: 1400px) {
    .services-section .container {
        max-width: 1600px;
    }
    
    .services-grid {
        overflow-x: visible;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .services-grid .service-card {
        flex: 0 0 calc(33.333% - 30px);
    }
    
    .services-grid.col4 .service-card {
        flex: 0 0 calc(25% - 30px);
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .services-grid {
        overflow-x: visible;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .services-grid .service-card {
        flex: 0 0 calc(33.333% - 20px);
    }
    
    .services-grid.col4 .service-card {
        flex: 0 0 calc(25% - 23px);
    }
}

/* Responsive Design */
@media (max-width: 1199px) {
    .services-grid {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    
    .services-grid .service-card {
        flex: 0 0 350px;
    }
    
    .services-grid.col4 .service-card {
        flex: 0 0 300px;
    }
}

@media (max-width: 768px) {
    .services-grid {
        gap: 20px;
        padding: 0 10px 10px;
    }
    
    .services-grid .service-card,
    .services-grid.col4 .service-card {
        flex: 0 0 280px;
        min-width: 280px;
    }
    
    .service-image {
        height: 240px;
    }
    
    .service-eng {
        font-size: 0.75rem;
        bottom: 20px;
        left: 20px;
    }

    .service-content {
        padding: 25px 20px;
    }

    .service-content dt span {
        font-size: 0.9rem;
    }

    .service-content dd {
        font-size: 0.75rem;
    }
}

/* Entrance Animation Delay */
.service-card[data-delay="1"] {
    animation-delay: 0.1s;
}

.service-card[data-delay="2"] {
    animation-delay: 0.2s;
}

.service-card[data-delay="3"] {
    animation-delay: 0.3s;
}

.service-card[data-delay="4"] {
    animation-delay: 0.4s;
}

.service-card[data-delay="5"] {
    animation-delay: 0.5s;
}

.service-card[data-delay="6"] {
    animation-delay: 0.6s;
}

.service-card[data-delay="7"] {
    animation-delay: 0.7s;
}

/* Loading State */
.service-card:not(.animated) .service-image img {
    transform: scale(1.1);
}

/* Focus State for Accessibility */
.service-card a:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .service-image {
        height: auto;
    }
    
    .service-cat,
    .service-eng {
        position: static;
        display: block;
        margin-bottom: 10px;
    }
    
    .service-content::after {
        display: none;
    }
}