/* =========================================================
   albums.css — Photo Albums page (cream theme, matches the
   essay reading pages; styles.css provides tokens + gate).
   ========================================================= */

.albums-page { min-height: 100vh; background: var(--bg-cream); color: var(--ink); padding: 0 clamp(20px, 5vw, 72px) 60px; }

.albums-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 0 0; font-family: var(--sans); }
.albums-nav-back { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft); }
.albums-nav-back:hover { color: var(--gold-deep); }
.albums-nav-spacer { width: 70px; }

.albums-head { text-align: center; margin: clamp(30px, 6vh, 56px) auto 0; max-width: 640px; }
.albums-kicker { font-family: var(--sans); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.albums-back { display: inline-block; margin-bottom: 22px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft); }
.albums-back:hover { color: var(--gold-deep); }
.albums-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; margin: 0; }
.albums-lede { font-family: var(--serif); font-style: italic; font-size: clamp(15px, 1.9vw, 18px); color: var(--ink-soft); margin: 12px auto 0; }
.albums-flourish { height: 1px; width: clamp(120px, 16vw, 200px); margin: 20px auto 0; background: linear-gradient(to right, transparent, var(--gold), transparent); }

/* ---- Album index tiles ---- */
.album-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 4vw, 48px); margin-top: clamp(28px, 5vh, 48px); }
.album-tile { display: block; width: clamp(220px, 26vw, 300px); cursor: pointer; text-align: center; background: none; border: none; padding: 0; font: inherit; color: inherit; }
.album-tile-frame { width: 100%; aspect-ratio: 4 / 3.1; overflow: hidden; background: #d6cdba; box-shadow: 0 14px 34px rgba(28, 34, 48, 0.18); transition: box-shadow 0.4s ease; }
.album-tile:hover .album-tile-frame { box-shadow: 0 20px 44px rgba(28, 34, 48, 0.28); }
.album-tile-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-tile-name { font-family: var(--serif); font-weight: 500; font-size: 18px; margin-top: 12px; }
.album-tile-count { font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }

/* ---- Masonry grid (1px auto-rows + measured row spans) ---- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; grid-auto-rows: 1px; margin-top: clamp(24px, 4vh, 40px); }
@media (max-width: 640px) { .album-grid { grid-template-columns: repeat(2, 1fr); } }
.album-cell { grid-row-end: span 170; }
.album-thumb { position: relative; cursor: pointer; background: #fff; box-shadow: 0 3px 12px rgba(28, 34, 48, 0.14); transition: box-shadow 0.3s ease; }
.album-thumb:hover { box-shadow: 0 8px 22px rgba(28, 34, 48, 0.24); }
.album-thumb img { width: 100%; height: auto; display: block; }

/* Edit/Move modes swap masonry for uniform tiles - row order reads
   left-to-right, so drag-reorder and selection are easy to follow.
   albums.js measure() skips row-span math while this class is on. */
.album-grid.ake-uniform { grid-auto-rows: auto; row-gap: 10px; align-items: start; }
.album-grid.ake-uniform .album-cell { grid-row-end: auto; }
.album-grid.ake-uniform .album-thumb { aspect-ratio: 1 / 1; }
.album-grid.ake-uniform .album-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Full-screen viewer: shared rules live in viewer.css ---- */
/* ---- Footer / sign-in ---- */
.albums-foot { text-align: center; margin-top: clamp(40px, 8vh, 80px); }
.albums-signin { background: none; border: none; cursor: pointer; font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); opacity: 0.75; }
.albums-signin:hover { color: var(--gold-deep); opacity: 1; }

/* ---- Landing cover link ---- */
.cover-albums-link { display: inline-block; margin-top: clamp(20px, 3vh, 32px); font-family: var(--sans); font-size: clamp(10px, 1.25vh, 11.5px); letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold-soft); text-decoration: none; border: 1px solid rgba(212, 180, 120, 0.55); border-radius: 999px; padding: 9px 24px 9px calc(24px + 0.28em); transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease; }
.cover-albums-link:hover { color: var(--cream-ink); border-color: var(--gold-soft); background-color: rgba(176, 138, 72, 0.14); }

/* ---- Editor UI (populated by album-admin.js) ---- */
.ake-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1100px; margin: 18px auto 0; padding: 10px 0; border-bottom: 1px solid var(--rule-light); font-family: var(--sans); font-size: 12px; color: var(--ink-soft); }
.ake-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ake-btn { display: inline-block; padding: 7px 14px; border: 1px solid rgba(28, 34, 48, 0.3); background: none; font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; color: var(--ink); }
.ake-btn:hover { border-color: var(--ink); }
.ake-btn.gold { border-color: var(--gold); color: var(--gold-deep); }
.ake-btn.gold:hover { border-color: var(--gold-deep); }
.ake-del { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--ink); color: var(--bg-cream); font-size: 16px; line-height: 1; cursor: pointer; z-index: 2; box-shadow: 0 1px 4px rgba(13, 16, 24, 0.35); display: flex; align-items: center; justify-content: center; }
.ake-renamebtn { display: block; width: 100%; text-align: center; font-family: var(--sans); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); padding: 6px 4px 2px; cursor: pointer; }
.ake-capbtn { display: block; width: 100%; border: none; background: none; font-family: var(--sans); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); padding: 6px 4px 7px; cursor: pointer; }
.ake-handle { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--gold-deep); color: var(--bg-cream); font-size: 13px; line-height: 1; cursor: grab; z-index: 2; touch-action: none; user-select: none; box-shadow: 0 1px 4px rgba(13, 16, 24, 0.35); }
.ake-handle:active { cursor: grabbing; }
.ake-selbox { position: absolute; inset: 0; border: none; background: transparent; cursor: pointer; z-index: 2; -webkit-tap-highlight-color: transparent; }
.album-cell.selected .album-thumb { outline: 3px solid var(--gold); outline-offset: -3px; }
.album-cell.selected .ake-selbox::after { content: '\2713'; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold-deep); color: var(--bg-cream); font-size: 14px; line-height: 24px; text-align: center; box-shadow: 0 1px 4px rgba(13, 16, 24, 0.35); }
.ake-albumrow { display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 8px; border: 1px solid rgba(28, 34, 48, 0.25); background: #fff; font-family: var(--serif); font-size: 15px; color: var(--ink); cursor: pointer; }
.ake-albumrow:hover { border-color: var(--gold); }
.ake-albumrow.selected { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: rgba(176, 138, 72, 0.07); }
.ake-select { display: block; width: 100%; box-sizing: border-box; margin-bottom: 4px; font-size: 15px; font-family: var(--serif); }
.album-cell.dragging { opacity: 0.4; }
.album-cell.drop-before { box-shadow: -3px 0 0 var(--gold); }
.album-grid.drop-end { box-shadow: inset 0 -3px 0 var(--gold); }
.ake-modal-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(13, 16, 24, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ake-modal { width: min(480px, 100%); max-height: 86vh; overflow-y: auto; background: #fbf7ee; border: 1px solid var(--rule-light); box-shadow: 0 24px 60px rgba(13, 16, 24, 0.35); padding: 22px 24px; font-family: var(--sans); }
.ake-modal h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 12px; }
.ake-note { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 14px; }
.ake-note.dim { color: var(--cream-ink-soft); margin: 12px 0 0; }
.ake-drop { border: 1px dashed var(--gold); text-align: center; font-size: 13px; color: var(--ink-soft); padding: 26px 16px; line-height: 1.7; margin-bottom: 14px; cursor: pointer; }
.ake-drop.dragover { background: rgba(176, 138, 72, 0.08); }
.ake-drop small { color: var(--cream-ink-soft); }
.ake-queue { display: flex; flex-direction: column; gap: 10px; }
.ake-qrow { display: flex; align-items: center; gap: 10px; }
.ake-qrow img { width: 44px; height: 44px; object-fit: cover; display: block; }
.ake-input { flex: 1 1 auto; min-width: 0; border: 1px solid rgba(28, 34, 48, 0.25); background: #fff; font-family: var(--sans); font-size: 13px; padding: 8px 10px; color: var(--ink); }.ake-qstat { font-size: 11px; color: var(--gold-deep); white-space: nowrap; min-width: 84px; text-align: right; }
.ake-qstat.done { color: #4a7a4a; }
.ake-qstat.err { color: #a0432e; }
.ake-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 9px 2px; border-bottom: 1px solid var(--rule-light); }
.ake-remove { background: none; border: none; color: var(--gold-deep); cursor: pointer; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.ake-add { display: flex; gap: 8px; margin-top: 14px; }
.ake-pwfield { display: block; margin: 0 0 12px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.ake-pwfield .ake-input { display: block; width: 100%; box-sizing: border-box; margin-top: 5px; }
.ake-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ake-error { font-size: 12px; color: #a0432e; margin: 8px 0 0; }
