/* General page structure */
.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Hero Section */
.work-hero {
    text-align: center;
    padding: 48px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 48px;
}
.work-hero h1 {
    font-size: 48px;
    margin-bottom: 16px;
    font-weight: 400;
}
.work-hero .subtitle {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 32px auto;
    line-height: 1.6;
    color: #555;
}

/* Call to Action Button */
.cta-button {
    display: inline-block;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    text-transform: uppercase;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
.cta-button:hover {
    background-color: #555;
}

/* --- UPDATED: Services Section (2x2 Grid) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    gap: 24px;
    margin-bottom: 64px;
}

.service-card-link {
    text-decoration: none;
    color: inherit;
}

.service-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards in a row are the same height */
    /* NEW: Default background for cards without a valid image */
    background-image: linear-gradient(145deg, #f0f2f5 0%, #e6e9f0 100%);
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
}

.service-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    flex-shrink: 0; /* Prevents image from shrinking */
    /* REMOVED: background-color: #fff; */
    position: relative; /* Ensures image sits on top of the gradient */
    z-index: 2;
}

/* NEW: Hides the image tag ONLY if its src attribute is empty */
.service-card img[src=""] {
    display: none;
}

.card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative; /* Ensures text sits on top of the gradient */
    z-index: 2;
}
.card-content h3 {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 12px;
}
.card-content p {
    color: #555;
    line-height: 1.5;
    font-size: 15px;
}

/* Contact Section */
.contact-section {
    text-align: center;
    padding: 48px 0;
    border-top: 1px solid #ddd;
}
.contact-section h2 {
    font-size: 32px;
    margin-bottom: 16px;
}
.contact-section p {
    max-width: 550px;
    margin: 0 auto 32px auto;
    color: #555;
    line-height: 1.6;
}

/* Contact Form Styles */
#contact-form-mailto {
    display: flex;
    flex-direction: column;
    max-width: 700px;
    margin: 48px auto 0 auto;
    text-align: left;
}
.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #444;
}
#contact-form-mailto input[type="text"],
#contact-form-mailto input[type="email"],
#contact-form-mailto textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    background-color: #fafafa;
    box-sizing: border-box;
    transition: all 0.3s ease;
}
#contact-form-mailto input[type="text"]:focus,
#contact-form-mailto input[type="email"]:focus,
#contact-form-mailto textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}
#contact-form-mailto .cta-button {
    width: 100%;
    border: none;
    cursor: pointer;
}

/* Responsive styles */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
    }
}
