/* Optimized responsive CSS with DRY principles, utility cleanup, responsive typography, and spacing system */

/* --- Optimized .welcome section --- */
.welcome {
  width: 100%;
  height: 100svh;
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url('../assets/images/DSC_3261.jpg') center/cover no-repeat fixed;
  color: #fff;
  transition: opacity 1s ease, transform 1s ease;
  opacity: 0;
  transform: translateY(-100%);
  overflow-x: hidden;
}

.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.welcome > * {
  position: relative;
  z-index: 2;
}

.welcome.active {
  opacity: 1;
  transform: translateY(0);
}

.welcome.hide {
  transform: translateY(-100%);
  opacity: 0;
}

.welcome h2 {
  font-size: 3rem;
  font-family: var(--sacramento);
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
  letter-spacing: 1px;
  margin: -20rem 0 var(--space-4);
}

.welcome figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0;
}

.welcome figure img {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--shadow-md);
}

.welcome figure figcaption {
  font-size: var(--text-2xl);
  font-family: var(--sacramento);
  font-weight: 400;
  color: #fff;
  margin-top: var(--space-2);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

.welcome p span {
  font-size: var(--text-xl);
  margin: var(--space-4) 0;
  display: block;
}

.welcome button {
  font-family: var(--sacramento);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--round-md);
  cursor: pointer;
  font-size: var(--text-base);
  min-height: 44px;
  min-width: 44px;
  background: #fff;
  color: #000;
  transition: var(--transition-small);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.welcome button:hover {
  background-color: #000;
  color: #fff;
}

.welcome button i {
  font-size: var(--text-lg);
}

/* END welcome */

:root {
  /* Spacing scale */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Typography scale */
  --text-xs: clamp(0.7rem, 1vw, 0.8rem);
  --text-sm: clamp(0.85rem, 1vw, 0.95rem);
  --text-base: clamp(1rem, 1.4vw, 1.1rem);
  --text-lg: clamp(1.2rem, 2vw, 1.6rem);
  --text-xl: clamp(1.4rem, 2vw, 2rem);
  --text-2xl: clamp(1.6rem, 3vw, 2.4rem);
  --text-3xl: clamp(2rem, 3.5vw, 3rem);

  /* Element sizes */
  --btn-size-sm: 2.5rem;
  --btn-size-md: 3rem;

  /* Generic utils */
  --round-sm: 8px;
  --round-md: 12px;
  --round-full: 999px;
}

/* -------------------------------------------- */
/* GLOBAL UTILITY CLASSES */
/* -------------------------------------------- */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

.rounded-md {
  border-radius: var(--round-md);
}

.rounded-full {
  border-radius: var(--round-full);
}

.tap {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

/* -------------------------------------------- */
/* BASE MOBILE-FIRST LAYOUT */
/* -------------------------------------------- */
.home,
.about,
.time,
.hadist,
.gallery,
.wishas,
footer {
  width: 100%;
}

.home {
  height: 100svh;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  padding: var(--space-8) var(--space-4);
}

.home h2 {
  font-size: var(--text-2xl);
}

.home figure img {
  width: 8rem;
  height: 8rem;
}

/* ABOUT */
.about {
  padding: var(--space-16) var(--space-4);
}

.about h2,
.about h3 {
  font-size: var(--text-xl);
}

/* STORY */
.story-intro,
.story-conclusion {
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.story-paragraph {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  text-align: justify;
}

/* GALLERY */
.gallery {
  padding: var(--space-8) var(--space-4);
}

.gallery .container figure img {
  height: 14rem;
}

.gallery button {
  font-size: var(--text-2xl);
  width: var(--btn-size-md);
  height: var(--btn-size-md);
  border-radius: 50%;
}

/* FOOTER */
footer {
  padding: var(--space-8) var(--space-4);
}

footer h2 {
  font-size: var(--text-xl);
}

/* -------------------------------------------- */
/* RESPONSIVE BREAKPOINTS */
/* -------------------------------------------- */

/* SM: >480px */
@media (min-width: 480px) {
  .home figure img {
    width: 9rem;
    height: 9rem;
  }

  .gallery .container figure img {
    height: 13rem;
  }

  footer {
    padding: var(--space-10) var(--space-6);
  }
}

/* MD: >768px */
@media (min-width: 768px) {
  .about,
  .time {
    padding: var(--space-16) var(--space-8);
  }

  .gallery {
    padding: var(--space-16) var(--space-8);
  }

  .gallery .container figure img {
    height: 25rem;
  }

  footer {
    padding: var(--space-12) var(--space-8);
  }
}

/* TIME (optimized) */
.time {
  width: 100%;
  min-height: 100vh;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  position: relative;
}

.time h2 {
  font-family: var(--sacramento);
  font-size: var(--text-xl);
  font-weight: 400;
}

.time > div:first-of-type {
  margin-top: var(--space-4);
}

.time > div:first-of-type h3 {
  font-family: var(--sacramento);
  font-size: var(--text-2xl);
  font-weight: 400;
}

.time a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-8) auto var(--space-4);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-base);
  background: #000;
  color: #fff;
  border-radius: var(--round-full);
  width: fit-content;
}

.time a i {
  font-size: var(--text-lg);
}

