/* =============================================
   TIMBERLY LOFT - GALLERY PAGE
   Nav styles are in ../shared/nav.css
   ============================================= */

/* ===== CSS VARIABLES ===== */
:root {
  --brown-dark:    #3B1F0F;
  --brown-mid:     #6B3A1F;
  --brown-warm:    #8C4A22;
  --brown-light:   #C48A5C;
  --cream-deep:    #F0E6D3;
  --cream-light:   #FAF6EF;
  --cream-white:   #FFFDF9;
  --text-primary:  #2A1608;
  --text-secondary:#6B5744;
  --text-muted:    #A08060;
  
   --font-display: 'Host Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --nav-h:        80px;
  --section-pad:  clamp(64px, 8vw, 120px);
  --container:    1200px;
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    24px;

  --transition:   0.3s ease;
  --shadow-soft:  0 4px 24px rgba(59, 31, 15, 0.08);
  --shadow-card:  0 8px 40px rgba(59, 31, 15, 0.12);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background-color: var(--cream-white);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== UTILITY ===== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
}
.section-pad { padding: var(--section-pad) 0; }

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown-warm);
  margin-bottom: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background-color: var(--brown-dark);
  color: var(--cream-light);
  border-color: var(--brown-dark);
}
.btn-primary:hover {
  background-color: var(--brown-mid);
  border-color: var(--brown-mid);
  transform: translateY(-1px);
}
.btn-lg { padding: 18px 44px; font-size: 1rem; }

/* ===== IMG PLACEHOLDER ===== */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--cream-deep) 0%, #DEC5A8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-placeholder span {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: calc(var(--nav-h) + clamp(40px, 6vw, 80px)) 0 clamp(40px, 5vw, 64px);
  background-color: var(--cream-white);
  border-bottom: 1px solid var(--cream-deep);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.05;
  margin-bottom: 16px;
}
.page-subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background-color: var(--cream-white);
  border-bottom: 1px solid var(--cream-deep);
  padding: 16px 0;
}

.filter-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: none;
  border: 1.5px solid var(--cream-deep);
  border-radius: 100px;
  padding: 7px 18px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--brown-light);
  color: var(--brown-dark);
}
.filter-btn.active {
  background-color: var(--brown-dark);
  border-color: var(--brown-dark);
  color: var(--cream-white);
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
  padding: clamp(40px, 5vw, 72px) 0 var(--section-pad);
  background-color: var(--cream-white);
}

/* Masonry-style grid */
.gallery-grid {
  columns: 3;
  column-gap: 20px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item.hidden {
  display: none;
}

/* Default height */
.gallery-img-wrap {
  height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}
/* Wide item — spans full row feel via taller height */
.gallery-item--wide .gallery-img-wrap { height: 340px; }
/* Tall item */
.gallery-item--tall .gallery-img-wrap { height: 420px; }

.gallery-img-wrap .img-placeholder {
  height: 100%;
  transition: transform 0.5s ease;
}
.gallery-item:hover .img-placeholder { transform: scale(1.04); }

/* Hover overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(42, 22, 8, 0.88) 0%, rgba(42, 22, 8, 0.1) 55%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 24px;
  border-radius: var(--radius-md);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

.overlay-content {
  transform: translateY(8px);
  transition: transform var(--transition);
}
.gallery-item:hover .overlay-content { transform: translateY(0); }

.overlay-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background-color: var(--brown-warm);
  color: var(--cream-white);
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}

.overlay-content h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream-white);
  line-height: 1.25;
  margin-bottom: 4px;
}
.overlay-content p {
  font-size: 0.8rem;
  color: rgba(250, 246, 239, 0.75);
}

/* Empty state */
.gallery-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
  font-size: 1rem;
}
.gallery-empty a {
  color: var(--brown-warm);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== LIGHTBOX ===== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 12, 4, 0.92);
  z-index: 200;
  backdrop-filter: blur(4px);
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden],
.lightbox-backdrop[hidden] { display: none; }

.lightbox-content {
  background-color: var(--cream-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: lightboxIn 0.25s ease both;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-img-wrap {
  height: 480px;
  flex-shrink: 0;
}
.lightbox-placeholder {
  height: 100%;
  background: linear-gradient(135deg, #6B3A1F 0%, #3B1F0F 100%);
}
.lightbox-placeholder span { color: rgba(196, 138, 92, 0.5); }

.lightbox-caption {
  padding: 24px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lightbox-caption h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}
.lightbox-caption p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 202;
  background: rgba(250, 246, 239, 0.12);
  border: 1px solid rgba(250, 246, 239, 0.2);
  color: var(--cream-white);
  font-size: 1.5rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: rgba(250, 246, 239, 0.22); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 202;
  background: rgba(250, 246, 239, 0.1);
  border: 1px solid rgba(250, 246, 239, 0.2);
  color: var(--cream-white);
  font-size: 1.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(250, 246, 239, 0.22); }

/* ===== CTA BANNER ===== */
.cta-banner {
  background: linear-gradient(135deg, var(--brown-mid) 0%, var(--brown-dark) 100%);
  padding: clamp(64px, 8vw, 100px) 0;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C48A5C' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.cta-inner { text-align: center; position: relative; z-index: 1; }
.cta-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--cream-white);
  margin-bottom: 16px;
}
.cta-subtext {
  font-size: 1rem;
  color: rgba(250, 246, 239, 0.7);
  margin-bottom: 40px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.cta-banner .btn-primary {
  background-color: var(--brown-light);
  border-color: var(--brown-light);
  color: var(--brown-dark);
  font-weight: 600;
}
.cta-banner .btn-primary:hover {
  background-color: var(--cream-light);
  border-color: var(--cream-light);
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--brown-dark);
  color: var(--cream-deep);
  padding: clamp(48px, 6vw, 80px) 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(32px, 4vw, 60px);
  padding-bottom: clamp(40px, 5vw, 64px);
  border-bottom: 1px solid rgba(250, 246, 239, 0.1);
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream-white);
  margin-bottom: 14px;
}
.footer-logo span { color: var(--brown-light); }
.footer-tagline {
  font-size: 0.875rem;
  color: rgba(240, 230, 211, 0.65);
  line-height: 1.65;
  max-width: 260px;
}
.footer-heading {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown-light);
  margin-bottom: 20px;
}
.footer-nav ul, .footer-contact ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-nav a, .footer-contact a, .footer-contact li {
  font-size: 0.875rem;
  color: rgba(240, 230, 211, 0.7);
  transition: color var(--transition);
}
.footer-nav a:hover, .footer-contact a:hover { color: var(--cream-white); }
.social-links { display: flex; flex-direction: column; gap: 12px; }
.social-links a {
  font-size: 0.875rem;
  color: rgba(240, 230, 211, 0.7);
  transition: color var(--transition);
}
.social-links a:hover { color: var(--brown-light); }
.footer-bottom { padding: 24px 0; text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: rgba(240, 230, 211, 0.35); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header .container { animation: fadeUp 0.6s ease both; }

.gallery-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.gallery-item.hidden { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .gallery-grid { columns: 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .gallery-grid { columns: 1; }
  .filter-inner { gap: 12px; }
  .gallery-img-wrap,
  .gallery-item--wide .gallery-img-wrap,
  .gallery-item--tall .gallery-img-wrap { height: 260px; }
  .lightbox-img-wrap { height: 280px; }
  .lightbox-caption { padding: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}