/* Albums tab: sidebar of albums beside the selected album's detail (the
   Utilities/Automations layout), plus the overview's cover tiles. All visual
   values via theme tokens. */

.albums-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 100px);
}

.albums-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.albums-sidebar h2 a {
    color: inherit;
    text-decoration: none;
}

.albums-sidebar h2 a.active {
    color: var(--color-accent);
}

.albums-content {
    flex: 1;
    min-width: 0;
}

.new-album-button {
    width: 100%;
    margin-top: 16px;
}

/* Overview: one tile per album — the only surface that renders a cover, which is
   why "Set as cover" exists at all. */
.album-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.album-tile {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, border-color 0.15s;
}

.album-tile:hover,
.album-tile:focus-visible {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.album-tile-cover {
    aspect-ratio: 4 / 3;
    background: var(--color-surface-sunken);
}

.album-tile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-tile-body {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
}

.album-tile-name {
    font-weight: 600;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.album-tile-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Cover marker on the album grid, so "Set as cover" has a visible result on the
   page you set it from (the tile it drives lives on the overview). */
.album-photo-card .album-cover-chip {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
}

.photo-grid.is-selecting .album-photo-card {
    cursor: grab;
}

.album-photo-card.is-dragging {
    opacity: 0.5;
}

/* Confirmation after an add — the user stays on the add screen, so this (plus the
   header count and the photos leaving the grid) is how they know it worked. */
.add-photos-confirmation {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: var(--color-success-soft);
    border: var(--border-width) solid var(--color-success-soft-border);
    border-radius: var(--radius-sm);
    color: var(--color-success-soft-text);
    font-weight: 600;
}

/* Share modal: one row per paired device. The checkbox IS the state — checked means
   granted — so the rows are a plain list, not stacked .form-groups (which add
   form-field spacing that reads as gaps between unrelated fields). */
.share-album-hint {
    margin: 0 0 12px;
}

.share-device-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.share-device-list .checkbox-label {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}

.share-device-list .checkbox-label:hover {
    background: var(--color-surface-hover);
}
