/* 
   五百羅漢プロジェクト 
   プレミアムモダン和風スタイル 
*/

:root {
    --color-bg-dark: #121212;
    --color-bg-surface: #1e1e1e;
    --color-text-main: #f5f4ef;
    --color-text-muted: #a09d94;
    --color-gold: #d4af37;
    --color-gold-hover: #b5952f;
    --color-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Noto Serif JP', serif;
    --nav-height: 80px;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    line-height: 1.8;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    transition: all 0.3s ease;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gold);
    text-decoration: none;
    letter-spacing: 0.1em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-gold);
}

/* Hero Section */
.hero {
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(rgba(18, 18, 18, 0.5), rgba(18, 18, 18, 0.9)), 
                url('../images/16/IMG_16_1.jpg') center/cover no-repeat;
    /* ダミー背景色（画像がない場合用） */
    background-color: #2a2a2a;
    padding-top: var(--nav-height);
    text-align: center;
}

.hero-content {
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title {
    font-size: 3rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 1rem;
    letter-spacing: 0.15em;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 100px;
}

/* Section Title */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-gold);
    letter-spacing: 0.1em;
    position: relative;
}

/* Text Content */
.content-text p {
    margin-bottom: 1.8rem;
    font-size: 1.1rem;
    text-align: justify;
    line-height: 2;
}

.content-text .highlight {
    color: var(--color-gold);
    font-weight: 600;
}

.content-text .author {
    text-align: right;
    font-size: 1.2rem;
    color: var(--color-gold);
    margin-top: 3rem;
}

.poem-box {
    background: var(--color-bg-surface);
    padding: 30px;
    border-left: 3px solid var(--color-gold);
    margin: 30px 0;
    font-style: italic;
    font-size: 1.1rem;
}

/* Gallery Grid */
.gallery-controls {
    text-align: center;
    margin-bottom: 3rem;
}

.filter-select {
    background: var(--color-bg-surface);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 1rem;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:focus {
    border-color: var(--color-gold);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.gallery-item {
    background: var(--color-bg-surface);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/5;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15);
}

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

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--color-text-main);
    opacity: 1; /* 常に表示 */
    transition: background 0.3s;
}

.gallery-item:hover .gallery-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,1)); /* ホバー時に少し暗くして強調 */
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Form Elements */
.form-container {
    background: var(--color-bg-surface);
    padding: 50px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-gold);
    font-weight: 600;
}

.form-input, .form-textarea {
    width: 100%;
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 15px;
    font-family: var(--font-main);
    font-size: 1rem;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

.form-btn {
    width: 100%;
    background: var(--color-gold);
    color: var(--color-bg-dark);
    border: none;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    letter-spacing: 0.1em;
}

.form-btn:hover {
    background: var(--color-gold-hover);
}

/* Button & Links */
.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    margin-top: 20px;
}

.btn-primary:hover {
    background: var(--color-gold);
    color: var(--color-bg-dark);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------
   Mobile Menu (Hamburger)
   ------------------------- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--color-gold);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(18, 18, 18, 0.98);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        gap: 3rem;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    /* ハンバーガーアイコンのアニメーション（×になる） */
    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2rem;
    }
    .container {
        padding: 40px 15px 80px;
    }
    .form-container {
        padding: 30px 20px;
    }
}

/* -------------------------
   Lightbox Modal
   ------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90vh;
}

.modal-content {
    max-width: 100%;
    max-height: 80vh; /* キャプションのために高さを調整 */
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    object-fit: contain;
}

.modal-caption {
    margin-top: 15px;
    color: var(--color-gold);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.modal.show .modal-content,
.modal.show .modal-caption {
    transform: scale(1);
}

/* -------------------------
   Feature Panel (JSON Data)
   ------------------------- */
.gallery-item.feature-panel {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    cursor: default;
    aspect-ratio: auto;
    height: 100%;
}

.gallery-item.feature-panel:hover {
    transform: none; /* テキストパネルは浮き上がりを無効に */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.feature-title {
    color: var(--color-gold);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
}

.feature-content p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--color-text-main);
}

.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    font-size: 0.95rem;
}

.feature-table th, .feature-table td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.feature-table tr:last-child th,
.feature-table tr:last-child td {
    border-bottom: none;
}

.feature-table th {
    color: var(--color-gold);
    font-weight: 600;
    width: 35%;
    white-space: nowrap;
}

.feature-table td {
    color: var(--color-text-main);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 2001;
}

.modal-close:hover {
    color: var(--color-gold);
}

/* -------------------------
   Specific Layouts (PC)
   ------------------------- */
@media (min-width: 769px) {
    /* 十六羅漢のレイアウト（1枚目を上に大きく、2枚目・3枚目を下に並べる） */
    div#gallery-16.gallery-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 30px !important;
    }
    
    div#gallery-16.gallery-grid .gallery-item {
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        border-radius: 8px !important;
    }

    div#gallery-16.gallery-grid .gallery-item:nth-child(1) {
        grid-column: 1 / -1 !important;
    }

    /* 五百羅漢の特徴パネル（JSON）の幅を2倍にする */
    .gallery-grid .gallery-item.feature-panel {
        grid-column: span 2;
    }
}
