/* ========================================
   GALLERY PAGE (/gallery) - DR PATHIK
   Sab class "pg-" se shuru hoti hain (sootradhar.css ki .gal* se takraav nahi).
   Photo kahin se kategi nahi: sab jagah asli ratio ya object-fit: contain.
   ======================================== */

.pg {
  --g-ink: #30271F;
  --g-head: #493321;
  --g-muted: #6B5846;
  --g-border: #E0D0B8;
  --g-accent: #805633;
  --g-soft: #F0E4D2;
  width: min(calc(100% - 36px), 1380px);
  margin: auto;
  padding: 24px 0 68px;
  color: var(--g-ink);
  font: 15px/1.6 var(--font-body, 'Inter', sans-serif);
}
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg button { font: inherit; cursor: pointer; }
.pg :focus-visible { outline: 2px solid var(--g-accent); outline-offset: 3px; }

/* ---------- hero ---------- */
.pg-hero {
  position: relative;
  overflow: hidden;
  margin: 4px 0 26px;
  padding: 30px 38px 25px;
  border: 1px solid var(--g-border);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 93% 12%, rgba(128, 86, 51, .13), transparent 36%),
    linear-gradient(120deg, #fffdf9, #f5ecdf);
  box-shadow: 0 12px 35px rgba(73, 51, 33, .06);
}
.pg-eyebrow { display: inline-block; color: var(--g-accent); font-size: .7rem; letter-spacing: .18em; font-weight: 800; }
.pg-hero h1 {
  margin: 5px 0 8px;
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  color: var(--g-head);
}
.pg-hero > p { margin: 0; color: var(--g-muted); }
.pg-hero .pg-stats { margin-top: 12px; font-size: .86rem; }
.pg-stats strong { color: var(--g-head); }
.pg-stats span { padding: 0 6px; color: #b99b79; }

/* ---------- sabse nayi photo (featured) ---------- */
.pg-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 0;
  margin-bottom: 38px;
  border: 1px solid var(--g-border);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, #fffdf9, #f5ead9);
  box-shadow: 0 16px 40px rgba(73, 51, 33, .10);
}
.pg-feature__media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 18px;
  border: 0;
  overflow: hidden;
  background: #2b1f16;
  cursor: zoom-in;
}
/* peeche usi photo ka dhundhla roop -- photo ke aaspaas khaali jagah sundar bhari rehti hai */
.pg-feature__bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(.62);
  transform: scale(1.1);
}
.pg-feature__media img {
  position: relative;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 620px);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}
.pg-feature__info { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 34px 32px; }
.pg-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--g-head);
  color: #f8ead4;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.pg-feature__info h2 {
  margin: 8px 0 0;
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  color: var(--g-head);
  overflow-wrap: anywhere;
}
.pg-date { margin: 0 0 14px; color: var(--g-muted); font-size: .9rem; }
.pg-btn {
  display: inline-block;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--g-head);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.pg-btn:hover { background: var(--g-accent); }

/* ---------- mahine ke section ---------- */
.pg-month { margin-bottom: 34px; }
.pg-month__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--g-border);
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 1.35rem;
  color: var(--g-head);
}
.pg-month__title span { font: 600 .78rem var(--font-body, 'Inter', sans-serif); color: var(--g-muted); letter-spacing: .04em; }

/* ---------- photo grid: masonry, har photo apne asli ratio me (kati nahi) ---------- */
.pg-grid { list-style: none; margin: 0; padding: 0; columns: 4; column-gap: 16px; }
.pg-item { break-inside: avoid; margin: 0 0 16px; }

.pg-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--g-soft);
  cursor: zoom-in;
  box-shadow: 0 8px 22px rgba(73, 51, 33, .10);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pg-card img { display: block; width: 100%; height: auto; }
.pg-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(73, 51, 33, .20); }

.pg-new {
  position: absolute;
  top: 10px; left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(73, 51, 33, .88);
  color: #f8ead4;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.pg-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 36px 14px 12px;
  text-align: left;
  color: #fff8ee;
  font-size: .85rem;
  line-height: 1.4;
  background: linear-gradient(to top, rgba(30, 20, 12, .8), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.pg-card:hover .pg-cap, .pg-card:focus-visible .pg-cap { opacity: 1; transform: none; }
@media (hover: none) { .pg-cap { opacity: 1; transform: none; } }   /* touch: caption hamesha dikhe */

/* ---------- lightbox ---------- */
.pg-lb {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 14, 10, .95);
}
.pg-lb[hidden] { display: none; }
.pg-lb__fig { margin: 0; max-width: min(92vw, 1200px); text-align: center; }
.pg-lb__fig img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 8px; object-fit: contain; }
.pg-lb__fig figcaption { margin-top: 12px; color: var(--g-soft); font-size: .98rem; overflow-wrap: anywhere; }
.pg-lb__fig figcaption small { display: block; margin-top: 4px; color: #b99b79; font-size: .78rem; letter-spacing: .06em; }
.pg-lb__x, .pg-lb__nav {
  position: absolute;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 1.8rem; line-height: 1;
}
.pg-lb__x { top: 14px; right: 14px; }
.pg-lb__nav { top: 50%; transform: translateY(-50%); }
.pg-lb__prev { left: 14px; }
.pg-lb__next { right: 14px; }
.pg-lb button:hover { background: rgba(255, 255, 255, .3); }

/* ---------- khali gallery ---------- */
.pg-empty {
  max-width: 560px;
  margin: 30px auto;
  padding: 44px 28px;
  text-align: center;
  border: 1px dashed var(--g-border);
  border-radius: 20px;
  background: linear-gradient(160deg, #fffdf9, #f5ead9);
}
.pg-empty h2 { margin: 0 0 8px; font-family: var(--font-heading, 'Playfair Display', serif); color: var(--g-head); }
.pg-empty p { margin: 0 0 18px; color: var(--g-muted); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .pg-grid { columns: 3; } }
@media (max-width: 860px) {
  .pg-feature { grid-template-columns: 1fr; }
  .pg-feature__media { min-height: 240px; padding: 14px; }
  .pg-feature__media img { max-height: 60vh; }
  .pg-feature__info { padding: 22px 22px 26px; }
}
@media (max-width: 760px) {
  .pg { width: min(calc(100% - 24px), 1380px); padding-top: 16px; }
  .pg-hero { padding: 24px 20px 20px; border-radius: 18px; }
  .pg-feature { border-radius: 18px; margin-bottom: 28px; }
  .pg-grid { columns: 2; column-gap: 10px; }
  .pg-item { margin-bottom: 10px; }
  .pg-card { border-radius: 10px; }
  .pg-month__title { font-size: 1.15rem; }
  .pg-lb__x, .pg-lb__nav { width: 38px; height: 38px; font-size: 1.5rem; }
  .pg-lb__prev { left: 8px; } .pg-lb__next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-card, .pg-cap { transition: none; }
  .pg-card:hover { transform: none; }
}
