/* General Reset */
body, h1, p, ul, li, a {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  background-color: #f9f9f9;
  color: #333;
}

/* Password Protection */
#password-protect {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(249, 249, 249, 0.9);
  z-index: 1000;
}

.password-container {
  text-align: center;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.password-container input {
  margin-bottom: 10px;
  padding: 10px;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

.password-container button {
  padding: 10px 20px;
  font-size: 1rem;
  color: white;
  background-color: #333;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.password-container button:hover {
  background-color: #555;
}

.password-container p {
  margin-top: 10px;
  font-size: 0.9rem;
  color: red;
  display: none;
}

/* Main Content Hidden Initially */
#main-content {
  display: none;
}

/* Wrapper for Page */
.page-wrapper {
  display: flex;
  width: 100%;
}

/* Side Navigation Bar */
.side-navbar {
  width: 160px;
  background-color: #f1f1f1;
  padding: 20px;
  border-right: 1px solid #ccc;
  transition: width 0.3s ease;
  position: fixed;
  height: 100vh;
  overflow: hidden;
  z-index: 1000;
}

.side-navbar.transparent {
  background-color: rgba(241, 241, 241, 0.9);
}

.side-navbar.collapsed {
  width: 33px;
  padding: 10px;
}

.side-navbar .toggle-btn {
  position: absolute;
  top: 20px;
  left: 10px;
  z-index: 1100;
  background-color: #333;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
}

.side-navbar .toggle-btn:hover {
  background-color: #555;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 60px 0 0 0;
}

.nav-links li {
  margin: 10px 0;
}

.nav-links .nav-item {
  margin-bottom: 15px;
  opacity: 1;
  display: block;
  transition: opacity 0.3s ease, display 0.3s ease;
}

.side-navbar.collapsed .nav-item {
  opacity: 0;
  display: none;
  pointer-events: none;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-size: 1.3rem;
  display: block;
  white-space: nowrap;
}

.nav-links a:hover {
  text-decoration: underline;
}

/* Highlight the current page in the navigation bar */
.nav-links a.current-page {
  font-weight: bold;
  color: #fff;
  background-color: #007BFF;
  border-radius: 5px;
  padding: 8px 12px;
  text-decoration: none;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-links a.current-page:hover {
  background-color: #0056b3;
  color: #f9f9f9;
}

.nav-links a:hover:not(.current-page) {
  color: #333;
  background-color: #f1f1f1;
  text-decoration: underline;
}

/* Main Content */
main {
  margin-left: 200px;
  padding: 20px;
  flex: 1;
  transition: margin-left 0.3s ease;
}

.side-navbar.collapsed ~ main {
  margin-left: 100px;
}

main h1 {
  font-size: 6rem;
  font-weight: bold;
  margin: 20px 0;
  color: #333;
  letter-spacing: 1px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  width: 100%;
}

.photo-wrapper {
  display: inline-block;  /* Ensures each photo can wrap properly */
  margin-bottom: 12px;    /* Spacing below each photo */
  width: 100%; 
}

.photo-tile {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
}

.photo-tile:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

#shuffle-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  background-color: #f9f9f9;
  border: 2px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#shuffle-btn i, #shuffle-btn span {
  margin-right: 8px;
}

#shuffle-btn:hover {
  background-color: #e6e6e6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#shuffle-btn:active {
  border-color: #555;
  background-color: #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#shuffle-advice-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  background-color: #f9f9f9;
  border: 2px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#shuffle-advice-btn i, #shuffle-advice-btn span {
  margin-right: 8px;
}

#shuffle-advice-btn:hover {
  background-color: #e6e6e6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#shuffle-advice-btn:active {
  border-color: #555;
  background-color: #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Story List */

.story-tile .story-link:hover {
  color: #555;
}

.story-tile .story-link {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  margin-bottom: 8px;
}

.story-tile {
  width: 100%;
  margin-bottom: 15px;
  padding: 15px;
  border: 2px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.story-list {
  display: flex;
  flex-direction: column;
  margin: 20px 0;
  padding-right: 20px;
  max-width: 1200px;
  align-items: flex-start;
}

.story-link {
  display: inline-block;
  padding: 10px 10px;
  font-size: 20rem;
  font-weight: bold;
  color: #333;
  background-color: #f9f9f9;
  border: 2px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.story-link:hover {
  background-color: #cbcbcb;
  border-color: #555;
}

/* Story Content */
.story-content {
  margin: 20px 0;
}

#back-to-list {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  background-color: #333;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#back-to-list:hover {
  background-color: #555;
}

#story-title {
  font-size: 4rem;
  font-weight: bold;
  margin-top: 10px;
}

.story-description {
  font-size: 1rem;
  color: #757575;
  line-height: 1.3;
  margin: 0;
  padding-left: 15px;
  padding-right: 15px;
}

.full-story-author {
  font-size: 1.2rem;
  font-style: italic;
  color: #007BFF; /* Slightly darker for better contrast */
  padding-left: 15px;
  padding-right: 15px;
}

.story-author {
  font-size: 0.9rem;
  font-style: italic;
  color: #007BFF; /* Light gray for subtle styling */
  padding-left: 15px;
  padding-right: 15px;
}

#story-text {
  font-size: 1.6rem !important;
  line-height: 1.8;
  margin-top: 20px;
  color: #333;
  font-family: "Georgia", serif;
  text-align: justify;
  padding: 15px;
  background-color: #f9f9f9;
  border-left: 5px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#story-text:hover {
  background-color: #e6e6e6;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

#shuffle-stories-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  background-color: #f9f9f9;
  border: 2px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#shuffle-stories-btn:hover {
  background-color: #e6e6e6;
  border-color: #555;
}

#shuffle-stories-btn i {
  margin-right: 8px;
}

/* Content Container */
.content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Styling for Text Wrapping Around Photo */
.right-photo {
  float: right;
  margin: 0 0 10px 15px;
  max-width: 300px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

main p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Styling for External Links List */
.external-links {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.external-links li {
  margin-bottom: 20px;
}

.external-links a {
  font-size: 1.5rem;
  font-weight: bold;
  color: #007BFF;
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease, transform 0.2s ease;
}

.external-links a:hover {
  color: #0056b3;
  text-decoration: underline;
  transform: scale(1.05);
}

.link-description {
  display: block;
  font-size: 1rem;
  color: #333;
  margin-top: 5px;
  line-height: 1.5;
}

.external-links li:hover .link-description {
  color: #555;
}

#tree {
  width: 100%;
  height: 80vh;
  border: 1px solid #ccc;
  box-sizing: border-box;
  background-color: #fff;
  position: relative;
}

/* Tree container */
.tree-container {
  position: relative;
  overflow: auto;
  padding: 20px;
  width: 100%;
  height: 100vh;
  background: #fff;
  cursor: grab;
  user-select: none;
}

.tree-container.grabbing {
  cursor: grabbing;
}

/* Family tree structure */
.tree {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  min-width: 1500px;
  white-space: nowrap;
}

.tree ul {
  position: relative;
  white-space: nowrap;
  padding-top: 20px;
  transition: all 0.5s ease;
}

.tree li {
  display: inline-block;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 5px 0 5px;
  vertical-align: top;
  transition: all 0.5s ease;
}

.tree li::before, .tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 1px solid #ccc;
  width: 50%;
  height: 20px;
}

.tree li::after {
  right: auto;
  left: 50%;
  border-left: 1px solid #ccc;
}

.tree li:only-child::after, .tree li:only-child::before {
  display: none;
}

.tree li:only-child {
  padding-top: 0;
}

.tree li:first-child::before, .tree li:last-child::after {
  border: none;
}

.tree li:last-child::before {
  border-right: 1px solid #ccc;
  border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
  border-radius: 5px 0 0 0;
}

.tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 1px solid #ccc;
  width: 0;
  height: 20px;
}

.tree li a.person {
  display: inline-block;
  min-width: 120px;
  padding: 10px 15px;
  text-align: center;
  text-decoration: none;
  color: #666;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #fefefe;
  position: relative;
  transition: all 0.5s ease;
  line-height: 1.4;
}

.couple {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.couple .person {
  text-decoration: none;
  font-weight: bold;
  color: #007BFF;
  transition: color 0.3s ease;
}

.couple .person:hover {
  color: #0056b3;
}

.tree li a.person:hover,
.tree li a.person:hover + ul li a.person {
  background: #c8e4f8;
  color: #000;
  border: 1px solid #94a0b4;
}

.tree li a.person:hover + ul li::after,
.tree li a.person:hover + ul li::before,
.tree li a.person:hover + ul::before,
.tree li a.person:hover + ul ul::before {
  border-color: #94a0b4;
}

.tree li a.person::after {
  content: attr(data-info);
  display: none;
  position: absolute;
  bottom: -70px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #333;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  white-space: normal;
  width: 220px;
  text-align: left;
  font-size: 12px;
  box-shadow: 0px 2px 5px rgba(0,0,0,0.2);
  z-index: 999;
}

.home-quote {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #555;
  font-style: italic;
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  border-left: 4px solid #007BFF;
  background-color: #f9f9f9;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.home-quote span {
  display: block;
  margin-top: 10px;
  font-size: 1.4rem;
  font-style: normal;
  color: #333;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #f9f9f9;
  color: #777;
  text-align: center;
  font-size: 0.8rem;
  padding: 10px 0;
  border-top: 1px solid #ccc;
  z-index: 1000;
}

/* Advice List */
.advice-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.advice-tile {
  display: block;
  max-width: 900px;
  padding: 10px 15px;
  font-size: 1rem;
  font-weight: normal;
  color: #333;
  background-color: #f9f9f9;
  border: 2px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: left;
  word-wrap: break-word;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.advice-tile:hover {
  background-color: #e6e6e6;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.advice-question {
  font-weight: bold;
  margin-bottom: 8px;
}

.advice-answer {
  margin-top: 0;
}

@media (max-width: 768px) {
  .side-navbar {
    width: 100px;
    height: 100vh;
    overflow: hidden;
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 1000;
  }

  .side-navbar.collapsed {
    width: 33px;
  }

  main {
    margin-left: 110px;
    padding: 20px;
    transition: margin-left 0.3s ease;
  }

  .side-navbar.collapsed ~ main {
    margin-left: 50px;
  }

  .footer {
      font-size: 0.7rem;
      padding: 8px 0;
  }

  .photo-gallery {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      grid-auto-rows: 15px;
  }

  .photo-tile {
      grid-row: span 7;
  }

  .story-list {
      padding: 10px;
  }
  
  .story-link {
      width: 100%;
      max-width: 300px;
  }
}

@media (max-width: 480px) {
  .photo-gallery {
      grid-template-columns: 1fr;
      grid-auto-rows: 20px;
  }

  .photo-tile {
      grid-row: span 15;
  }
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

