/* Elves Tembe - PHE Teacher Portfolio
   Matches the original Weebly look: white header, light-grey spaced nav with
   grey flyout menus, red gradient pages and a pale-grey About/Home page. */

:root {
  --red: #ee1111;
  --ink: #2b2b2b;
  --nav: #8a8a8a;
  --menu-bg: #f5f5f5;
  --menu-hover: #e4e4e4;
  --link: #5b9aa9;
  --page-light: #f3f4f4;
  --col: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Gentium Book Plus", Georgia, serif;
  color: var(--ink);
  line-height: 1.6;
  background: #fff;
}

img { max-width: 100%; display: block; }
a { color: var(--link); }

/* ---------- Header ---------- */

.site-header { text-align: center; padding: 56px 20px 40px; background: #fff; }
.site-header p {
  margin: 0;
  font-family: "Cambo", Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  text-transform: uppercase;
  color: #111;
}

/* ---------- Nav ---------- */

nav.main-nav {
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 2vw, 32px);
  padding: 0 20px;
  height: 36px;
  position: relative;
  z-index: 20;
  font-family: "Lora", Georgia, serif;
  font-size: clamp(0.6rem, 1.05vw, 0.78rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-line { width: 80px; height: 1px; background: #ccc; }

nav.main-nav > a,
nav.main-nav .nav-parent {
  display: block;
  line-height: 36px;
  padding: 0 10px;
  margin: 0 -10px;
  text-decoration: none;
  color: var(--nav);
}

/* Dropdown parents are buttons that look like the other items. */
nav.main-nav .nav-parent {
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
nav.main-nav .nav-parent::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}
nav.main-nav .has-dropdown.open > .nav-parent::after { transform: translateY(2px) rotate(-135deg); }

nav.main-nav > a:hover,
nav.main-nav .nav-parent:hover,
nav.main-nav .has-dropdown.open > .nav-parent,
nav.main-nav a.active,
nav.main-nav .nav-parent.active { background: var(--menu-bg); color: #666; }

.has-dropdown { position: relative; }

.dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: -10px;
  width: 220px;
  background: var(--menu-bg);
  font-family: "Raleway", Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* Click opens a dropdown (nav.js). Without JavaScript, hover and keyboard focus still work. */
.has-dropdown.open > .dropdown-panel,
html:not(.js) .has-dropdown:hover > .dropdown-panel,
html:not(.js) .has-dropdown:focus-within > .dropdown-panel { display: block; }

.dropdown-panel a {
  display: block;
  padding: 7px 15px;
  line-height: 1.05;
  color: #555;
  text-decoration: none;
}
.dropdown-panel a:hover { background: var(--menu-hover); }

/* Keep the last dropdown inside the screen edge. */
.has-dropdown:last-of-type > .dropdown-panel { left: auto; right: -10px; }

/* Drawer controls only exist on small screens. */
.nav-toggle, .nav-close, .nav-overlay { display: none; }

@media (max-width: 1360px) {
  .nav-line { display: none; }
}

/* Tablets: tighter text so all seven items stay on one line. */
@media (min-width: 821px) and (max-width: 1100px) {
  nav.main-nav { letter-spacing: 0.045em; gap: 11px; padding: 0 12px; }
  nav.main-nav .nav-parent::after { margin-left: 4px; }
}
@media (min-width: 821px) and (max-width: 900px) {
  nav.main-nav { letter-spacing: 0.04em; gap: 8px; }
}
@media (min-width: 960px) and (max-width: 1100px) {
  nav.main-nav { letter-spacing: 0.05em; gap: 17px; }
}

/* ---------- Hero photo (home / about) ---------- */

.hero-photo { width: 100%; height: 340px; overflow: hidden; background: #cfd8c6; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.hero-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #6c7a63; font: 0.9rem "Raleway", sans-serif;
}

/* ---------- Page body ---------- */

main { margin: 0 auto; padding: 60px 24px 90px; max-width: calc(var(--col) + 48px); }

main h2 {
  font-family: "Lora", Georgia, serif;
  font-size: 1.75rem;
  line-height: 1.25;
  text-align: center;
  margin: 1.4em 0 0.5em;
}
main h2:first-child { margin-top: 0; }
main h3 {
  font-family: "Lora", Georgia, serif;
  font-size: 1.25rem;
  text-align: center;
  margin: 1.4em 0 0.5em;
}
main h4.label {
  font-family: "Lora", Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin: 1.8em 0 0.8em;
}
main p { margin: 0 0 1em; font-size: 1.05rem; }
main hr.rule { border: 0; border-top: 1px solid #dcdcdc; margin: 1.6em 0; }
ul.plain { padding-left: 1.2em; margin: 0 0 1em; }
ul.plain li { margin-bottom: 0.4em; }

.figure, figure { margin: 1.6em 0; text-align: center; }
.figure img, figure img { margin: 0 auto; }
figcaption { font-size: 0.9rem; font-style: italic; margin-top: 8px; }

.img-row { display: grid; gap: 14px; margin: 1.6em 0; }
.img-row.cols-2 { grid-template-columns: 1fr 1fr; }
.img-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.img-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.img-row figure { margin: 0; }
.img-row img { width: 100%; }

.side { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin: 1.4em 0; }
.side figure { margin: 0; }
.side-text p { font-size: 1rem; }

.yt-embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* video placeholder: replace with a YouTube embed when the URL is known */
.video-ph {
  position: relative; aspect-ratio: 16 / 9; background: #1b1b1b; color: #fff;
  display: flex; align-items: flex-end; text-align: left;
}
.video-ph .video-label { padding: 10px 14px; font: 600 0.8rem "Raleway", sans-serif; }
.video-ph .play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px;
  background: #e00; border-radius: 12px;
}
.video-ph .play::after {
  content: ""; position: absolute; left: 25px; top: 12px;
  border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}

.media-ph {
  background: rgba(255,255,255,0.55); border: 1px dashed #999; height: 220px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 16px;
  color: #666; font: 0.85rem "Raleway", sans-serif;
}

.note-box { background: rgba(255,255,255,0.6); border-left: 3px solid var(--red); padding: 14px 18px; margin: 1.4em 0; }

/* slideshow: horizontal scroll-snap */
.slideshow { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 1.2em 0; background: #fff; }
.slide { flex: 0 0 100%; scroll-snap-align: start; }
.slide img { width: 100%; }

/* embedded PDF viewer look */
.pdf-viewer { background: #323639; margin: 1.5em 0; }
.pdf-bar { display: flex; justify-content: space-between; padding: 12px 18px; color: #eee; font: 0.8rem "Raleway", sans-serif; background: #3b3f43; }
.pdf-page { padding: 12px; background: #525659; }
.pdf-page img { margin: 0 auto; background: #fff; }
.pdf-bar a { color: #eee; }
.pdf-frame { display: block; width: 100%; height: 80vh; min-height: 480px; background: #525659; }
.pdf-frame p { padding: 1em; color: #eee; }
.pdf-frame a { color: #fff; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin: 2em 0; }
.card { background: rgba(255,255,255,0.85); padding: 18px; text-decoration: none; color: var(--ink); }
.card h3 { text-align: left; margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.92rem; }

/* ---------- Light theme (Home / About Me) ---------- */

.theme-light { background: var(--page-light); }
.theme-light .site-header, .theme-light nav.main-nav { background: #fff; }
.theme-light main { padding-top: 34px; }
.theme-light main p.italic-lead,
.theme-light main ul.plain {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
}
.theme-light main p.italic-lead { text-align: center; margin-bottom: 1.6em; }
.theme-light main h2 { font-size: 1.35rem; margin: 0.4em 0 0.4em; }
.theme-light main h3 { font-size: 1.15rem; margin: 1.2em 0 0.3em; }
.theme-light main ul.plain { color: #444; }
.theme-light main .about-content p,
.theme-light main .about-content ul,
.theme-light main .about-content ol {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
}
.theme-light main .about-content p { text-align: center; margin-bottom: 1.6em; }
.theme-light main .about-content ul,
.theme-light main .about-content ol { padding-left: 1.2em; margin: 0 0 1em; color: #444; }
.theme-light main .about-content li { margin-bottom: 0.4em; }
.theme-light figcaption { font-family: "Lora", Georgia, serif; text-align: left; }
.theme-light .img-row figure { text-align: left; }
.signature { display: block; text-align: center; padding: 20px 0; background: #fff; font: 1.3rem "Raleway", sans-serif; color: #666; }
.theme-light figure.figure { margin: 1.6em 0 0; }

/* ---------- Red gradient theme (all other pages) ---------- */

.theme-red {
  background: linear-gradient(to bottom, #ee1111 0, #ee1111 140px, #f07a77 700px, #f4c9c8 1500px, #f3eeee 100%) no-repeat;
  background-color: #f3eeee;
  min-height: 100vh;
}
.theme-red main h2:first-child { color: #fff; font-size: 2rem; }
.theme-red main h2 { color: #2b2b2b; }
.theme-red main h2.white { color: #fff; }
.theme-red main p.intro { color: #fff; text-align: justify; }
.theme-red main .intro-h3 { color: #fff; }
.theme-red main p { text-align: justify; }
.theme-red main h3 { color: #222; }
.theme-red a { color: #7a1010; }
.theme-red main { max-width: 960px; }
.theme-red .side-text p { text-align: left; }

main h3.left { text-align: left; }
.figure.narrow { max-width: 52%; margin-left: auto; margin-right: auto; }
.theme-red main h3.left.dark { color: #2b2b2b; }
.theme-red main h2.underline { text-decoration: underline; }
.theme-red main .accent { color: #e8605f; }
.theme-red main h3.white { color: #fff; }
.theme-red main h2.plain { font-weight: 400; }
.theme-red main p.center { text-align: center; }
.theme-red main h2.left { text-align: left; }
.theme-red main h2.white { color: #fff; }
.theme-red main h2.dark.left { color: #1d1d1d; }
.theme-red main h2.italic { font-style: italic; }
.theme-red main h3.sub-italic { font-style: italic; }
.side-media .side-text { margin-top: 12px; }
.theme-red .side.light, .theme-red .side.light .side-text p { color: #fff; }
.side.img-left { align-items: center; }
.small-caps-label { text-transform: uppercase; font-weight: 700; margin: 0 0 4px; }
.theme-red main .k { color: #3a0000; font-weight: 700; }
.theme-red main figcaption { font-style: normal; font-size: 1.05rem; text-align: center; }
.theme-red main h2.soft { color: #fff6f6; text-align: left; }
.theme-red main h2.dark { color: #2b2b2b; }

/* ---------- Footer ---------- */

footer.site-footer { text-align: center; padding: 26px 20px; font-size: 0.85rem; color: #777; background: #fff; }
footer.site-footer p { margin: 0; }

/* ---------- Mobile ---------- */

/* Without JavaScript the menu just wraps and stays visible. */
@media (max-width: 820px) {
  .site-header { padding: 28px 16px 18px; }
  nav.main-nav { height: auto; flex-wrap: wrap; gap: 4px 18px; padding: 6px 12px; font-size: 0.68rem; white-space: normal; }
  .nav-line { display: none; }
  .dropdown-panel, .has-dropdown:last-of-type > .dropdown-panel { position: static; width: auto; left: auto; right: auto; }
}

/* With JavaScript: a button opens the menu as a drawer from the left. */
@media (max-width: 820px) {
  .js .nav-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 20px;
    border: 0; background: #fff; color: var(--nav); cursor: pointer;
    font: 0.8rem "Lora", Georgia, serif; letter-spacing: 0.12em; text-transform: uppercase;
  }
  .nav-toggle-icon {
    width: 20px; height: 14px; color: currentColor;
    background:
      linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat,
      linear-gradient(currentColor 0 0) 0 100% / 100% 2px no-repeat;
  }

  .js .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45);
    opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s;
  }
  .js.nav-open .nav-overlay { opacity: 1; visibility: visible; transition: opacity 0.25s; }
  .js.nav-open { overflow: hidden; }

  .js nav.main-nav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: min(86vw, 330px); height: auto; padding: 56px 0 24px;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 0;
    overflow-y: auto; overscroll-behavior: contain;
    font-size: 0.8rem; letter-spacing: 0.1em;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    transform: translateX(-102%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0s 0.25s;
  }
  .js.nav-open nav.main-nav { transform: none; visibility: visible; transition: transform 0.25s ease; }

  .js .nav-close {
    display: block; position: absolute; top: 6px; right: 8px; width: 44px; height: 44px;
    border: 0; background: none; color: #666; font-size: 2rem; line-height: 1; cursor: pointer;
  }

  .js nav.main-nav > a,
  .js nav.main-nav .nav-parent {
    line-height: 1.3; padding: 13px 20px; margin: 0; border-bottom: 1px solid #eee;
  }
  .js nav.main-nav .nav-parent {
    display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left;
  }
  .js nav.main-nav .nav-parent::after { width: 8px; height: 8px; margin: 0 4px 4px 0; border-width: 2px; border-color: #888; }
  .js nav.main-nav .has-dropdown.open > .nav-parent::after { transform: translateY(4px) rotate(-135deg); }

  .js .dropdown-panel { box-shadow: none; }
  .js .dropdown-panel a { padding: 12px 20px 12px 32px; line-height: 1.3; border-bottom: 1px solid #eaeaea; }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .js nav.main-nav, .js .nav-overlay { transition: none; }
}

@media (max-width: 760px) {
  .side, .img-row.cols-2 { grid-template-columns: 1fr; }
  .img-row.cols-3 { grid-template-columns: 1fr; }
  .img-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .hero-photo { height: 170px; }
}
