/* ==========================================================================
   Modern Photo Gallery - Styles
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@400;500;600&display=swap");

:root {
    /* カラーパレット - エレガントダーク */
    --color-bg-primary: #0a0a0a;
    --color-bg-secondary: #151515;
    --color-bg-tertiary: #1f1f1f;
    --color-accent: #d4a574;
    --color-accent-bright: #e8c4a0;
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #b8b8b8;
    --color-text-muted: #6a6a6a;
    --color-border: rgba(255, 255, 255, 0.1);

    /* タイポグラフィ */
    --font-display: "Playfair Display", serif;
    --font-body: "DM Sans", sans-serif;

    /* スペーシング */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;

    /* 効果 */
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    padding: var(--space-md) var(--space-lg);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-accent);
    text-decoration: none;
    letter-spacing: 1px;
}

/* Main Container */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

/* Breadcrumbs (階層ナビゲーション) */
.breadcrumbs {
    margin-bottom: var(--space-lg);
    font-size: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.breadcrumb-item {
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color var(--transition-speed);
}

.breadcrumb-item:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.sep {
    color: var(--color-text-muted);
    user-select: none;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

/* Gallery Items */
.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--color-bg-secondary);
    aspect-ratio: 1 / 1;
    transition: transform var(--transition-speed) ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px);
}

/* Folder Specific */
.gallery-item.folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

.folder-icon {
    font-size: 4rem;
    margin-bottom: var(--space-sm);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.gallery-item-info {
    text-align: center;
    padding: 0 var(--space-sm);
}

/* Image Specific */
.gallery-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

/* Overlay Info */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: var(--color-text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-muted);
}
.loading::after {
    content: "Loading...";
    display: block;
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header {
        padding: var(--space-sm) var(--space-md);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-sm);
    }

    .folder-icon {
        font-size: 3rem;
    }

    .gallery-item-title {
        font-size: 0.8rem;
    }
}

/* PhotoSwipe Customization (Optional) */
/* PhotoSwipeの背景をサイトの背景色に合わせる */
.pswp__bg {
    background: var(--color-bg-primary) !important;
}
/* 1. 全体的なリンクの下線を消す */
a {
    text-decoration: none;
}

/* 2. パンくずリストのホバー時の下線も消す（必要な場合） */
.breadcrumb-item:hover {
    text-decoration: none;
    color: var(--color-accent); /* 色だけ変えるようにすると上品です */
}

/* 3. ロゴの下線を念のため無効化 */
.logo {
    text-decoration: none;
}
.folder-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}
