/* ============================================================
   MEG McCOY MEDIA - Luxury Equestrian Photography
   Custom CSS (supplements Tailwind)
   ============================================================ */

/* Force scrollbar always visible to prevent layout shift */
html {
  overflow-y: scroll;
}

/* --- Brand Tokens --- */
:root {
  --color-charcoal: #1a1a1a;
  --color-charcoal-deep: #111111;
  --color-charcoal-surface: #222222;
  --color-charcoal-border: #2a2a2a;
  --color-gold: #c9a96e;
  --color-gold-light: #e0c99a;
  --color-gold-dark: #9a7a45;
  --color-ivory: #f5f0e8;
  --color-sage: #7a8c6e;
  --color-muted: #8a8070;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
}

/* ============================================================
   1. MASONRY LAYOUT
   ============================================================ */
.masonry-grid {
  column-count: 4;
  column-gap: 16px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  display: inline-block;
  width: 100%;
}

/* Reserve space for gallery images to prevent CLS */
.masonry-item img,
.gallery-item img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
  height: auto;
}

@media (max-width: 1280px) {
  .masonry-grid {
    column-count: 3;
  }
}

@media (max-width: 1024px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .masonry-grid {
    column-count: 1;
  }
}

/* ============================================================
   2. SHIMMER LOADING ANIMATION
   ============================================================ */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-charcoal-surface) 25%,
    var(--color-charcoal-border) 37%,
    var(--color-charcoal-surface) 63%
  );
  background-size: 800px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* ============================================================
   3. FADE-IN ANIMATION
   ============================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.fade-in-delay-1 {
  animation-delay: 0.1s;
}
.fade-in-delay-2 {
  animation-delay: 0.2s;
}
.fade-in-delay-3 {
  animation-delay: 0.3s;
}
.fade-in-delay-4 {
  animation-delay: 0.4s;
}

/* ============================================================
   4. SLIDE-UP ANIMATION (page transitions)
   ============================================================ */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
}

/* ============================================================
   5. IMAGE / GALLERY HOVER EFFECTS
   ============================================================ */
.gallery-item {
  position: relative;
  overflow: hidden;
  transition:
    transform 400ms ease,
    box-shadow 400ms ease;
  cursor: pointer;
}

.gallery-item img,
.gallery-item video {
  transition: transform 400ms ease;
  display: block;
  width: 100%;
  height: auto;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 400ms ease;
  pointer-events: none;
  z-index: 2;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.03);
}

.gallery-item:hover::after {
  border-color: var(--color-gold);
}

.gallery-item:hover {
  box-shadow: 0 0 20px rgba(201, 169, 110, 0.12);
}

/* Gallery card variant for grid pages */
.gallery-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-charcoal-border);
  transition:
    border-color 400ms ease,
    box-shadow 400ms ease;
}

.gallery-card img {
  transition: transform 400ms ease;
}

.gallery-card:hover {
  border-color: var(--color-gold);
  box-shadow: 0 0 24px rgba(201, 169, 110, 0.08);
}

.gallery-card:hover img {
  transform: scale(1.03);
}

/* ============================================================
   6. LIGHTBOX TRANSITIONS
   ============================================================ */
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lightboxFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

.lightbox-enter {
  animation: lightboxFadeIn 0.3s ease-out forwards;
}

.lightbox-exit {
  animation: lightboxFadeOut 0.2s ease-in forwards;
}

.lightbox-image-enter {
  animation: lightboxImageIn 0.3s ease-out forwards;
}

#lightbox_container img {
  max-height: 90vh;
  max-width: 90vw;
  object-fit: contain;
}

/* ============================================================
   7. TOAST ANIMATIONS
   ============================================================ */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-enter {
  animation: toastSlideIn 0.35s ease-out forwards;
}

.toast-exit {
  animation: toastSlideOut 0.25s ease-in forwards;
}

/* ============================================================
   8. UPLOAD PROGRESS BAR
   ============================================================ */
@keyframes progressStripe {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}

.upload-progress-bar {
  height: 4px;
  background-color: var(--color-charcoal-border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 50%,
    var(--color-gold) 100%
  );
  transition: width 0.3s ease;
  border-radius: 2px;
}

.upload-progress-fill.active {
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.1) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.1) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  animation: progressStripe 0.8s linear infinite;
}

/* ============================================================
   9. FORM INPUT STYLES (underline-only)
   ============================================================ */
.input-underline {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-charcoal-border);
  border-radius: 0;
  padding: 12px 0;
  width: 100%;
  color: var(--color-ivory);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
  outline: none;
}

.input-underline::placeholder {
  color: var(--color-muted);
  font-weight: 300;
}

.input-underline:focus,
.input-underline:focus-visible {
  border-bottom-color: var(--color-gold);
  box-shadow: 0 1px 0 0 var(--color-gold);
  outline: none !important;
  -webkit-appearance: none;
}

textarea.input-underline {
  resize: vertical;
  min-height: 100px;
  border-bottom-width: 1px;
}

select.input-underline {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a8070' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 20px;
  cursor: pointer;
}

/* ============================================================
   10. SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-charcoal-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold-dark) var(--color-charcoal-deep);
}

/* ============================================================
   11. NAV TRANSITION (scroll-aware)
   ============================================================ */
.nav-bar {
  transition:
    background-color 0.4s ease,
    box-shadow 0.4s ease;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-bar.scrolled,
.nav-scrolled .nav-bar {
  background-color: rgba(0, 0, 0, 0.88);
  box-shadow: 0 1px 0 var(--color-charcoal-border);
}

.nav-link {
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background-color: var(--color-gold);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ============================================================
   12. FAQ ACCORDION
   ============================================================ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
  opacity: 0;
}

.faq-item.open .faq-answer,
.faq-item.active .faq-answer {
  opacity: 1 !important;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron,
.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

/* ============================================================
   13. MOBILE MENU OVERLAY
   ============================================================ */
@keyframes mobileMenuIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobileMenuOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.mobile-menu-enter {
  animation: mobileMenuIn 0.35s ease-out forwards;
}

.mobile-menu-exit {
  animation: mobileMenuOut 0.25s ease-in forwards;
}

.mobile-menu-overlay {
  background: #111111;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.mobile-menu-overlay.active {
  display: flex !important;
}

/* ============================================================
   14. TYPOGRAPHY UTILITIES
   ============================================================ */
.heading-display {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--color-ivory);
}

.text-editorial {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  line-height: 1.3;
}

.logo-type {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold);
}

/* ============================================================
   15. DOT PULSE LOADER
   ============================================================ */
@keyframes dotPulse {
  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.dot-pulse {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.dot-pulse span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-gold);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.dot-pulse span:nth-child(1) {
  animation-delay: 0s;
}
.dot-pulse span:nth-child(2) {
  animation-delay: 0.2s;
}
.dot-pulse span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ============================================================
   16. GHOST BUTTON BASE (for non-Tailwind contexts)
   ============================================================ */
.btn-ghost {
  display: inline-block;
  padding: 12px 32px;
  border: 1px solid var(--color-gold);
  background: transparent;
  color: var(--color-gold);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.btn-ghost:hover {
  background-color: var(--color-gold);
  color: var(--color-charcoal-deep);
}

/* ============================================================
   17. TOGGLE SWITCH
   ============================================================ */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 22px;
  background: var(--color-charcoal-border);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-switch.active {
  background: var(--color-gold);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-ivory);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch.active::after {
  transform: translateX(22px);
}

/* ============================================================
   18. DRAG & DROP UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--color-charcoal-border);
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-gold);
  background-color: rgba(201, 169, 110, 0.04);
}

/* ============================================================
   19. ASPECT RATIO HELPERS
   ============================================================ */
.aspect-3-4 {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.aspect-4-3 {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ============================================================
   20. SELECTION COLOR
   ============================================================ */
::selection {
  background-color: rgba(201, 169, 110, 0.3);
  color: var(--color-ivory);
}

/* ============================================================
   21. ACCESSIBILITY - Focus Rings
   ============================================================ */
*:focus-visible {
  outline: 2px solid #c9a96e;
  outline-offset: 2px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   22. STAT NUMBERS - Lining Numerals
   ============================================================ */
.stat-number,
.font-display {
  font-variant-numeric: lining-nums;
}
