:root {
  --orange: #ff6600;
  --orange-strong: #e05500;
  --dark: #2a2a2a;
  --muted: #6b6b6b;
  --line: #e6e8ec;
  --paper: #ffffff;
  --soft: #f5f6f8;
  --ink: #202124;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Sarabun', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f7f8 0%, #ffffff 42%, #f2f3f5 100%);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.gallery-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(14px);
}

.brand-link {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 2px;
  line-height: 1;
}

.brand-link span:first-child { color: var(--orange); }
.brand-link span:last-child { color: var(--muted); }

.top-actions,
.folder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.btn.primary {
  background: var(--orange);
  color: #fff;
}

.btn.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--dark);
}

.gallery-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 70px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a:hover { color: var(--orange); }

.hero-panel,
.featured-random,
.notice,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: clamp(24px, 4vw, 42px);
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--dark);
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 190px));
  gap: 10px;
}

.metric {
  min-width: 130px;
  padding: 16px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.metric strong {
  display: block;
  color: var(--orange);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  line-height: 1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric em {
  display: block;
  margin-top: 3px;
  color: var(--orange);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.featured-random {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.4fr);
  gap: 24px;
  align-items: stretch;
  padding: 18px;
  margin-bottom: 24px;
}

.featured-copy {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.featured-copy h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  margin-bottom: 10px;
}

.featured-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.featured-image {
  min-height: 310px;
  border-radius: 10px;
  overflow: hidden;
  background: #e9ecef;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.toolbar {
  margin: 20px 0;
  display: flex;
  justify-content: flex-end;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 430px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.search-box span {
  color: var(--orange);
  font-weight: 700;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  background: transparent;
}

.customer-grid,
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.customer-card,
.folder-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.customer-card:hover,
.folder-card:hover,
.photo-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(255,102,0,0.45);
  box-shadow: 0 18px 36px rgba(0,0,0,0.13);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--soft);
}

.card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-logo {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--orange);
  font-weight: 800;
  overflow: hidden;
}

.customer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.card-body { padding: 16px; }

.card-body h2,
.folder-card h2 {
  font-size: 1.08rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.card-stats,
.folder-card p {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.folder-actions { margin: 0 0 18px; }

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.folder-icon {
  flex: 0 0 54px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,102,0,0.12);
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.photo-tile {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.placeholder,
.empty-state,
.notice {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  background: repeating-linear-gradient(135deg, #f1f2f4 0 10px, #e8eaed 10px 20px);
  font-weight: 700;
}

.empty-state,
.notice {
  grid-column: 1 / -1;
  gap: 8px;
  padding: 28px;
  text-align: center;
  background: #fff;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 14px;
  padding: 24px;
  background: rgba(17,17,17,0.94);
}

.lightbox[hidden] { display: none; }

.lightbox figure {
  margin: 0;
  min-width: 0;
  text-align: center;
}

.lightbox img {
  max-height: 82vh;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
}

.lightbox figcaption {
  margin-top: 12px;
  color: rgba(255,255,255,0.78);
  overflow-wrap: anywhere;
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  width: 54px;
  height: 54px;
  font-size: 2.7rem;
}

@media (max-width: 900px) {
  .gallery-topbar,
  .hero-panel,
  .featured-random {
    grid-template-columns: 1fr;
  }

  .gallery-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-row { grid-template-columns: repeat(auto-fit, minmax(150px, 190px)); }

  .featured-image { min-height: 220px; }
}

@media (max-width: 620px) {
  .gallery-shell { width: min(100% - 24px, 1440px); }
  .metric-row { grid-template-columns: 1fr; }
  .customer-grid,
  .photo-grid,
  .folder-grid { grid-template-columns: 1fr; }
  .lightbox {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    padding: 14px;
  }
  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 2rem;
  }
}
