/* An album (pages/album.html.twig). */

/* Segmented control */
.seg-view button { height: 32px; padding: 0 12px; }
@media (max-width: 760px) { .seg-view button span { display: none; } .seg-view button { padding: 0 10px; } }
.subcard-cover .ac-nsfw { right: 6px; bottom: 6px; height: 18px; padding: 0 6px; font-size: 10px; }
.chip.chip-nsfw { background: rgba(251,176,31,.14); border-color: rgba(251,176,31,.45); color: var(--ld-text-strong); font-weight: 700; }

/* Sub-albums row (today's layout, new look): small 4:3 picture cards, eight to a row */
.subrow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px 12px; }
.subcard { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0; border: 0; background: none; color: var(--ld-text); text-align: left; cursor: pointer; font: inherit; }
.subcard-cover { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 4px; }
.subcard-cover > i { position: absolute; inset: 0; border-radius: var(--ld-radius-md); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: transform var(--ld-ease-enter), box-shadow var(--ld-ease-enter); }
.subcard:hover .subcard-cover > i { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.1); }
.subcard.has-subs .subcard-cover { margin-top: 8px; }
.subcard.has-subs .sheet { display: block; }
.subcard .sheet.s1 { left: 12px; right: 12px; top: -8px; background: #20252d; }
.subcard .sheet.s2 { left: 6px; right: 6px; top: -4px; background: #191d24; }
.subcard.has-subs:hover .sheet.s1 { transform: translateY(-3px); }
.subcard.has-subs:hover .sheet.s2 { transform: translateY(-1.5px); }
.subcard-lock { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(5,6,8,.7); color: #fff; }
.subcard-name { font: 700 13px/17px var(--font-display); color: var(--ld-text-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.subcard:hover .subcard-name { color: var(--ld-green); }
.subcard-meta { font: 400 12px/16px var(--font-sans); color: var(--ld-text-muted); }
.subcard.more .more-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--ld-radius-md); background: rgba(5,6,8,.45); color: var(--ld-text-strong); font: 800 20px/1 var(--font-display); transition: background-color var(--ld-ease); }
.subcard.more:hover .more-label { background: rgba(14,229,155,.18); color: var(--ld-green); }
.subrow.is-open > li { animation: ld-rise .35s ease-out both; }
@media (max-width: 1100px) { .subrow { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 760px) { .subrow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; } .subcard-name { font-size: 12px; line-height: 16px; } .subcard-meta { font-size: 11px; } }

/* ---------- Phone pass ---------- */
.meta-dots { display: flex; flex-wrap: wrap; row-gap: 2px; }
.meta-dots > span + span::before { content: "·"; margin: 0 8px; color: var(--ld-text-dim); }
@media (max-width: 760px) {

  .meta-dots .upd { flex-basis: 100%; }
  .meta-dots .upd::before { content: none; }
}

/* ---------- Album page on Lens core ---------- */
.album-head { position: relative; z-index: 5; padding: 40px 0 32px; }
.album-wash { position: absolute; inset: 0; overflow: hidden; }
.album-wash img { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(48px) saturate(1.2); opacity: .45; transform: scale(1.1); }
.album-wash::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--ld-surface-1), rgba(11,13,19,.55)); }
.album-head-in { position: relative; display: flex; gap: 32px; align-items: flex-end; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ld-text-muted); }
.crumbs a { color: var(--ld-text-secondary); }
.crumbs a:hover { color: var(--ld-text-strong); }
.crumb-owner { display: inline-flex; align-items: center; gap: 6px; }
/* The ⋯ menu opens under its button, right edges lined up */
.album-more-at { position: relative; display: inline-flex; }
.album-more { position: absolute; z-index: 40; top: 100%; right: 0; width: 260px; padding: 6px; transform-origin: top right; margin-top: 8px; }
.album-head .icon-row { position: relative; }
/* Above the sticky toolbar while the menu is open; a divider with nothing above it is dropped */
.album-head:has(.album-more:not([hidden])) { z-index: 9; }
.album-more > .menu-sep:first-child { display: none; }
.empty-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 14px 16px; border-radius: var(--ld-radius-lg); border: 1px dashed var(--ld-line-strong); color: var(--ld-text-secondary); }
.empty-inline > span { flex: 1 1 280px; }
.subcard-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--ld-radius-md); background: var(--ld-surface-3); transition: transform var(--ld-ease-enter), box-shadow var(--ld-ease-enter); }
.subcard:hover .subcard-cover > img { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.4); }
.subcard-cover > i { background: var(--ld-surface-3); }
.subs-chev { transition: transform var(--ld-ease-enter); }
.subs.is-all .subs-chev { transform: rotate(180deg); }
/* Collapsed: one row of as many places as the width holds, the last "+N" */
.subs:not(.is-all) .subrow > li:not(.subs-more):nth-child(n + 8) { display: none; }
.subs-next { display: flex; justify-content: center; margin: 16px 0 0; }
.subs:not(.is-all) .subs-next { display: none; }
.subs.is-all .subrow > li.is-past, .subs-next.is-done { display: none; }
/* Open before its script has sized it (frontend/site/subs-state.ts): 3 full rows, as the script then shows. */
.subs.is-all:not(.is-sized) .subrow > li:not(.subs-more):nth-child(n + 25) { display: none; }
.subs-search { position: relative; display: flex; align-items: center; }
.subs-search-open { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--ld-radius-full); background: none; color: var(--ld-text-secondary); cursor: pointer; transition: background var(--ld-ease), color var(--ld-ease); }
.subs-search-open:hover { background: var(--ld-surface-3); color: var(--ld-text); }
.subs-search input { width: 0; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--ld-radius-md); background: transparent; color: var(--ld-text); font: 400 14px/20px var(--font-sans); opacity: 0; transition: width .2s ease-out, padding .2s ease-out, opacity .15s ease-out, border-color var(--ld-ease); }
.subs-search.is-open input { width: 220px; padding: 0 10px; border-color: var(--ld-line-strong); background: var(--ld-surface-3); opacity: 1; }
.subs-search.is-open input:focus { outline: none; border-color: var(--ld-green); box-shadow: var(--ld-focus-ring); }
.subs-found { margin: -6px 0 12px; }
@media (max-width: 760px) { .subs-search.is-open input { width: 150px; } }
@media (prefers-reduced-motion: reduce) { .subs-search input { transition: none; } }
.subs .more-label .at-6, .subs .more-label .at-3, .subs .subcard-name .at-6, .subs .subcard-name .at-3 { display: none; }
@media (max-width: 1100px) {
  .subrow { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .subs:not(.is-all) .subrow > li:not(.subs-more):nth-child(n + 6) { display: none; }
  .subs.is-all:not(.is-sized) .subrow > li:not(.subs-more):nth-child(n + 19) { display: none; }
  .subs .more-label .at-8, .subs .subcard-name .at-8 { display: none; }
  .subs .more-label .at-6, .subs .subcard-name .at-6 { display: inline; }
}
@media (max-width: 760px) {
  .subrow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
  .subs:not(.is-all) .subrow > li:not(.subs-more):nth-child(n + 3) { display: none; }
  .subs.is-all:not(.is-sized) .subrow > li:not(.subs-more):nth-child(n + 10) { display: none; }
  .subs .more-label .at-6, .subs .subcard-name .at-6 { display: none; }
  .subs .more-label .at-3, .subs .subcard-name .at-3 { display: inline; }
}
@media (max-width: 760px) {
  .album-head { padding: 24px 0 20px; }
}
.page-album .toolbar { margin-top: 28px; }
.page-album .nsfwbar { margin-top: 28px; }

/* Album tree: the panel beside the album's files on desktop; below 1024px a "Browse" pill opens it as a bottom sheet. */
.al-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 32px; align-items: start; }
.al-body.is-tree-off { grid-template-columns: minmax(0, 1fr); }
.al-main { min-width: 0; }
.al-tree-head { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.al-tree-owner { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 8px; font: 600 14px/20px var(--font-sans); color: var(--ld-text-strong); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-tree-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--ld-radius-md); border: 1px solid var(--ld-line-strong); background: var(--ld-surface-1); color: var(--ld-text-muted); transition: border-color .15s ease-out; }
.al-tree-search:focus-within { border-color: var(--ld-green); }
.al-tree-search input { flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; outline: 0; color: var(--ld-text); font: 400 14px/20px var(--font-sans); }
.al-tree-back { display: inline-flex; align-items: center; gap: 6px; padding: 2px; font: 500 13px/18px var(--font-sans); color: var(--ld-text-secondary); text-decoration: none; }
.al-tree-back:hover { color: var(--ld-text-strong); }
.al-tree-label { display: flex; justify-content: space-between; gap: 8px; padding: 4px 2px 0; font: 600 11px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ld-text-dim); }
.al-tree > :not(.al-tree-list) { flex-shrink: 0; }
.al-tree-list { list-style: none; margin: 0 -4px; padding: 0 4px; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.al-node { display: flex; align-items: center; padding-left: calc(var(--depth, 0) * 14px); }
.al-tog { width: 24px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--ld-radius-sm); background: none; color: var(--ld-text-muted); cursor: pointer; }
.al-tog:hover { color: var(--ld-text-strong); }
.al-node[aria-expanded="true"] > .al-tog svg { transform: rotate(90deg); }
.al-tog.is-leaf { visibility: hidden; }
/* No row of the list opens: no column kept for the toggles. */
.al-tree-list.is-flat .al-tog.is-leaf { display: none; }
/* The search's tree: the albums on the way to a match, dimmed. */
.al-node.is-path > .al-link { color: var(--ld-text-muted); }
.al-node.is-path > .al-link .al-count { opacity: .6; }
.al-tree-list .al-tog:not([data-tree-toggle]):not(.is-leaf) { cursor: default; }
.al-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: var(--ld-radius-sm); color: var(--ld-text-secondary); text-decoration: none; font: 500 13.5px/18px var(--font-sans); transition: background-color .15s ease-out, color .15s ease-out; }
.al-link svg { width: 16px; height: 16px; flex: none; color: var(--ld-text-muted); }
.al-link:hover, .al-link.is-active { background: var(--ld-surface-3); color: var(--ld-text-strong); }
.al-link[aria-current="page"] { background: var(--ld-green-surface); color: var(--ld-text-strong); font-weight: 600; }
.al-link[aria-current="page"] svg { color: var(--ld-green); }
.al-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-name mark { background: none; color: var(--ld-green); font-weight: 700; }
.al-path { display: block; font: 400 11.5px/15px var(--font-sans); color: var(--ld-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-count { flex: none; font: 500 12px/16px var(--font-sans); color: var(--ld-text-dim); font-variant-numeric: tabular-nums; }
.al-tree-empty { padding: 6px 4px; font: 400 13px/18px var(--font-sans); color: var(--ld-text-muted); }
.al-tree-new { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 4px; border: 0; background: none; color: var(--ld-green); font: 600 13px/18px var(--font-sans); cursor: pointer; }
/* Hidden on desktop, the tree folds into the Browse pill at the bottom left (as the old page); it opens the panel again. */
@media (min-width: 1024px) {
  .al-body.is-tree-off ~ .al-browse { position: fixed; z-index: 30; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; height: 44px; max-width: min(360px, calc(100vw - 32px)); padding: 0 18px; border-radius: 999px; border: 1px solid var(--ld-line-strong); background: var(--ld-surface-3); box-shadow: var(--ld-shadow-modal); color: var(--ld-text-strong); font: 600 14px/20px var(--font-sans); white-space: nowrap; cursor: pointer; animation: ld-pill-in .25s ease-out both; }
  .al-body.is-tree-off ~ .al-browse > span { overflow: hidden; text-overflow: ellipsis; }
  .al-body.is-tree-off ~ .al-browse:hover { background: var(--ld-surface-4); }
  .al-body.is-tree-off { padding-bottom: 76px; }
}
html:has(.listing.is-selecting) .al-browse { display: none !important; }
@keyframes ld-pill-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 1023px) {
  .al-body, .al-body.is-tree-off { grid-template-columns: minmax(0, 1fr); }
  .al-tree-phone { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 12px; }
  .al-browse > span { overflow: hidden; text-overflow: ellipsis; }
  .al-browse.is-away { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
}
.al-tree-close { display: none; }
.al-scrim { position: fixed; inset: 0; z-index: 60; background: var(--ld-scrim); animation: ld-fade .2s ease-out both; }
.al-scrim[hidden] { display: none; }
@media (max-width: 1023px) {
  .al-tree.is-open .al-tree-hide { display: none; }
  .al-tree.is-open .al-tree-close { display: inline-flex; }
  .al-tree.is-open::before { content: ""; align-self: center; width: 40px; height: 4px; flex: none; margin-bottom: 2px; border-radius: 2px; background: var(--ld-line-strong); }
}
/* The album's header mosaic and its comments panel: beside the files on desktop, a bottom sheet below 1024px */
.ld-album-mosaic { flex: none; width: 200px; height: 200px; border-radius: var(--ld-radius-xl); overflow: hidden; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--ld-surface-3); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.ld-album-mosaic img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.ld-album-mosaic.is-one img { grid-column: 1 / -1; grid-row: 1 / -1; }
.nsfw-blur .ld-album-mosaic img.is-nsfw { filter: blur(14px); transform: scale(1.1); }
.ld-album-cm { position: fixed; z-index: 35; top: 64px; right: 0; bottom: 0; width: 420px; display: flex; flex-direction: column; background: var(--ld-surface-2); border-left: 1px solid var(--ld-line); animation: ld-panel-in var(--ld-ease-enter) both; }
.ld-album-cm[hidden], .ld-album-cm-scrim[hidden] { display: none; }
.ld-album-cm-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--ld-line); }
.ld-album-cm-h h2 { flex: 1; margin: 0; }
.ld-album-cm-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; scrollbar-width: thin; }
.ld-album-cm-grab { display: none; }
.ld-album-cm-btn[aria-expanded="true"] { border-color: var(--ld-green-line); color: var(--ld-green); }
@media (min-width: 1024px) {
  [data-page="album"].is-cm-open .al-body.is-tree-off ~ .al-browse { display: none; }
}
@media (max-width: 1023px) {
  .ld-album-cm { z-index: 61; top: auto; left: 0; width: auto; height: 68vh; padding-bottom: env(safe-area-inset-bottom); border: 1px solid var(--ld-line-strong); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: var(--ld-shadow-modal); animation: ld-sheet-in var(--ld-ease-enter) both; }
  .ld-album-cm-grab { display: block; flex: none; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--ld-line-strong); }
  .ld-album-cm-h { padding-top: 4px; }
  .ld-album-cm-b { padding: 16px; }
  .ld-album-cm-scrim { position: fixed; inset: 0; z-index: 60; background: var(--ld-scrim); animation: ld-fade .2s ease-out both; }
  [data-page="album"].is-cm-open .al-browse { display: none; }
}
/* Phones: the header's actions on one line (Upload and Share as icons, the counts kept), the ⋯ menu at the right end */
@media (max-width: 760px) {
  .ld-album-mosaic { display: none; }
  .ld-album-acts { gap: 6px; }
  .ld-album-acts .btn-primary { gap: 0; width: 44px; min-width: 44px !important; padding: 0 !important; justify-content: center; flex: none; }
  .ld-album-acts .ld-album-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ld-album-acts .btn.ld-album-cm-btn { width: auto; padding: 0 12px !important; }
  .ld-album-acts > .album-more-at { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .ld-album-cm, .ld-album-cm-scrim { animation: none; } }
.ld-on { color: var(--ld-green); }
