html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Hiragino Maru Gothic Pro', 'ヒラギノ丸ゴ Pro';
    line-height: 1.7;
    color: #333;
    background: linear-gradient(135deg, #faf8f3 0%, #f5f0e6 100%);
}

/* ナビゲーション */
header {
    background: linear-gradient(135deg, #d4a574 0%, #c89b6e 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* ハンバーガーメニューボタン */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    margin-left: auto;
    order: 2;
}

.menu-toggle:focus {
    outline: none;
}

nav {
    position: relative;
    order: 1;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

/* ヒーロー セクション */
.hero {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.7), rgba(200, 155, 110, 0.7)),
        url('../images/hero/title.png');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 8rem 2rem;
    position: relative;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #e8b4a0 0%, #d9a08f 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* セクション */
section {
    padding: 5rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #8b6947;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #d4a574, #e8b4a0);
    border-radius: 2px;
}

/* 特色セクション */
.features {
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: linear-gradient(135deg, #fff5f0 0%, #faf8f3 100%);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 5px solid #d4a574;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.25);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #4a3728;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #333;
    font-size: 0.95rem;
}

/* 学科セクション */
.courses {
    background: linear-gradient(135deg, #f5f0e6 0%, #faf8f3 100%);
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.3);
}

.course-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
}

.course-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.course-content {
    padding: 1.5rem;
}

.course-content h3 {
    color: #8b6947;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.course-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 就職セクション */
.employment {
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, #f5f0e6 0%, #faf8f3 100%);
    padding: 2rem;
    text-align: center;
    border-radius: 15px;
    border-top: 5px solid #d4a574;
}

.stat-number {
    font-size: 2.5rem;
    color: #d4a574;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #8b6947;
    font-weight: 600;
}

/* 学生寮セクション */
.dormitory {
    background: linear-gradient(135deg, #f5f0e6 0%, #faf8f3 100%);
}

.dorm-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.dorm-image {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    position: relative;
}

.dorm-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 15px;
}

.dorm-text h3 {
    color: #8b6947;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.dorm-text ul {
    list-style: none;
    margin-left: 1rem;
}

.dorm-text li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    color: #666;
}

.dorm-text li::before {
    content: '♥';
    position: absolute;
    left: 0;
    color: #d4a574;
}

/* カルーセル */
.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.carousel-wrapper {
    overflow: hidden;
    border-radius: 15px;
    padding: 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.carousel-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: calc(100% - 2rem);
    margin: 0 1rem;
    height: fit-content;
}

.carousel-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.carousel-content {
    padding: 2rem;
}

.carousel-content h3 {
    color: #8b6947;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.carousel-content p {
    color: #666;
    line-height: 1.8;
    font-size: 0.95rem;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(212, 165, 116, 0.9);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(212, 165, 116, 1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.3);
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.carousel-dot.active {
    background: #d4a574;
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(212, 165, 116, 0.6);
}

/* ギャラリー */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.student-life-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.cooking-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 200px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s;
}

.gallery-item img:hover {
    opacity: 0.85;
}

/* ライトボックス（拡大表示） */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2001;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 5px;
    transition: background 0.3s;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.5);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        font-size: 24px;
        padding: 8px 12px;
        left: -60px;
        right: -60px;
    }

    .lightbox-close {
        top: -35px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {

    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 5px 10px;
        left: 10px;
        right: auto;
    }

    .lightbox-next {
        left: auto;
        right: 10px;
    }
}

/* フォーム */
.contact-form {
    background: white;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #8b6947;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0d5c7;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #d4a574;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #d4a574 0%, #c89b6e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.form-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

/* フッター */
footer {
    background: linear-gradient(135deg, #8b6947 0%, #6b5437 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 0.7;
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, #d4a574 0%, #c89b6e 100%);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        padding: 3rem 1.5rem 1.5rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    nav ul li a {
        display: block;
        padding: 0.6rem 0;
        font-size: 0.85rem;
    }

    /* 募集要項の下に区切り線を追加（所在地とお問い合わせを視覚的に分離） */
    nav ul li:nth-last-child(3) {
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 4rem 1rem;
    }

    .dorm-content {
        grid-template-columns: 1fr;
    }

    .carousel-container {
        padding: 0 1rem;
    }

    .carousel-slide {
        min-width: 50%;
    }

    .carousel-card {
        width: 100%;
        margin: 0 0.5rem;
    }

    section {
        padding: 3rem 0.5rem;
    }

    /* index.html以外のページのレスポンシブ時の左右マージンを減らす */
    /* インラインスタイルを持つセクションの左右パディングを減らす */
    section[style*="padding"] {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* コンテナの左右パディングも減らす */
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* メニューオーバーレイ */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* トップへ戻るボタン */
#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    background: linear-gradient(135deg, #d4a574 0%, #c89b6e 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
    transition: all 0.3s ease;
}

#scrollToTopBtn:hover {
    background: linear-gradient(135deg, #c89b6e 0%, #b8895e 100%);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.6);
    transform: translateY(-3px);
}

#scrollToTopBtn.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }

    nav ul {
        width: 80%;
        max-width: 280px;
        padding: 2.5rem 1.2rem 1.2rem;
    }

    nav ul li a {
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    #scrollToTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .carousel-container {
        padding: 0 2rem;
    }

    .carousel-prev,
    .carousel-next {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .carousel-prev {
        left: -5px;
    }

    .carousel-next {
        right: -5px;
    }

    .carousel-image {
        height: 250px;
    }

    .carousel-content {
        padding: 1.5rem;
    }

    .carousel-content h3 {
        font-size: 1.1rem;
    }

    .carousel-content p {
        font-size: 0.9rem;
    }

    /* index.html以外のページのレスポンシブ時の左右マージンをさらに減らす */
    /* インラインスタイルを持つセクションの左右パディングをさらに減らす */
    section[style*="padding"] {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* コンテナの左右パディングもさらに減らす */
    .container {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* 所在地ページのスタイル */
.location-section {
    padding: 4rem 0;
}

.location-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.location-info h2 {
    color: #8b6f47;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    border-bottom: 3px solid #d4a574;
    padding-bottom: 1rem;
}

.info-box {
    background: #f9f7f3;
    border-left: 4px solid #d4a574;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.info-box h3 {
    color: #8b6f47;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.info-box p {
    color: #555;
    line-height: 1.8;
}

.info-box a {
    color: #d4a574;
    text-decoration: none;
    font-weight: bold;
}

.info-box a:hover {
    text-decoration: underline;
}

.location-map h2 {
    color: #8b6f47;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #d4a574;
    padding-bottom: 1rem;
}

.location-map {
    width: 100%;
}

.map-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3のアスペクト比 (450/600 = 0.75) */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .location-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .map-wrapper {
        padding-bottom: 75%; /* 4:3のアスペクト比を維持 */
    }

    .location-info h2,
    .location-map h2 {
        font-size: 1.4rem;
    }

    .info-box {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .location-content {
        padding: 0 1.5rem;
    }

    .map-wrapper {
        padding-bottom: 75%; /* 4:3のアスペクト比を維持 */
    }

    .location-info h2,
    .location-map h2 {
        font-size: 1.2rem;
    }

    .info-box {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

/* ニュース・お知らせセクション */
.news {
    padding: 3rem 0;
    background: #fff;
}

.news-list {
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s;
}

.news-item:hover {
    background: #f9f9f9;
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    min-width: 100px;
    font-size: 0.9rem;
    color: #999;
    font-weight: bold;
}

.news-content p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

.news-ellipsis {
    margin-right: 0.25rem;
}

.news-read-more {
    color: #999;
    text-decoration: none;
    font-weight: normal;
    margin-left: 0.25rem;
    cursor: pointer;
    transition: color 0.3s;
}

.news-read-more:hover {
    color: #666;
}

.news-close-link {
    margin-left: 0.5rem;
}

.news-text-full {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .news {
        padding: 2rem 0;
    }
    
    .news-item {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }

    /* スマホ表示でfooterの最初のセクションを中央揃え */
    .footer-section:first-child {
        text-align: center;
    }

    .footer-section:first-child .logo {
        justify-content: center;
    }

    .footer-section:first-child p {
        text-align: center !important;
        padding-left: 0 !important;
    }
}