/* ES Photos — gallery inside ES Social. Builds on es_social.css variables. */

.esp { --esp-row: 220px; --esp-gap: 6px; --esp-ink: #0b0d10; }
/* Full screen: the gallery spans the whole browser width. The site navbar and
   footer stay; only the page body is uncapped. body[data-path] covers browsers
   without :has(). */
main:has(> .page_content .esp), main:has(.esp),
body[data-path^="social/gallery"] main { max-width: none; width: 100%; margin: 0; padding-left: 0; padding-right: 0; }
body[data-path^="social/gallery"] main .page_content,
body[data-path^="social/gallery"] main .page-header-wrapper { max-width: none; padding: 0; margin: 0; }
.esp.es-social { max-width: none; width: 100%; margin: 0; padding: 0 24px 60px; box-sizing: border-box; }
.esp .es-topbar { padding-left: 0; padding-right: 0; }
.esp .es-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--es-border); background: var(--es-card); font-weight: 600; font-size: 14px; cursor: pointer;
  color: var(--es-text); line-height: 1.2; white-space: nowrap; }
.esp .es-btn-primary { background: var(--es-primary); border-color: var(--es-primary); color: #fff; }
.esp .es-btn-danger { color: #c0392b; border-color: #f0c4be; }
.esp .es-block { display: flex; justify-content: center; width: 100%; }
.esp .es-btn-link { background: none; border: 0; padding: 0; font-size: 12px; color: var(--es-muted); cursor: pointer; }
.esp .es-nav a.active { background: var(--es-border); color: var(--es-text); }
.esp-nav-me { padding: 4px 6px !important; }
.esp-search { max-width: 280px; }
.esp-search input { width: 100%; }

.esp-layout.es-layout { grid-template-columns: 260px minmax(0, 1fr); }
.esp-main { min-width: 0; }
.esp-aside { gap: 12px; }
.esp-side-card { padding: 14px; margin-bottom: 0; }
.esp-side-title { font-weight: 800; font-size: 17px; display: block; margin-bottom: 6px; }
.esp-upload-btn { margin-top: 8px; }
.esp-links { list-style: none; margin: 0; padding: 0; }
.esp-links a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px;
  font-weight: 500; font-size: 14px; }
.esp-links a:hover, .esp-links a.active { background: var(--es-bg); }
.esp-links a.active { color: var(--es-primary); font-weight: 700; }
.esp-album-links { max-height: 46vh; overflow: auto; }
.esp-album-links span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-count { color: var(--es-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.esp-muted, .esp .es-muted { color: var(--es-muted); font-size: 13px; }

.esp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.esp-chip { background: var(--es-bg); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.esp-chip:hover { background: var(--es-border); }
.esp-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--es-bg); color: var(--es-muted); vertical-align: middle; }

.esp-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px;
  color: var(--es-muted); margin: 0 2px 10px; }
.esp-crumbs a:hover { color: var(--es-primary); }
.esp-crumbs span:last-child { color: var(--es-text); font-weight: 600; }

.esp-h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.3px; line-height: 1.25; }
.esp-hero, .esp-list-head, .esp-album-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap; }
.esp-desc { margin: 10px 0 0; white-space: pre-line; color: var(--es-text); }
.esp-byline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.esp-byline a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--es-text); }
.esp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.esp-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; }
.esp-avatar-initials { background: var(--es-accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }

/* ---------- album cards ---------- */
.esp-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.esp-albums-sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 0; }
.esp-album { background: var(--es-card); border-radius: var(--es-radius); box-shadow: var(--es-shadow); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.esp-album:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.esp-album-cover { position: relative; aspect-ratio: 13 / 9; background: #dfe3e8; overflow: hidden; display: block; }
.esp-album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.esp-album:hover .esp-album-cover img { transform: scale(1.04); }
.esp-album-empty { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 36px; opacity: .5; }
.esp-album-subs { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.esp-album-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.esp-album-title { font-weight: 700; line-height: 1.3; }
.esp[data-layout="list"] .esp-albums { grid-template-columns: 1fr; gap: 8px; }
.esp[data-layout="list"] .esp-album { flex-direction: row; align-items: center; }
.esp[data-layout="list"] .esp-album-cover { width: 150px; flex: none; }

/* ---------- justified photo grid (flex-grow by aspect ratio) ---------- */
.esp-grid { display: flex; flex-wrap: wrap; gap: var(--esp-gap); }
.esp-grid::after { content: ""; flex-grow: 999999; }
.esp-tile { position: relative; display: block; overflow: hidden; border-radius: 6px; background: #e4e7eb;
  flex-grow: calc(var(--w) / var(--h)); width: calc(var(--esp-row) * var(--w) / var(--h)); }
.esp-tile > i { display: block; }
.esp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.esp-tile:hover img { transform: scale(1.03); }
.esp-tile-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); opacity: 0; transition: opacity .2s; display: flex;
  justify-content: space-between; gap: 6px; font-size: 12px; }
.esp-tile:hover .esp-tile-cap, .esp-tile:focus .esp-tile-cap { opacity: 1; }
.esp-tile-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-tile-stats { white-space: nowrap; opacity: .9; }
.esp-tile-video::before { content: "▶"; position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 18px; padding-left: 3px; }
.esp[data-layout="list"] .esp-grid { --esp-row: 380px; }

.esp-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.esp-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.esp-sort select, .esp-form select, .esp-form input, .esp-form textarea, .esp-upload select, .esp-upload input, .esp-upload textarea {
  border: 1px solid var(--es-border); border-radius: 8px; padding: 7px 10px; background: var(--es-card); font-size: 14px;
  color: var(--es-text); }
.esp-view-toggle { display: inline-flex; border: 1px solid var(--es-border); border-radius: 8px; overflow: hidden; }
.esp-view-toggle button { border: 0; background: var(--es-card); padding: 6px 11px; cursor: pointer; color: var(--es-muted); font-size: 15px; }
.esp-view-toggle button.active { background: var(--es-bg); color: var(--es-text); }
.esp-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; }

/* ---------- photo page ---------- */
.esp-photo-wrap { background: var(--esp-ink); border-radius: var(--es-radius); overflow: hidden; margin-bottom: 16px; }
.esp-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; max-height: 78vh; }
.esp-main-img { max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; display: block; cursor: zoom-in; }
.esp-video { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; }
.esp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.esp-nav-arrow { position: absolute; top: 0; bottom: 0; width: 18%; max-width: 120px; display: flex; align-items: center;
  font-size: 54px; color: #fff; opacity: 0; transition: opacity .2s; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.esp-prev { left: 0; padding-left: 18px; }
.esp-next { right: 0; justify-content: flex-end; padding-right: 18px; }
.esp-stage:hover .esp-nav-arrow { opacity: .9; }
.esp-video ~ .esp-nav-arrow { top: 40%; bottom: 40%; }
.esp-stage-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; gap: 10px;
  background: #15181d; flex-wrap: wrap; }
.esp-stage-bar .es-muted { color: #9aa3ad; }
.esp-stage-bar .es-btn { background: #23272e; border-color: #2e333b; color: #e9edf2; }
.esp-photo-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.esp-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.esp-dl dt { color: var(--es-muted); font-weight: 500; }
.esp-dl dd { margin: 0; word-break: break-word; }
.esp-dl a { color: var(--es-primary); }
.esp-owner-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--es-border); }
.esp-filmstrip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.esp-filmstrip a { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; background: #e4e7eb; }
.esp-filmstrip img { width: 100%; height: 100%; object-fit: cover; }
.esp-filmstrip span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; color: #fff; font-size: 12px;
  font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.7)); }

.esp-reactbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; margin-top: 8px;
  border-top: 1px solid var(--es-border); border-bottom: 1px solid var(--es-border); }
.esp-react-wrap { position: relative; }
.esp-react-btn.active { color: var(--es-primary); border-color: var(--es-primary); }
.esp-react-picker { position: absolute; bottom: calc(100% + 6px); left: 0; display: none; gap: 2px; padding: 6px;
  background: var(--es-card); border-radius: 999px; box-shadow: 0 4px 18px rgba(0,0,0,.18); z-index: 5; }
.esp-react-wrap:hover .esp-react-picker, .esp-react-wrap:focus-within .esp-react-picker { display: flex; }
.esp-react-picker button { border: 0; background: none; font-size: 22px; cursor: pointer; padding: 2px 4px;
  transition: transform .12s; }
.esp-react-picker button:hover { transform: scale(1.3) translateY(-2px); }
.esp-comments { margin-top: 14px; }
.esp-comment { display: flex; gap: 10px; margin-bottom: 10px; }
.esp-comment-body { background: var(--es-comments-bg, #e7f3ff); border-radius: 14px; padding: 8px 12px; max-width: 100%; }
.esp-comment-author { font-weight: 700; font-size: 13px; }
.esp-comment-text { font-size: 14px; word-break: break-word; }
.esp-comment-form { display: flex; gap: 8px; align-items: flex-start; }
.esp-comment-form textarea { flex: 1; border: 1px solid var(--es-border); border-radius: 18px; padding: 8px 14px;
  resize: none; font: inherit; font-size: 14px; min-height: 38px; background: var(--es-bg); }

/* ---------- keywords / calendar / search ---------- */
.esp-cloud { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-top: 12px; }
.esp-cloud a:hover { color: var(--es-primary); }
.esp-cloud sup { color: var(--es-muted); font-size: 10px; }
.esp-cloud-1 { font-size: 14px; } .esp-cloud-2 { font-size: 16px; } .esp-cloud-3 { font-size: 19px; font-weight: 600; }
.esp-cloud-4 { font-size: 23px; font-weight: 700; } .esp-cloud-5 { font-size: 28px; font-weight: 800; }
.esp-cal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.esp-cal-item { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 10px; background: var(--es-bg); }
.esp-cal-item:hover { background: var(--es-border); }
.esp-cal-item b { font-size: 18px; }
.esp-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.esp-wd { font-size: 12px; color: var(--es-muted); text-align: center; font-weight: 600; }
.esp-day { aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--es-muted); font-size: 13px; }
.esp-day.has { background: var(--es-bg); color: var(--es-text); }
.esp-day.has span { font-size: 11px; color: var(--es-primary); font-weight: 700; }
.esp-day.has:hover, .esp-day.active { background: var(--es-primary); color: #fff; }
.esp-day.has:hover span, .esp-day.active span { color: #fff; }
.esp-search-big { display: flex; gap: 8px; margin: 10px 0; }
.esp-search-big input { flex: 1; border: 1px solid var(--es-border); border-radius: 999px; padding: 9px 16px; font-size: 15px; }

/* ---------- upload ---------- */
.esp-upload label, .esp-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.esp-upload-album { display: grid; gap: 4px; margin: 10px 0; }
.esp-new-album { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 12px; border-radius: 10px; background: var(--es-bg); }
.esp-new-album label:last-child { grid-column: 1 / -1; }
.esp-drop { border: 2px dashed #c4cad3; border-radius: 14px; padding: 34px 16px; text-align: center; cursor: pointer;
  transition: background .15s, border-color .15s; margin: 8px 0 12px; }
.esp-drop:hover, .esp-drop.over { background: #eef5ff; border-color: var(--es-primary); }
.esp-drop-inner { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.esp-drop-icon { font-size: 30px; color: var(--es-primary); }
.esp-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.esp-inline input { flex: 1; min-width: 180px; }
.esp-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.esp-q { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #e4e7eb; }
.esp-q img { width: 100%; height: 100%; object-fit: cover; }
.esp-q-name { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 34px 8px 8px;
  text-align: center; font-size: 11px; line-height: 1.3; color: #555; word-break: break-all; }
.esp-q img:not([hidden]) + .esp-q-name { display: none; }
.esp-q.retry { cursor: pointer; }
.esp-q.dup img { opacity: .55; }
.esp-q.dup .esp-q-bar { background: #8a94a3; }
.esp-q-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--es-primary); width: 0; transition: width .2s; }
.esp-q-state { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px;
  padding: 2px 6px; border-radius: 999px; }
.esp-q.err { outline: 2px solid #c0392b; }
.esp-q-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 7px; background: rgba(192,57,43,.92); color: #fff;
  font-size: 11px; line-height: 1.3; max-height: 70%; overflow: auto; }
.esp-upload-done { margin-top: 14px; padding: 12px; border-radius: 10px; background: #e9f7ef; }

/* ---------- viewer / slideshow ---------- */
.esp-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(8,9,11,.97); color: #fff; display: flex;
  align-items: center; justify-content: center; }
.esp-viewer[hidden] { display: none; }
.esp-viewer-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: linear-gradient(rgba(0,0,0,.6), transparent); z-index: 3; }
.esp-viewer-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-viewer-count { opacity: .7; font-size: 13px; font-variant-numeric: tabular-nums; }
.esp-viewer-top button, .esp-viewer-top a { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.esp-viewer-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 60px 70px 30px; }
.esp-viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; animation: esp-fade .35s ease; user-select: none; }
.esp-viewer-stage iframe { width: min(100%, 160vh); aspect-ratio: 16/9; border: 0; }
@keyframes esp-fade { from { opacity: 0; } to { opacity: 1; } }
.esp-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; background: rgba(255,255,255,.1);
  border: 0; color: #fff; width: 52px; height: 52px; border-radius: 50%; font-size: 30px; cursor: pointer; }
.esp-viewer-nav.prev { left: 12px; } .esp-viewer-nav.next { right: 12px; }
.esp-viewer-speed { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 4px 0 10px; margin: 0;
  border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 14px; cursor: pointer; }
.esp-viewer-speed select { background: transparent; border: 0; color: #fff; font: inherit; font-variant-numeric: tabular-nums;
  padding: 0 2px; cursor: pointer; outline: none; }
.esp-viewer-speed select option { color: #1c1e21; }
.esp-viewer-speed:focus-within { box-shadow: 0 0 0 2px var(--es-primary); }
.esp-viewer-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.1); }
.esp-viewer-progress i { display: block; height: 100%; width: 0; background: var(--es-primary); }
.esp-viewer.playing .esp-viewer-progress i { animation: esp-progress var(--esp-interval, 5s) linear; }
@keyframes esp-progress { from { width: 0; } to { width: 100%; } }

/* ---------- modal ---------- */
.esp-modal { position: fixed; inset: 0; z-index: 1900; background: rgba(0,0,0,.45); display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.esp-modal[hidden] { display: none; }
.esp-modal-box { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; margin: 0; }
.esp-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.esp-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c1e21; color: #fff;
  padding: 10px 16px; border-radius: 10px; z-index: 2100; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.esp-toast a { color: #8ab4ff; font-weight: 600; }
.esp-foot { text-align: center; margin-top: 24px; }

.esp-mobile-strip { display: none; }

@media (min-width: 1800px) {
  .esp { --esp-row: 260px; }
  .esp-layout.es-layout { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .esp-photo-cols { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .esp.es-social { padding-left: 10px; padding-right: 10px; }
  .esp-layout.es-layout { grid-template-columns: 1fr; }
  .esp .es-aside { display: none; }
  .esp-search { display: none; }
  .esp { --esp-row: 140px; --esp-gap: 4px; }
  .esp-albums { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .esp-new-album { grid-template-columns: 1fr; }
  .esp-nav-arrow { opacity: .7; font-size: 40px; }
  .esp-viewer-stage { padding: 56px 8px 20px; }
  .esp-viewer-nav { width: 40px; height: 40px; font-size: 24px; }
  .esp-tile-cap { display: none; }
  .esp-mobile-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px 12px; padding: 2px; }
  .esp-mobile-strip::-webkit-scrollbar { display: none; }
  .esp-mobile-strip a { flex: none; white-space: nowrap; padding: 7px 12px; border-radius: 999px; background: var(--es-card);
    border: 1px solid var(--es-border); color: var(--es-text); font-size: 13px; font-weight: 600; }
  .esp-mobile-strip a.active { background: var(--es-primary); border-color: var(--es-primary); color: #fff; }
}

/* member page header */
.esp-member-head { display: flex; align-items: center; gap: 14px; }
.esp-member-head .esp-avatar { flex: none; font-size: 20px; }
