/* Custom Properties (Variables) */
:root {
  /* Colors */
  --primary: #81001c;
  --primary-container: #a6192e;
  --on-primary: #ffffff;

  --secondary: #515f7a;

  --tertiary-fixed: #ffe088;

  --surface: #fcf9f6;
  --surface-low: #f6f3f0;
  --surface-lowest: #ffffff;
  --surface-container: #f0edea;
  --surface-highest: #e5e2df;

  --on-surface: #1c1c1a;
  --on-surface-variant: #594040;
  --outline-variant: #e1bebe;

  /* Typography */
  --font-headline: "Noto Serif", serif;
  --font-body: "Inter", sans-serif;
}

/* Base Reset & Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background-color: var(--primary-container);
  color: var(--on-primary);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
.font-headline {
  font-family: var(--font-headline);
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  vertical-align: middle;
}

/* Layout Utilities */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 3rem;
  }
}

.main-container {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .main-container {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

.section-margin {
  margin-bottom: 6rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn-large {
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background-color: var(--primary-container);
}

.btn-outline {
  background-color: var(--surface);
  color: var(--on-surface);
  border: 1px solid rgba(225, 190, 190, 0.5);
}

.btn-outline:hover {
  background-color: var(--surface-highest);
}

.btn-dark {
  background-color: var(--secondary);
  color: var(--on-primary);
}

.btn-dark:hover {
  background-color: var(--on-surface);
}

.flex-btn {
  gap: 0.5rem;
}

.shadow-glow {
  box-shadow: 0 8px 30px rgba(129, 0, 28, 0.3);
}

.shadow-glow:hover {
  box-shadow: 0 12px 40px rgba(129, 0, 28, 0.4);
  transform: translateY(-2px);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background-color: rgba(252, 249, 246, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: 9vh;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.logo {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary); /* Changed to primary to be visible on white bg */
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  color: var(--secondary);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.icon-group {
  display: flex;
  gap: 1rem;
}

.icon-btn {
  color: var(--secondary);
  padding: 0.5rem;
  transition: color 0.3s;
}

.icon-btn:hover {
  color: var(--primary);
}

.nav-btn {
  display: none;
}

@media (min-width: 768px) {
  .nav-btn {
    display: inline-flex;
  }
}

.mobile-menu-btn {
  display: block;
  color: var(--on-surface);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Menu Styles */
@media (max-width: 767px) {
  .nav-links.nav-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 9vh;
    left: 0;
    right: 0;
    background-color: var(--surface);
    padding: 1rem 1.5rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 49;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .nav-links.nav-open a {
    width: 100%;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--surface-low);
  }

  .nav-links.nav-open a:last-child {
    border-bottom: none;
  }
}

/* Hero Section */
.hero-section {
  position: relative;
  width: 100%;
  height: 91vh;
  min-height: 600px;
  margin-top: 9vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

.hero-content {
  position: relative;
  z-index: 20;
  text-align: center;
  max-width: 42rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hide hero elements initially to prevent flash of un-animated content */
.hero-content > * {
  opacity: 0;
}

.hero-tag {
  color: var(--tertiary-fixed);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .hero-tag {
    font-size: 1rem;
  }
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 900;
  color: white;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  text-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .hero-content h1 {
    font-size: 4.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-content h1 {
    font-size: 6rem;
  }
}

.hero-content p {
  color: var(--surface-low);
  font-size: 1.125rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.6;
}

@media (min-width: 768px) {
  .hero-content p {
    font-size: 1.25rem;
  }
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  color: rgba(255, 255, 255, 0.7);
  animation: bounce 2s infinite;
}

.hero-scroll-indicator .material-symbols-outlined {
  font-size: 2rem;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-10px) translateX(-50%);
  }
  60% {
    transform: translateY(-5px) translateX(-50%);
  }
}

/* Featured Collection */
.section-header-flex {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .section-header-flex {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.header-text {
  max-width: 42rem;
}

.header-text h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .header-text h2 {
    font-size: 3rem;
  }
}

.header-text p {
  color: var(--secondary);
  font-size: 1.125rem;
  line-height: 1.625;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.link-action:hover {
  color: var(--primary-container);
  border-color: var(--primary-container);
}

.featured-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface-lowest);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(225, 190, 190, 0.2);
}

@media (min-width: 1024px) {
  .featured-card {
    flex-direction: row;
  }
}

.featured-image {
  width: 100%;
  height: 16rem;
}

@media (min-width: 768px) {
  .featured-image {
    height: 24rem;
  }
}

@media (min-width: 1024px) {
  .featured-image {
    width: 66.666%;
    height: auto;
    min-height: 24rem;
  }
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-content {
  width: 100%;
  padding: 2rem;
  background-color: var(--surface-low);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .featured-content {
    padding: 3rem;
  }
}

@media (min-width: 1024px) {
  .featured-content {
    width: 33.333%;
  }
}

.tag-accent {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.featured-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .featured-content h3 {
    font-size: 1.875rem;
  }
}

.featured-content p {
  color: var(--on-surface-variant);
  margin-bottom: 2rem;
  line-height: 1.625;
}

.featured-content .btn {
  align-self: flex-start;
}

/* Latest Moments Gallery */
.gallery-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .gallery-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.gallery-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background-color: var(--surface-container);
  color: var(--on-surface);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid rgba(225, 190, 190, 0.2);
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background-color: var(--surface-highest);
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* Enhanced CSS Grid Mosaic */
.mosaic-grid {
  display: grid;
  /* Creates a responsive grid with a minimum item width of 300px */
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: auto; /* Let content decide height */
  gap: 1.5rem;
}
.mosaic-item {
  /* Reset button styles */
  border: none;
  padding: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
  display: block;
}

.mosaic-item {
  aspect-ratio: 4 / 3; /* Maintain a consistent aspect ratio */
}

.mosaic-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--surface-low);
  cursor: pointer;
  display: flex; /* Ensure image fills the item */
}

.mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.mosaic-item:hover img {
  transform: scale(1.05);
}

.mosaic-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

.mosaic-item:hover .mosaic-overlay {
  opacity: 1;
}

/* On mobile, make the overlay always visible as there is no hover state */
@media (max-width: 768px) {
  .mosaic-overlay {
    opacity: 1;
    /* Use a slightly softer gradient for the always-on mobile view */
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.75) 0%,
      rgba(0, 0, 0, 0) 70%
    );
  }
}

.mosaic-tag {
  color: var(--tertiary-fixed);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.mosaic-overlay h4 {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.mosaic-overlay p {
  color: var(--surface-lowest);
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.load-more-container {
  margin-top: 3rem;
  text-align: center;
}

/* Archive Section */
.archive-section {
  background-color: var(--surface-low);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  border: 1px solid rgba(225, 190, 190, 0.1);
}

@media (min-width: 768px) {
  .archive-section {
    padding: 4rem;
    flex-direction: row;
    align-items: center;
  }
}

.archive-content {
  width: 100%;
}

@media (min-width: 768px) {
  .archive-content {
    width: 50%;
  }
}

.archive-content h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

.archive-content p {
  color: var(--secondary);
  font-size: 1.125rem;
  line-height: 1.625;
  margin-bottom: 2rem;
}

.archive-images {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .archive-images {
    width: 50%;
  }
}

.archive-img-wrapper {
  border-radius: 8px;
  overflow: hidden;
  height: 12rem;
}

.archive-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offset-img {
  margin-top: 2rem;
}

/* Footer */
.footer {
  background-color: var(--surface-low);
  padding: 5rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-logo {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-background);
  margin-bottom: 1.5rem;
}

.footer-contact {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.social-icon:hover {
  transform: scale(1.1);
}

.footer-links h4 {
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 1.5rem;
  font-family: var(--font-body);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--secondary);
  font-size: 0.875rem;
  transition:
    color 0.3s,
    text-decoration-color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary);
}

.footer-bottom {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(225, 190, 190, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--secondary);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-badges {
  display: flex;
  gap: 2rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 28, 26, 0.9); /* --on-surface with alpha */
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background-color: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: background-color 0.2s;
}

.modal-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-close-btn .material-symbols-outlined {
  font-size: 1.75rem;
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* This is key for panning */
}

#modalImage {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: zoom-in;
  transition: transform 0.3s ease;
  will-change: transform; /* Performance hint */
}

.modal-content.zoomed #modalImage {
  transform: scale(2);
  cursor: grab;
}

.modal-content.zoomed.grabbing #modalImage {
  cursor: grabbing;
}

@media (max-width: 768px) {
  .modal-close-btn {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  .modal-close-btn .material-symbols-outlined {
    font-size: 1.5rem;
  }
}
