/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #3b3024;
  color: #fff;
  font-family: "Cormorant Garamond", serif;
  z-index: 1000;
  padding: 10px 0;
}

.header-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* When there's only nav (no logo), center it */
.header-content:has(nav:only-child) {
  justify-content: center;
}

/* Fallback for browsers that don't support :has() */
.header-content nav:first-child:last-child {
  margin: 0 auto;
}

.header .logo {
  font-size: 1.5em;
  font-family: "Great Vibes", cursive;
}

.header nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* When there's no logo (letter pages), make nav span full width */
.header-content:has(nav:only-child) nav {
  max-width: 640px; /* 700px - 60px padding to align with letter content */
}

/* Fallback for browsers that don't support :has() */
.header-content nav:first-child {
  max-width: 640px; /* 700px - 60px padding to align with letter content */
}

.header nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1em;
}

.header nav a:hover {
  text-decoration: underline;
}

html, body {
  margin: 0,;
  padding: 0;
}

/* Global Styles */
body {
  font-family: "Great Vibes", "Cormorant Garamond", serif; /* Cursive and serif fonts */
  background: #f9f4e8; /* Parchment-like background */
  color: #3b3024; /* Deep brown ink color */
  margin: 0;
  /* padding: 20px; */
  line-height: 1.8;
  font-size: 20px;
}

/* Add texture to the background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://www.transparenttextures.com/patterns/old-wall.png');
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

/* Letter Container */
.letter-container {
  max-width: 700px;
  margin: 100px auto 40px auto;
  padding: 30px;
  background: rgba(255, 255, 240, 0.9); /* Faint parchment overlay */
  border: 1px solid #c1b99b;
  border-radius: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 1.1em;
  font-family: "Cormorant Garamond", serif; /* Classic serif font for readability */
}

.site-title {
  font-family: "Great Vibes", cursive; /* Romantic cursive font */
  font-size: 1em;
  margin-bottom: 20px;
  color: #5a4839;
  text-align: center;
  border-bottom: 1px solid #d4c6aa;
  padding-bottom: 10px;
}

.site-title h1 {
  font-family: 'Aboreto';
  font-size: 2em;
  margin: 0;
}

.site-title img {
  height: 175px;
}

/* Header styling for the address and date */
.letter-header {
  font-family: "Great Vibes", cursive; /* Romantic cursive font */
  font-size: 1.25em;
  margin-bottom: 20px;
  color: #5a4839;
  text-align: right;
  border-bottom: 1px solid #d4c6aa;
  padding-bottom: 10px;
}

/* Main content */
.letter-body {
  font-family: "Special Elite", "Courier New", Courier, monospace;
  white-space: pre-wrap;
  overflow: hidden;
  display: block;
  font-size: 1em;
  text-align: justify;
  padding: 0 25px;
  animation: fade-in 3s ease-out; /* Smooth fade-in animation */
}

/* Footer for signature */
.letter-footer {
  font-family: "Great Vibes", cursive;
  font-size: 1.5em;
  text-align: left;
  color: #3b3024;
}

/* Mobile Style */
@media (max-width: 800px) {
  .site-title img {
    height: 125px;
  }
  .site-title h1 {
    font-size: 1em;
  }
  .letter-container {
    margin: 120px 20px 30px 20px;
    padding: 25px;
  }
  .letter-header {
    font-size: 1em;
  }
  .letter-body {
    font-size: 0.75em;
  }
}

/* Button Styles */
.button {
  display: block;
  width: fit-content;
  padding: 10px 20px;
  background: #3b3024;
  color: #fff;
  text-decoration: none;
  font-family: "Cormorant Garamond", serif;
  font-size: 1em;
  border-radius: 5px;
  margin: 20px auto 0 auto;
  text-align: center;
  transition: background 0.3s ease;
}

.button:hover {
  background: #5a4839;
}

/* Typewriter animation */
@keyframes fade-in {
  from {
    opacity: 0; /* Start fully transparent */
  }
  to {
    opacity: 1; /* End fully visible */
  }
}

/* Mobile Styles */
@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    padding: 0 20px;
  }

  .header .logo {
    margin-bottom: 10px;
  }

  .header nav {
    max-width: 100%;
    width: 100%;
    justify-content: space-between;
  }

  /* On mobile, nav takes full width when it's the only child */
  .header-content nav:first-child,
  .header-content:has(nav:only-child) nav {
    max-width: 100%;
  }
}