/**
 * Gallery — home teal design system
 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --gy-primary: #0d7377;
    --gy-primary-light: #14a098;
    --gy-primary-dark: #074f51;
    --gy-bg: #f8fafc;
    --gy-card: #ffffff;
    --gy-text: #0f172a;
    --gy-muted: #64748b;
    --gy-border: #e2e8f0;
    --gy-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --gy-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --gy-radius: 14px;
    --gy-radius-lg: 18px;
    --gy-font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --gy-font-body: 'Inter', system-ui, sans-serif;
}

.gallery-page {
    font-family: var(--gy-font-body);
    background: var(--gy-bg);
    color: var(--gy-text);
}

.gy-hero {
    background: linear-gradient(135deg, var(--gy-primary) 0%, var(--gy-primary-dark) 100%);
    padding: 48px 0 56px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.gy-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -12%; width: 48%; height: 180%;
    background: rgba(255,255,255,0.04); transform: rotate(18deg); pointer-events: none;
}
.gy-hero .container { position: relative; z-index: 1; }

.gy-breadcrumb {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    list-style: none; padding: 0; margin: 0 0 18px; font-size: 0.85rem;
}
.gy-breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.gy-breadcrumb a:hover { color: #fff; }
.gy-breadcrumb span { color: rgba(255,255,255,0.45); }
.gy-breadcrumb .current { color: rgba(255,255,255,0.95); }

.gy-hero-title {
    font-family: var(--gy-font-display);
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px;
}
.gy-hero-sub {
    margin: 0 0 18px; max-width: 36rem; color: rgba(255,255,255,0.85); line-height: 1.55;
}
.gy-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gy-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
    font-size: 0.82rem; font-weight: 600;
}
.gy-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
    background: #fff; color: var(--gy-primary-dark); text-decoration: none;
    font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.gy-btn:hover { background: #f0fdfa; color: var(--gy-primary-dark); }
.gy-btn-ghost {
    background: transparent; color: #fff; border-color: rgba(255,255,255,0.35);
}
.gy-btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.gy-btn-primary {
    background: var(--gy-primary); color: #fff;
}
.gy-btn-primary:hover { background: var(--gy-primary-dark); color: #fff; }

.gy-section { padding: 36px 0 48px; }

.gy-alert {
    border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
    border: 1px solid transparent; font-size: 0.92rem;
}
.gy-alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.gy-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.gy-alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.gy-toolbar {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
}
.gy-toolbar-left, .gy-toolbar-right {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.gy-view-toggle {
    display: inline-flex; border: 1px solid var(--gy-border); border-radius: 10px; overflow: hidden; background: #fff;
}
.gy-view-toggle button {
    border: 0; background: transparent; color: var(--gy-muted); padding: 8px 12px; cursor: pointer;
}
.gy-view-toggle button.active {
    background: var(--gy-primary); color: #fff;
}
.gy-select, .gy-search {
    border: 1px solid var(--gy-border); border-radius: 10px; background: #fff;
    padding: 8px 12px; font-size: 0.9rem; color: var(--gy-text);
}
.gy-search { min-width: min(100%, 220px); }
.gy-search:focus, .gy-select:focus {
    outline: none; border-color: var(--gy-primary-light);
    box-shadow: 0 0 0 3px rgba(13,115,119,0.12);
}

.gy-meta-bar {
    display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    color: var(--gy-muted); font-size: 0.88rem; margin-bottom: 14px;
}

.gy-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}

.album-item { min-width: 0; }
.album-card {
    background: var(--gy-card); border: 1px solid var(--gy-border); border-radius: var(--gy-radius-lg);
    box-shadow: var(--gy-shadow-sm); overflow: hidden; height: 100%;
    display: flex; flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.album-card:hover { transform: translateY(-3px); box-shadow: var(--gy-shadow-md); }

.card-img-wrapper {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #e2e8f0;
}
.album-thumbnail {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.35s ease;
}
.hover-overlay {
    position: absolute; inset: 0;
    background: rgba(7, 79, 81, 0.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s ease;
}
.card-img-wrapper:hover .album-thumbnail { transform: scale(1.04); }
.card-img-wrapper:hover .hover-overlay { opacity: 1; }
.btn-view-album {
    border: 0; border-radius: 10px; padding: 10px 14px;
    background: #fff; color: var(--gy-primary-dark); font-weight: 700; font-size: 0.88rem;
}

.card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card-title, .gy-card-title {
    font-family: var(--gy-font-display); font-size: 1.08rem; font-weight: 800;
    margin: 0 0 8px; letter-spacing: -0.02em; line-height: 1.3;
}
.card-text, .gy-card-desc {
    color: var(--gy-muted); font-size: 0.9rem; line-height: 1.5; margin: 0 0 12px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.album-meta {
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--gy-border);
    font-size: 0.8rem; color: var(--gy-muted); display: grid; gap: 6px;
}
.album-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* List view */
#albumsContainer.list-view {
    display: flex; flex-direction: column; gap: 14px;
}
#albumsContainer.list-view .album-item { width: 100%; }
#albumsContainer.list-view .album-card { flex-direction: row; }
#albumsContainer.list-view .card-img-wrapper {
    width: 280px; flex-shrink: 0; aspect-ratio: auto; height: 180px;
}

.gy-empty {
    grid-column: 1 / -1; text-align: center; padding: 56px 20px;
    background: #fff; border: 1px dashed var(--gy-border); border-radius: var(--gy-radius-lg);
    color: var(--gy-muted);
}
.gy-empty i { font-size: 2.2rem; color: var(--gy-primary-light); margin-bottom: 10px; }
.gy-empty h3 { font-family: var(--gy-font-display); color: var(--gy-text); margin: 0 0 6px; }

.gy-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    list-style: none; padding: 0; margin: 28px 0 0;
}
.gy-pagination a, .gy-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
    border: 1px solid var(--gy-border); background: #fff; color: #475569;
    text-decoration: none; font-weight: 600; font-size: 0.88rem;
}
.gy-pagination a:hover { border-color: var(--gy-primary); color: var(--gy-primary); }
.gy-pagination .is-active a {
    background: var(--gy-primary); border-color: var(--gy-primary); color: #fff;
}
.gy-pagination .is-disabled span { opacity: 0.45; }

/* Modals polish */
#uploadModal .modal-content,
#albumViewModal .modal-content {
    border: 0; border-radius: 16px; overflow: hidden;
}
#uploadModal .modal-header {
    background: linear-gradient(135deg, var(--gy-primary), var(--gy-primary-dark));
    color: #fff;
}
#uploadModal .btn-close { filter: invert(1); }
.upload-zone {
    border: 2px dashed var(--gy-border); border-radius: 14px; cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--gy-primary); background: rgba(13,115,119,0.04);
}
.preview-container {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px;
}
.upload-preview {
    width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
}
.album-view-container { max-height: 80vh; overflow-y: auto; }
.album-image {
    aspect-ratio: 1; object-fit: cover; cursor: pointer; border-radius: 8px;
    transition: transform 0.2s ease;
}
.album-image:hover { transform: scale(1.02); }

.modal-fullscreen .modal-content {
    height: 100vh !important; background: rgba(0,0,0,0.92) !important; border: 0 !important;
}
.modal-fullscreen .modal-body {
    height: calc(100vh - 60px) !important; overflow: hidden !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
}
#fullSizeImage {
    max-height: calc(100vh - 80px) !important; max-width: calc(100vw - 160px) !important;
    object-fit: contain !important; border-radius: 8px;
}
.btn-navigation {
    background: rgba(255,255,255,0.12) !important; color: #fff !important;
    width: 48px; height: 48px; border-radius: 50% !important; border: 1px solid rgba(255,255,255,0.25) !important;
    z-index: 1070;
}

@media (max-width: 992px) {
    .gy-grid { grid-template-columns: 1fr 1fr; }
    #albumsContainer.list-view .album-card { flex-direction: column; }
    #albumsContainer.list-view .card-img-wrapper { width: 100%; height: auto; aspect-ratio: 16 / 10; }
}
@media (max-width: 640px) {
    .gy-grid { grid-template-columns: 1fr; }
    .preview-container { grid-template-columns: 1fr 1fr; }
    .gy-toolbar { flex-direction: column; align-items: stretch; }
    .gy-search { width: 100%; min-width: 0; }
}
