/* =========================================================
   MAUI THE FISHERMAN
   Simple Premium Hawaiian Story
   Old Story / Moʻolelo Aesthetic
   Performance First
   ========================================================= */


/* =========================================================
   01. STORY VARIABLES
   ========================================================= */

.story-page {
  --story-reading-width: 700px;
  --story-hero-width: 1100px;

  --story-paper: #fff8e8;
  --story-paper-deep: #f8efd9;

  --story-ink: #30271f;
  --story-muted: #756858;

  --story-coral: #ad604b;
  --story-gold: #bd9454;
  --story-ocean: #123f50;

  --story-rule: rgba(91, 69, 45, 0.2);

  background: var(--story-paper);
  color: var(--story-ink);

  min-height: 100vh;
}


/* =========================================================
   HERO
   Image is supplied by HTML
   ========================================================= */

.story-hero {
  position: relative;

  width: 100%;

  min-height: min(680px, 82vh);

  display: flex;
  align-items: flex-end;

  overflow: hidden;

  background:
    #123f50;
}


/* =========================================================
   HERO IMAGE
   ========================================================= */

.story-hero-image {
  position: absolute;

  inset: 0;

  display: block;

  z-index: 0;
}

.story-hero-image img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  /*
    Slightly darkens the image without using
    a CSS background or expensive effects.
  */

  filter:
    brightness(0.72);
}


/* =========================================================
   HERO CONTENT
   ========================================================= */

.story-hero-content {
  position: relative;

  z-index: 2;

  width:
    min(
      calc(100% - 2rem),
      var(--story-reading-width)
    );

  margin:
    0 auto;

  padding:
    0 0 5rem;

  color:
    #fff8e8;

  text-align:
    left;

  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.5);
}

.story-hero-content > * {
  margin-left:
    0;

  margin-right:
    0;

  text-align:
    left;
}


/* =========================================================
   HERO EYEBROW
   ========================================================= */

.story-hero .eyebrow {
  margin:
    0 0 1.25rem;

  color:
    #f0d69b;

  font-family:
    var(--font-display);

  font-size:
    0.72rem;

  font-weight:
    700;

  letter-spacing:
    0.2em;

  text-transform:
    uppercase;
}


/* =========================================================
   HERO TITLE
   ========================================================= */

.story-hero h1 {
  max-width:
    700px;

  margin:
    0;

  color:
    #fff8e8;

  font-family:
    var(--font-display);

  font-size:
    clamp(
      3.5rem,
      9vw,
      6.5rem
    );

  font-weight:
    800;

  line-height:
    0.9;

  letter-spacing:
    -0.055em;

  text-wrap:
    balance;
}


/* =========================================================
   STRAIGHT BOTTOM EDGE
   ========================================================= */

.story-wave {
  display:
    none;
}


/* =========================================================
   DARK MODE
   ========================================================= */

html[data-theme="dark"] .story-hero {
  background:
    #071b24;
}

html[data-theme="dark"] .story-hero-image img {
  filter:
    brightness(0.55);
}

html[data-theme="dark"] .story-hero-content {
  color:
    #fff8e8;
}

html[data-theme="dark"] .story-hero h1 {
  color:
    #fff8e8;
}

html[data-theme="dark"] .story-hero .eyebrow {
  color:
    #e3c98f;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

  .story-hero {
    min-height:
      620px;
  }

  .story-hero-image img {
    object-position:
      62% center;
  }

  .story-hero-content {
    width:
      calc(100% - 2.5rem);

    padding-bottom:
      4.5rem;
  }

  .story-hero h1 {
    font-size:
      clamp(
        3rem,
        15vw,
        4.75rem
      );
  }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

  .story-hero {
    min-height:
      570px;
  }

  .story-hero-image img {
    object-position:
      60% center;
  }

  .story-hero-content {
    width:
      calc(100% - 2rem);

    padding-bottom:
      4rem;
  }

  .story-hero h1 {
    font-size:
      3.15rem;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .story-hero-image img {
    transition:
      none;
  }
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

  .story-hero {
    min-height:
      auto;

    background:
      none;
  }

  .story-hero-image {
    position:
      relative;
  }

  .story-hero-image img {
    height:
      auto;

    filter:
      none;
  }

  .story-hero-content {
    padding:
      2rem 0;

    color:
      #000;

    text-shadow:
      none;
  }

  .story-hero h1 {
    color:
      #000;
  }
}


/* =========================================================
   07. STORY CONTENT
   ========================================================= */

.story-content {
  width:
    100%;

  padding:
    5rem 1.25rem 7rem;

  background:
    var(--story-paper);
}


/* =========================================================
   08. CENTERED READING COLUMN
   ========================================================= */

.story-content > * {
  width:
    min(
      100%,
      var(--story-reading-width)
    );

  margin-left:
    auto;

  margin-right:
    auto;
}


/* =========================================================
   09. INTRODUCTION
   ========================================================= */

.story-intro {
  margin-bottom:
    5rem;

  padding:
    0 0 3rem;

  border-bottom:
    1px solid
    var(--story-rule);
}

.story-intro::before {
  content:
    "MOʻOLELO";

  display:
    block;

  margin-bottom:
    1.5rem;

  color:
    var(--story-coral);

  font-family:
    var(--font-display);

  font-size:
    0.7rem;

  font-weight:
    700;

  letter-spacing:
    0.2em;
}

.story-intro p {
  max-width:
    680px;

  margin:
    0;

  color:
    var(--story-muted);

  font-size:
    clamp(
      1.2rem,
      2.2vw,
      1.42rem
    );

  line-height:
    1.8;

  text-align:
    left;
}


/* =========================================================
   10. STORY SECTIONS
   ========================================================= */

.story-section {
  margin-bottom:
    5.5rem;

  text-align:
    left;
}


/* =========================================================
   11. SECTION HEADINGS
   ========================================================= */

.story-section h2 {
  margin:
    0 0 1.75rem;

  color:
    var(--story-ink);

  font-family:
    var(--font-display);

  font-size:
    clamp(
      2rem,
      4vw,
      2.8rem
    );

  font-weight:
    700;

  line-height:
    1.05;

  letter-spacing:
    -0.035em;

  text-align:
    left;
}


/* =========================================================
   12. SMALL RULE ABOVE HEADINGS
   ========================================================= */

.story-section h2::before {
  content:
    "";

  display:
    block;

  width:
    2.5rem;

  height:
    1px;

  margin-bottom:
    1.25rem;

  background:
    var(--story-coral);
}


/* =========================================================
   13. STORY BODY
   ========================================================= */

.story-text {
  max-width:
    680px;

  margin:
    0 auto;

  color:
    var(--story-ink);

  font-family:
    var(--font-body);

  font-size:
    1.08rem;

  line-height:
    1.9;

  text-align:
    left;
}

.story-text p {
  margin:
    0 0 1.55rem;
}

.story-text p:last-child {
  margin-bottom:
    0;
}


/* =========================================================
   14. FIRST LETTER
   ========================================================= */

.story-section:first-of-type
.story-text > p:first-child::first-letter {
  float:
    left;

  margin:
    0.08em
    0.12em
    0
    0;

  color:
    var(--story-coral);

  font-family:
    var(--font-display);

  font-size:
    4.4rem;

  font-weight:
    700;

  line-height:
    0.75;
}


/* =========================================================
   15. EMPHASIS
   ========================================================= */

.story-text strong {
  color:
    var(--story-ink);

  font-weight:
    800;
}

.story-text em {
  color:
    var(--story-coral);

  font-family:
    var(--font-display);

  font-size:
    1.04em;
}


/* =========================================================
   16. HAWAIIAN TERMS
   ========================================================= */

.hawaiian-term {
  color:
    var(--story-ocean);

  font-family:
    var(--font-display);

  font-weight:
    700;
}


/* =========================================================
   17. QUOTE
   ========================================================= */

.story-quote {
  width:
    min(
      100%,
      650px
    );

  margin:
    4.5rem auto;

  padding:
    2.5rem
    1.5rem;

  border-top:
    1px solid
    var(--story-rule);

  border-bottom:
    1px solid
    var(--story-rule);

  text-align:
    center;
}

.story-quote::before {
  content:
    "✦";

  display:
    block;

  margin-bottom:
    1.25rem;

  color:
    var(--story-gold);

  font-size:
    0.85rem;
}

.story-quote p {
  margin:
    0;

  color:
    #5d4937;

  font-family:
    var(--font-display);

  font-size:
    clamp(
      1.45rem,
      3vw,
      2rem
    );

  font-weight:
    600;

  line-height:
    1.45;
}


/* =========================================================
   18. STORY SECTION SPACING
   ========================================================= */

.story-section + .story-section {
  padding-top:
    0;
}


/* =========================================================
   19. STORY ENDING
   ========================================================= */

.story-ending {
  margin-top:
    6rem;

  padding:
    3rem 0 0;

  border-top:
    1px solid
    var(--story-rule);

  text-align:
    center;
}

.story-ending::before {
  content:
    "〰";

  display:
    block;

  margin-bottom:
    1.25rem;

  color:
    var(--story-gold);

  font-size:
    2rem;

  line-height:
    0.5;
}

.story-ending p {
  max-width:
    580px;

  margin:
    0 auto;

  color:
    var(--story-muted);

  font-family:
    var(--font-display);

  font-size:
    clamp(
      1.25rem,
      2.5vw,
      1.6rem
    );

  line-height:
    1.55;
}


/* =========================================================
   20. NAVIGATION
   ========================================================= */

.story-nav {
  width:
    min(
      calc(100% - 2rem),
      var(--story-reading-width)
    );

  margin:
    0 auto;
}

.story-nav a {
  color:
    inherit;

  text-decoration:
    none;
}

.story-nav a:hover {
  color:
    var(--story-coral);
}


/* =========================================================
   21. SELECTION
   ========================================================= */

::selection {
  color:
    #fff8e8;

  background:
    var(--story-coral);
}


/* =========================================================
   22. FOCUS
   ========================================================= */

.story-page a:focus-visible {
  outline:
    2px solid
    var(--story-gold);

  outline-offset:
    4px;

  border-radius:
    2px;
}


/* =========================================================
   23. DARK MODE
   ========================================================= */

html[data-theme="dark"] .story-page {
  --story-paper:
    #17120f;

  --story-paper-deep:
    #110d0a;

  --story-ink:
    #eadfce;

  --story-muted:
    #aa9986;

  --story-rule:
    rgba(218, 185, 140, 0.2);

  --story-ocean:
    #79bfc1;
}

html[data-theme="dark"] .story-content {
  background:
    var(--story-paper);
}

html[data-theme="dark"] .story-intro p {
  color:
    #c5b7a4;
}

html[data-theme="dark"] .story-quote p {
  color:
    #d8c9b5;
}

html[data-theme="dark"] .story-wave {
  background:
    var(--story-paper);
}

html[data-theme="dark"] .story-text {
  color:
    var(--story-ink);
}

html[data-theme="dark"] .story-text strong {
  color:
    var(--story-ink);
}

html[data-theme="dark"] .story-text em {
  color:
    #d07b62;
}


/* =========================================================
   24. TABLET
   ========================================================= */

@media (max-width: 900px) {

  .story-hero {
    min-height:
      620px;
  }

  .story-hero-content {
    padding-bottom:
      6rem;
  }

  .story-content {
    padding-top:
      4rem;
  }
}


/* =========================================================
   25. MOBILE
   ========================================================= */

@media (max-width: 700px) {

  .story-hero {
    min-height:
      620px;

    background-position:
      62% center;
  }

  .story-hero-content {
    width:
      calc(100% - 2.5rem);

    padding-bottom:
      5.25rem;
  }

  .story-hero h1 {
    font-size:
      clamp(
        3rem,
        15vw,
        4.75rem
      );
  }

  .story-wave {
    height:
      45px;
  }

  .story-content {
    padding:
      3.5rem 1.25rem 5rem;
  }

  .story-intro {
    margin-bottom:
      4rem;

    padding-bottom:
      2.5rem;
  }

  .story-intro p {
    font-size:
      1.12rem;

    line-height:
      1.8;
  }

  .story-section {
    margin-bottom:
      4.5rem;
  }

  .story-section h2 {
    font-size:
      2rem;

    margin-bottom:
      1.5rem;
  }

  .story-text {
    font-size:
      1rem;

    line-height:
      1.85;
  }

  .story-text p {
    margin-bottom:
      1.4rem;
  }

  .story-section:first-of-type
  .story-text > p:first-child::first-letter {
    font-size:
      3.8rem;
  }

  .story-quote {
    margin:
      3.5rem auto;

    padding:
      2rem
      1rem;
  }

  .story-quote p {
    font-size:
      1.4rem;
  }

  .story-ending {
    margin-top:
      4rem;
  }
}


/* =========================================================
   26. SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

  .story-hero {
    min-height:
      570px;

    background-position:
      60% center;
  }

  .story-hero-content {
    width:
      calc(100% - 2rem);

    padding-bottom:
      4.75rem;
  }

  .story-hero .eyebrow {
    font-size:
      0.65rem;
  }

  .story-hero h1 {
    font-size:
      3.15rem;

    letter-spacing:
      -0.055em;
  }

  .story-content {
    padding-left:
      1rem;

    padding-right:
      1rem;
  }

  .story-intro p {
    font-size:
      1.05rem;
  }

  .story-text {
    font-size:
      0.98rem;

    line-height:
      1.82;
  }

  .story-section h2 {
    font-size:
      1.85rem;
  }

  .story-quote {
    margin:
      3rem auto;
  }

  .story-quote p {
    font-size:
      1.3rem;
  }

  .story-ending p {
    font-size:
      1.2rem;
  }
}


/* =========================================================
   27. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior:
      auto !important;
  }
}


/* =========================================================
   28. HIGH CONTRAST
   ========================================================= */

@media (prefers-contrast: more) {

  .story-text {
    color:
      var(--story-ink);
  }

  .story-text em,
  .hawaiian-term {
    text-decoration:
      underline;
  }

  .story-nav a {
    text-decoration:
      underline;
  }

  .story-intro,
  .story-quote,
  .story-ending {
    border-color:
      currentColor;
  }
}


/* =========================================================
   29. PRINT
   ========================================================= */

@media print {

  .story-page {
    background:
      #fff;

    color:
      #000;
  }

  .story-hero {
    min-height:
      auto;

    background:
      none;
  }

  .story-hero-content {
    padding:
      2rem 0;

    color:
      #000;
  }

  .story-hero h1 {
    color:
      #000;
  }

  .story-wave {
    display:
      none;
  }

  .story-content {
    padding:
      2rem 0;
  }

  .story-intro p,
  .story-text,
  .story-ending p {
    color:
      #000;
  }

  .story-quote p {
    color:
      #000;
  }
}
