/*  !  ||  styling common to multiple html pages   */

/* !  code suggested for lineage-page only by PaulOB   */
:root {
  /* ! pseudo class sets variable "--column-width  */
  --column-width: 450px;
  --gap: 1rem;
  --main-font: "Birthstone", serif;
}

html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
  box-sizing: inherit;
}
html,
body {
  margin: 0;
  padding: .2rem;
}
body,
p,
li {
  font-family: "Philosopher", serif;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.birthstone {
  font-family: "birthstone", cursive;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

h1.heading {
  display: block;
  margin: 0 0.5rem 0;
  margin-left: 0px;
  margin-right: 0px;
  font-family: birthstone;
  font-size: 4rem;
  font-weight: normal;
  text-align: center;
  line-height: 1.4rem;
  padding: 0; /* ! Added after seeing too much space */
}

h2.subheading {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  margin-left: 0px;
  margin-right: 0px;
  font-size: 2rem;
  font-weight: normal;
  text-align: center;
  font-family: birthstone;
}

h3.subheading2 {
  font-size: 1.5rem;
  font-weight: normal;
  text-align: center;
  margin-top: -4rem;
}

h4.subheading3 {
  font-size: 1.25rem;
  font-weight: normal;
  text-align: center;
  margin-top: 0;
}

h5.subheading4 {
  font-size: 1.2rem;
  color: blue;
  font-weight: bold;
  text-align: center;
  margin-top: 0;
}

.heading,
.subheading,
.menu-notice,
.button-row,
footer {
  text-align: center;
  width: 100%;
  font-family: "Birthstone", cursive;
  font-size: 2.25rem;
  font-style: italic;
  color: brown;
  padding: 10px;
}

.text-color-red {
  color: red;
  font-weight: 700;
}

.text-color-blue {
  color: blue;
  font-weight: 700;
}

dl {
  display: grid;
  column-gap: 0.5rem;
  grid-template-columns: max-content;
  line-height: 1.1rem;
  padding: 0;
}

dt {
  font-weight: normal;
}

dd {
  margin: 0;
  grid-column-start: 2;
}

dt,
dd {
  margin: 0;
}

.masthead {
  background-color: #efe2d5;
  border: 3px solid #801515;
  border-radius: 100px;
  padding: 0;              /* ← Remove padding, let flexbox handle centering */
  margin: 1rem auto;
  width: 70%;
  height: 120px;           /* ← ADD FIXED HEIGHT */
  text-align: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;           /* ← ADD: Make masthead itself a flex container */
  align-items: center;     /* ← ADD: Vertical centering */
  justify-content: center; /* ← ADD: Horizontal centering */
}

.masthead-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.masthead-line1,
.masthead-line2 {
  font-family: "Birthstone", cursive;
  color: #5a1a1a;
  text-align: center;
  display: block;
}

.masthead-line1 {
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;      /* ⬅️ Reduce bottom spacing */
  font-size: 3.5rem;
  font-weight: 500;
  line-height: 1;           /* ⬅️ Compress line spacing */
}

.masthead-line2 {
  margin-top: 0;              /* ⬅️ Remove default top spacing */
  font-size: 2rem;
  line-height: 1;           /* ⬅️ Optional for symmetry */
}

h2.masthead-line2.subheading {
  margin-top: -0.5rem;    /* Override just the margin */
  margin-bottom: 0;       /* Override just the margin */
  /* Inherits everything else from h2.subheading */
}

.page-footer p {
  text-align: center;
  font-family: "Birthstone", cursive !important;
  font-size: 1.2rem;
  color: brown;
  margin-top: 2rem;
} 

/*.page-format {
  max-width: 1500;
  margin: 1rem auto;
  padding: 1rem 1rem 2rem;
  background-color: rgb(212, 244, 246);
  border: 3px solid #0e214e;
  border-radius: 20px;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.5);
}*/

.page-format {          /*  Outer Container   */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 1500px; 
  max-width: 100%; 
  margin: 0 auto; 
  padding: 1.5rem; 
  border-style: ridge;
  border-width: 6px;
  border-radius: 20px;
  border-color: brown;
  background-color: #f4dfd2;
  box-sizing: border-box; 
  font-family: "Birthstone";
  font-size: 16px;
  font-weight: 400;
}


.champion-page-format {
  max-width: 1500;
  margin: 1rem auto;
  padding: 1rem 1rem 2rem;
  background-color: rgb(212, 244, 246);
  border: 3px solid #0e214e;
  border-radius: 20px;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.5);
}

.hull-page-format {
  max-width: 1500;
  margin: 1rem auto;
  padding: 1rem 1rem 2rem;
  background-color: rgb(247, 236, 236);
  border: 3px solid #590e0e;
  border-radius: 20px;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.5);
}

/*  !  ||  END of styling common to multiple html pages   */

/*  ! ||  index.html (Home Page) Styling  */

.home-page-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10rem;
  row-gap: 1.5rem;
  margin-top: 2rem;
  padding: 0;
}

.home-page-2 img {
  width: 100%;
  height: 400px;
  object-fit: contain; /* 🔁 changed from cover */
  border: 1.5px solid brown;
  border-radius: 6px;
  background-color: #f6eadd; /* fill any empty space */
}

.register-login {
  grid-row: 1;
  grid-column: 1 / span 2; /*  spans both columns */
  background-color: /*#f4e6d7*/ #efe2d5;
  text-align: center;
  padding: 0.4rem;
  font-family: "Birthstone", cursive !important;
  font-size: 2rem;
  line-height: 1.2rem;
  border: 2px solid brown;
  border-radius: 10px;
}

h4.login-message {
  font-family: "Birthstone", cursive;
  font-size: 2rem;
  font-weight: 500;
  color: maroon;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 0.5rem; /* bottom spacing only */
  padding: 0;
}

.login-description {
  font-family: "Birthstone", cursive;
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.4;
  text-align: center;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  max-width: 800px;
  color: brown; /* Change to brown to match the rest */
}

.login-description p {
  margin: 0;
  font-weight: normal;
  font-family: "Birthstone", cursive; /* Ensure Birthstone font */
  color: maroon; /* Ensure brown color */
}

.welcome-and-login {
  margin: 0;
  font-family: "Birthstone", cursive !important;
  font-size: 1.5rem;
  line-height: 1.2rem;
}

.auth-buttons {
  margin-top: 0;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.button {
  display: inline-block;
  padding: 0.4px 10px; /* smaller padding */
  font-size: 0.9rem; /* slightly smaller text */
  font-weight: 600;
  color: brown; /* brown text */
  background-color: #f0e6d6; /* light background */
  border: 2px solid brown;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.button:hover {
  background-color: brown;
  color: white; /* invert on hover */
}

legend {
  font-size: 1.5rem; /* or use px like 24px */
  font-family: "Birthstone", cursive !important;
  color: brown;
  font-weight: bold;
}

.nav-wrapper {
  grid-column: 1;
  grid-row: 1;
  align-self: start;         /* Prevents vertical stretching */
}

.navbar {
  /*  row 2 / column 1  */
  grid-row: 2;
  grid-column: 1;
  display: inline-block;
  min-width: 300px;
  align-self: start; /* ✅ prevent stretching */
  height: auto;
  margin-top: 0;
  padding: 0.95rem 1rem 1.1rem;
  font-family: "Birthstone", cursive !important;
  font-size: 1.5rem;
  text-align: left;
    background-color: #f6eadd;
  border: 3px solid #999;
  border-color: brown;
  border-radius: 10px;
}

.navbar a,
.navbar li,
.navbar ul {
  font-family: "Birthstone", cursive;
}

.navbar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.navbar li {
  margin-bottom: 0.3rem;
}

/* Photo cell is in column 2, top-left of its cell */
.family-photo {
  grid-column: 2;            /* ensure it lives in the right column */
  grid-row: 1;
  justify-self: center;
  align-self: start;
}

/* Keep figure simple; don't force it to 100% height */
.family-photo figure {
  margin: 0;
  display: block;
  max-width: 100%;
}

/* Cap only the image area, not the caption */
.family-photo .photo-wrap {
  max-height: 360px;         /* choose your preferred cap */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;          /* just in case, but img is constrained */
}

/* Image: intrinsic sizing, no crop, preserve aspect */
.family-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;  /* no object-fit needed */
}

.family-photo figcaption {
  margin-top: .5rem;
  line-height: 1.3;
}

/* Grid layout stays normal */
.home-page {
  display: grid;
  grid-template-columns: minmax(300px, 20%) 1fr; /* or use 45% / 55%, etc. */
  column-gap: 50px;
  row-gap: 1.5rem;
  margin-top: 2rem;
  align-items: start; /* don't stretch items vertically */
}

/* Reset figure */
.family-photo figure {
  margin: 0;
  display: block;
}

.family-photo img {
  max-width: 100%;
  height: auto;
  max-height: none;
}

.no-bullets {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

figure {
  display: block;
  text-align: center; /* Optional: center the image and caption */
  margin: 1rem auto;
  max-width: 100%;
}

figure img {
  width: 100%;
  height: auto;
  display: block; /* Ensure image takes up a full line */
  margin: 0 auto;
}

figcaption {
  display: block;
  font-size: 1.1rem;
  color: #333;
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.3;
}

.photo {
  width: 100%;
  height: auto;
  margin: 0;
}

.photo img {
  width: 100%;
  height: auto;
}

img {
  border: 1.5px solid brown;
  border-radius: 6px;  /* softens the edges */ 
}

.personal-pages-wrap {  
  display: grid; /* 5 rows / 4 columns*/
  gap: 0.6rem 1rem;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  margin-top: 2rem;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.2rem;
  align-items: start;
}

h3.title {
  display: flex; /*  Defines 'h3.title' as a flex box  */
  gap: 1rem; /*  Sets free space on all sides of container to 1rem  */
  margin: 0; /*  Makes flex box have no margins on any sides   */
  position: relative; /*  Makes 'h3.title' content relative to container it is
                                  defined in; ex. biography, children, birth, marriage, death and thumbnails   */
  font-family: birthstone;
  font-size: 1.25rem; /*  Makes 'h3.title' content font size  1rem    */
  font-weight: normal; /*  Makes 'h3.title' content font weight normal */
  transform: translateY(-0.75rem);
}

h1.visually-hidden-welcome {
  font-size: 6rem;
}

h3.visually-hidden {
  font-size: 1.25rem;
  font-weight: normal;
}

h3.title:before,              /*  Addresses area preceding 'h3.title' */
h3.title:after {
  /*  Addresses area following 'h3.title' */
  content: ""; /*  Defines a blank line ?  */
  flex: 1 0 0; /*  Allows to grow, not to shrink; no starting width */
  height: 1rem; /*  Sets 'h3.title' height to 1rem      */
  transform: translateY(
    -1.4rem
  ); /*  Shifts .title content 1rem up vertcally (Y axis)  */
}

h3.title:before {
  max-width: 1.5rem; /*  The selector (h3.title:before) specifically addresses
                                  the area to the left of (before) .title contents and
                                  limits that content to 1.5 rem width    */
}

.offset-heading {
  position: relative;
  margin: 0 0 1rem;
  background: white;
  border: 1px solid #000;
  border-top: none;
  border-radius: 8px;
}

.offset-heading:last-child {
  margin-bottom: 0rem;
}

.photo-wrap {
  grid-row: 1 / 4;
  grid-column: 1;
  background-color: light blue;
}

.photo-wrap > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.biography-wrap {
  grid-row: 1;
  grid-column: 2 / span 3;
  padding: 0 0.5rem 0.5rem;
  background-color: #f4ece3;
}

.children-wrap {
  grid-row: 2;
  grid-column: 2 / span 3;
  padding: 0 0.5rem 0.5rem;
  background-color: #f4ece3;
}

.birth-details {
  grid-row: 3;
  grid-column: 2;
  padding: 0 0.5rem 0.5rem;
  background-color: #f4ece3;

}

.marriage-details {
  grid-row: 3;
  grid-column: 3; /*  if out, column becomes 2  */
  padding: 0 0.5rem 0.5rem;
  background-color: #f4ece3;
 
}

.death-details {
  grid-row: 3;
  grid-column: 4; /*  if out, column becomes 3  */
  padding: 0 0.5rem 0.5rem;
  background-color: #f4ece3;

}

.thumbnails-wrap {
  grid-row: 4;
  grid-column: 2 / span 3; /* if out, column becomes 1  */
  padding: 0 0.5rem 0.5rem;
   background-color: #f4ece3;
 
}

.thumbnails {
  width: 1.2rem;
  height: 2rem;
  border: 2px black;
  border-radius: 6px;
  object-fit: contain;
}

.thumbnails img {
  width: 100%;
  height: auto;
}

/*  !  ||  END of personal-pages.html  styling  */

/*  !  ||  lineage.html  styling   */

.ancestor-page-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 100%;
  padding: 1rem;
  box-sizing: border-box;
}

.generation-wrap {
  width: 100%; /* critical for grid fit */
  box-sizing: border-box;
  font-family: "Birthstone", cursive;
  font-size: 1.25rem;
  padding: 1rem;
  background-color: #f4ece3;
  border-radius: 12px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

h4.generation-name {
  text-decoration-line: underline;
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.1;
  padding: 1rem 0 0.5rem;
  margin: 0;
}

h3.generation {
  display: flex;
  gap: 1rem;
  margin: 0;
  position: relative;
  margin-top: -2rem;
  font-family: birthstone;
  font-size: 1.5rem;
  font-weight: normal;
}

h3.generation:before,
h3.generation:after {
  content: "";
  flex: 1 0 0;
  height: 1rem;
  transform: translateY(-1rem);
}

h3.generation {
  left: 9rem;
}
h3.generation:before {
  max-width: 15rem;
}

.hover-box-container {
  position: relative;
  display: block;
  cursor: pointer;
}

.hover-box {
  display: none;
  position: absolute;
  top: 100%; /* ! Position below the heading */
  left: 0;
  margin-top: 0.5rem;
  padding: 0.5rem 1.5rem;
  background-color: #fff;
  color: black;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1rem;
  z-index: 10;
}

.hover-box-container:hover .hover-box {
  display: block;
  max-width: 50rem;
}

/*  !  ||  END of lineage.html  styling   */

/* !   ||  Phyllis Scrapbook.html  styling   */
 .page-content {
  display: block;
  padding: 1rem;
  border: 0.2rem solid brown;
  border-radius: 10px;
  page-break-after: always;
} 

 .page-content img {
  width: 100%;
  height: auto;
  border: none;
} 

.scrapbook-grid {
  background-color:#f4ece3
}

.scrapbook-image {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 3rem;
  border: 3px solid brown;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
}

.scrapbook-image:first-of-type {
  margin-top: 3rem;
}

.scrapbook-page-number {
  text-align: center;
  vertical-align: top;
  font-family: birthstone;

  font-size: 1.5rem;
  margin: 0;
  padding: 0 0 0 1rem;
}

/*  !  ||  END of Phyllis Scrapbook.html  styling   */

.modal {
  display: none;
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background-color: white;
  border: 6px solid brown;
  border-radius: 20px;
  width: 80%;
  max-width: 600px;
  padding: 0;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.modal.visible {
  display: block;
}

#required-fields-modal .modal-content {
  font-family: "Birthstone", cursive !important;
}

.modal-content {
  font-family: "Birthstone", cursive;
  font-size: 1.5rem;
  background-color: #fff4e6;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}

.hidden {
  display: none;
}

.close-button {
  float: right;
  font-size: 1.2rem;
  font-weight: bold;
  background: none;
  border: none;
  color: brown;
  cursor: pointer;
}

/* Force modal content and children to use Birthstone font */
#required-fields-modal .modal-content,
#required-fields-modal .modal-content * {
  font-family: "Birthstone", cursive !important;
}
/* Make it wider on large screens */
@media (min-width: 1200px) {
  .page-content {
    max-width: 1200px;
  }
}

@media screen and (max-width: 500px) {
  /* */
  :root {
    --column-width: 300px;
    --gap: 0.5rem;
  }
}
