/* =============================================================
   TT Album Carousel  v1.4.0 — Frontend Styles
   ============================================================= */

/* ---------- outer wrapper ---------- */
.tt-ac-wrap {
  --tt-ac-gap:     16px;
  --tt-ac-cover-h: 240px;
  position: relative;      /* anchor for abs-positioned arrows */
  width: 100%;
  box-sizing: border-box;
  padding: 0 50px 20px;    /* horizontal room for the arrow buttons */
}

/* ---------- viewport ---------- */
.tt-ac-viewport {
  overflow: hidden;
  width: 100%;
  position: relative;
}

/* ---------- track ---------- */
.tt-ac-track {
  display: flex;
  /* gap injected inline via JS/CSS var */
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.tt-ac-track:active  { cursor: grabbing; }
.tt-ac-track.tt-no-anim { transition: none !important; }

/* each slide — width set by JS */
.tt-ac-slide { flex-shrink: 0; box-sizing: border-box; }

/* clones: no pointer events, no tab focus */
.tt-ac-clone { pointer-events: none; }

/* ---------- GRID mode (carousel off) ---------- */
.tt-ac-is-grid .tt-ac-viewport { overflow: visible; }
.tt-ac-is-grid .tt-ac-track {
  display: grid;
  gap: var(--tt-ac-gap);
  grid-template-columns: repeat(var(--ttg-d,3), 1fr);
  transition: none;
  cursor: default;
}
.tt-ac-is-grid .tt-ac-slide { width: auto !important; }
@media (max-width:1199px){ .tt-ac-is-grid .tt-ac-track { grid-template-columns: repeat(var(--ttg-l,3),1fr); } }
@media (max-width: 991px){ .tt-ac-is-grid .tt-ac-track { grid-template-columns: repeat(var(--ttg-t,2),1fr); } }
@media (max-width: 767px){ .tt-ac-is-grid .tt-ac-track { grid-template-columns: repeat(var(--ttg-m,1),1fr); } }

/* ---------- Arrow buttons ---------- */
.tt-ac-btn {
  position: absolute;
  top: calc(var(--tt-ac-cover-h) / 2 - 22px); /* vertically centred on cover */
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .16s, color .16s, transform .16s, box-shadow .16s;
}
.tt-ac-btn:hover  { background:#1a1a1a; color:#fff; transform:scale(1.1); box-shadow:0 4px 18px rgba(0,0,0,.28); }
.tt-ac-btn:active { transform:scale(0.95); }
.tt-ac-btn .tt-ac-icon { font-size:22px; width:22px; height:22px; }
.tt-ac-btn-prev { left: 0; }
.tt-ac-btn-next { right: 0; }

/* narrow screens: put buttons just inside edge */
@media (max-width:600px) {
  .tt-ac-wrap { padding-left: 40px; padding-right: 40px; }
  .tt-ac-btn-prev { left: 2px; }
  .tt-ac-btn-next { right: 2px; }
}

/* ---------- Dots ---------- */
.tt-ac-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.tt-ac-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ccc;
  border: none; padding: 0;
  cursor: pointer;
  transition: all .22s;
  flex-shrink: 0;
}
.tt-ac-dot.active { background: #1a1a1a; width: 24px; border-radius: 4px; }
.tt-ac-dot:hover:not(.active) { background: #999; }

/* =============================================================
   Album card  (same in both modes)
   ============================================================= */
.tt-ac-album-card {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
  outline: none;
  display: block;
  width: 100%;
}
.tt-ac-album-card:hover,
.tt-ac-album-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

/* cover */
.tt-ac-cover {
  position: relative;
  height: var(--tt-ac-cover-h);
  overflow: hidden;
  background: #edecea;
}
.tt-ac-cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .38s ease;
}
.tt-ac-album-card:hover .tt-ac-cover img,
.tt-ac-album-card:focus-visible .tt-ac-cover img { transform: scale(1.07); }

.tt-ac-cover-empty {
  width:100%; height:100%;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:8px; color:#bbb; font-size:13px;
}
.tt-ac-cover-empty .tt-ac-icon { font-size:40px; width:40px; height:40px; }

.tt-ac-cover-overlay {
  position:absolute; inset:0;
  background:rgba(0,0,0,.35);
  opacity:0; transition:opacity .22s;
  display:flex; align-items:center; justify-content:center;
}
.tt-ac-album-card:hover .tt-ac-cover-overlay,
.tt-ac-album-card:focus-visible .tt-ac-cover-overlay { opacity:1; }

.tt-ac-play-btn {
  width:52px; height:52px; border-radius:50%;
  background:rgba(255,255,255,.9);
  display:flex; align-items:center; justify-content:center;
}
.tt-ac-play-btn .tt-ac-icon { font-size:24px; width:24px; height:24px; color:#1a1a1a; }

.tt-ac-badge {
  position:absolute; bottom:8px; right:10px;
  background:rgba(0,0,0,.55); color:#fff;
  font-size:11px; padding:3px 9px; border-radius:20px;
  letter-spacing:.02em;
}

.tt-ac-album-info { padding:10px 14px 12px; }
.tt-ac-album-name {
  font-size:14px; font-weight:600; color:#1a1a1a;
  margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* =============================================================
   Lightbox
   ============================================================= */
.tt-ac-lb-overlay {
  position:fixed; inset:0; z-index:999999;
  background:rgba(0,0,0,.92);
  display:flex; flex-direction:column; align-items:stretch;
}
.tt-ac-lb-container {
  display:flex; flex-direction:column; height:100%;
  max-width:1100px; margin:0 auto; width:100%;
  padding:16px 20px 12px;
}
.tt-ac-lb-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:14px; flex-shrink:0;
}
.tt-ac-lb-title { font-size:18px; font-weight:600; color:#fff; margin:0; }
.tt-ac-lb-header-right { display:flex; align-items:center; gap:12px; }
.tt-ac-lb-counter { font-size:13px; color:rgba(255,255,255,.5); }
.tt-ac-lb-close {
  width:36px; height:36px; border-radius:50%;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.08); color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:background .15s;
}
.tt-ac-lb-close:hover { background:rgba(255,255,255,.22); }
.tt-ac-lb-close .tt-ac-icon { font-size:20px; width:20px; height:20px; }
.tt-ac-lb-stage {
  flex:1; position:relative;
  display:flex; align-items:center; justify-content:center;
  min-height:0; overflow:hidden;
}
.tt-ac-lb-img-wrap {
  position:relative; display:flex;
  align-items:center; justify-content:center;
  width:100%; height:100%;
}
#tt-ac-lb-img {
  max-width:calc(100% - 110px); max-height:100%;
  object-fit:contain; border-radius:6px; display:block;
  transition:opacity .18s ease;
}
#tt-ac-lb-img.tt-loading { opacity:0; }
.tt-ac-lb-spinner { position:absolute; display:none; color:rgba(255,255,255,.5); }
.tt-ac-lb-spinner .tt-ac-icon { font-size:28px; width:28px; height:28px; }
.tt-ac-spin { animation:tt-ac-spin 1s linear infinite; }
@keyframes tt-ac-spin { to { transform:rotate(360deg); } }
.tt-ac-lb-nav {
  position:absolute; top:50%; transform:translateY(-50%);
  width:46px; height:46px; border-radius:50%;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.1); color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:background .15s, transform .15s; z-index:2;
}
.tt-ac-lb-nav:hover { background:rgba(255,255,255,.25); transform:translateY(-50%) scale(1.08); }
.tt-ac-lb-nav .tt-ac-icon { font-size:22px; width:22px; height:22px; }
.tt-ac-lb-prev { left:12px; }
.tt-ac-lb-next { right:12px; }
.tt-ac-lb-caption {
  text-align:center; color:rgba(255,255,255,.65);
  font-size:13px; padding:8px 20px 6px;
  flex-shrink:0; min-height:30px; margin:0;
}
.tt-ac-lb-thumbs {
  display:flex; gap:6px;
  overflow-x:auto; padding:6px 2px 4px; flex-shrink:0;
  scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.15) transparent;
}
.tt-ac-lb-thumbs::-webkit-scrollbar { height:4px; }
.tt-ac-lb-thumbs::-webkit-scrollbar-thumb { background:rgba(255,255,255,.15); border-radius:2px; }
.tt-ac-lb-thumb {
  width:68px; height:50px; flex-shrink:0;
  border-radius:6px; overflow:hidden;
  border:2px solid transparent; cursor:pointer;
  opacity:.52; transition:opacity .15s, border-color .15s;
}
.tt-ac-lb-thumb:hover { opacity:.85; }
.tt-ac-lb-thumb.active { border-color:#fff; opacity:1; }
.tt-ac-lb-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.tt-ac-empty { color:#888; font-style:italic; }

/* =============================================================
   Sub-album browser (shown when an album has children)
   ============================================================= */
.tt-ac-sb-container {
  max-width: 1000px;
}
.tt-ac-sb-close { margin-left: auto; }
.tt-ac-sb-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 4px 2px 20px;
  align-content: start;
}
@media (max-width: 860px) {
  .tt-ac-sb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .tt-ac-sb-grid { grid-template-columns: 1fr; }
}
.tt-ac-sb-grid .tt-ac-album-card {
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.tt-ac-sb-grid .tt-ac-cover {
  height: 160px;
  background: rgba(255,255,255,.06);
}
.tt-ac-sb-grid .tt-ac-cover-empty .tt-ac-icon { color: rgba(255,255,255,.35); }
.tt-ac-sb-grid .tt-ac-album-info { padding: 10px 12px 12px; }
.tt-ac-sb-grid .tt-ac-album-name { color: #fff; }
.tt-ac-sb-loading {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0; color: rgba(255,255,255,.5);
}
.tt-ac-sb-loading .tt-ac-icon { font-size: 28px; width: 28px; height: 28px; }


/* =============================================================
   BENTO LAYOUT  (5-album masonry grid matching reference)
   ============================================================= */

.tt-ac-bento {
  --tt-bento-gap:     16px;
  --tt-bento-cover-h: 240px;
  --tt-bento-radius:  14px;

  display: grid;
  /* 3 columns: left(2 rows) | hero(2 rows) | right(2 rows) */
  grid-template-columns: 1fr 1.35fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--tt-bento-gap);
  width: 100%;
  box-sizing: border-box;
}

/* item default: takes one row */
.tt-ac-bento-item {
  position: relative;
  border-radius: var(--tt-bento-radius);
  overflow: hidden;
}

/*
  Layout map  (like the screenshot):
  col1-row1  col2-row1&2  col3-row1
  col1-row2               col3-row2
*/
.tt-ac-bento-item:nth-child(1) { grid-column: 1; grid-row: 1; }
.tt-ac-bento-item:nth-child(2) { grid-column: 3; grid-row: 1; }
.tt-ac-bento-item:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; } /* HERO */
.tt-ac-bento-item:nth-child(4) { grid-column: 1; grid-row: 2; }
.tt-ac-bento-item:nth-child(5) { grid-column: 3; grid-row: 2; }

/* Hero card fills full height of its 2-row span */
.tt-ac-bento-hero .tt-ac-album-card { height: 100%; }
.tt-ac-bento-hero .tt-ac-cover {
  height: 100% !important;
  min-height: calc(var(--tt-bento-cover-h) * 2 + var(--tt-bento-gap));
}

/* Non-hero cover height */
.tt-ac-bento-item:not(.tt-ac-bento-hero) .tt-ac-cover {
  height: var(--tt-bento-cover-h);
}

/* album-card fills its bento cell */
.tt-ac-bento-item .tt-ac-album-card {
  border-radius: var(--tt-bento-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 3px 14px rgba(0,0,0,.10);
  cursor: pointer;
  height: 100%;
  transition: transform .22s ease, box-shadow .22s ease;
}
.tt-ac-bento-item .tt-ac-album-card:hover,
.tt-ac-bento-item .tt-ac-album-card:focus-visible {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

/* cover fills card */
.tt-ac-bento-item .tt-ac-cover {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #edecea;
}
.tt-ac-bento-item .tt-ac-cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .38s ease;
}
.tt-ac-bento-item .tt-ac-album-card:hover .tt-ac-cover img { transform: scale(1.06); }

/* overlay on hover */
.tt-ac-bento-item .tt-ac-cover-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.32);
  opacity: 0; transition: opacity .22s;
  display: flex; align-items: center; justify-content: center;
}
.tt-ac-bento-item .tt-ac-album-card:hover .tt-ac-cover-overlay { opacity: 1; }

/* ── Label pill (like the screenshot — white pill at bottom) ── */
.tt-ac-bento-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 40px;
  padding: 7px 22px;
  white-space: nowrap;
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  z-index: 3;
  pointer-events: none;
}
.tt-ac-bento-label .tt-ac-album-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a73e8;      /* blue like the reference */
  letter-spacing: .01em;
  white-space: nowrap;
}

/* responsive: collapse to 2-col on tablet, 1-col on mobile */
@media (max-width: 860px) {
  .tt-ac-bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .tt-ac-bento-item:nth-child(1) { grid-column:1; grid-row:1; }
  .tt-ac-bento-item:nth-child(2) { grid-column:2; grid-row:1; }
  .tt-ac-bento-item:nth-child(3) { grid-column:1/span 2; grid-row:2; } /* full width hero */
  .tt-ac-bento-item:nth-child(4) { grid-column:1; grid-row:3; }
  .tt-ac-bento-item:nth-child(5) { grid-column:2; grid-row:3; }
  .tt-ac-bento-hero .tt-ac-cover { min-height: var(--tt-bento-cover-h) !important; }
}
@media (max-width: 540px) {
  .tt-ac-bento {
    grid-template-columns: 1fr;
  }
  .tt-ac-bento-item,
  .tt-ac-bento-hero { grid-column: 1 !important; grid-row: auto !important; }
  .tt-ac-bento-hero .tt-ac-cover { min-height: var(--tt-bento-cover-h) !important; }
}

/* Inline SVG icons (replace Dashicons, which only load for logged-in users) */
.tt-ac-icon { display:block; flex-shrink:0; fill:none; stroke:currentColor; }
.tt-ac-spin { transform-origin:50% 50%; }
