/*
 * Molly Flynn series site — initial Tiny Theme customization
 * Starting palette and design system based on The Ghost of Molly Flynn cover.
 * Designed to be refined as individual pages are built.
 */

/* ---------- 1. Core palette ---------- */
:root {
  --mf-night: #071526;
  --mf-night-deep: #030a13;
  --mf-ocean: #0b2945;
  --mf-ocean-mid: #123858;
  --mf-mist: #c8d9e6;
  --mf-mist-cool: #9fbad0;
  --mf-spectral: #b9c6f3;
  --mf-spectral-deep: #8e9ed6;
  --mf-ghost-light: #8fdcff;
  --mf-ghost-core: #eefbff;
  --mf-gold: #e8b56f;
  --mf-text: #f4f4f2;
  --mf-text-muted: #c7d0d9;
  --mf-panel: rgba(12, 29, 48, 0.78);
  --mf-panel-soft: rgba(18, 40, 62, 0.58);
  --mf-border: rgba(185, 198, 243, 0.34);

  /* Override Tiny's principal colors. */
  --text: var(--mf-text);
  --link: var(--mf-ghost-light);
  --link_visited: var(--mf-ghost-light);
  --accent1: var(--mf-spectral);
  --accent2: var(--mf-text-muted);
  --background: var(--mf-night-deep);
  --button-text: var(--mf-night-deep);
  --blockquote: rgba(139, 157, 210, 0.12);
  --blockquote-border: var(--mf-spectral);
  --aside: rgba(159, 186, 208, 0.12);
  --aside-border: var(--mf-mist-cool);
  --note: rgba(232, 181, 111, 0.10);
  --note-border: var(--mf-gold);
  --field: rgba(255, 255, 255, 0.08);
  --code: rgba(255, 255, 255, 0.09);
}

/* Keep our chosen palette even when the device prefers dark mode. */
@media (prefers-color-scheme: dark) {
  :root {
    --text: var(--mf-text);
    --link: var(--mf-ghost-light);
    --link_visited: var(--mf-ghost-light);
    --accent1: var(--mf-spectral);
    --accent2: var(--mf-text-muted);
    --background: var(--mf-night-deep);
    --button-text: var(--mf-night-deep);
    --blockquote: rgba(139, 157, 210, 0.12);
    --blockquote-border: var(--mf-spectral);
    --aside: rgba(159, 186, 208, 0.12);
    --aside-border: var(--mf-mist-cool);
    --note: rgba(232, 181, 111, 0.10);
    --note-border: var(--mf-gold);
    --field: rgba(255, 255, 255, 0.08);
    --code: rgba(255, 255, 255, 0.09);
  }
}

/* ---------- 2. Nighttime ocean background ---------- */
html {
  min-height: 100%;
  background: var(--mf-night-deep);
}

body {
  max-width: 62rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  color: var(--mf-text);
  background-color: var(--mf-night-deep);
  background-image:
    radial-gradient(ellipse at 72% 12%, rgba(142, 158, 214, 0.12) 0%, transparent 34%),
    radial-gradient(ellipse at 18% 26%, rgba(143, 220, 255, 0.07) 0%, transparent 28%),
    linear-gradient(to bottom,
      rgba(7, 21, 38, 0.96) 0%,
      rgba(8, 29, 49, 0.98) 24%,
      rgba(5, 20, 35, 0.99) 55%,
      rgba(3, 10, 19, 1) 100%),
    repeating-linear-gradient(to bottom,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      rgba(0, 0, 0, 0.018) 2px,
      rgba(0, 0, 0, 0.018) 7px);
  background-attachment: fixed;
}

/* A faint shadowed edge helps the content feel surrounded by night. */
main {
  position: relative;
}

/* ---------- 3. Header mist / fog bank ---------- */
header {
  position: relative;
  isolation: isolate;
  margin: 0 -1.25rem 2.5rem;
  padding: 1.6rem 1.25rem 2.2rem;
  text-align: center;
}

header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -6vw -1rem;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 14% 48%, rgba(200, 217, 230, 0.25) 0 18%, transparent 48%),
    radial-gradient(ellipse at 39% 30%, rgba(159, 186, 208, 0.24) 0 20%, transparent 50%),
    radial-gradient(ellipse at 64% 42%, rgba(200, 217, 230, 0.22) 0 22%, transparent 51%),
    radial-gradient(ellipse at 87% 35%, rgba(159, 186, 208, 0.20) 0 19%, transparent 47%),
    linear-gradient(to bottom,
      rgba(159, 186, 208, 0.14),
      rgba(159, 186, 208, 0.09) 55%,
      transparent 100%);
  filter: blur(0.3px);
}

/* ---------- 4. Series logo ---------- */
.series-logo {
  margin: 0 auto 0.9rem;
  line-height: 1;
}

.series-logo a,
.series-logo a:visited,
.series-logo a:hover {
  display: inline-block;
  text-decoration: none;
}

.series-logo img {
  display: block;
  width: min(100%, 34rem);
  height: auto;
  margin: 0 auto;
  filter:
    drop-shadow(0 0 0.25rem rgba(238, 251, 255, 0.38))
    drop-shadow(0 0 0.75rem rgba(143, 220, 255, 0.24));
}

/* ---------- 5. Navigation + Molly's ghost-light ---------- */
nav {
  margin-top: 0.6rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.6rem;
  margin: 0;
}

nav ul li {
  display: block;
  margin: 0;
}

nav a,
nav a:visited {
  position: relative;
  display: inline-block;
  padding: 0.42rem 0.68rem 0.42rem 1.35rem;
  border: 0;
  border-radius: 999px;
  color: var(--mf-text);
  background: rgba(4, 18, 31, 0.16);
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}

nav a:hover,
nav a:focus-visible {
  color: var(--mf-ghost-core);
  background: rgba(143, 220, 255, 0.08);
  outline: 2px solid rgba(143, 220, 255, 0.55);
  outline-offset: 2px;
}

/* Requires the navigation Microhook to add aria-current="page". */
nav a[aria-current="page"] {
  color: var(--mf-ghost-core);
  background:
    radial-gradient(circle at 0.75rem 50%, rgba(143, 220, 255, 0.20), transparent 2.4rem),
    rgba(143, 220, 255, 0.035);
  text-shadow:
    0 0 0.22rem rgba(238, 251, 255, 0.52),
    0 0 0.55rem rgba(143, 220, 255, 0.30);
}

nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0.56rem;
  top: 50%;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--mf-ghost-core);
  box-shadow:
    0 0 0.18rem 0.08rem rgba(238, 251, 255, 0.96),
    0 0 0.45rem 0.22rem rgba(143, 220, 255, 0.70),
    0 0 1rem 0.45rem rgba(143, 220, 255, 0.24);
}

/* ---------- 6. Typography ---------- */
body {
  font-family: var(--font_transitional);
  line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--mf-text);
  font-family: var(--font_antique);
  font-weight: 600;
  letter-spacing: 0.015em;
  text-wrap: balance;
}

h1:not(.series-logo),
h2 {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.75),
    0 0 0.45rem rgba(185, 198, 243, 0.10);
}

/* Optional class for a slightly more spectral heading treatment. */
.mf-spectral-heading {
  color: var(--mf-spectral);
  text-shadow:
    0 0 0.22rem rgba(185, 198, 243, 0.28),
    0 0 0.75rem rgba(143, 220, 255, 0.12);
}

/* ---------- 7. Links and buttons ---------- */
a {
  text-underline-offset: 0.16em;
  text-decoration-thickness: 0.07em;
}

a:hover,
a:focus-visible {
  color: var(--mf-ghost-core);
}

.mf-button,
a.read-more,
input[type="submit"],
button {
  display: inline-block;
  border: 1px solid rgba(143, 220, 255, 0.68);
  border-radius: 0.65rem;
  padding: 0.55rem 0.9rem;
  color: var(--mf-ghost-core);
  background: rgba(143, 220, 255, 0.08);
  box-shadow: inset 0 0 0.7rem rgba(143, 220, 255, 0.035);
  text-decoration: none;
}

.mf-button:hover,
.mf-button:focus-visible,
a.read-more:hover,
a.read-more:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible,
button:hover,
button:focus-visible {
  color: var(--mf-night-deep);
  background: var(--mf-ghost-light);
  box-shadow: 0 0 0.7rem rgba(143, 220, 255, 0.28);
}

/* ---------- 8. Spectral content surfaces ---------- */
.mf-panel,
.callout {
  padding: clamp(1rem, 2.5vw, 1.6rem);
  border: 1px solid var(--mf-border);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(185, 198, 243, 0.055), transparent 45%),
    var(--mf-panel);
  box-shadow:
    0 0.8rem 2.4rem rgba(0, 0, 0, 0.20),
    inset 0 1px rgba(255, 255, 255, 0.035);
}

.mf-panel--soft {
  background:
    linear-gradient(135deg, rgba(159, 186, 208, 0.08), transparent 58%),
    var(--mf-panel-soft);
}

/* ---------- 9. Fading spectral dividers ---------- */
hr {
  height: 1px;
  margin: 2.7rem 0;
  background: linear-gradient(to right,
    transparent,
    rgba(185, 198, 243, 0.55) 22%,
    rgba(143, 220, 255, 0.72) 50%,
    rgba(185, 198, 243, 0.55) 78%,
    transparent);
}

hr::before {
  content: none;
}

/* ---------- 10. Quotations / Fun Stuff opening quote ---------- */
blockquote,
.mf-quote {
  border-left: 3px solid rgba(185, 198, 243, 0.72);
  border-radius: 0 0.8rem 0.8rem 0;
  background:
    linear-gradient(to right, rgba(185, 198, 243, 0.12), transparent 72%);
  color: var(--mf-text);
  box-shadow: none;
}

blockquote cite,
.mf-quote cite {
  color: var(--mf-text-muted);
}

/* ---------- 11. Home-page physical-book effect ----------
   Wrap the cover image in: <div class="mf-book-cover">...</div>
   This is deliberately subtle rather than a dramatic 3-D mockup.
*/
.mf-book-cover {
  position: relative;
  display: block;
  width: min(100%, 22rem);
  margin: 0 auto 2rem;
  perspective: 900px;
  filter: drop-shadow(0.8rem 1rem 1.15rem rgba(0, 0, 0, 0.48));
}

.mf-book-cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0.7%;
  right: -0.42rem;
  width: 0.52rem;
  height: 98.6%;
  border-radius: 0 0.22rem 0.22rem 0;
  background: linear-gradient(to right,
    #c9bea5 0%,
    #eee6d4 35%,
    #b4aa94 100%);
  box-shadow: inset -1px 0 rgba(0, 0, 0, 0.28);
  transform: skewY(-0.7deg);
}

.mf-book-cover::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 2% -0.65rem -0.55rem 3%;
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.32);
  filter: blur(0.45rem);
}

.mf-book-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.22rem 0.12rem 0.12rem 0.22rem;
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, 0.10),
    0 0 0 1px rgba(255, 255, 255, 0.045);
  transform: rotateY(-1.4deg) rotateZ(-0.15deg);
  transform-origin: center left;
}

/* Optional two-column hero used later on the Home or Books page. */
.mf-book-hero {
  display: grid;
  grid-template-columns: minmax(13rem, 21rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin: 1rem 0 3rem;
}

.mf-book-hero .mf-book-cover {
  margin-bottom: 0;
}

/* ---------- 12. Latest news / reusable cards ---------- */
.mf-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.mf-card {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(185, 198, 243, 0.22);
  border-radius: 0.85rem;
  background: rgba(10, 27, 45, 0.64);
  box-shadow: 0 0.7rem 1.6rem rgba(0, 0, 0, 0.16);
}

.mf-card > :first-child { margin-top: 0; }
.mf-card > :last-child { margin-bottom: 0; }

/* ---------- 13. Images and embedded video ---------- */
article img,
.e-content img,
.p-summary img {
  border-radius: 0.45rem;
}

.mf-video,
.mf-embed {
  overflow: hidden;
  border: 1px solid rgba(185, 198, 243, 0.22);
  border-radius: 0.85rem;
  background: rgba(3, 10, 19, 0.72);
  box-shadow: 0 0.7rem 2rem rgba(0, 0, 0, 0.28);
}

.mf-video iframe,
.mf-embed iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

/* ---------- 14. Forms ---------- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
textarea {
  color: var(--mf-text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(143, 220, 255, 0.45) !important;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--mf-ghost-light);
  outline-offset: 2px;
}

/* The Letterbird iframe itself can be framed cleanly, although its internal CSS
   remains controlled by Letterbird. */
iframe {
  max-width: 100%;
}

.mf-contact-form iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.85rem;
}

/* ---------- 15. Newsletter/footer region ---------- */
.mf-newsletter {
  position: relative;
  margin: 3.5rem 0 1.5rem;
  padding: 1.35rem;
  text-align: center;
  border-top: 1px solid rgba(185, 198, 243, 0.22);
  background: linear-gradient(to bottom,
    rgba(159, 186, 208, 0.055),
    transparent 82%);
}

footer {
  position: relative;
  color: var(--mf-text-muted);
}

footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -8vw;
  right: -8vw;
  top: -1.6rem;
  height: 5rem;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 55%, rgba(159, 186, 208, 0.08), transparent 56%),
    radial-gradient(ellipse at 72% 45%, rgba(185, 198, 243, 0.07), transparent 54%);
}

/* ---------- 16. Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--mf-ghost-light);
  outline-offset: 3px;
}

::selection {
  color: var(--mf-night-deep);
  background: var(--mf-ghost-light);
}

/* Users who ask for reduced motion get no CSS transitions/animations that
   may later be introduced by Tiny or future Molly-specific additions. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 17. Responsive adjustments ---------- */
@media (max-width: 44rem) {
  body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  header {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .series-logo img {
    width: min(94vw, 30rem);
  }

  .mf-book-hero {
    grid-template-columns: 1fr;
  }

  .mf-book-cover {
    width: min(78vw, 20rem);
  }
}

@media (max-width: 28rem) {
  nav ul {
    gap: 0.28rem;
  }

  nav a,
  nav a:visited {
    padding-right: 0.5rem;
    padding-left: 1.2rem;
    font-size: 0.88em;
  }
}
    
    
    .mf-book-intro {
      flex: 1 1 24rem;
    }
    
    .mf-kicker {
      font-size: 1.15em;
      font-style: italic;
      line-height: 1.5;
    }
    
    .mf-audience {
      margin-top: 1.75rem;
    }
    
    .mf-book-actions {
      margin-top: 1.5rem;
    }
    
    .mf-button {
      display: inline-block;
      padding: 0.7em 1.15em;
      text-decoration: none;
      border: 1px solid currentColor;
      border-radius: 0.5rem;
    }
    
    .mf-button:hover,
    .mf-button:focus-visible {
      text-decoration: underline;
    }

    .mf-latest-news {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--mf-spectral-border);
    }
    
    .mf-latest-news > h2 {
    margin-bottom: 1.5rem;
    }
    
    .mf-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    }
    
    .mf-news-card {
    padding: 1.25rem;
    background: var(--mf-panel);
    border: 1px solid var(--mf-spectral-border);
    border-radius: 0.75rem;
    }
    
    .mf-news-card h3 {
    margin-top: 0.25rem;
    }
    
    .mf-news-date {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.75;
    }
    
    .mf-news-more {
    margin-top: 1.5rem;
    }
    
    @media (max-width: 700px) {
    .mf-news-grid {
    grid-template-columns: 1fr;
    }
    }
