/* =============================================================
   Coasts in Crisis — global stylesheet
   -------------------------------------------------------------
   1. Custom properties & reset
   2. Base typography & links
   3. Layout: header & footer
   4. Shared components (page header, nav buttons, curator box)
   5. Homepage: interactive hurricane-path map
   6. Info pages: About, Resources, People
   7. Pathway pages: Entangled Ecologies, Predictable Precarity,
      Creative Resistance
   8. Responsive overrides
   ============================================================= */

/* -------------------------------------------------------------
   1. Custom properties & reset
   ------------------------------------------------------------- */

:root {
  --teal: #008080;
  --ink: #333;
  --muted: #a0a0a0;
  --pill-bg: #d9d9d9;
  --pill-ink: #454545;
  --max-width: 1140px;
}

* {
  box-sizing: border-box;
}

/* -------------------------------------------------------------
   2. Base typography & links
   ------------------------------------------------------------- */

body {
  margin: 0;
  font-family: Geneva, Verdana, sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  background-color: #fff;
  background-image: url("../images/map_grid.png");
  background-repeat: repeat;
  background-size: 900px 450px;
}

a {
  color: var(--teal);
}

/* body-text links: gray pill, teal on hover */
p > a,
.resource-links a {
  background-color: var(--pill-bg);
  color: var(--pill-ink);
  padding: 0 0.5em;
  text-decoration: none;
}

p > a:hover,
.resource-links a:hover {
  background-color: var(--teal);
  color: var(--pill-bg);
}

/* -------------------------------------------------------------
   3. Layout: header & footer
   ------------------------------------------------------------- */

.site-header {
  padding: 1.5rem 1rem 0.5rem;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* full-width and centered, like the original navbar-brand (col-md-12,
   text-align: center, font-size: 50px) — stacked above the nav, not
   beside it */
.site-brand {
  display: block;
  text-align: center;
  font-family: Tahoma, sans-serif;
  font-size: 50px;
  color: var(--teal);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.site-nav a {
  font-family: Tahoma, sans-serif;
  color: var(--teal);
  text-decoration: none;
  font-size: 1.1rem;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink);
  font-size: 0.9rem;
}

/* -------------------------------------------------------------
   4. Shared components
   ------------------------------------------------------------- */

.page-header {
  text-align: center;
  font-family: Tahoma, sans-serif;
  font-size: 1.9rem;
  font-weight: normal;
  color: var(--teal);
  padding-top: 1.5rem;
  margin: 0 auto 1rem;
}

.button-nav {
  display: inline-block;
  background-color: var(--teal);
  color: #e7e7e7;
  padding: 0.6em 1.3em;
  text-decoration: none;
  font-size: 1rem;
  border-radius: 50px;
  white-space: nowrap;
}

.button-nav:hover,
.button-nav:active {
  background-color: var(--muted);
  color: #e7e7e7;
}

/* curator statement box: translucent gray card used across the
   homepage, info pages, and pathway pages */
.curator-msg {
  max-width: 42em;
  margin: 2rem auto 4rem;
  padding: 1.5em 2em;
  line-height: 1.6;
  background-color: rgba(217, 217, 217, 0.7);
}

/* -------------------------------------------------------------
   5. Homepage: interactive hurricane-path map
   ------------------------------------------------------------- */

.hero {
  position: relative;
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero__icons {
  position: absolute;
  /* matches .hero's padding so this box lines up exactly with the map image
     (a plain inset: 0 spans the padded box, not the image itself) */
  inset: 0 1rem;
}

.hurricane-icon {
  position: absolute;
  width: 5em;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.hurricane-icon img {
  display: block;
  width: 100%;
  height: auto;
}

/* positioned over the magenta (María) path, near the islands */
.icon-irma {
  top: 29.25%;
  left: 22.6%;
}

/* positioned below the loop in the yellow (José) path */
.icon-jose {
  top: 54.17%;
  left: 60.6%;
}

/* positioned over the top section of the green (Irma) path */
.icon-maria {
  top: 12.5%;
  left: 66%;
}

.rotate {
  animation: rotation 8s infinite linear;
}

@keyframes rotation {
  from { transform: rotate(359deg); }
  to { transform: rotate(0deg); }
}

.overlay-container {
  position: relative;
}

.hero__base {
  display: block;
  width: 100%;
  height: auto;
}

.overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay-container:hover .overlay {
  opacity: 1;
}

.pathway {
  position: absolute;
  inset: 0;
}

.pathway img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pathway a {
  position: absolute;
  z-index: 20;
}

.pathway--entangled a {
  top: 6%;
  right: 4%;
}

/* between the yellow-line icon (54.17%) and the magenta/yellow crossing
   point (71%), nudged up from the midpoint */
.pathway--predictable a {
  top: 58.4%;
  right: 12%;
}

/* left of and slightly higher than the magenta-line icon (22.6%, 29.25%),
   so the two aren't symmetrically aligned — left is set so the button's
   own center lands left of the icon, not just its edge */
.pathway--creative a {
  top: 20.8%;
  left: 6.3%;
}

/* -------------------------------------------------------------
   6. Info pages: About, Resources, People
   ------------------------------------------------------------- */

.page-content {
  max-width: 50em;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
  line-height: 1.6;
}

.page-content h2 {
  color: var(--teal);
  font-family: Tahoma, sans-serif;
  font-weight: normal;
  margin-top: 2.5rem;
}

.page-content hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 1.5rem 0;
}

.resource-links {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.resource-links li {
  margin-bottom: 0.6rem;
}

.sponsors {
  display: block;
  height: auto;
  width: 750px;
  max-width: 100%;
  margin: 1.5rem auto;
}

.person {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 2rem 0;
}

.portrait {
  flex-shrink: 0;
  border-radius: 1em;
  height: 15em;
  width: auto;
  max-width: 100%;
}

.portrait--team {
  height: 14em;
}

.people-p {
  text-align: justify;
}

/* -------------------------------------------------------------
   7. Pathway pages
   ------------------------------------------------------------- */

.pathway-content {
  max-width: 62em;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.6;
  overflow: hidden;
}

.pathway-content figure {
  margin: 1.5em 0;
}

.pathway-content figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.25em;
}

/* full-bleed figures (not floated) fill the content column; floated
   ones (.align-left/.align-right, handled below) are excluded so their
   width="" HTML attribute — the real size Drupal displayed — governs
   instead of being stretched to fill the column */
.pathway-content figure:not(.align-left):not(.align-right) img {
  width: 100%;
}

.pathway-content figcaption {
  margin-top: 0.5em;
  font-size: 0.85em;
  font-style: italic;
  color: #666;
}

/* float only — no fixed width. The original never scaled these images
   down to a percentage; they render at their real width (via each img's
   own width/height attributes) up to the content column's max-width. */
.align-left {
  float: left;
  margin: 0 2em 1.5em 0;
}

.align-right {
  float: right;
  margin: 0 0 1.5em 2em;
}

.curator-msg.float-left {
  float: left;
  max-width: 22em;
  margin: 0 2em 1.5em 0;
}

.curator-msg.float-right {
  float: right;
  max-width: 24em;
  margin: 0 0 1.5em 2em;
}

.clear-left {
  clear: left;
}

.clear-right {
  clear: right;
}

.clear-both {
  clear: both;
}

.video-embed {
  max-width: 560px;
  margin: 1.5em 0;
  clear: both;
}

/* when a video is floated (e.g. next to another right-floated element
   like a curator box), it needs its own side margin back — otherwise
   .video-embed's own margin rule above wins and they end up touching */
.video-embed.align-left {
  margin: 0 2em 1.5em 0;
}

.video-embed.align-right {
  margin: 0 0 1.5em 2em;
}

.video-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

/* each pathway's own hurricane-path drawing sits behind the page's
   main content (hero image, curator text, video) as a watermark, with
   the rotating icon positioned on the line. Image files are named by
   pathway, not hurricane — the original theme's hurricane-name file
   names (and the .icon-maria/.icon-jose/.icon-irma classes on the
   homepage) don't match their actual rendered colors, so we go by
   pathway instead. */
.pathway-hero {
  position: relative;
}

/* sized purely by the background image's own aspect ratio (via the
   img's natural width/height), independent of how tall the sibling
   .pathway-hero__content ends up being — this way the icon's percentage
   position (below) always lines up with the same spot on the line,
   regardless of how much text/media the page has */
.pathway-hero__bkg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}

.pathway-hero__bkg {
  display: block;
  width: 100%;
  height: auto;
}

.pathway-hero__content {
  position: relative;
  z-index: 1;
}

.pathway-hero__icon {
  position: absolute;
  z-index: 1;
  width: 4em;
  transform: translate(-50%, -50%);
}

.pathway-hero__icon img {
  display: block;
  width: 100%;
  height: auto;
}

/* on the green line, mid-page */
.pathway-hero__icon--entangled-ecologies {
  top: 40%;
  left: 50.4%;
}

/* on the magenta line, upper-left */
.pathway-hero__icon--creative-resistance {
  top: 33.3%;
  left: 10%;
}

/* on the yellow line, upper-left */
.pathway-hero__icon--predictable-precarity {
  top: 33.3%;
  left: 5.9%;
}

/* Creative Resistance pages: rounded, padded figures with centered captions */
.cr-page figure img {
  border-radius: 20px;
  padding: 10px;
}

.cr-page figcaption {
  text-align: center;
}

/* Predictable Precarity pages: poem excerpts and Nicole Delgado's boarding pass */
.exhibit-text {
  font-family: Courier, monospace;
  font-size: 1.2em;
  font-weight: bold;
}

.poem-title {
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 300;
  padding: 0.5em 0;
}

.boardingpass {
  display: block;
  width: 45em;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  margin: 1.5em 0;
}

.spiral-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  clear: both;
  margin: 3em 0 2em;
}

.button-left,
.button-right {
  background-color: var(--teal);
  color: #e7e7e7;
  padding: 10px 21px;
  text-decoration: none;
  border-radius: 50px;
  font-size: 0.95rem;
}

.button-left:hover,
.button-right:hover {
  background-color: var(--muted);
  color: #e7e7e7;
}

/* -------------------------------------------------------------
   8. Responsive overrides
   ------------------------------------------------------------- */

@media (max-width: 640px) {
  .site-brand {
    font-size: 2rem;
  }

  .site-nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .button-nav {
    font-size: 0.8rem;
    padding: 0.4em 0.8em;
  }

  /* scale hurricane icons down 10% on mobile */
  .hurricane-icon {
    width: 4.5em;
  }

  .person {
    flex-direction: column;
  }

  .portrait,
  .portrait--team {
    height: auto;
    width: 60%;
    margin: 0 auto;
  }

  .align-left,
  .align-right,
  .curator-msg.float-left,
  .curator-msg.float-right {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1.5em;
  }
}

@media (min-width: 1024px) {
  /* scale hurricane icons up 10% on laptop/desktop */
  .hurricane-icon {
    width: 5.5em;
  }
}
