/* ==========================
   Root Variables & Reset
========================== */
:root {
  --sidebar-w: 120px;
  --icon-size: 56px;
  --icon-font: 22px;
  --gap: 6px;
  --topbar-h: 120px;
  --accent-color: #ff4757;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', 'Roboto', Arial, sans-serif;
  background: #0f0f10;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p { margin: 15px 0; line-height: 1.75; }
h2 { margin: 20px 0 0; }
ul { margin: 15px 0 15px 30px; }
ul li { line-height: 1.75; }



/* Hero Header above Swiper */
.hero-header {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: auto;
}

/* AP Logo — larger circle */
.hero-logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.hero-logo:hover,
.hero-logo:focus {
  transform: scale(1.08);
  box-shadow: 0 8px 22px rgba(0,0,0,0.55);
  outline: none;
}

/* Navigation links top-right */
.hero-nav {
  display: flex;
  gap: 12px;
}

.hero-link {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s;
}
.hero-link:hover,
.hero-link:focus {
  background: #fff;
  color: #000;
  transform: scale(1.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  outline: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-header {
    top: 16px;
    left: 16px;
    right: 16px;
  }
  .hero-logo { width: 72px; height: 72px; font-size: 24px; }
  .hero-link { width: 48px; height: 48px; font-size: 20px; }
}

/* ==========================
   Sidebar Navigation
========================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
  gap: 18px;
  z-index: 1200;
}

.sidebar .logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #fff;
  text-decoration: none;
  margin-bottom: 18px;
  cursor: pointer;
}

.sidebar .logo-text {
  font-weight: 700;
  font-size: 40px;
  user-select: none;
}

.sidebar .nav-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.sidebar .nav-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 0;
  cursor: pointer;
}

.sidebar .nav-link .icon {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: var(--icon-font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.2s, filter 0.2s;
}

.sidebar .nav-link.active .icon {
  background: #fff;
  color: #000;
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.7);
  animation: pulse 2s infinite ease-in-out;
}

.sidebar .nav-link.active-parent .icon {
  background: #ccc;
  color: #000;
  transform: scale(1.1);
}

.sidebar .nav-link .icon:hover,
.sidebar .nav-link .icon:focus {
  background: #fff;
  color: #000;
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
  outline: none;
}

@keyframes pulse {
  0%,100% { transform: scale(1.15); box-shadow: 0 6px 16px rgba(0,0,0,0.7); }
  50% { transform: scale(1.18); box-shadow: 0 8px 20px rgba(0,0,0,0.8); }
}

/* ==========================
   Main Content / Gallery
========================== */
.main {
  margin-left: var(--sidebar-w);
  width: calc(100vw - var(--sidebar-w));
  min-height: 100vh;
  overflow: hidden;
}

.gallery-wrap {
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}


/* ==========================
   Gallery Grid (3-2-1 Responsive)
========================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 320px;
  gap: var(--gap);
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 280px;
  }
}

@media (max-width: 600px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
}

/* Gallery items */
.gallery-item {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.25s ease;
}
.gallery-item.loaded { opacity: 1; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
@media (hover:hover) and (pointer:fine) {
  .gallery-item:hover img { transform: scale(1.05); }
}

/* ===== Overlay (caption) ===== */
.overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(.2,.9,.2,1), opacity 0.28s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 16px;
  line-height: 1.4;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  will-change: transform, opacity;
}
.overlay h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.overlay p {
  font-size: 14px;
  margin: 0;
  opacity: 0.92;
  max-width: 92%;
  line-height: 1.45;
  font-weight: 400;
  text-wrap: balance;
}

/* overlay icons row — circular buttons */
.overlay-icons {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.overlay-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s;
}
.overlay-icon:focus,
.overlay-icon:hover {
  background: #fff;
  color: #000;
  transform: scale(1.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  outline: none;
}

/* show overlay on hover for pointer devices */
@media (hover:hover) and (pointer:fine) {
  .gallery-item:hover .overlay {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== Badges — multi-image / PDF ===== */
.badge-animated {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.98);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  padding: 10px 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.55);
  letter-spacing: 0.02em;
  z-index: 60;
  transition: box-shadow 0.18s ease, transform 0.35s cubic-bezier(.2,.9,.2,1), opacity 0.25s ease;
  will-change: transform, opacity;
}

/* Visible via JS */
.badge-animated.visible {
  opacity: 1;
  pointer-events: auto;
  animation: badge-entry 0.8s ease-out both;
}

/* Hover pulse */
.gallery-item:hover .badge-animated {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: auto;
  animation: badge-pulse 1.6s infinite ease-in-out;
}

.badge-animated:focus {
  transform: scale(1.12);
  box-shadow: 0 8px 22px rgba(255,255,255,0.06);
  outline: none;
}

@keyframes badge-entry {
  0% { opacity: 0; transform: scale(0.6) translateY(10px); }
  60% { opacity: 1; transform: scale(1.15) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes badge-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 3px 10px rgba(0,0,0,0.45); }
  50%     { transform: scale(1.15); box-shadow: 0 6px 18px rgba(255,255,255,0.12); }
}

/* stacked multiple badges */
.gallery-item .badge-animated + .badge-animated {
  top: 12px;
  right: calc(12px + 60px);
}

/* ==========================
   Modal Base
========================== */
.modal {
  visibility: hidden;
  /* opacity: 0; */
  position: fixed;
  inset: 0;
  /* background: rgba(0,0,0,0.95); */
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.show { visibility: visible; opacity: 1; }

.modal-inner {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}





.modal-bg {
  position: absolute;
  inset: 0;
  z-index: 0;

  background-size: cover;
  background-position: center;

  transform: scale(1.2); /* prevents edge blur gaps */
  filter: blur(40px);
  /* opacity: 0.35; */

  /* transition: background-image 0.35s ease, opacity 0.35s ease; */
}

/* dark overlay for contrast */
.modal-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /*background: rgba(0,0,0,0.55);*/
}

/* ensure main image sits above */
#modalImage {
  position: relative;
  z-index: 2;
}

/* ensure modal content stays above bg */
.modal-inner {
  position: relative;
  overflow: hidden;
}





#modalImage,
.modal-inner img,
.modal-inner embed {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  z-index: 10;
  margin: auto;
}

/* Close button */
#modalClose {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.2s;
}
#modalClose:hover,
#modalClose:focus {
  background: #fff; color: #000; transform: scale(1.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  outline: none;
}

/* Top-right icon links */
.modal-top-right {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 12px;
  z-index: 2200;
}
.modal-top-right .icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s;
}
.modal-top-right .icon:hover,
.modal-top-right .icon:focus {
  background: #fff; color: #000; transform: scale(1.12);
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
  outline: none;
}

/* Prev / Next Buttons */
#modalPrev,
#modalNext {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2100;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.2s;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
#modalPrev { left: 18px; }
#modalNext { right: 18px; }
#modalPrev:hover, #modalPrev:focus,
#modalNext:hover, #modalNext:focus {
  background: #fff; color: #000;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 8px 22px rgba(0,0,0,0.6);
  outline: none;
}

/* Modal Caption & Pagination */
.modal-caption {
  position: absolute;
  bottom: 22px;
  right: 22px;
  max-width: 40%;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 14px 18px;
  border-radius: 8px;
  text-align: right;
  z-index: 2000;
}
.modal-caption h2 { font-size: 22px; margin: 0 0 6px 0; font-weight: 700; }
.modal-caption p { font-size: 15px; margin: 0; opacity: 0.95; }
.modal-pagination { margin-top: 8px; font-size: 13px; color: #ccc; }

/* Modal Thumbnails (vertical stack) */
.modal-thumbnails {
  position: absolute;
  bottom: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(18,18,18,0.9);
  padding: 8px;
  border-radius: 8px;
  z-index: 2000;
}
.modal-thumbnails img {
  width: 84px;
  height: 64px;
  object-fit: cover;
  opacity: 0.75;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease, border .18s;
  border: 2px solid transparent;
}
.modal-thumbnails img:hover,
.modal-thumbnails img:focus {
  opacity: 1; transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  border: 2px solid #fff; outline: none;
}
.modal-thumbnails img.current {
  opacity: 1; transform: scale(1.08); border: 3px solid #fff;
}

.modal-bg {
  position: absolute;
  inset: 0;
  z-index: 0;

  background-size: cover;
  background-position: center;

  transform: scale(1.2); /* prevents edge blur gaps */
  filter: blur(40px);
  /*opacity: 0.35;*/

  transition: background-image 0.35s ease, opacity 0.35s ease;
}

/* dark overlay for contrast */
.modal-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /*background: rgba(0,0,0,0.55);*/
}

/* ensure main image sits above */
#modalImage {
  position: relative;
  z-index: 2;
}

/* ensure modal content stays above bg */
.modal-inner {
  position: relative;
  overflow: hidden;
}



/* Carousel caption */
.carousel-caption {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  text-align: center;
  max-width: 30%;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(.2,.8,.2,1), transform 0.6s cubic-bezier(.2,.8,.2,1);
  z-index: 30;
}
.carousel-caption.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.carousel-caption h2 { font-size: 2.2rem; margin: 0 0 .25rem; font-weight: 800; }
.carousel-caption p { font-size: 1.05rem; margin: 0; opacity: 0.95; display: none; }

/* Responsive modal fixes */
/* <= 900px */
@media (max-width: 900px) {
  #modalPrev {
    width: 56px;
    height: 56px;
    font-size: 24px;
    left: 14px;   /* only left */
    top: 50%;
    transform: translateY(-50%);
  }
  #modalNext {
    width: 56px;
    height: 56px;
    font-size: 24px;
    right: 14px;  /* only right */
    top: 50%;
    transform: translateY(-50%);
  }

  .modal-caption { max-width: 52%; bottom: 14px; right: 14px; padding: 12px; }
  .modal-thumbnails { left: 14px; bottom: 14px; padding: 6px; }
}

/* <= 500px */
@media (max-width: 500px) {
  #modalPrev {
    width: 48px;
    height: 48px;
    font-size: 20px;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  #modalNext {
    width: 48px;
    height: 48px;
    font-size: 20px;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }

  #modalClose { width: 44px; height: 44px; font-size: 18px; left: 10px; top: 10px; }
  .modal-top-right { top: 10px; right: 10px; gap: 8px; }
  .modal-caption { max-width: 70%; bottom: 10px; right: 10px; padding: 10px; }
  .modal-thumbnails { left: 10px; bottom: 10px; padding: 6px; flex-direction: row; gap: 6px; }
  .modal-thumbnails img { width: 60px; height: 44px; }
}

/* ==========================
   FEATURED SWIPER (BULLETPROOF MOBILE-FIRST)
========================== */

.featured-swiper {
  position: relative;
  width: 100%;
  height: 100vh;   /* fallback */
  height: 100dvh;  /* modern mobile fix */
  height: 100svh;  /* iOS Safari safe fallback */
  overflow: hidden;
  background: #000;

  /* prevent mobile gesture weirdness */
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* Swiper base structure MUST inherit height */
.featured-swiper .swiper-wrapper {
  height: 100%;
}

.featured-swiper .swiper-slide {
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* inner wrapper (if you use one) */
.featured-swiper .slide-inner {
  width: 100%;
  height: 100%;
  display: flex;
}

/* image must fully cover slide */
.featured-swiper .swiper-slide img,
.featured-swiper .slide-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.slide-inner.zoom-layer {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide-inner.zoom-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 6s ease;
}

/* ONLY active slide zoom */
.swiper-slide-active .zoom-layer img {
  transform: scale(1.08);
}

/* Optional: only desktop zoom effect */
@media (min-width: 769px) {
  .featured-swiper .swiper-slide-active img {
    transform: scale(1.08);
    transition: transform 6s ease;
  }
}

/* ==========================
   SAFE AREA FIX (iOS NOTCH)
========================== */
@supports (padding: env(safe-area-inset-top)) {
  .featured-swiper {
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

/* ==========================
   CAPTION (CENTERED + MOBILE SAFE)
========================== */
.featured-swiper .carousel-caption {
  position: absolute;
  left: 50%;
  bottom: max(14%, 90px);
  transform: translateX(-50%) translateY(20px);

  width: min(92%, 720px);
  text-align: center;

  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 20px 22px;
  border-radius: 10px;

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.6s cubic-bezier(.2,.8,.2,1),
    transform 0.6s cubic-bezier(.2,.8,.2,1);

  z-index: 30;
}

/* ONLY JS controls this */
.featured-swiper .carousel-caption.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* .featured-swiper .swiper-slide-active .carousel-caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
*/

/* responsive typography */
.featured-swiper .carousel-caption h2 {
  font-size: clamp(22px, 4vw, 44px);
  margin: 0 0 6px;
  line-height: 1.15;
}

.featured-swiper .carousel-caption p {
  font-size: clamp(13px, 2vw, 18px);
  margin: 0;
  opacity: 0.9;
}

/* ==========================
   NAVIGATION ARROWS (MOBILE FIRST)
========================== */

.featured-swiper .swiper-prev,
.featured-swiper .swiper-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(1);

  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 50;
  cursor: pointer;

  transition: transform 0.2s ease, background 0.2s ease;
  will-change: transform;
}

/* desktop spacing */
@media (min-width: 769px) {
  .featured-swiper .swiper-prev { left: 24px; }
  .featured-swiper .swiper-next { right: 24px; }
}

/* mobile spacing */
@media (max-width: 768px) {
  .featured-swiper .swiper-prev { left: 12px; }
  .featured-swiper .swiper-next { right: 12px; }

  .featured-swiper .swiper-prev,
  .featured-swiper .swiper-next {
    top: auto;
    bottom: 16px;
    transform: none;
  }
}

/* hover only for non-touch */
@media (hover: hover) and (pointer: fine) {
  .featured-swiper .swiper-prev:hover,
  .featured-swiper .swiper-next:hover {
    transform: translateY(-50%) scale(1.12);
    background: #000;
  }
}

/* ==========================
   PAGINATION (CLEAN MOBILE)
========================== */

.featured-swiper .swiper-pagination {
  bottom: 16px;
}

.featured-swiper .swiper-pagination-bullet {
  background: rgba(255,255,255,0.6);
  opacity: 0.7;
}

.featured-swiper .swiper-pagination-bullet-active {
  background: #fff;
  transform: scale(1.3);
}









/* Scroll Button */
.scroll-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 54px;
  height: 54px;
  background: rgba(0,0,0,0.95);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 1250;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s;
  box-shadow: 0 8px 26px rgba(0,0,0,0.6);
}
.scroll-btn:hover,
.scroll-btn:focus {
  background: #fff; color: #000; transform: scale(1.08);
  outline: none;
}

/* ==========================
   Category Filter (desktop & mobile safe)
========================== */
.category-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  color: #000;
  font-size: 15px;
  margin: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  z-index: 1100;
}
.category-filter i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #000; color: #fff; font-size: 14px;
}
.category-filter select {
  border: none;
  background: transparent;
  font-size: 15px;
  color: #000;
  outline: none;
  cursor: pointer;
}

/* Mobile: full-width comfortably */
@media (max-width: 768px) {
  .category-filter {
    width: calc(100% - 28px);
    margin: 10px 14px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ==========================
   Page Title tweaks
========================== */
.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 800;
  margin-bottom: 18px;
  color: #fff;
}
.page-title .icon-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff; color: #000;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
}

/* ==========================
   Contact Form – Modernized
========================== */
.contact-page {
  max-width: 720px;
  width: 100%;
  margin: 15px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: rgba(20, 20, 20, 0.95);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-page:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.65);
}

.contact-page label {
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}

.contact-page input,
.contact-page textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #ededed;
  color: #000000;
  font-size: 20px;
  transition: all 0.22s ease;
  outline: none;
  margin: 15px 0 0 0;
}

.contact-page input:focus,
.contact-page textarea:focus {
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.3);
  background: #ffffff;
}

.contact-page textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-page .btn-submit {
  align-self: flex-start;
  padding: 14px 28px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #ffffff;
  color: #000000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-page .btn-submit:hover,
.contact-page .btn-submit:focus {
  transform: translateY(-2px) scale(1.02);
  outline: none;
}

/* Flash Messages – Modernized */
.flash {
  width: 100%;
  padding: 14px 18px;
  border-radius: 0;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  text-align: center;
}

.flash.success {
  background: #28a745;
  color: #fff;
}

.flash.error {
  background:#d64545;
  color: #fff;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .contact-page { padding: 24px; gap: 18px; }
  .contact-page .btn-submit { width: 100%; text-align: center; }
  .contact-page textarea { min-height: 120px; }
}

@media (max-width: 500px) {
  .contact-page { padding: 18px; gap: 14px; }
  .contact-page label { font-size: 15px; }
  .contact-page input,
  .contact-page textarea { padding: 12px 14px; font-size: 14px; }
  .contact-page .btn-submit { padding: 12px 20px; font-size: 16px; }
}


/* ==========================
   About / Skills Page Grid
========================== */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding: 24px 0;
}
.page-grid-item {
  background: rgba(40,40,40,0.96);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.page-grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.55);
}
.page-grid-item i {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 10px;
}
.page-grid-item h3 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.page-grid-item p {
  font-size: 16px;
  color: #ccc;
  line-height: 1.55;
  margin: 0;
}

/* Tablet & mobile adjustments */
@media (max-width: 768px) {
  .page-grid { gap: 14px; padding: 16px 0; }
  .page-grid-item { padding: 16px; }
  .page-grid-item h3 { font-size: 20px; }
  .page-grid-item p { font-size: 15px; }
}

/* ==========================
   Accessibility & Utility Helpers
========================== */
/* Hide visually but keep screen reader readable */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Smooth fade-in for lazy-loaded sections */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Generic overlay shade for future use */
.overlay-dark {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
}

/* ==========================
   Footer / Legal
========================== */
footer {
  text-align: center;
  font-size: 14px;
  color: #999;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ==========================
   Mobile Layout Adjustments
========================== */
@media (max-width: 768px) {
  /* Sidebar becomes top stacked */
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: column;
    padding: 16px 0;
    gap: 12px;
    display: flex;
    align-items: center;
  }

  /* Logo centered at top */
  .sidebar .logo-link {
    margin-bottom: 12px;
  }

  /* Nav links stacked under logo */
  .sidebar .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: auto;
  }

  .sidebar .nav-link {
    width: auto;
    padding: 6px 10px;
  }

/* Mobile: stacked, full-width category filter */
  .category-filter {
    width: 100%;
    margin: 12px 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: nowrap;
  }

  .category-filter i {
    flex-shrink: 0; /* icon stays fixed size */
  }

  .category-filter label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .category-filter select {
    flex: 1;
    min-width: 0;          /* prevent overflow of flex container */
    white-space: nowrap;   
    overflow-x: auto;      /* allow horizontal scroll for long text */
    text-overflow: ellipsis;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
  }

  .category-filter select::-webkit-scrollbar {
    height: 4px;
  }
  .category-filter select::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
  }


  /* Main content (gallery) full width under stacked header */
  .main {
    margin-left: 0;
    width: 100%;
    padding: 0 12px 24px 12px;
  }
  
  /* Optional: adjust gallery gaps for smaller screens */
  .gallery {
    gap: 8px;
  }
}

/* =========================
   ADMIN DASHBOARD
========================= */
#admin-header {
  padding: 20px;
  background-color: #000000;
  color: #fff;
  text-align: center;
}
#admin-header a {
  color: #fff;
  text-decoration: underline;
}
#admin-header h2 {
  margin: 5px 0 15px 0;
  font-size: 24px;
  font-weight: 700;
}
#admin-header hr {
  margin: 15px auto;
  border: 1px solid #fff;
}

/* =========================
   CONTAINER
========================= */
#list {
  max-width: 1100px;
  margin: auto;
  font-family: system-ui;
  background-color: #ededed;
  color: #000;
}

/* =========================
   PROJECT BLOCK
========================= */
.item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}

/* =========================
   TOP ROW
========================= */
.row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}

.drag {
  cursor: grab;
}

.index {
  color: #999;
  width: 24px;
}

.file {
  font-weight: 600;
  flex: 1;
}

.cms-item {
  border: 1px solid #ddd;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.cms-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f5f5f5;
  cursor: grab;
}

.cms-header .meta {
  flex: 1;
}

.cms-header .toggle {
  margin-left: auto;
}

.cms-body {
  display: none;
  padding: 12px;
}

.cms-item.open .cms-body {
  display: block;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

textarea {
  width: 100%;
  margin-top: 10px;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.img-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.drag {
  cursor: grab;
}

.dragging {
  opacity: 0.4;
}

/* =========================
   FIELDS
========================= */
.row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.desc-input {
  width: 100%;
  min-height: 60px;
  margin-bottom: 8px;
}

/* =========================
   IMAGE GRID (KEY FIX)
========================= */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

/* =========================
   IMAGE CARD
========================= */
.img-card {
  border: 1px solid #eee;
  padding: 6px;
  border-radius: 6px;
  background: #fafafa;
}

.img-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
  margin-bottom: 4px;
  border-radius: 4px;
}

.img-card input {
  width: 100%;
  font-size: 11px;
  margin-bottom: 4px;
  padding: 4px;
}

/* =========================
   FEATURED
========================= */
.featured {
  font-size: 12px;
}

#featured-panel {
  padding: 10px;
  border-bottom: 10px solid #000000;
  background: #fafafa;
  color: #000;
}

#featured-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}

.featured-item {
  min-width: 120px;
  border: 1px solid #ccc;
  background: #fff;
  padding: 5px;
  cursor: grab;
}

.featured-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

.featured-item small {
  display: block;
  text-align: center;
  margin-top: 4px;
}

.featured-remove {
  display: block;
  text-align: center;
  font-size: 11px;
  color: red;
  cursor: pointer;
}

/* ===== End of Master CSS ===== */