/* ═══════════════════════════════════════════════
   GALLERY PAGE — galleryStyle.css
   F95 Advance Physiotherapy & Research Centre
   Full-Width Portfolio · Glassmorphism · Skeleton Loading
   Companion to indexStyle.css — extends design system
═══════════════════════════════════════════════ */

/* ════════════════════════════════════════
   SCROLL REVEAL
════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════
   QUICK LINKS BAR
════════════════════════════════════════ */
#gallery-quicklinks {
  background: var(--white);
  border-bottom: 1px solid var(--gray-line);
  padding: 14px 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.quicklinks-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quicklinks-inner::-webkit-scrollbar {
  display: none;
}

.quicklinks-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray-mid);
  white-space: nowrap;
  flex-shrink: 0;
}

.quicklinks-pills {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.quicklink-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--gray-soft);
  border: 1.5px solid var(--gray-line);
  color: var(--warm-text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.22s;
  cursor: pointer;
  flex-shrink: 0;
}

.quicklink-pill:hover {
  background: var(--mist);
  border-color: var(--blue);
  color: var(--navy);
  transform: translateY(-1px);
}

.quicklink-pill.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.quicklink-pill.active .pill-dot {
  background: var(--blue);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-mid);
  flex-shrink: 0;
  transition: background 0.22s;
}

.quicklink-pill:hover .pill-dot {
  background: var(--blue);
}

/* ════════════════════════════════════════
   GALLERY PAGE LAYOUT — Full-width, single column
   max-width: 1320px, centred with auto margins
════════════════════════════════════════ */
#gallery-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── MAIN CONTENT ─────────────────────── */
#gallery-main {
  padding: 48px 0 80px;
}

/* ════════════════════════════════════════
   EVENT SECTION
════════════════════════════════════════ */
.gallery-event {
  margin-bottom: 96px;
}

.gallery-event:last-child {
  margin-bottom: 0;
}

/* ════════════════════════════════════════
   GLASSMORPHIC EVENT HEADER
   Vertically slim — keeps total height under 60px
   Sticky below nav + quicklinks bar
════════════════════════════════════════ */
.glass-header {
  position: sticky;
  top: calc(var(--nav-h) + 53px); /* nav + quicklinks bar height */
  z-index: 80;
  margin-bottom: 24px;

  /* Glassmorphism — enhanced blur per spec */
  background: rgba(225, 245, 254, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);

  border: none;
  border-bottom: 1px solid rgba(197, 234, 251, 0.8);
  border-radius: var(--radius-lg);
  box-shadow:
    0 2px 16px rgba(10, 35, 81, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);

  overflow: hidden;
  transition: box-shadow 0.3s;
}

/* Decorative navy-to-blue left-bar */
.glass-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--navy), var(--blue));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* Elevated shadow when pinned / images scroll beneath */
.glass-header.is-pinned {
  border-radius: var(--radius);
  box-shadow:
    0 6px 28px rgba(10, 35, 81, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ── Inner padding: slim on desktop ─────── */
.event-header-inner {
  padding: 10px 28px 10px 32px;
  position: relative;
  /* Use flex row so meta + title sit side-by-side, keeping height minimal */
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ── Meta row (tag + year) ───────────────── */
.event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.event-tag {
  display: inline-flex;
  align-items: center;
  background: var(--navy);
  color: var(--blue);
  font-family: 'Nunito', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.event-year {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-mid);
  letter-spacing: 0.06em;
}

/* ── Title: tight sizing to keep header under 60px ── */
.event-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;          /* constrained on large screens */
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;        /* tight line-height */
  flex: 1;
  min-width: 0;
}

/* ── Desc + Stats: hidden inside sticky header on desktop ──
   They're part of the HTML for SEO & accessibility, but
   visually tucked away to keep the header slim.
   They re-appear on tablet/mobile where space isn't tight. */
.glass-header .event-desc,
.glass-header .event-stats {
  display: none;
}

/* ── Desc + Stats: shown in a detail band below the grid ── */
.event-detail-band {
  display: none; /* reserved for future enhancement */
}

/* ════════════════════════════════════════
   PHOTO GRID
   Desktop:  4 columns (masonry spans)
   Tablet:   3 columns
   Mobile:   1 column
════════════════════════════════════════ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  grid-auto-rows: 220px;
}

/* Wide item spans 2 columns — dynamic masonry feel */
.gallery-item--wide {
  grid-column: span 2;
}

/* Tall item spans 2 rows */
.gallery-item--tall {
  grid-row: span 2;
}

/* ── Individual photo card ─────────────── */
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.32s ease;
}

.gallery-item:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

/* ── The actual photo ──────────────────── */
.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.5s ease;
  transform: scale(1.04);
}

.gallery-img.loaded {
  opacity: 1;
  transform: scale(1.0);
}

/* ════════════════════════════════════════
   SKELETON LOADING — shimmer wireframe
════════════════════════════════════════ */
.skeleton-box {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #e8edf2 0%,
    #f0f4f8 40%,
    #e8edf2 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: inherit;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.gallery-item.img-loaded .skeleton-box {
  opacity: 0;
  pointer-events: none;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ════════════════════════════════════════
   PHOTO OVERLAY — description on hover
════════════════════════════════════════ */
.gallery-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  padding: 20px 16px;
  background: linear-gradient(
    to top,
    rgba(10, 35, 81, 0.90) 0%,
    rgba(10, 35, 81, 0.55) 45%,
    transparent 75%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-within .gallery-overlay {
  opacity: 1;
}

.gallery-overlay p {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(6px);
  transition: transform 0.3s ease 0.05s;
}

.gallery-item:hover .gallery-overlay p {
  transform: translateY(0);
}

/* Touch devices: toggled by JS */
.gallery-item.overlay-visible .gallery-overlay {
  opacity: 1;
}

/* ════════════════════════════════════════
   STORY BOX — Full-width CTA above footer
   Always visible on all screen sizes
════════════════════════════════════════ */
.gallery-story-box {
  max-width: 1320px;
  margin: 72px auto 80px;
  padding: 0 32px;
}

.gallery-story-box-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding: 48px 56px;
  background: var(--mist);
  border-left: 5px solid var(--blue);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  border-top: 1px solid var(--mist-deep);
  border-bottom: 1px solid var(--mist-deep);
  border-right: 1px solid var(--mist-deep);
  position: relative;
  overflow: hidden;
}

/* Decorative watermark */
.gallery-story-box-inner::before {
  content: '+';
  position: absolute;
  right: 40px;
  top: -16px;
  font-size: 9rem;
  font-family: 'Playfair Display', serif;
  color: rgba(0, 174, 239, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.story-box-content {
  flex: 1;
  min-width: 260px;
}

.story-box-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
  margin-bottom: 10px;
}

.story-box-question {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 600;
  font-style: italic;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 10px;
}

.story-box-question em {
  color: var(--blue);
  font-style: normal;
}

.story-box-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--warm-text);
  line-height: 1.65;
  max-width: 560px;
}

.story-box-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Outline secondary button — mirrors index design system */
.btn-secondary-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 2px solid var(--navy);
  color: var(--navy);
  background: transparent;
  text-decoration: none;
  transition: all 0.22s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-secondary-outline:hover {
  background: var(--navy);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ════════════════════════════════════════
   FOOTER SOCIAL
════════════════════════════════════════ */
.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-social-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

.footer-social-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.25s;
  text-decoration: none;
}

.footer-social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-social-link:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.15);
}

.footer-social-link--facebook:hover  { background: #1877F2; border-color: #1877F2; color: white; }
.footer-social-link--instagram:hover { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); border-color: transparent; color: white; }
.footer-social-link--youtube:hover   { background: #FF0000; border-color: #FF0000; color: white; }
.footer-social-link--linkedin:hover  { background: #0A66C2; border-color: #0A66C2; color: white; }
.footer-social-link--x:hover         { background: #000000; border-color: #000000; color: white; }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET (≤1100px)
   Switch grid to 3 columns
════════════════════════════════════════ */
@media (max-width: 1100px) {

  #gallery-layout {
    padding: 0 24px;
  }

  #gallery-main {
    padding: 36px 0 64px;
  }

  /* 3-col grid on tablet */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    gap: 13px;
  }

  /* Glass header: full-width sticky on tablet */
  .glass-header {
    top: calc(var(--nav-h) + 53px);
    border-radius: var(--radius);
    margin-bottom: 20px;
  }

  /* Compact inner padding on tablet */
  .event-header-inner {
    padding: 10px 20px 10px 22px;
    gap: 14px;
  }

  .gallery-story-box {
    padding: 0 24px;
    margin: 56px auto 64px;
  }

  .gallery-story-box-inner {
    padding: 40px 40px;
  }
}

/* ════════════════════════════════════════
   RESPONSIVE — LARGE TABLET / SMALL DESKTOP (≤900px)
════════════════════════════════════════ */
@media (max-width: 900px) {

  .event-header-inner {
    flex-direction: row;
    align-items: center;
  }

  .event-title {
    font-size: 0.95rem;
  }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE (≤700px)
   Single column grid
════════════════════════════════════════ */
@media (max-width: 700px) {

  /* Quick links horizontal scroll */
  #gallery-quicklinks {
    top: var(--nav-h);
  }

  .quicklinks-inner {
    padding: 0 16px;
    gap: 10px;
  }

  .quicklink-pill {
    font-size: 0.75rem;
    padding: 6px 13px;
  }

  #gallery-layout {
    padding: 0 14px;
  }

  #gallery-main {
    padding: 22px 0 48px;
  }

  /* 1-column grid on mobile */
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 230px;
    gap: 10px;
  }

  /* Cancel masonry spans — every item is a single cell */
  .gallery-item--wide,
  .gallery-item--tall {
    grid-column: auto;
    grid-row: auto;
  }

  /* Sticky glass header on mobile */
  .glass-header {
    top: calc(var(--nav-h) + 48px);
    border-radius: var(--radius);
    margin-bottom: 14px;
  }

  .glass-header::before {
    width: 3px;
  }

  .event-header-inner {
    padding: 9px 14px 9px 18px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .event-title {
    font-size: 0.88rem;
    line-height: 1.15;
  }

  .event-tag {
    font-size: 0.6rem;
    padding: 2px 8px;
  }

  .gallery-event {
    margin-bottom: 52px;
  }

  /* Touch: overlay slightly visible */
  .gallery-overlay {
    opacity: 0.85;
  }

  .gallery-overlay p {
    transform: translateY(0);
    font-size: 0.78rem;
  }

  /* Story box: mobile layout */
  .gallery-story-box {
    padding: 0 14px;
    margin: 40px auto 52px;
  }

  .gallery-story-box-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 24px 28px 28px;
  }

  .story-box-actions {
    width: 100%;
  }

  .story-box-actions .btn,
  .story-box-actions .btn-secondary-outline {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

/* ════════════════════════════════════════
   ACCESSIBILITY
════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .skeleton-box {
    animation: none;
    background: #e8edf2;
  }

  .gallery-item {
    transition: none;
  }

  .gallery-img {
    transition: opacity 0.3s ease;
  }

  .reveal {
    transition: none;
  }
}
