/* =========================
   FONT DECLARATIONS
   ========================= */
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-SemiBold.woff2') format('woff2'),
       url('../fonts/Nunito-SemiBold.woff') format('woff');
}

@font-face {
  font-family: 'TheanoDidot';
  src: url('../fonts/TheanoDidot-Regular.woff2') format('woff2'),
       url('../fonts/TheanoDidot-Regular.woff') format('woff');
}

/* =========================
   BASE STYLES (ALL PAGES)
   ========================= */
body {
  margin: 0;
  font-family: 'TheanoDidot', serif;
  font-weight: 100;
  background-color: #F5DFDD;
  color: #0019A9;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

::selection {
  background: #FFEA00;
  color: inherit;
}

::-moz-selection {
  background: #FFEA00;
  color: inherit;
}

a.highlight::selection {
  color: #0019A9;
}

/* =========================
   HOME PAGE
   ========================= */
body.home {
  display: flex;
  justify-content: center;
  padding: 4rem;
}

body.home .home-text {
  max-width: 700px;
  font-size: clamp(1.6rem, 3vw, 3rem);
  text-align: left;
  line-height: 1.45em;
}

@media (max-width: 768px) {
  body.home {
    padding: 2rem 1rem;  /* top/bottom, left/right */
    justify-content: flex-start; /* keep text aligned to left edge */
  }

  body.home .home-text {
    font-size: clamp(1.6rem, 4vw, 3rem);
    max-width: 100%;
  }
}

/* Highlighted terms on home page */
body.home a.highlight {
  background-color: #0019A9;
  color: #F5DFDD; 
  padding: 0.07em 0.05em;
  font-family: Nunito;
  font-weight: bold;
  display: inline-block;
  line-height: 1; /* fix line height so no vertical shift */
  transition: padding 0.03s ease; /* quick hover */
}

body.home a.highlight:hover {
  background-color: #0019A9;
  padding: 0.15em 0.25em; /* vertical + horizontal grow */
}

.topic-word {
/*  font-family: 'Nunito', sans-serif;
  font-weight: bold;*/
  cursor: pointer;
}

.topic-word:hover {
  text-decoration: underline; /* subtle feedback */
}

/* =========================
   SECONDARY PAGES

   WRITING
   ========================= */
body.secondary {
  display: flex;
  font-size: clamp(1rem, 1.6vw, 1.25rem); /* base scaling */
}

body.secondary nav.sidebar {
  padding-top: 2.5em; /* scales with font size */
  position: fixed;
  top: 8em;
  left: 0;
  bottom: 0;
  margin-left: 2rem;
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Sidebar links */
body.secondary nav.sidebar a {
  display: inline-block;
  background-color: #0019A9;
  color: #F5DFDD;
  font-family: Nunito;
  font-weight: bold;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  padding: 0.05em 0.15em;
  margin-bottom: 0.3em;
  line-height: 1;
  transition: padding 0.03s ease;
}

body.secondary nav.sidebar a:hover,
body.secondary nav.sidebar a.active {
  background-color: #0019A9;
  padding: 0.15em 0.25em; 
}

body.secondary nav.sidebar a:first-child {
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  background-color: #F5DFDD;
  color: #0019A9; 
}

/* Content area */
body.secondary main.content {
  margin-left: calc(2rem + 8ch); /* dynamic space for sidebar width */
  padding: 4rem;
  flex: 1;
  display: flex;
  justify-content: center;
}

body.secondary main.content > div {
  max-width: 700px;
  width: 100%;
  font-size: 1em; /* inherits dynamic scaling from body */
  text-align: left;
}

/* Headings */
body.secondary main.content h1 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  margin-bottom: 2rem;
}

body.secondary main.content h2 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

/* Lists */
body.secondary main.content ul {
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

body.secondary main.content ul li {
  margin-bottom: 0.4em;
}

body.secondary main.content ol {
  margin-top: 0.4em;
}

body.secondary main.content ol li {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}

/* =========================
   IMAGE GALLERY LINKS
   ========================= */
.image-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 100%;
}

.image-gallery .image-link {
  position: relative;
  display: block;
}

.image-gallery .image-link img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;    /* create a stacking context for z-index */
  z-index: 1;
}

.overlay-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 25, 169, 0.85);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.03s ease-in-out;
}

.overlay-title {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  color: #F5DFDD;
  font-family: 'TheanoDidot', serif;
  font-weight: bold;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.03s ease-in-out;
}

.image-link:hover .overlay-bg,
.image-link:hover .overlay-title {
  opacity: 1;
}

.img-descrip {
  font-family: 'Nunito', sans-serif !important;
  font-size: clamp(0.8rem, 1.5vw, 1.2rem);
  font-weight: 400;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.art-descrip {
  font-family: 'TheanoDidot', serif;
  font-size: clamp(1.3rem, 3vw, 2.3rem);
  line-height: 1.35;
  margin-top: 0.6em;  /* space between the image descrip and art descrip */
}

.art-descrip .highlight {
  background-color: #0019A9;
  color: #F5DFDD; 
  padding-top: 0.07em;
  padding-bottom: 0.04em;
  padding-left: 0.05em;
  padding-right: 0.05em;
  display: inline-block;
}

/* =========================
   CONTACT FORM
   ========================= */
.contact-form {
  display: flex;
  flex-direction: column;
  /*gap: 1rem;*/
  margin-top: 2rem;
}

.contact-form label {
  font-family: 'Nunito', sans-serif;
  font-weight: bold;
  color: #0019A9;
  padding: 0.1em 0.2em;
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  border: 3px solid #0019A9;
  background-color: #F5DFDD;
  color: #0019A9;
  padding: 0.5em;
  font-family: 'TheanoDidot', serif;
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
}

.contact-form button {
  align-self: flex-start;
  background-color: #0019A9;
  color: #F5DFDD;
  font-family: 'Nunito', sans-serif;
  font-weight: bold;
  font-size: 1rem;
  padding: 0.6em 1.2em;
  border: none;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: #FFEA00;
  color: #0019A9;
}

/* =========================
   HAMBURGER MENU
   ========================= */

/* ===== Desktop defaults (guard) ===== */
.hamburger { display: none; }
.overlay-menu { display: none; }

/* Ensure desktop sidebar shows on wide screens */
@media (min-width: 769px) {
  .hamburger,
  .overlay-menu { display: none !important; }

  /* Desktop sidebar visible & positioned like before */
  body.secondary nav.sidebar {
    display: flex !important;
  }
}

/* ===== Mobile: fullscreen overlay menu ===== */
@media (max-width: 768px) {
  body.secondary nav.sidebar {
    display: none !important;
  }

  /* Hamburger button */
  .hamburger {
    display: block;
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: #0019A9;
    font-size: 2rem;
    border: none;
    padding: 0;
    border-radius: 0;
    z-index: 1000; /* lower than overlay */
    cursor: pointer;
  }

  /* Fullscreen overlay */
  .overlay-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #0019A9;
    transform: translateY(-100%);
    transition: transform 0.03s ease;
    z-index: 1100;
    padding-top: 3rem; /* push content down */
  }
  .overlay-menu.open { transform: translateY(0); }

  /* Close button */
  .close-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #F5DFDD;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1200; /* above everything */
  }

  .overlay-links {
    width: 100%;
    padding-top: 2rem;
    margin: 0;
  }

  .overlay-links a {
    display: block;
    width: 100%;
    padding: 0.4rem 0;
    font-size: 1.8rem;
    color: #F5DFDD;
    text-decoration: none;
    font-family: 'TheanoDidot', serif;
    text-transform: uppercase;
    text-align: center;
    position: relative;
  }

/* uncomment for lines between menu items.
 * left: x%; controls the margin inset
 * height: xpx; controls line weight

  .overlay-links a::after {
    content: "";
    position: absolute;
    left: 5%;
    right: 5%;
    bottom: 0;
    height: 0.5px; 
    background: #F5DFDD;
  }

  .overlay-links a:first-child::before {
    content: "";
    position: absolute;
    left: 5%;
    right: 5%;
    top: 0;
    height: 0.5px;  
    background: #F5DFDD;
  } 
 */

  .overlay-links a:hover,
  .overlay-links a.active {
    color: #FFEA00;
  }

  /* Prevent background scroll when menu is open */
  body.menu-open { overflow: hidden; }

  /* Content remains full width under */
  body.secondary main.content {
    margin-left: 0 !important;
    padding: 2rem 1rem;
  }
}
