/* Reset margin/padding */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

section {
  display: block; /* default for non-JS users */
}

.js-enabled section {
  display: none;
}

.js-enabled section.active {
  display: block;
}

/* Golden ratio-based typography for headings */
h1 {
  font-size: 2.75rem; /* ~44px */
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.7rem; /* ~27px */
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.05rem; /* ~17px */
  margin-bottom: 1rem;
}

h4 {
  font-size: 1rem;
}

h5 {
  font-size: 0.95rem;
}

h6 {
  font-size: 0.9rem;
}

p, ul, ol {
  padding: 0;
  margin-bottom: 1rem;
}

ol, ul {
  padding-left: 2.5rem;
}

html {
  scroll-behavior: smooth;
}

html, body {
  font-family: 'Lato', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #333;
  font-size: 1.1rem;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* full height of viewport */
}

nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  background-color: #782F40;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
}

nav a {
  text-decoration: none;
  color: #FFF;
  font-weight: bold;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 999px; /* pill shape */
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover {
  background-color: #5f2433; /* slightly darker on hover */
}

nav a.active {
  background-color: #5f2433; /* darker pill for active link */
  color: #fff;
}

main {
  display: flex;
  flex: 1; /* takes up available space, allows main to grow and push footer down */
  align-items: flex-start;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

aside {
  position: sticky;
  flex: 0 0 33.33%; /* Takes 1/3 of the space */
  align-self: flex-start;
  top: 6rem;
  max-width: 400px;  /* Prevents it from getting too wide */
  
  height: fit-content;
}

.profile-card {
  padding: 2rem 0;
  margin: 0 1rem;       /* center horizontally */
  display: block;       /* ensure it obeys auto margins */
  max-width: 100%;      /* don't exceed aside width */
  background-color: #f0f0f0;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  text-align: center;
}

.headshot {
  width: 85%;
  border: 2px solid #e5e5e5;
  border-radius: 5px;
  flex-shrink: 0;
}

.small-headshot {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.icons {
  display: flex;
  justify-content: space-around;
  margin: 0 2rem;
}

.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: transparent;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.icon-wrapper:hover {
  background-color: #782F40; /* maroon */
  transform: scale(1.05);
}

.icon-wrapper i {
  font-size: 2rem;
  color: #782F40;
  transition: color 0.3s ease;
}

.icon-wrapper:hover i {
  color: #ffffff;
}

#email-form-container {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease;
  margin: 1rem;
  background-color: #f0f0f0;
  border-radius: 8px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
}

#email-form-container.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 1000px; /* large enough to fit content */
}

#email-form-container form {
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  margin: 0 1rem;
}

.form-field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

#email-form-container input,
#email-form-container textarea,
#email-form-container select {
  font-family: inherit;
  font-size: 1.1rem; /* Match body font size */
}

#email-form-container input,
#email-form-container textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 15rem;
  overflow-y: auto;
}

#email-form-container select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background-color: white;
  appearance: none;
}

#email-form-container select:focus {
  outline: none;
  border-color: #782F40;
  box-shadow: 0 0 0 2px rgba(120, 47, 64, 0.2);
}

#custom-subject-container input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* Make inputs grow vertically as content increases */
#email-form-container input[type="text"],
#email-form-container textarea {
  min-height: 2.5rem;
  resize: vertical;
  overflow: auto;
}

.auto-expand {
  overflow: hidden;
  transition: height 0.2s ease;
}

#email-form-container button {
  background-color: #782F40;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
}

.confirmation-checkmark {
  font-size: 3rem;
  color: #782F40;
  margin-bottom: 1rem;
  animation: pop 0.5s ease-out;
}

@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.my-content {
  flex: 0 1 66.66%; /* Takes 2/3 of the space */
  max-width: 800px;
  margin: 0 auto;
}

section {
  line-height: 1.3;
  display: none;
  padding: 2rem;
  margin: 2rem 1rem;
  max-width: 100%;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

  word-break: break-word;
  overflow-wrap: break-word;
}

section.active {
  display: block;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #782F40;
  color: white;
}

@media (max-width: 1024px) {
  nav {
    position: sticky;
    top: 0;
    z-index: 9999;
    background-color: #782F40;
    display: flex;
    padding: 1rem;
    gap: 1rem;
  }

  nav a {
    font-size: 0.9rem;
    padding: 0.5rem;
    display: inline-block;
    flex: 0 0 auto;
  }

  main {
    flex-direction: column;
    gap: 1rem;
  }

  aside {
    margin: 2rem auto 0;
    width: 100%;
    position: static;
    box-shadow: none;
    background-color: transparent;
  }

  section {
    padding: 1em;
    margin: .5em;
  }

  footer {
    text-align: center;
    padding: 1rem;
    background-color: #782F40;
    color: white;
  }
}

@media (prefers-color-scheme: dark) {
  html, body {
    background-color: #121212;
    color: #e0e0e0;
    font-size: 1.1rem;
  }

  nav {
    background-color: #1f1f1f;
  }

  nav a {
    color: #e0e0e0;
  }

  .profile-card {
    background-color: #1e1e1e;
    color: #f0f0f0;
  }

  .my-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
  }

  section {
    background-color: #1c1c1c;
    color: #e0e0e0;
    box-shadow: none;
  }

  footer {
    background-color: #1f1f1f;
    color: #aaa;
  }

  a {
    color: #8ab4f8;
  }
}