/* Alternative: For full-width headings with text-only underline */
.work-title span, 
.service-title span, 
.message-title span, 
.recruit-title span, 
.hero-title span,
.footer-company span,
.message1-title span {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.work-title span:after, 
.service-title span:after, 
.message-title span:after, 
.recruit-title span:after, 
.hero-title span:after,
.footer-company span:after,
.message1-title span:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: #ffe100;
}

@media (max-width: 768px) {
    .work-title:after, 
    .service-title:after, 
    .message-title:after, 
    .recruit-title:after, 
    .hero-title:after,
    .footer-company:after,
    .message1-title:after {
        width: 30px; /* Slightly narrower on smaller screens */
        height: 2px; /* Slightly thinner on smaller screens */
    }
}

/* 共通スタイルはそのまま */



/* 2列レイアウトの追加 */
/* Enhancement for the page-content section */
.page-content {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    animation: fadeIn 0.8s ease-in-out;
}

.page-content-left {
    width: 48%;
}

.page-content-right {
    width: 48%;
}

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

.content-container {
    max-width: 1200px;
    margin: 0 auto;
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Styling service items to match the message1-section aesthetic */
.service-item {
    background-color: #f5f5f5;
    border-radius: 0; /* Angular design instead of rounded */
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    padding: 30px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}



.service-item-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: none; /* Remove the existing border */
    text-align: left;
    position: relative;
}

/* Using the same underline style as in message1-title */
.service-item-title span {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    font-weight: normal; /* Ensuring span is not bold */
}

.service-item-title span:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: #ffe100;
}

.service-item-content {
    padding: 0;
}

.service-item-content p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
}

.service-list {
    list-style: none;
    padding: 0;
}

.service-list li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.2;
}

.service-list li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: #333;
}

/* Make the gallery section match the new design */


.facility-type {
    background: #ffffff;
    color: #2c3e50;
    border: 2px solid #ffe100;
    padding: 10px 20px;
    border-radius: 0;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
}

.facility-type:hover {
    background-color: #ffe100;
    transform: translateY(-3px);
}

.facility-type.active {
    background-color: #2c3e50;
    border-color: #2c3e50;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .page-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .service-item {
        padding: 20px;
    }
    
    .service-item-title {
        font-size: 20px;
    }
    

}

/* 写真ギャラリーのスタイル */
.photo-gallery {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 40px;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.gallery-item {
    width: calc(33.333% - 20px);
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: none;
}

.gallery-item.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-item .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 14px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .caption {
    transform: translateY(0);
}

.message1-section {
    min-height: 100vh;
    position: relative;
    background-color: #f5f5f5;
    overflow: hidden;
    margin-top: 100px;
    margin-bottom: 100px; /* 余白を追加 */
    animation: fadeIn 0.6s ease-in-out;
}

.message1-content {
    position: absolute;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    z-index: 2;
    width: 16em;
    text-align: justify; /* 事業内容と同じ最大幅 */
}

.message1-title {
    font-size: 36px;
    font-weight: normal;
    line-height: 1.6;
    margin-bottom: 10px;
}

.message1-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 40px;
}

.message1-text {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 60px;
}

.message1-image {
    position: absolute;
    right: 0;
    top: 0;
    width: 70%;
    height: 100%;
    overflow: hidden;
    background-color: #e6f2ff;
    transition: all 0.5s ease;
}

.message1-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
    transition: transform 1s ease;
}

.message1-image:hover img {
    transform: scale(1.03);
}

@media (max-width: 992px) {
    .page-content-left,
    .page-content-right {
        width: 100%;
    }
    
    .gallery-item {
        width: calc(50% - 15px);
    }
}

@media (max-width: 768px) {
    .message1-section {
        min-height: auto;
        padding: 60px 20px;
        background-color: #fff;
        margin-top: 60px;
        display: flex;
        flex-direction: column;
    }

    .message1-content {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: calc(100% - 80px);
        margin: 0 auto;
        order: 1; /* テキストを上に */
    }

    .message1-title {
        font-size: 28px;
        text-align: center;
    }

    .message1-subtitle {
        text-align: center;
    }

    .message1-text {
        font-size: 14px;
        text-align: justify; /* テキストを両端揃え */;
        margin-bottom: 40px;
    }

    .message1-image {
        position: relative;
        width: calc(100% - 80px);
        height: 300px;
        margin: 0 auto;
        order: 2; /* 画像を下に */
    }
    

    
    .gallery-item {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .message1-section {
        padding: 40px 20px;
        margin-top: 40px;
    }

    .message1-title {
        font-size: 24px;
    }

    .message1-content {
        width: calc(100% - 40px);
    }

    .message1-image {
        width: calc(100% - 40px);
        height: 220px;
    }
    
    .service-list li {
        font-size: 14px;
    }
}