/* Site Photos library */

.ops-photos-shell { max-width: 1200px; }

.ph-upload-btn { cursor: pointer; }
.ph-upload-btn input { display: none; }

.ph-filters { padding-bottom: 12px; }
.ph-filter-row {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px;
}
.ph-filter-row label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: .78rem; color: var(--muted); font-weight: 600;
}
.ph-filter-row input,
.ph-filter-row select {
    min-width: 140px; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: 6px; font-size: .9rem; font-weight: 400; color: var(--ink);
}

.ph-tag-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chip {
    border: 1px solid var(--line); background: #f8fafc; color: var(--ink);
    border-radius: 999px; padding: 5px 12px; font-size: .78rem; font-weight: 600;
    cursor: pointer;
}
.ph-chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.ph-chip-group {
    font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); width: 100%; margin: 6px 0 2px;
}

.ph-gallery { display: flex; flex-direction: column; gap: 18px; }
.ph-day h2 {
    margin: 0 0 10px; font-size: .95rem; color: var(--brand);
    border-bottom: 2px solid var(--accent); padding-bottom: 6px;
}
.ph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.ph-card {
    border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
    background: #fff; cursor: pointer; display: flex; flex-direction: column;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    transition: transform .12s ease, box-shadow .12s ease;
}
.ph-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,23,42,.1); }
.ph-card-thumb { width: 100%; aspect-ratio: 1; background: #e2e8f0; }
.ph-card img {
    width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; background: #e2e8f0; display: block;
}
.ph-card.is-archived { opacity: .92; }
.ph-archived-thumb {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    text-align: center; background: #0f172a; color: #cbd5e1;
    font-size: .78rem; font-weight: 700; line-height: 1.35; letter-spacing: .02em;
}
.ph-archived-note { color: #b45309; font-weight: 600; }
.ph-card-meta { padding: 8px 10px; font-size: .75rem; color: var(--muted); line-height: 1.35; }
.ph-card-meta strong { display: block; color: var(--ink); font-size: .8rem; margin-bottom: 2px; }
.ph-card-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.ph-mini-tag {
    background: #ecfdf5; color: #047857; border-radius: 4px;
    padding: 1px 6px; font-size: .68rem; font-weight: 600;
}

.ph-empty {
    padding: 36px 20px; text-align: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: 10px; background: #fff;
}

/* Lightbox */
.ph-lightbox {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
}
.ph-lightbox[hidden] { display: none !important; }
.ph-lb-backdrop {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.72);
}
.ph-lb-panel {
    position: relative; z-index: 1;
    width: min(1100px, 96vw); max-height: 92vh;
    background: #0f172a; border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.ph-lb-close {
    position: absolute; top: 10px; right: 10px; z-index: 5;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: #0f172a; border: none; color: #fff;
    font-size: 26px; cursor: pointer; line-height: 1;
    border-radius: 999px; padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.ph-lb-close:hover { background: #1e293b; }
.ph-lb-body {
    display: grid; grid-template-columns: 1fr 300px; min-height: 0; max-height: 92vh;
}
.ph-lb-image-wrap {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    background: #020617; min-height: 360px; max-height: 92vh; overflow: hidden;
}
.ph-lb-image-wrap img {
    max-width: 100%; max-height: 92vh; object-fit: contain; display: block;
}
.ph-lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 3; background: rgba(15, 23, 42, 0.55); border: 1px solid rgba(255,255,255,.2);
    color: #fff; font-size: 28px; width: 40px; height: 56px;
    cursor: pointer; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.ph-lb-nav:hover { background: rgba(15, 23, 42, 0.8); }
.ph-lb-prev { left: 10px; }
.ph-lb-next { right: 10px; }
.ph-lb-side {
    background: #fff; padding: 18px 16px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    /* room for the close button sitting over the top-right of the panel */
    padding-top: 48px;
}
.ph-lb-side h3 {
    margin: 10px 0 0; font-size: .82rem; color: var(--brand);
    text-transform: uppercase; letter-spacing: .04em;
}
.ph-lb-meta { font-size: .85rem; color: var(--muted); line-height: 1.45; }
.ph-lb-meta strong { display: block; color: var(--ink); font-size: .95rem; }
.ph-lb-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.ph-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #d1fae5; color: #065f46; border-radius: 999px;
    padding: 4px 10px; font-size: .78rem; font-weight: 600;
}
.ph-tag button {
    border: none; background: none; color: #047857; cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 0 0 2px;
}
.ph-lb-side textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 6px;
    padding: 10px; font: inherit; resize: vertical;
}
.ph-lb-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.ph-tag-picker {
    border: 1px solid var(--line); border-radius: 8px; background: #f8fafc;
    padding: 8px; max-height: 220px; overflow-y: auto;
}
.ph-tag-picker .ph-chip-group { margin-top: 8px; }
.ph-tag-picker button.ph-pick {
    display: block; width: 100%; text-align: left;
    border: none; background: transparent; padding: 6px 8px;
    border-radius: 4px; cursor: pointer; font-size: .82rem;
}
.ph-tag-picker button.ph-pick:hover { background: #e2e8f0; }
.ph-tag-picker button.ph-pick.is-on { background: #d1fae5; color: #065f46; font-weight: 600; }

/* Tags modal */
.ph-modal {
    position: fixed; inset: 0; z-index: 3100;
    display: flex; align-items: center; justify-content: center;
}
.ph-modal[hidden] { display: none !important; }
.ph-modal-backdrop {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55);
}
.ph-modal-card {
    position: relative; z-index: 1;
    width: min(720px, 94vw); max-height: 88vh;
    background: #fff; border-radius: 12px; padding: 18px 20px;
    overflow: auto; box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.ph-modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ph-modal-head h2 { margin: 0; font-size: 1.05rem; color: var(--brand); }
.ph-modal-head .ph-lb-close {
    position: static; width: auto; height: auto;
    background: none; color: var(--ink); box-shadow: none;
    font-size: 28px; border-radius: 0;
}
.ph-modal-foot {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px;
}
.ph-modal-foot .spacer { flex: 1; }

.ph-group-card {
    border: 1px solid var(--line); border-radius: 8px; padding: 12px;
    margin-bottom: 10px; background: #f8fafc;
}
.ph-group-card .ph-group-head {
    display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}
.ph-group-card input[type="text"] {
    flex: 1; min-width: 160px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 6px; font-size: .9rem;
}
.ph-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ph-tag-list .ph-tag { background: #e0e7ff; color: #312e81; }
.ph-tag-list .ph-tag button { color: #4338ca; }
.ph-add-tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-add-tag-row input {
    flex: 1; min-width: 140px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 6px; font-size: .85rem;
}

@media (max-width: 800px) {
    .ph-lb-body { grid-template-columns: 1fr; }
    .ph-lb-image-wrap { max-height: 45vh; min-height: 200px; }
    .ph-lb-side { max-height: 45vh; padding-top: 18px; }
    .ph-lb-nav { width: 34px; height: 48px; font-size: 24px; }
}
