/* =====================================================
   ALBUM PAGE
   Loaded after style.css. Palette and type are the site's:
   #6b4328 brown, #34180f dark brown, #f5c89a peach,
   #bf9b74 tan, Sacramento display, Work Sans body.

   The page itself never scrolls. Only .tf-scroller does.
   ===================================================== */

html, body.tf-static {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body.tf-static {
  background: #34180f;
  color: #fff;
}

/* ---------- fixed background ---------- */
.tf-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  background: url(../images/img_bg_2.jpg) center 28% no-repeat;
  background-size: cover;
}
.tf-bg:after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(52, 24, 15, 0.62);
  transition: background 0.5s;
}
body.view-album .tf-bg:after {
  background: rgba(38, 17, 10, 0.9);
}

/* ---------- one screen, three rows ---------- */
.tf-shell {
  position: relative;
  z-index: 2;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 20px calc(16px + env(safe-area-inset-bottom));
}
.tf-main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- landing ---------- */
#home-view {
  width: 100%;
  max-width: 780px;
  text-align: center;
  animation: tfRise 0.7s ease both;
}
body.view-album #home-view { display: none; }

.tf-title {
  font-family: "Sacramento", Arial, serif;
  font-size: 78px;
  line-height: 1.15;
  color: #fff;
  margin: 0;
}
.tf-sub {
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f5c89a;
  margin: 4px 0 18px;
}
.tf-blurb {
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  max-width: 540px;
  margin: 0 auto 26px;
}
.tf-cta { margin: 0 0 26px; }
.tf-cta .btn { margin: 0 5px 8px; }

/* the theme forces header buttons to a white pill, so a ghost button has to
   be scoped at least as tightly to win */
body.tf-static .btn.btn-ghost {
  background: transparent !important;
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  color: #fff !important;
}
body.tf-static .btn.btn-ghost:hover {
  background: #fff !important;
  color: #6b4328 !important;
}
body.tf-static .btn.btn-default {
  background: #fff;
  border: 2px solid #fff;
  color: #6b4328;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 12px 26px;
}
body.tf-static .btn.btn-default:hover {
  background: #f5e8d8;
  border-color: #f5e8d8;
  color: #34180f;
}

/* ---------- recent strip on the landing ---------- */
.tf-recent-wrap { display: none; }
.tf-recent-wrap.on { display: block; }
.tf-recent-label {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 12px;
}
.tf-recent {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
}
.tf-recent .tf-chip {
  position: relative;
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(191, 155, 116, 0.45);
  background-size: cover;
  background-position: center;
  transition: transform 0.4s, border-color 0.4s;
}
.tf-recent .tf-chip:hover {
  transform: translateY(-3px);
  border-color: #f5c89a;
}
.tf-recent .tf-chip .tf-play {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: rgba(52, 24, 15, 0.75);
  color: #f5c89a;
  font-size: 9px;
}

/* ---------- album view ---------- */
#album-view {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  animation: tfRise 0.5s ease both;
}
body.view-album #album-view { display: flex; }

.tf-albumbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(191, 155, 116, 0.35);
}
.tf-albumbar h2 {
  font-family: "Sacramento", Arial, serif;
  font-size: 38px;
  line-height: 1;
  color: #fff;
  margin: 0;
}
.tf-albumbar h2 small {
  display: block;
  font-family: "Work Sans", Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
}
.tf-albumbar-btns { display: flex; gap: 8px; flex: none; }
.tf-albumbar-btns .btn { margin: 0; }

/* the only scrolling element on the page */
.tf-scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 4px 10px;
  margin-right: -4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(191, 155, 116, 0.6) transparent;
}
.tf-scroller::-webkit-scrollbar { width: 6px; }
.tf-scroller::-webkit-scrollbar-thumb {
  background: rgba(191, 155, 116, 0.6);
  border-radius: 3px;
}

.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.tf-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06) center / cover no-repeat;
  border: 1px solid rgba(191, 155, 116, 0.3);
  transition: transform 0.4s, border-color 0.4s;
}
.tf-tile:hover {
  transform: translateY(-3px);
  border-color: #f5c89a;
}
.tf-by {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 10px 8px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(transparent, rgba(52, 24, 15, 0.88));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-play {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: rgba(52, 24, 15, 0.78);
  color: #f5c89a;
  font-size: 10px;
}
.tf-remove {
  display: none;
  position: absolute;
  top: 8px; left: 8px;
  width: 30px; height: 30px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #d9534f;
  color: #d9534f;
  font-size: 18px;
  cursor: pointer;
  z-index: 3;
}
body.album-admin .tf-remove { display: block; }
.tf-remove:hover { background: #d9534f; color: #fff; }
.tf-adminflag {
  position: fixed;
  top: 10px; left: 12px;
  z-index: 1002;
  background: #d9534f;
  color: #fff;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 3px;
}

.tf-empty {
  text-align: center;
  padding: 40px 16px;
  color: rgba(255, 255, 255, 0.7);
}
.tf-empty-title {
  font-family: "Sacramento", Arial, serif;
  font-size: 40px;
  color: #f5c89a;
  margin-bottom: 4px;
}

/* ---------- footer ---------- */
.tf-foot {
  flex: none;
  text-align: center;
  padding-top: 10px;
}
.tf-names {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 4px;
}
.tf-names a {
  color: #f5c89a;
  border-bottom: 1px solid rgba(245, 200, 154, 0.4);
  margin-left: 8px;
}
.tf-built {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}
.tf-built a { color: #f5c89a; }

@keyframes tfRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- lightbox ---------- */
/* the theme centres the media in the full viewport, which would put it under
   the caption, share row and thumb strip, so reserve that space */
#gallery-lightbox { padding-bottom: 215px; }
#lb-video {
  display: none;
  width: 90%;
  max-width: 1000px;
}
#lb-video iframe,
#lb-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 60vh;
  border: 0;
  border-radius: 8px;
  background: #000;
}
.lb-caption {
  position: absolute;
  bottom: 185px;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  letter-spacing: 1px;
  pointer-events: none;
}

/* style.css already defines .lb-share as a single centred link, so this
   overrides it into a row of buttons */
#gallery-lightbox .lb-share {
  position: absolute;
  bottom: 140px;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.lb-share-btn {
  width: 38px;
  height: 38px;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  transition: 0.3s;
}
.lb-share-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.lb-share-btn:hover {
  background: #f5c89a;
  border-color: #f5c89a;
  color: #34180f !important;
}
.lb-share-btn[hidden] { display: none; }

/* ---------- share modal ---------- */
#share-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#share-overlay.active { display: flex; }

#share-box {
  background: #fff;
  color: #6e6257;
  padding: 36px;
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
#share-box h3 {
  font-family: "Sacramento", Arial, serif;
  font-size: 44px;
  line-height: 1.2;
  color: #6b4328;
  text-align: center;
  margin: 0 0 8px;
}
#share-box .share-sub {
  text-align: center;
  color: #6e6257;
  font-weight: 300;
  margin-bottom: 24px;
}
#share-box .share-label {
  display: block;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 600;
  color: #bf9b74;
  margin-bottom: 8px;
}
#share-box .form-control {
  height: 50px;
  border: 1px solid #dadada;
  border-radius: 4px;
  box-shadow: none;
  color: #34180f;
  font-size: 16px;
}
#share-box .form-control:focus {
  border-color: #bf9b74;
  box-shadow: none;
}

/* bootstrap.css forces input[type=file] { display:block }, which beats the
   hidden attribute, so the raw file input has to be hidden here */
#share-box #files { display: none !important; }

.share-heart { margin-bottom: 10px; }
.share-heart i {
  font-size: 20px;
  background: rgba(221, 200, 163, 0.35);
  padding: 18px;
  color: #6b4328;
  border-radius: 50%;
}

.share-err {
  display: none;
  margin-bottom: 16px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.6;
  background: rgba(217, 83, 79, 0.1);
  border-left: 3px solid #d9534f;
  color: #a94442;
}
.share-err.active { display: block; }

.share-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}
.share-actions .btn {
  flex: 1;
  height: 46px;
  margin: 0;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
#share-box .btn.btn-default {
  background: #6b4328;
  border: 2px solid #6b4328;
  color: #fff;
}
#share-box .btn.btn-default:hover {
  background: #34180f;
  border-color: #34180f;
  color: #fff;
}
#share-box .btn.btn-ghost {
  background: transparent !important;
  border: 2px solid #6b4328 !important;
  color: #6b4328 !important;
}
#share-box .btn.btn-ghost:hover {
  background: #6b4328 !important;
  color: #fff !important;
}
#share-box .btn[disabled] { opacity: 0.45; }

.share-drop {
  border: 2px dashed #dadada;
  border-radius: 6px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
}
.share-drop:hover,
.share-drop.hot {
  border-color: #bf9b74;
  background: rgba(221, 200, 163, 0.14);
}
.share-drop i {
  font-size: 30px;
  color: #bf9b74;
  display: block;
  margin-bottom: 12px;
}
.share-drop b {
  display: block;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 2px;
  color: #34180f;
  margin-bottom: 6px;
}
.share-drop small { color: #8f8378; line-height: 1.7; }

.share-queue { margin-top: 18px; }
.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.share-row .thumb {
  width: 42px; height: 42px;
  flex: none;
  object-fit: cover;
  border-radius: 4px;
  background: #efefef;
}
.share-row .meta { flex: 1; min-width: 0; }
.share-row .nm {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6e6257;
}
.share-row .bar {
  display: block;
  height: 3px;
  margin-top: 6px;
  background: #efefef;
  border-radius: 2px;
  overflow: hidden;
}
.share-row .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #6b4328;
  transition: width 0.3s linear;
}
.share-row .st {
  flex: none;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a89a8c;
}
.share-row.ok .st { color: #6b4328; }
.share-row.bad .st,
.share-row.bad .nm { color: #d9534f; }

.share-oprog { margin-top: 18px; }
.share-obar {
  height: 4px;
  background: #efefef;
  border-radius: 2px;
  overflow: hidden;
}
.share-obar i {
  display: block;
  height: 100%;
  width: 0;
  background: #6b4328;
  transition: width 0.25s linear;
}
.share-olab {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a89a8c;
}

/* ---------- phones ---------- */
@media screen and (max-width: 640px) {
  .tf-shell { padding: 16px 14px calc(12px + env(safe-area-inset-bottom)); }
  .tf-title { font-size: 54px; }
  .tf-sub { font-size: 12px; margin-bottom: 12px; }
  .tf-blurb { font-size: 14px; margin-bottom: 20px; }
  .tf-cta .btn { display: block; width: 100%; margin: 0 0 8px; }
  .tf-recent { gap: 7px; }
  .tf-recent .tf-chip { width: 68px; height: 68px; }
  .tf-albumbar h2 { font-size: 30px; }
  .tf-albumbar-btns .btn { padding: 9px 14px; font-size: 11px; }
  .tf-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; }
  .tf-by { font-size: 10.5px; padding: 20px 7px 6px; }
  #share-box { padding: 24px 18px; }

  #gallery-lightbox { padding-bottom: 200px; }
  #gallery-lightbox #lb-image { max-height: calc(100vh - 260px); }
  #lb-video iframe,
  #lb-video video { max-height: calc(100vh - 260px); }
  .lb-caption { bottom: 178px; font-size: 12px; }
  #gallery-lightbox .lb-share { bottom: 134px; gap: 7px; }
  .lb-share-btn { width: 34px; height: 34px; }
  .lb-share-btn svg { width: 15px; height: 15px; }
}

/* very short screens, mostly phones in landscape */
@media screen and (max-height: 560px) {
  .tf-title { font-size: 44px; }
  .tf-blurb { display: none; }
  .tf-recent .tf-chip { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
