:root {
    /* カスタムプロパティ（変数） */
    --font-size-default: 14px;
    --font-family-default: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --line-height-default: 1.6;
    --text-color-default: #333;
    --text-align-center: center;

    --hero-height: 300px;
    --hero-text-color: #ffffff;
    --hero-bg-image: url('../image/works.jpg');
    --hero-bg-size: cover;
    --hero-bg-position: center;
    --hero-container-max-width: 800px;
    --hero-container-padding: 20px;
    --hero-h1-font-size: 2.5em;
    --hero-margin-bottom: 20px;
    --hero-padding: 10px;
    --hero-text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
    --hero-p-font-size: 1.2em;

    --txt-padding: 20px;
    --txt-background-color: #f4f4f4;
    --txt--in-background-color: #ffffff;
    --txt--in-border-radius: 10px;
    --txt--in-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --txt--in-max-width: 800px;

    --home_about--ttl-font-size: 28px;

    --works-section-bg-color: #f9f9f9;
    --works-section-padding: 60px 0;
    --container-width: 80%;
    --container-margin: 0 auto;

    --works-grid-gap: 20px;

    --works-item-bg-color: #fff;
    --works-item-padding: 20px;
    --works-item-border-radius: 8px;
    --works-item-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    --works-image-width: 100%;
    --works-image-max-width: 400px;
    --works-image-height: 100px;
    --works-image-border-radius: 8px;
    --works-image-margin-bottom: 20px;

    --works-content-text-align: center;

    --works-content-h3-font-size: 18px;
    --works-content-h3-color: #333;
    --works-content-h3-margin-bottom: 10px;
    --works-content-h3-height: 3em;

    --works-grid-mobile-columns: 2;
    --works-item-mobile-padding: 10px;
    --works-content-h3-mobile-font-size: 16px;
    --works-content-h3-mobile-height: 2.5em;
}

body, h1, h2, h3, p, ul {
    margin: 0;
    padding: 0;
    font-size: var(--font-size-default);
    text-align: var(--text-align-center);
}

/* Hero section styles */
.hero {
    position: relative;
    height: var(--hero-height); /* 任意の高さ */
    color: var(--hero-text-color);
    text-align: var(--text-align-center);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: var(--hero-bg-image); /* 背景画像の追加 */
    background-size: var(--hero-bg-size);
    background-position: var(--hero-bg-position);
    margin-top: 60px;
}

.hero .container {
    position: relative;
    z-index: 1;
    max-width: var(--hero-container-max-width);
    width: 100%;
    padding: var(--hero-container-padding);
}

.hero h1 {
    font-size: var(--hero-h1-font-size);
    margin-bottom: var(--hero-margin-bottom);
    padding: var(--hero-padding);
    text-shadow: var(--hero-text-shadow); /* グレーの強いぼやけた境界線 */
}

.hero p {
    font-size: var(--hero-p-font-size);
    margin-bottom: var(--hero-margin-bottom);
    text-shadow: var(--hero-text-shadow); /* グレーの強いぼやけた境界線 */
}

.txt {
    display: flex;
    justify-content: center;
    padding: var(--txt-padding);
    background-color: var(--txt-background-color);
}

.txt--in {
    background-color: var(--txt--in-background-color);
    padding: var(--txt-padding);
    border-radius: var(--txt--in-border-radius);
    box-shadow: var(--txt--in-box-shadow);
    max-width: var(--txt--in-max-width);
    width: 100%;
}

.home_about--ttl {
    font-size: var(--home_about--ttl-font-size);
    margin-bottom: var(--hero-margin-bottom);
}

.img.right {
    display: none;
}

.works-section {
    background-color: var(--works-section-bg-color);
    padding: var(--works-section-padding);
}

.container {
    width: var(--container-width);
    margin: var(--container-margin);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--works-grid-gap);
}

.works-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--works-item-bg-color);
    padding: var(--works-item-padding);
    border-radius: var(--works-item-border-radius);
    box-shadow: var(--works-item-box-shadow);
}

.works-image img {
    width: var(--works-image-width);
    max-width: var(--works-image-max-width);
    height: var(--works-image-height);
    border-radius: var(--works-image-border-radius);
    margin-bottom: var(--works-image-margin-bottom);
}

.works-content {
    text-align: var(--works-content-text-align);

    h3 {
    font-size: var(--works-content-h3-font-size);
    color: var(--works-content-h3-color);
    margin-bottom: var(--works-content-h3-margin-bottom);
    height: var(--works-content-h3-height); /* 高さを指定 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
}

@keyframes fadeInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* スマホ幅のデザイン調整 */
@media (max-width: 768px) {
    .works-grid {
        grid-template-columns: repeat(var(--works-grid-mobile-columns), 1fr); /* 2カラム表示に設定 */
    }

    .works-item {
        padding: var(--works-item-mobile-padding); /* パディングを調整 */
    }

    .works-image img {
        max-width: 100%; /* 画像を親要素に合わせる */
        height: auto; /* 高さの自動調整 */
    }

    .works-content h3 {
        font-size: var(--works-content-h3-mobile-font-size); /* フォントサイズを調整 */
        height: var(--works-content-h3-mobile-height); /* 高さを調整 */
    }
}
