/* =========================================================
   photo-gallery.css – CSS cho phần NỘI DUNG trang
   "Photography Portfolio / Our photo gallery"
   (không gồm navigation / footer)

   Mọi class có tiền tố .pg- và mọi biến màu/font nằm trong .pg
   nên không ảnh hưởng tới các trang khác của website.
   Bộ lọc (All projects / Pre-wedding / ...) chạy bằng CSS thuần,
   không cần JavaScript.
   ========================================================= */

/* =========================================================
   1. TOKENS + RESET NHẸ
   ========================================================= */
.pg {
  --green:    #244336;
  --ink:      #141414;
  --muted:    #766d66;
  --line:     rgba(20, 20, 20, 0.12);
  --bg-page:  #f8f5f1;   /* nền khu vực ảnh */
  --bg-light: #faf7f4;   /* nền phần tiêu đề */
  --bg-bar:   #f7f4f0;   /* nền thanh lọc */

  --font-ui:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bodoni Moda", "Playfair Display", "Didot", "Times New Roman", serif; /* Playfair bù glyph tiếng Việt */

  position: relative;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* specificity 0 để không đè các style bên dưới */
:where(.pg) *,
:where(.pg) *::before,
:where(.pg) *::after { box-sizing: border-box; }

:where(.pg) :is(h1, p, figure, ul) { margin: 0; }
:where(.pg) ul { padding: 0; list-style: none; }
:where(.pg) a { color: inherit; text-decoration: none; }
:where(.pg) a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.pg-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(20px, 3vw, 40px);
}

/* =========================================================
   2. PHẦN TIÊU ĐỀ
   ========================================================= */
.pg-hero {
  padding: 40px 0 56px;
  text-align: center;
  background: var(--bg-light);
}
@media (min-width: 1024px) {
  .pg-hero { padding: 48px 0 68px; }
}

.pg-eyebrow {
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.pg-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
}
.pg-title em {
  font-style: italic;
  text-transform: none;
}

.pg-lead {
  max-width: 780px;
  margin: 22px auto 0;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--muted);
  text-wrap: pretty;
}
@media (min-width: 1024px) {
  .pg-lead { font-size: 17px; }
}

/* =========================================================
   3. THANH LỌC (radio ẩn + label dạng nút)
   ========================================================= */
/* Radio ẩn khỏi mắt nhưng vẫn focus được bằng bàn phím */
.pg-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pg-filterbar {
  padding: 24px 0;
  background: var(--bg-bar);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1024px) {
  .pg-filterbar { padding: 32px 0; }
}

.pg-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pg-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #e4dfd8;
  border-radius: 8px;
  background: var(--bg-light);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6d645c;
  cursor: pointer;
  user-select: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.pg-chip:hover { border-color: var(--green); color: var(--green); }

/* Nút đang chọn */
#pg-f-all:checked       ~ .pg-filterbar label[for="pg-f-all"],
#pg-f-pre:checked       ~ .pg-filterbar label[for="pg-f-pre"],
#pg-f-ceremony:checked  ~ .pg-filterbar label[for="pg-f-ceremony"],
#pg-f-intimate:checked  ~ .pg-filterbar label[for="pg-f-intimate"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Viền focus khi dùng bàn phím (phím mũi tên đổi giữa các nút) */
#pg-f-all:focus-visible       ~ .pg-filterbar label[for="pg-f-all"],
#pg-f-pre:focus-visible       ~ .pg-filterbar label[for="pg-f-pre"],
#pg-f-ceremony:focus-visible  ~ .pg-filterbar label[for="pg-f-ceremony"],
#pg-f-intimate:focus-visible  ~ .pg-filterbar label[for="pg-f-intimate"] {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Ẩn các ảnh không thuộc nhóm đang chọn (khớp với data-cat trong HTML) */
#pg-f-pre:checked      ~ .pg-gallery .pg-item:not([data-cat="pre-wedding"]),
#pg-f-ceremony:checked ~ .pg-gallery .pg-item:not([data-cat="wedding-ceremony"]),
#pg-f-intimate:checked ~ .pg-gallery .pg-item:not([data-cat="intimate-celebration"]) {
  display: none;
}

/* =========================================================
   4. LƯỚI ẢNH
   ========================================================= */
.pg-gallery { padding: 40px 0 72px; }
@media (min-width: 1024px) {
  .pg-gallery { padding: 64px 0 104px; }
}

.pg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 992px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .pg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}

.pg-item { animation: pg-fade .4s ease both; }
@keyframes pg-fade {
  from { opacity: 0; transform: translateY(6px); }
}

.pg-link {
  display: block;
  overflow: hidden;      /* cắt phần ảnh phóng to khi hover */
}

/* Ảnh thật: <figure class="pg-media"><img src="..." alt="..."></figure> */
.pg-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--ph, #8b8983);
  transition: transform .6s ease;
}
.pg-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pg-link:hover .pg-media { transform: scale(1.04); }

/* Màu giữ chỗ – xoá khi đã có ảnh thật */
.pg-ph-a { --ph: linear-gradient(160deg, #3d5233, #8f9a7d 55%, #b58d6b); }
.pg-ph-b { --ph: linear-gradient(180deg, #d9dcdf, #8f8f8a 60%, #2b2b2b); }
.pg-ph-c { --ph: linear-gradient(160deg, #3a1c17, #6a2f2a 60%, #1c1210); }
.pg-ph-d { --ph: linear-gradient(160deg, #6e2a34, #c98b8e 60%, #e7d3cb); }
.pg-ph-e { --ph: linear-gradient(180deg, #6f746b, #2a3128); }
.pg-ph-f { --ph: linear-gradient(180deg, #8a938a, #3f5a3a); }
.pg-ph-g { --ph: linear-gradient(160deg, #4b4a44, #a8a29a); }
.pg-ph-h { --ph: linear-gradient(160deg, #e7b7c4, #f4dfe2); }

/* =========================================================
   5. GIẢM CHUYỂN ĐỘNG
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .pg-item { animation: none; }
  .pg-media,
  .pg-chip { transition: none; }
}
