/* delivery.css — Copertina della consegna, etichette XMP, revisione asincrona, filtro Libreria.
   Un pezzo del foglio di PicSelect: l'ordine dei pezzi conta (la cascata) ed è in assets/app.js. */

/* ---------- copertina della consegna (decisione #9) ---------- */

/* card admin: pillola ☆/★ per scegliere la copertina (solo album di consegna) */
.cover-row {
    margin: .35rem .5rem .5rem;
}

.cover-toggle {
    padding: .2rem .6rem;
    font-size: .8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.cover-toggle:hover {
    border-color: var(--accent);
}

.cover-toggle.is-cover {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* pagina del cliente: foto grande col titolo sopra */
.delivery-hero {
    position: relative;
    margin: 0 0 1.25rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.delivery-hero img {
    display: block;
    width: 100%;
    max-height: 46vh;
    object-fit: cover;
}

.delivery-hero-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 2.5rem 1.25rem .9rem;
    font-size: clamp(1.6rem, 4.5vw, 2.6rem);
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
    /* leggibile su qualsiasi foto, chiara o scura, in entrambi i temi */
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}

/* ---------- etichette XMP (decisione #7): form utente e pannellino album ---------- */

.xmp-labels-form,
.album-labels-form {
    display: grid;
    gap: .6rem;
    max-width: 34rem;
    margin: .5rem 0 0;
}

.xmp-labels-form select,
.album-labels-form select {
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.custom-labels {
    display: grid;
    gap: .4rem;
    padding: .6rem .75rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.custom-label-row {
    display: grid;
    grid-template-columns: 6rem 1fr;
    align-items: center;
    gap: .5rem;
}

.custom-label-row input {
    padding: .35rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.xmp-labels-form .btn,
.album-labels-form .btn {
    justify-self: start;
}

/* ---------- modalità async della revisione (decisione #8) ---------- */

.async-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 0 0 1rem;
}

.async-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
}

/* scelta fatta ma non ancora inviata: la card lo dice a colpo d'occhio */
.photo-card.pending-sync {
    outline: 2px dashed #d97706;
    outline-offset: -2px;
}

/* confronto foto per foto: overlay sopra la galleria, coerente coi due temi */
.async-conflicts {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .55);
}

.async-conflicts-box {
    width: min(38rem, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.async-conflicts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.async-conflicts-head h2 { margin: 0; }

.async-conflicts-box ul {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
    display: grid;
    gap: .75rem;
}

.conflict-item {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: .6rem .75rem;
    align-items: start;
    padding: .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.conflict-item img {
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    border-radius: calc(var(--radius) / 2);
}

.conflict-body {
    display: grid;
    gap: .15rem;
    font-size: .9rem;
}

.conflict-choice {
    grid-column: 1 / -1;
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

/* ---------- Filtro Libreria stile Lightroom ---------- */

.library-filter .lf-badge {
    margin-left: .5rem;
    padding: .1rem .5rem;
    font-size: .8rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
}

.lf-attribute {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem 1.1rem;
    margin: .5rem 0 .75rem;
}

.lf-group {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.lf-op,
.lf-pill,
.lf-star {
    padding: .15rem .45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: .85rem;
}

.lf-star {
    border: none;
    padding: .15rem .05rem;
    font-size: 1.05rem;
}

.lf-op.active,
.lf-pill.active {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.lf-star.active { color: #eab308; }

.lf-dot {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    border: 2px solid transparent;
    display: inline-block;
}

.lf-dot.active { border-color: var(--text); }
.lf-dot-red { background: #dc2626; }
.lf-dot-yellow { background: #eab308; }
.lf-dot-green { background: #16a34a; }
.lf-dot-blue { background: #2563eb; }
.lf-dot-purple { background: #9333ea; }

.lf-clear { margin-left: auto; }

/* riga metadati: colonne affiancate, scroll orizzontale se non ci stanno */
.lf-columns {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.lf-column {
    min-width: 11rem;
    max-height: 14rem;
    overflow-y: auto;
    padding: .5rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: .85rem;
}

.lf-column-title {
    font-weight: 600;
    margin-bottom: .3rem;
}

.lf-value {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .1rem .25rem;
    border-radius: calc(var(--radius) / 2);
    text-decoration: none;
    color: var(--text);
}

.lf-value:hover { background: var(--surface); }

.lf-value.active {
    background: var(--accent);
    color: #fff;
}

.lf-value .lf-count { opacity: .65; }

.lf-indent { margin-left: .8rem; }
