/* Route-specific Firefly styles: gallery */


.gallery-page {
    display: grid;
    gap: 18px;
}


.gallery-shell,
.gallery-album-detail {
    padding: 22px;
}


.gallery-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}


.gallery-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}


.gallery-head-main {
    min-width: 0;
}


.gallery-title-icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
}


.gallery-title-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.gallery-head h1,
.gallery-detail-copy h1 {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.15;
}


.gallery-head p,
.gallery-detail-copy p {
    margin: 8px 0 0 46px;
    color: var(--text-soft);
}


.gallery-detail-copy p {
    margin-left: 0;
    color: rgba(255, 255, 255, 0.82);
}


.gallery-count {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    background: color-mix(in oklch, var(--primary) 12%, transparent);
    color: var(--primary);
    font-weight: 800;
}


.gallery-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 13px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in oklch, var(--card-solid) 42%, transparent);
}


.gallery-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}


.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}


.gallery-filters button,
.gallery-password-row button {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}


.gallery-filters button {
    padding: 7px 12px;
    border-radius: 9px;
    background: color-mix(in oklch, var(--primary) 12%, transparent);
    color: var(--primary);
}


.gallery-filters button.active {
    background: var(--primary);
    color: white;
}


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


.gallery-album-card {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    color: white;
    background: color-mix(in oklch, var(--primary) 10%, #222);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}


.gallery-album-card:hover {
    transform: translateY(-4px) scale(1.012);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.18);
}


.gallery-album-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}


.gallery-album-cover img,
.gallery-detail-hero img,
.gallery-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.gallery-album-cover img {
    transition: transform 0.35s ease;
}


.gallery-album-card:hover img {
    transform: scale(1.06);
}


.gallery-photo-count,
.gallery-lock-badge {
    position: absolute;
    top: 10px;
    z-index: 2;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.52);
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}


.gallery-photo-count {
    right: 10px;
}


.gallery-lock-badge {
    left: 10px;
}


.gallery-card-copy {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 56%;
    padding: 12px 14px 13px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.42) 52%, transparent);
}


.gallery-card-copy h2 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.gallery-card-copy p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.gallery-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.82rem;
    line-height: 1.2;
}


.gallery-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}


.gallery-tags span {
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 750;
}


.gallery-detail-hero {
    position: relative;
    min-height: 310px;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 18px;
    background: color-mix(in oklch, var(--primary) 10%, #222);
}


.gallery-detail-hero img {
    position: absolute;
    inset: 0;
}


.gallery-detail-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.2) 58%, rgba(0, 0, 0, 0.08));
}


.gallery-detail-copy {
    position: absolute;
    inset: auto 0 0;
    padding: 24px;
    color: white;
}


.gallery-back-link {
    display: inline-flex;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 800;
}


.gallery-lock {
    display: grid;
    gap: 10px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px dashed color-mix(in oklch, var(--primary) 38%, transparent);
    border-radius: 14px;
    background: color-mix(in oklch, var(--primary) 9%, transparent);
}


.gallery-lock p {
    margin: 0;
    color: var(--text-soft);
}


.gallery-password-row {
    display: flex;
    gap: 8px;
}


.gallery-password-row input {
    min-width: 0;
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
}


.gallery-password-row button {
    padding: 9px 14px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
}


.gallery-masonry {
    columns: var(--gallery-column-width) auto;
    column-gap: 12px;
}


.gallery-masonry.is-locked {
    display: none;
}


.gallery-photo-card {
    display: block;
    break-inside: avoid;
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 12px;
    background: color-mix(in oklch, var(--primary) 10%, transparent);
}


.gallery-photo-card img {
    display: block;
    height: auto;
    transition: transform 0.25s ease;
}


.gallery-photo-card:hover img {
    transform: scale(1.025);
}


.gallery-empty {
    padding: 28px;
    border-radius: 14px;
    background: color-mix(in oklch, var(--primary) 8%, transparent);
    color: var(--text-soft);
    text-align: center;
}


.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
}


.gallery-lightbox.open {
    display: grid;
}


.gallery-lightbox img {
    max-width: min(100%, 1180px);
    max-height: 86vh;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}


.gallery-lightbox button {
    position: fixed;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    cursor: pointer;
    font: inherit;
    font-size: 1.8rem;
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
}


.gallery-lightbox-close {
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
}


.gallery-lightbox-prev,
.gallery-lightbox-next {
    top: 50%;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
}


.gallery-lightbox-prev {
    left: 18px;
}


.gallery-lightbox-next {
    right: 18px;
}
