/* Seoulbooth — trang xem ảnh sau khi quét QR.
   Tông "Seoul Life Photobox" đồng bộ với app kiosk: nền đỏ đô #640702, chữ/nút kem #FAF5D6,
   ren ở mép trên, font Prata (tiêu đề) + Lobster Two (số) + Great Vibes (chữ viết tay).
   Mobile-first. KHÔNG dùng CDN: font nhúng sẵn trong assets/fonts (OFL) vì máy khách có thể
   nối WiFi của booth không có internet. */

@font-face { font-family: "Prata";       src: url("fonts/Prata-Regular.ttf") format("truetype");      font-display: swap; }
@font-face { font-family: "Lobster Two"; src: url("fonts/LobsterTwo-Bold.ttf") format("truetype");    font-weight: 700; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("fonts/GreatVibes-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --maroon:      #640702;                 /* nền chính */
  --maroon-soft: #7A1E12;                 /* ô phụ / hover */
  --cream:       #FAF5D6;                 /* chữ, nút chính */
  --cream-20:    rgba(250, 245, 214, .2); /* ô mờ (tab tắt, card) */
  --cream-dim:   rgba(250, 245, 214, .72);
  --ink:         #640702;                 /* chữ trên nền kem */
  --radius:      14px;
  --gap:         10px;
  --display:     "Prata", Georgia, "Times New Roman", serif;
  --number:      "Lobster Two", Georgia, serif;
  --script:      "Great Vibes", "Brush Script MT", cursive;
  --shadow:      0 6px 18px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--display);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

/* [hidden] phải thắng mọi display: của class (nút "Tải video" từng hiện khi không có video) */
[hidden] { display: none !important; }

/* ---------- Ren mép trên (giống mọi màn của app) ---------- */
.lace {
  height: 34px;
  background: url("lace.png") center top / auto 100% repeat-x;
  flex: none;
}

/* ---------- Đầu trang: logo + tên ---------- */
.topbar {
  position: relative;
  padding: 26px 12px 8px;
  text-align: center;
}

.lang {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 7px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--cream-20);
  color: var(--cream);
  font: 12px/1 var(--display);
  cursor: pointer;
  transition: transform .14s ease, background .2s ease;
}
.lang:active { transform: scale(.96); background: rgba(250, 245, 214, .3); }
.lang-icon { font-size: 12px; opacity: .8; }

.logo {
  display: block;
  width: 84px;
  height: auto;
  margin: 4px auto 0;
}

.wordmark {
  margin-top: 6px;
  color: var(--cream);
  line-height: 1;
}
.wordmark .script {
  display: block;
  font: 30px/1 var(--script);
  margin-bottom: 4px;
}
.wordmark .name {
  display: block;
  font: 34px/1.1 var(--display);
  letter-spacing: .5px;
}
/* Thương hiệu đơn vị làm hệ thống - hiện ở mọi trang web (27/08/2026) */
.wordmark .by {
  display: block;
  margin-top: 6px;
  font: 22px/1 var(--script);
  color: var(--cream-dim);
}

/* ---------- Tab Ảnh / Video: hai viên như hộp bước của app ---------- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 18px 16px 4px;
}

.tab {
  min-width: 132px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cream-20);
  color: var(--cream);
  font: 17px/1 var(--display);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .14s ease, background .25s ease, color .25s ease;
}
.tab:active { transform: scale(.96); }
.tab.is-active { background: var(--cream); color: var(--ink); }

/* ---------- Nội dung ---------- */
main {
  flex: 1;
  padding: 22px 16px 8px;
}

.hint {
  margin: 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
}
.hint-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--cream-dim);
}

.block { margin-top: 28px; }

.caption {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 1.2px;
  color: var(--cream-dim);
}

/* Nút tải: viên kem chữ đỏ (Seoul.CreamPillButton) */
.btn-dl {
  display: block;
  margin: 24px auto 0;
  width: 100%;
  max-width: 340px;
  padding: 15px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.2 var(--display);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .14s ease, opacity .2s ease;
}
.btn-dl:active { transform: scale(.96); }
.btn-dl[disabled] { opacity: .7; cursor: default; }

/* Card kem mờ bo góc như Seoul.Card */
.card {
  background: var(--cream-20);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

/* Ảnh ghép (bản in) */
.strip-wrap { display: flex; justify-content: center; }
.strip-wrap img {
  max-width: 62%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #fff;
}

/* Lưới ảnh lẻ */
.grid {
  display: grid;
  /* minmax(0,1fr): ảnh gốc rộng hơn cột không được nong cột ra làm card tràn màn */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  justify-items: stretch;
}
.grid img {
  width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 2;      /* ảnh chụp ra là 3:2 */
  object-fit: cover;
  display: block;
  border-radius: 8px;
  background: var(--cream-20);
}

/* Video */
.video-wrap { display: flex; justify-content: center; }
.video-wrap video {
  width: 100%;
  max-width: 460px;
  border-radius: 10px;
  background: #000;
}

/* Giữ chỗ trong lúc tải */
.ph {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(250,245,214,.14) 25%, rgba(250,245,214,.26) 37%, rgba(250,245,214,.14) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: 0 0 } }

/* Trạng thái lỗi / hết hạn */
.state {
  margin: 40px auto;
  max-width: 340px;
  padding: 22px 18px;
  border-radius: 18px;
  background: var(--cream-20);
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cream);
}

/* ---------- Chân trang: đường kẻ kem + ghi chú hết hạn ---------- */
.foot {
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--cream-dim);
}
.foot .rule {
  display: block;
  height: 2px;
  margin: 0 auto 14px;
  max-width: 340px;
  background: var(--cream);
  opacity: .8;
}
.foot .foot-by { display: block; margin-top: 8px; letter-spacing: .2px; }
.foot .foot-by b { color: var(--cream); font-weight: 700; }
.lb-by {
  position: absolute; left: 0; right: 0; bottom: calc(6px + env(safe-area-inset-bottom));
  margin: 0; text-align: center;
  font: 18px/1 var(--script); color: var(--cream-dim);
  pointer-events: none;
}

/* Ảnh trong lưới / bản ghép là nút bấm mở ảnh lớn */
.grid button, .strip-wrap button {
  padding: 0; border: 0; background: transparent; cursor: pointer;
  width: 100%; display: block;
}
/* Điện thoại: không cho nhấn giữ lưu ảnh từ LƯỚI (lưới là bản nhỏ, lưu sẽ mờ) -
   lưu ảnh gốc trong khung xem lớn. Ảnh trong lightbox vẫn nhấn giữ được. */
.grid button img, .strip-wrap button img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.strip-wrap button { width: auto; max-width: 62%; }
.strip-wrap button img { max-width: 100%; }
.grid button:active img, .strip-wrap button:active img { opacity: .85; }

/* ---------- Xem ảnh lớn (lightbox) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(46, 3, 1, .96);
  animation: lbfade .2s ease both;
}
@keyframes lbfade { from { opacity: 0 } to { opacity: 1 } }
.lb-body {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: var(--shadow);
  background: var(--cream-20);
}
.lb-body img.is-loading { opacity: .35; }
.lb-spin {
  position: absolute;
  width: 38px; height: 38px;
  border: 3px solid rgba(250, 245, 214, .25);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.lb-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font: 20px/1 var(--display);
  cursor: pointer;
  z-index: 1;
}
.lb-hint {
  margin: 12px 0 calc(4px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--cream-dim);
  text-align: center;
}
/* Nút tải ảnh gốc trong khung xem lớn (máy tính: chuột phải trên lưới chỉ được ảnh nhỏ) */
.lb-dl {
  margin-top: 12px;
  padding: 11px 26px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--maroon);
  font: 700 15px/1 var(--display);
  text-decoration: none;
  letter-spacing: .3px;
}
.lb-dl:active { opacity: .85; }

/* ---------- Hiện dần khi mở trang (như Reveal của app) ---------- */
.reveal { animation: reveal .8s cubic-bezier(.22, .61, .36, 1) both; }
.reveal-1 { animation-delay: .05s; }
.reveal-2 { animation-delay: .12s; }
.reveal-3 { animation-delay: .2s; }
.reveal-4 { animation-delay: .3s; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
}

/* Màn rộng: giới hạn bề ngang cho dễ nhìn */
@media (min-width: 620px) {
  .topbar, .tabs, main, .foot { max-width: 560px; margin-inline: auto; }
  .lace { height: 44px; }
}
