/* style.css - Dark Blue and Light Blue Theme with Animations */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', sans-serif;
  background-color: #f0f8ff;
  color: #1e3a8a;
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

header {
  background-color: #1e3a8a;
  padding: 30px;
  text-align: center;
  font-size: 2.5rem;
  color: #ffffff;
  border-bottom: 3px solid #93c5fd;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
  background-color: #e0f2fe;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 15px;
  border-bottom: 2px solid #bfdbfe;
}

nav a {
  color: #1e40af;
  margin: 8px 15px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

nav a:hover {
  color: #2563eb;
  text-decoration: underline;
}

section {
  padding: 50px 20px;
  max-width: 1000px;
  margin: auto;
  background-color: #ffffff;
  border-radius: 20px;
  margin-top: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  animation: fadeInUp 0.8s ease-in;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2, h3 {
  color: #1e3a8a;
}

ul {
  list-style-type: none;
  padding-left: 0;
}

li {
  margin-bottom: 15px;
  font-size: 1.1rem;
  background: #e0f2fe;
  padding: 10px 15px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  animation: noteAppear 0.5s ease forwards;
}

@keyframes noteAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 10px 5px;
}

.gallery img {
  width: 100%;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

form input {
  padding: 10px;
  margin-right: 10px;
  border-radius: 10px;
  border: 1px solid #93c5fd;
  width: 60%;
}

button {
  padding: 10px 20px;
  background-color: #1e40af;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

button:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

footer {
  text-align: center;
  color: #1e3a8a;
  padding: 30px;
  margin-top: 50px;
  font-size: 0.95rem;
  background-color: #e0f2fe;
  border-top: 2px solid #bfdbfe;
}

.family-photo {
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.family-photo:hover {
  transform: scale(1.03);
}

.page {
  overflow: hidden;
  position: relative;
}

.page img {
  object-fit: cover;
  position: absolute;
  top: 20px;
  right: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 1;
}

.page:hover img {
  display: block;
}

.family-tree {
  text-align: center;
  margin: 40px auto;
  padding: 30px;
  background: #e0f2fe;
  border-radius: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  max-width: 600px;
}

.tree ul {
  padding-top: 10px;
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.tree li {
  list-style-type: none;
  position: relative;
  padding: 15px 5px 0 5px;
  text-align: center;
}

.tree li::before,
.tree li::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 15px;
  border-top: 2px solid #1e3a8a;
}

.tree li::before {
  right: 50%;
  border-right: 2px solid #1e3a8a;
}

.tree li::after {
  left: 50%;
  border-left: 2px solid #1e3a8a;
}

.tree li:only-child::before,
.tree li:only-child::after {
  display: none;
}

.hover-pic,
.top-pic,
.center-pic,
.left-pic,
.right-pic {
  display: none;
}

.memory img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.memory img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  header {
    font-size: 1.8rem;
    padding: 20px;
  }

  nav {
    flex-direction: column;
    align-items: center;
  }

  nav a {
    margin: 8px 0;
    font-size: 1rem;
  }

  section {
    padding: 30px 15px;
    border-radius: 10px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px;
  }

  .memory img {
    height: 180px;
  }

  .storybook {
    padding: 20px;
  }

  .page h3 {
    font-size: 1.2rem;
  }

  .page p {
    font-size: 1rem;
  }

  form input {
    width: 100%;
    margin-bottom: 10px;
  }

  button {
    width: 100%;
  }

  .tree ul {
    flex-direction: column;
  }

  .hover-pic,
  .top-pic,
  .left-pic,
  .right-pic,
  .center-pic {
    display: none !important;
  }

  .gallery img,
  .family-photo {
    width: 100%;
    height: auto;
  }
}

@media screen and (max-width: 768px) {
  nav a {
    display: block;
    font-size: 1.05rem;
    padding: 10px;
    margin: 5px auto;
    width: 90%;
    text-align: center;
    background-color: #dbeafe;
    border-radius: 10px;
  }

  section {
    padding: 25px 15px;
    margin: 20px 10px;
  }

  .family-tree {
    padding: 15px;
    max-width: 90%;
  }

  form input,
  button {
    width: 100%;
    font-size: 1rem;
  }

  ul li {
    font-size: 1rem;
  }

  /* 🌱 Fix for family tree photos on mobile */
  .top-pic,
  .center-pic,
  .left-pic,
  .right-pic {
    display: block !important;
    position: static;
    margin: 10px auto;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .box {
    text-align: center;
  }

  .tree ul {
    flex-direction: column;
    align-items: center;
  }

  .tree li::before,
  .tree li::after {
    display: none;
  }

  .tree li {
    padding: 10px 0;
  }
}

