/* === Base resets & Pixi canvas ========================================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* === Modal & backdrop styles =========================================== */
.river-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.06); /* high-key milky veil */
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 9990;
  backdrop-filter: blur(7px);
}
.river-modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Modal container (always centered; watercolor substrate applied here) */
.river-modal {
  box-sizing: border-box;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width:400px;
  min-height:600px;

  
  width: min(73vw, 35rem);
  height: auto;
  max-height: 92vh;
  max-height: 92svh;
  max-height: 92dvh;
  
  max-width: 456px;

  background: transparent;
  color: #0e1525;
  border-radius: 14px;

  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9991;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;

  isolation: isolate;
  padding:0 ;
}
.river-modal.is-visible {
  box-shadow: 0 2px 3px rgba(0,0,0,0.4);
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  visibility: visible;
  background: #fffce0 url("../img/dark-stripes-light.png");
  
}


/* Ensure header & content above the substrate */
.river-modal__header,
.river-modal__content {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

/* Modal header + close button */
.river-modal__header {
  text-align:right;
  backdrop-filter: none;
}
.river-modal__title {
  font-weight: 600;
  letter-spacing: .3px;
  font-size: clamp(1.6rem, 2.8vh + 1vw, 5rem);
  padding:0 2rem;
}
.river-modal__close {
  text-align:center;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;

  min-width: 52px;
  min-height: 52px;
  font-size: clamp(2.2rem, 3vh + 1vw, 2.8rem);
}
.river-modal__close:hover { background: rgba(14,21,37,0.08); }

/* Modal content */
.river-modal__content {
  font-size: 1.1rem;
  line-height: 1.4;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding:0 2rem;
}

/* Hide duplicate title in content */
.river-modal__content .river-modal__title,
.river-modal__content .modal-title,
.river-modal__content > h1:first-child,
.river-modal__content > header > h1:first-child {
  display: none !important;
}

/* Clear backgrounds inside content */
.river-modal__content > div,
.river-modal__content > section,
.river-modal__content > article,
.river-modal__content > header,
.river-modal__content > footer {
  background: transparent;
  box-shadow: none;
}

/* Media wrapper */
.river-modal__media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 22vh;
  margin: 0 3rem 1rem 3rem;
  border-radius: .5rem;
  background: #f7f7f7;
  overflow: hidden;
}
.river-modal__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Prevent body scroll */
body.river-modal-open { overflow: hidden; }

/* Notice block */
.river-modal__notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin: 8px 0 12px 0;
  border-radius: 12px;
  background: rgba(255, 213, 0, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.38);
}
.river-modal__notice-icon img {
  display: block;
  max-height: 48px;
  height: auto;
  width: auto;
}
.river-modal__notice-text {
  font-size: clamp(1.05rem, 1.6vh + 0.6vw, 1.2rem);
  line-height: 1.55;
}

/* Card media sizing */
#river-card-media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
#river-card-media picture,
#river-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}



/* === Watercolor button substrate ====================================== */
.river-modal__actions {
  display: flex;
  justify-content: center;
  margin-top:auto;
  padding-bottom:1rem;
}

.river-btn {

  height: 70px;
  width: 193px;
  opacity: .75;

  background: url(/themes/custom/inspirarte/img/watercolor-button.png);
  background-position: left center;
  background-size: cover;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;              /* white text */
  font-weight: bold;        /* bold text */
  font-size:1.6rem;

  text-decoration: none;
  border: none;
  cursor: pointer;
  z-index: 1;
}

.river-btn:hover { transform: translateY(-1px); transition: transform 120ms ease; }
.river-btn:active { transform: translateY(0); }
.river-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 5px hsl(203 80% 72% / .55);
  border-radius: 12px;
}

/* === Modal typography: EB Garamond (scoped) ============================ */
.river-modal,
.river-modal__title,
.river-modal__content,
.river-modal__actions,
.river-modal__notice,
.river-modal__notice-text {
  font-family: "EB Garamond", ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.river-modal__chapter {
    padding: 0 2rem;
    text-align: center;
    margin-bottom: .5rem;
}

.river-modal__title {
  font-weight: 700;
  line-height:2.5rem;

}

.river-btn {
  font-family: "EB Garamond", ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 700;
}


/* MOBILE RESPONSIVE CSS PORTRAIT*/

/* Handheld portrait only (no hover, coarse pointer, narrow viewport) */
@media (orientation: portrait) and (hover: none) and (pointer: coarse) and (min-resolution:2dppx) {
  .river-modal {
    width: 85vw;
    height:69vh;
    max-width: 85vw;
    aspect-ratio: 2 / 3;
    height: auto;
    /* dual-cap for stable height across mobile browsers */
    max-height: 92svh;
    max-height: 92dvh;

    min-width: unset;
    min-height: unset;
  }

  .river-modal__header {
    min-height: 10%;
    font-size: 1em; /* scale with modal’s text size */
  }

  .river-modal__close {
    width: 17%;
    height: 100%;
    /* avoid vh for text (URL bar jitter); tie to container instead */
    font-size: 5vh;
    line-height: 1;     
  }

  /* Large side margins (10rem) will crush small phones; make them fluid */
  .river-modal__media {
    margin:0 10rem 2rem 10rem;
  }

  /* Use rem for readability; avoid vh so text doesn’t shrink when bars appear */
  .river-modal__content,
  .river-modal__notice-text {
    font-size:2.1rem;
    line-height: 1.5;
  }

  .river-modal__notice {
    border: 7px solid rgba(255, 193, 7, 0.38);
  }

  /* Icon height tied to viewport can jitter; prefer em relative to text */
  .river-modal__notice-icon img {
    max-height:5vh;
  }

  .river-modal__actions{
    padding-bottom:2.5rem;
  }

  .river-btn {
    
    font-size:2.8rem;
    width:40%;
    height:auto;
    
    padding:2rem 0;
  }
}

/* MOBILE RESPONSIVE CSS LANDSCAPE*/

@media (orientation: landscape) and (hover: none) and (pointer: coarse) and (min-resolution: 2dppx) {
    .river-modal {
      min-width: 800px;
      min-height: 84vh;
      max-width: 800px;

      width: min(73vw, 35rem);
      max-height: 92vh;
      max-height: 92svh;
      max-height: 92dvh;
      max-width: 800px;

    }

    .river-modal__media {
      display:none;
    }
    .river-modal__content {
      column-count: 2;
    }

}
/* --- Logo-triggered menu content ---------------------------------------- */
.river-menu {
  display: grid;
  gap: 12px;
  padding: 0 2rem 1.25rem 2rem;
}

.river-menu__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: #0e1525;
  background: rgba(14, 21, 37, 0.08);
}
.river-menu__btn:hover { background: rgba(14, 21, 37, 0.12); }

/* Logo shown inside the menu modal */
.river-modal__logo {
  display: block;
  max-width: 60%;
  height: auto;
  margin: 0 auto 1rem;
}

/* Special modal: take over layout from template */
.river-modal.is-special .river-modal__media,
.river-modal.is-special .river-modal__title,
.river-modal.is-special .river-modal__actions {
  display: none !important;
}

/* Optional: give special content a bit more breathing room */
.river-modal.is-special .river-modal__content {
  padding-top: 1rem;
}

.river-modal__content .copyright {
  text-align:center;
}