/* Theme variables (align with cart.css) */
:root{
  --bg: #FAF9F6;              /* warm off-white */
  --panel: #FFFFFF;
  --muted: #636363;
  --accent: #D4A373;          /* golden amber */
  --brand: #0056d6;
  --text-on-panel: #1A1A1A;
  --danger: #d9534f;
  --border: #EAE7E2;
  --shadow: 0 10px 24px rgba(0,0,0,0.08);
  --radius: 12px;
}

/* Basic reset */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text-on-panel);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
  display:flex;
  flex-direction:column;
}

/* Header (shared site header styling) */
@import url('https://fonts.googleapis.com/css2?family=Slabo+27px&display=swap');

.slabo-27px-regular{ font-family:"Slabo 27px", serif; font-weight:400; font-style:normal; }

.site-header{
  width:100%;
  position:sticky;
  top:0;
  z-index:60;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(250,249,246,0.95), rgba(250,249,246,0.90));
  border-bottom: 1px solid var(--border);
  color: var(--text-on-panel);
}
.site-header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:14px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

/* Logo */
.logo{ display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; }
.logo-icon{ width:44px; height:44px; object-fit:contain; border-radius:6px; background:linear-gradient(180deg,#fff,#f3f3f3); padding:6px; }
.logo-text .brand{ display:block; font-weight:700; font-size:1.25rem; line-height:1; color:var(--accent); font-family: "Dancing Script", "Kaushan Script", "Lobster", cursive; }
.logo-text .tagline{ display:block; font-size:0.72rem; color:rgba(255,255,255,0.65); margin-top:2px; }

/* Nav */
.main-nav ul{ display:flex; gap:18px; margin:0; padding:0; list-style:none; }
.main-nav a{ color:var(--text-on-panel); text-decoration:none; font-weight:600; padding:6px 8px; border-radius:6px; }
.main-nav a:hover{ color:var(--accent); background: rgba(212,163,115,0.06); }

/* Header actions (search, cart, user) */
.header-actions{ display:flex; align-items:center; gap:12px; }
.search input{
  width:220px; max-width:34vw; padding:8px 10px; border-radius:8px;
  border:1px solid var(--border); background: transparent; color:var(--text-on-panel);
}
.search input::placeholder { color: rgba(255,255,255,0.5); }

.cart-link{ position:relative; display:inline-flex; align-items:center; gap:6px; color:var(--accent); text-decoration:none; padding:6px; border-radius:8px; }
.cart-icon { display:block; color:var(--accent); }
.cart-quantity{
  position:absolute; top:-6px; right:-6px; min-width:20px; height:20px; line-height:18px;
  text-align:center; border-radius:999px; background:var(--danger); color:#fff; font-size:0.75rem; padding:0 6px;
}

/* Page Title (match cart.css sizing) */
.page-title {
  display:flex; flex-direction:column; align-items:center; gap:8px; margin:0 0 20px; text-align:center;
}
.page-title h1{ font-family:"Playfair Display", serif; font-size:2.5rem; margin:0; color:var(--accent); }
.page-title h3{ font-family:"Playfair Display", serif; font-size:1.05rem; margin:0; color:var(--muted); }

/* Gallery layout: 3-up grid on desktop, 2-up tablet, 1-up mobile */
.gallery-grid {
  column-count: 4;
  column-gap: 16px;
  padding: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Each item flows into the column layout and sizes to the image */
.gallery-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  overflow: visible;
  border-radius: 12px;
  position: relative;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .28s ease, box-shadow .28s ease;
}

/* Show the full image, width-constrained and height auto so entire photo is visible */
.gallery-item img,
.gallery-item video {
  display: block;
  width: 100%;
  height: auto;          /* preserve full image aspect */
  object-fit: contain;   /* ensure full image visible, not crop */
  object-position: center center;
  border-radius: 12px;
  transition: transform .35s ease;
  position: static;      /* undo absolute positioning used for cropped cards */
}

/* Move caption below image instead of overlay so it doesn't hide the photo */
.gallery-item .gallery-caption,
.gallery-item .caption {
  position: static;
  display: block;
  margin-top: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text-on-panel);
  font-weight: 700;
  border-radius: 6px;
  text-shadow: none;
}

/* Subtle hover lift (no cropping/scale of image) */
.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
.gallery-item:hover img { transform: none; }

/* optional badge for photographer credit above gallery */
.gallery-intro {
  max-width: 1100px;
  margin: 8px auto 18px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(212,163,115,0.06), rgba(255,255,255,0.02));
  border-radius: 10px;
  color: var(--text-on-panel);
  font-size: 0.95rem;
  text-align: center;
}

/* Responsive column counts */
@media (max-width:1200px) {
  .gallery-grid { column-count: 3; }
}
@media (max-width:880px) {
  .gallery-grid { column-count: 2; }
  .gallery-item .caption, .gallery-item .gallery-caption { font-size:0.9rem; left:10px; bottom:10px; }
}
@media (max-width:520px) {
  .gallery-grid { column-count: 1; padding: 12px; }
  .gallery-item { margin-bottom: 12px; }
  .gallery-item .caption, .gallery-item .gallery-caption { left:8px; bottom:8px; font-size:0.88rem; padding:6px 8px; }
}

/* Image viewer overlay (modal) */
.image-viewer{
  display:none;
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,0.85);
  z-index:1200;
  justify-content:center;
  align-items:center;
  padding:20px;
}
.image-viewer.open{ display:flex; }
.image-viewer img{
  max-width:90%;
  max-height:90%;
  border-radius:8px;
  box-shadow:0 8px 30px rgba(0,0,0,0.6);
  object-fit:contain;
}

/* close button */
.image-viewer .close-viewer{
  position:fixed;
  top:18px;
  right:22px;
  color:#fff;
  font-size:28px;
  cursor:pointer;
  background:transparent;
  border:0;
  padding:6px;
  z-index:1300;
}
.image-viewer .close-viewer:hover { color: var(--accent); }

/* Responsive: 2 columns then 1 */
@media (max-width: 980px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap:20px; padding:24px; }
}
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: 1fr; gap:12px; padding:12px; }
  .gallery-item { padding-bottom: 85%; } /* make cards taller on small screens */
}

/* About-style gallery hero */
.gallery-hero.container {
  max-width: 1200px;
  margin: 34px auto 18px;
  padding: 20px 20px 8px;
}

.gallery-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.gallery-hero-inner h1 {
  margin: 0 0 10px;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4.8vw, 3.3rem);
  line-height: 1.06;
  color: var(--accent-dark);
}

.gallery-hero-inner p,
.gallery-hero-inner .muted {
  margin: 0 auto 10px;
  max-width: 820px;
  color: var(--accent-dark);
}

.gallery-hero-inner a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Image viewer / modal (kept from existing) */
.image-viewer{ display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); z-index:1000; justify-content:center; align-items:center; padding:20px; }
.image-viewer img{ max-width:70%; max-height:70%; border-radius:10px; box-shadow:0 4px 8px rgba(0,0,0,0.5); object-fit:contain; }
.image-viewer .close-viewer{ position:absolute; top:20px; right:30px; color:#fff; font-size:2rem; font-weight:bold; cursor:pointer; transition:color 0.3s ease; }
.image-viewer .close-viewer:hover{ color:var(--accent); }

/* Modal */
.modal{ display:none; position:fixed; z-index:1000; left:0; top:0; width:100%; height:100%; overflow:auto; background:rgba(0,0,0,0.9); }
.modal-content{ display:block; margin:auto; max-width:80%; max-height:80%; border-radius:10px; box-shadow:0 4px 8px rgba(0,0,0,0.5); }
.modal .close{ position:absolute; top:20px; right:35px; color:#fff; font-size:40px; font-weight:bold; cursor:pointer; }
.modal .close:hover, .modal .close:focus{ color:var(--accent); }

body.modal-open { overflow: hidden; }

.protected-image {
  -webkit-user-drag: none;
  user-select: none;
}

.gallery-item {
  position: relative !important;
}

.gallery-item::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  background-image: repeating-linear-gradient(
    -28deg,
    rgba(255, 255, 255, 0.2) 0 16px,
    rgba(255, 255, 255, 0) 16px 78px
  );
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
}

.gallery-item::after {
  content: "V'Ari Visuals • V2 Jigsaw Puzzle Warehouse";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 48px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.25));
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
}

.modal::after {
  content: "V'Ari Visuals • V2 Jigsaw Puzzle Warehouse";
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: clamp(20px, 4vw, 46px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 1001;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

#caption {
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin: 14px auto 0;
  max-width: min(720px, 88vw);
  font-weight: 600;
}

/* Main container */
main{ max-width:1200px; margin:0 auto; padding:20px; display:flex; flex-direction:column; align-items:center; }

/* Footer */
.site-footer{ text-align:center; padding:20px; background:transparent; color:var(--muted); }
.footer-container{ display:flex; justify-content:space-around; flex-wrap:wrap; gap:20px; max-width:1200px; margin:0 auto; }
.footer-section h4{ color:var(--accent); margin-bottom:10px; }
.footer-section a{ color:var(--text-on-panel); text-decoration:none; }
.footer-section a:hover{ color:var(--accent); }

/* Utilities */
.muted{ color:var(--muted); }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Responsive tweaks */
@media (max-width:980px){
  .gallery-grid{ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap:20px; padding:24px; }
  .search input{ width:140px; }
  .logo-text .tagline{ display:none; }
}
@media (max-width:640px){
  .main-nav{ display:none; }
  .search input{ display:none; }
  .logo-text .brand{ font-size:1rem; }
  .gallery-grid{ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:12px; padding:12px; }
  .gallery-item::after {
    left: 10px;
    right: 10px;
    bottom: 42px;
    font-size: 9px;
    letter-spacing: 0.05em;
    padding: 6px 8px;
  }
  .modal::after {
    font-size: clamp(18px, 6vw, 30px);
    white-space: normal;
    width: min(84vw, 360px);
    text-align: center;
  }
}
