/* DyneNAS — application Photos : grille, visionneuse, rétrospectives, imports. Mêmes variables que app.css. */
.ph { position: relative; }
.ph-side .fs-share .icon { width: 18px; height: 18px; }
.ph-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ph-main { padding: 12px 0 0; }
.ph-head { display: flex; align-items: center; gap: 12px; padding: 0 16px 10px; flex-wrap: wrap; }
.ph-head .toolbar { margin: 0 0 0 auto; }
.ph-head .toolbar button, .ph-bar button, .ph-bar a.btn { display: inline-flex; align-items: center; gap: 6px; }
.ph-head .toolbar .icon { width: 16px; height: 16px; }
.ph-title { font-size: 17px; font-weight: 660; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 12px; }
.ph-scan { font-weight: 400; }
.ph-content { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 20px; }
.ph-main > .uploads { padding: 0 16px; }
.ph-pad { padding-top: 4px; }
.ph-month { position: sticky; top: 0; z-index: 2; margin: 0; padding: 12px 0 8px; font-size: 14px; background: linear-gradient(var(--bg-solid) 70%, transparent); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 4px; }
.ph-tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--track); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ph-tile:hover { transform: none; box-shadow: none; border: 0; filter: brightness(1.08); }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.ph-tile.nothumb > .icon { width: 34px; height: 34px; opacity: .6; }
.ph-tile.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph-tile.picked img { transform: scale(.9); border-radius: 4px; }
.ph-badge { position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px; padding: 1px 7px 1px 4px; border-radius: 20px; background: rgba(0, 0, 0, .58); color: #fff; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ph-badge .icon { width: 12px; height: 12px; fill: currentColor; }
.ph-heart { position: absolute; left: 6px; bottom: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); display: flex; }
.ph-heart .icon { width: 16px; height: 16px; fill: #ff5a7a; stroke: #fff; }
.ph-check { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .28); color: transparent; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.ph-check .icon { width: 14px; height: 14px; stroke-width: 3; }
.ph-tile:hover .ph-check, .ph-tile:focus-visible .ph-check, .ph-tile.picked .ph-check { opacity: 1; }
.ph-tile.picked .ph-check { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: none) { .ph-check { opacity: .85; } }
.ph-more { height: 1px; }
.ph-empty { max-width: 560px; margin: 0 auto; }
.ph-empty h2 { font-size: 18px; color: var(--text); margin: 12px 0 8px; }
.big-icon { width: 54px; height: 54px; stroke-width: 1.2; opacity: .55; }
.ph-center { justify-content: center; margin-top: 16px; }
.ph-wrap { overflow-wrap: anywhere; text-align: right; }

/* Visionneuse */
.ph-viewer, .ph-story { position: absolute; inset: 0; z-index: 30; background: #06080d; color: #f3f5fa; display: flex; flex-direction: column; animation: fade .2s both; }
.ph-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; flex: none; background: linear-gradient(rgba(0, 0, 0, .55), transparent); z-index: 2; }
.ph-bar-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ph-viewer button, .ph-viewer a.btn, .ph-story button { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; padding: 6px 9px; }
.ph-viewer button:hover, .ph-viewer a.btn:hover, .ph-story button:hover { background: rgba(255, 255, 255, .2); border-color: transparent; box-shadow: none; transform: none; }
.ph-viewer button.on { color: #ff6b88; }
.ph-viewer button.on .icon { fill: currentColor; }
.ph-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-caption .small { opacity: .75; }
.ph-view-body { flex: 1; min-height: 0; display: flex; }
.ph-stage, .ph-story-stage { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
/* La scène est un conteneur dimensionné : l'image s'y inscrit en entier quelle que soit la taille de la fenêtre. */
.ph-stage, .ph-story-stage { container-type: size; }
.ph-frame { position: relative; display: flex; }
.ph-frame > img:first-child, .ph-frame > video { max-width: 100cqw; max-height: 100cqh; object-fit: contain; display: block; }
.ph-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.ph-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 64px; border-radius: 12px; z-index: 3; display: flex; align-items: center; justify-content: center; }
.ph-viewer .ph-nav:hover { transform: translateY(-50%); }
.ph-nav.prev { left: 10px; }
.ph-nav.next { right: 10px; }
.ph-info { width: 300px; flex: none; overflow-y: auto; padding: 14px 16px; background: #11151f; border-left: 1px solid rgba(255, 255, 255, .08); font-size: 13.5px; }
.ph-info .row { border-color: rgba(255, 255, 255, .08); gap: 12px; }
.ph-info .muted { color: #9aa4b8; }
.ph-info a, .ph-viewer .ph-info button.link { color: #8fb0ff; background: none; padding: 0; }
.ph-view-body:has(.ph-info:not([hidden])) ~ .ph-nav.next { right: 310px; }

/* Souvenirs et rétrospectives */
.ph-memories { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 8px; }
.ph-memories.featured { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ph-memory { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 16px; overflow: hidden; text-align: left; color: #fff; background: linear-gradient(150deg, var(--wall-a), var(--wall-b)); box-shadow: var(--shadow); }
.ph-memory.big { aspect-ratio: 16 / 11; }
.ph-memory.kind-year { background: linear-gradient(150deg, #f59e0b, #db2777); }
.ph-memory.kind-trip { background: linear-gradient(150deg, #0ea5e9, #10b981); }
.ph-memory:hover { border: 0; transform: translateY(-3px); box-shadow: 0 14px 30px rgba(10, 16, 34, .28); }
.ph-memory img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.ph-memory:hover img { transform: scale(1.05); }
.ph-memory-text { position: absolute; inset: auto 0 0 0; padding: 44px 14px 13px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); }
.ph-memory-text b { font-size: 16.5px; line-height: 1.2; letter-spacing: -.01em; }
.ph-memory.big .ph-memory-text b { font-size: 21px; }
.ph-memory-text .small { opacity: .88; }
.ph-chip { align-self: flex-start; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); margin-bottom: 4px; }
.ph-memory-play { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.ph-memory-play .icon { width: 16px; height: 16px; fill: #fff; }
.ph-memory:hover .ph-memory-play { opacity: 1; }
.ph-story-bars { display: flex; gap: 3px; padding: 10px 12px 0; flex: none; z-index: 4; }
.ph-story-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.ph-story-bars b { display: block; height: 100%; width: 0; background: #fff; }
.ph-story-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex: none; z-index: 4; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.ph-story-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-story .ph-story-zone { position: absolute; top: 70px; bottom: 0; left: 0; width: 32%; border: 0; border-radius: 0; background: none; z-index: 3; cursor: pointer; }
.ph-story .ph-story-zone:hover { background: none; }
.ph-story .ph-story-zone.right { left: 32%; width: 68%; }
.ph-story.ended .ph-story-zone { display: none; }
.ph-story-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(.5); }
.ph-story-card { position: relative; z-index: 5; text-align: center; padding: 24px; max-width: 640px; animation: rise .6s var(--ease) both; }
.ph-story-card h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.1; margin: 10px 0; color: #fff; }
.ph-story-card h2 { font-size: 19px; margin: 4px 0 10px; color: #fff; }
.ph-story-card p { font-size: 16px; opacity: .85; }
.ph-story-card .ph-chip { display: inline-block; }
.ph-story-big { font-size: clamp(54px, 11vw, 110px); font-weight: 780; line-height: 1.05; letter-spacing: -.03em; background: linear-gradient(120deg, #fde68a, #f472b6, #818cf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-story-months { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 120px; margin-top: 22px; }
.ph-story-months span { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; width: 20px; font-size: 11px; opacity: .8; }
.ph-story-months i { display: block; width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px; background: linear-gradient(#f472b6, #818cf8); }
.ph-kenburns { animation: kenburns 4.4s ease-out both; }
.ph-story.paused .ph-kenburns { animation-play-state: paused; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }

/* Imports */
.ph-import { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ph-import:last-child { border-bottom: 0; }
.ph-import-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-import-head button { margin-left: auto; }
.ph-import .bar { margin: 8px 0 4px; }

@media (max-width: 760px) {
  .ph-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 3px; }
  .ph-info { position: absolute; inset: auto 0 0 0; width: auto; max-height: 55%; z-index: 6; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); }
  .ph-nav { display: none; }
  .ph-head { padding: 0 12px 8px; }
  .ph-content { padding: 0 12px 16px; }
}
