/* Nebula Photos (kind 'photos'): galeria estilo Google Fotos, albuns, timeline e lightbox unificado. */
.ph-page { padding-bottom: 36px; }
.ph-body { display: flex; flex-direction: column; gap: 14px; }

.ph-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ph-modes { display: flex; gap: 4px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.ph-mode-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: none; border: 0; color: var(--md-sys-color-on-surface-variant); cursor: pointer; font: inherit; font-weight: 500; }
.ph-mode-btn.on { color: var(--md-sys-color-primary); border-bottom: 2px solid var(--md-sys-color-primary); }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.ph-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-timeline-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ph-months-bar .ph-chip { padding: 4px 12px; font-size: 12px; }

.ph-search-wrap { position: relative; min-width: 220px; flex: 0 1 320px; }
.ph-search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--md-sys-color-on-surface-variant); pointer-events: none; }
.ph-search-input { width: 100%; padding-left: 34px !important; }

.ph-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 14px; }
.ph-crumb { background: none; border: 0; padding: 4px 6px; border-radius: 8px; color: var(--md-sys-color-primary); font: inherit; cursor: pointer; }
.ph-crumb:hover { background: var(--md-sys-color-surface-container-high); }
.ph-sep { font-size: 18px; color: var(--md-sys-color-on-surface-variant); }

.ph-workspace { display: flex; align-items: flex-start; gap: 16px; }
.ph-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ph-count { font-size: 13px; }

.ph-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; border-radius: 12px; background: var(--md-sys-color-surface-container-low, transparent); }
.ph-rail-btn { background: none; border: 0; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); cursor: pointer; }
.ph-rail-btn:hover { background: var(--md-sys-color-surface-container-high); }
.ph-rail-btn.is-active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }

/* Timeline diaria e grade */
.ph-days { display: flex; flex-direction: column; gap: 22px; }
.ph-day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ph-day-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.ph-day-sub { font-size: 12px; }

.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px; }
.ph-tile-wrap { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--md-sys-color-surface-container-high); }
.ph-tile { width: 100%; height: 100%; border: 0; padding: 0; background: none; display: block; cursor: pointer; color: inherit; }
.ph-tile:focus-visible, .ph-album-card:focus-visible, .ph-star:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: -2px; }
.ph-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s ease; }
.ph-tile-wrap:hover .ph-img { transform: scale(1.03); }
.ph-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--md-sys-color-on-surface-variant); }
.ph-noimg .material-symbols-rounded { font-size: 38px; }

.ph-vbadge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 500; background: rgba(0, 0, 0, .68); color: #fff; pointer-events: none; }
.ph-vbadge .material-symbols-rounded { font-size: 16px; }

.ph-star { position: absolute; left: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(0, 0, 0, .42); color: rgba(255, 255, 255, .85); opacity: 0; transition: opacity .15s ease, background .15s ease; }
.ph-star .material-symbols-rounded { font-size: 18px; }
.ph-tile-wrap:hover .ph-star, .ph-star.is-on { opacity: 1; }
.ph-star.is-on { background: rgba(0, 0, 0, .65); color: #fbbc04; }
.ph-star.is-on .material-symbols-rounded { font-variation-settings: 'FILL' 1; }

/* Albuns com mosaico 2x2 */
.ph-albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.ph-album-card { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.ph-album-cover { aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--md-sys-color-surface-container-high); box-shadow: var(--elev-1); transition: transform .15s ease, box-shadow .15s ease; }
.ph-album-card:hover .ph-album-cover { transform: translateY(-2px); box-shadow: var(--elev-3); }
.ph-album-mosaic { width: 100%; height: 100%; display: grid; gap: 2px; background: var(--md-sys-color-surface-container); }
.ph-album-mosaic.n-1 { grid-template-columns: 1fr; }
.ph-album-mosaic.n-2 { grid-template-columns: 1fr 1fr; }
.ph-album-mosaic.n-3, .ph-album-mosaic.n-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.ph-album-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-album-empty, .ph-album-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--md-sys-color-on-surface-variant); }
.ph-album-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-album-sub { font-size: 12px; }

.ph-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 48px 16px; text-align: center; }
.ph-empty .big { font-size: 48px; color: var(--md-sys-color-on-surface-variant); }
.ph-more { display: flex; justify-content: center; padding: 12px 0; }

/* Lightbox */
.ph-lightbox .ph-lb-body { flex: 1; min-height: 0; display: flex; position: relative; }
.ph-lightbox .ph-lb-stage { flex: 1; min-width: 0; }
.ph-lb-img { max-width: 96%; max-height: 92vh; object-fit: contain; transition: transform .15s ease; }
.ph-lb-video { max-width: 96%; max-height: 90vh; }
.ph-lightbox .is-star-on { color: #fbbc04 !important; }
.ph-lightbox .is-star-on .material-symbols-rounded { font-variation-settings: 'FILL' 1; }

.ph-lb-info { width: 300px; max-width: 85vw; background: rgba(20, 22, 30, .94); color: #eef0f6; border-left: 1px solid rgba(255, 255, 255, .12); padding: 18px 16px; overflow-y: auto; }
.ph-info-title { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.ph-info-dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.ph-info-dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #9aa3b2; }
.ph-info-dl dd { margin: 2px 0 0; font-size: 13px; word-break: break-word; }

@media (max-width: 760px) {
  .ph-rail { display: none; }
  .ph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .ph-albums-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ph-star { opacity: 1; width: 26px; height: 26px; }
  .ph-lb-info { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; }
}
