* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.container {
    min-height: 100vh;
    width: 100vw;
    border: 12px solid #FF7B41;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.works-wrapper {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: 0 auto;
    flex: 1;
}

.section-title {
    font-size: 1.8em;
    font-weight: bold;
    color: #FF7B41;
    text-align: center;
    margin-bottom: 30px;
}

.works-container {
    overflow: hidden;
    transition: overflow 0.3s ease;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-items: center;
}

.work-tile {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1 / 1;
    text-align: center;
    background-color: white;
    border: 2px solid #FF7B41;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    transition: background-color 0.2s;
}

.work-tile:hover {
    background-color: #FFE5D9;
}

.work-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
}

.work-link:hover {
    transform: scale(1.1);
}

.work-thumbnail {
    width: 85%;
    aspect-ratio: 1 / 1;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f5f5f5;
}

.work-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.work-title {
    font-size: 0.85em;
    font-weight: bold;
    color: #333;
    transition: color 0.3s ease;
    word-wrap: break-word;
    width: 100%;
}

.work-link:hover .work-title {
    color: #FF7B41;
}

.more-button {
    display: block;
    margin: 20px auto 0 auto;
    padding: 10px 20px;
    background-color: #FF7B41;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.more-button:hover {
    background-color: #E66A30;
}

.more-button.hidden {
    display: none;
}

.home-button {
    margin: 20px 0 10px 0;
    padding: 10px 20px;
    background-color: #FF7B41;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.home-button:hover {
    background-color: #E66A30;
}

.footer {
    font-size: 0.75em;
    color: #888;
    margin-top: 10px;
}

/* タブレット対応: 2列 */
@media (max-width: 768px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .work-tile {
        max-width: 180px;
    }

    .section-title {
        font-size: 1.5em;
        margin-bottom: 25px;
    }
}

/* モバイル対応: 1列 */
@media (max-width: 480px) {
    .works-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .work-tile {
        max-width: 160px;
    }

    .works-wrapper {
        padding: 15px;
    }

    .section-title {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
}
