/* Mighty Mytilus — page-scoped Quarto styling.
   Add css: connections.css to connections.qmd YAML.
   All selectors target .mighty-page to avoid changing the wider lab notebook. */

.mighty-page {
  --mm-ink: var(--bs-body-color, #263b40);
  --mm-muted: var(--bs-secondary-color, #62747a);
  --mm-card: var(--bs-body-bg, #fff);
  --mm-tint: rgba(36, 112, 118, .065);
  --mm-line: rgba(71, 116, 121, .22);
  --mm-accent: #227e83;
  --mm-accent-strong: #155e64;
  --mm-sand: #d0a76d;
  --mm-shadow: 0 10px 28px rgba(18, 54, 63, .06);
  color: var(--mm-ink);
  max-width: 1160px;
  margin-inline: auto;
  padding-bottom: 4rem;
}

.mighty-page *, .mighty-page *::before, .mighty-page *::after { box-sizing: border-box; }
.mighty-page a { color: var(--mm-accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mighty-page a:hover { color: var(--mm-accent); }
.mighty-page a:focus-visible { outline: 3px solid var(--mm-sand); outline-offset: 4px; border-radius: 4px; }
.mighty-page .mm-eyebrow { font-size: .78rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 750; color: var(--mm-accent-strong); margin: 0 0 .7rem; }
.mighty-page .mm-lede { max-width: 62ch; font-size: 1.12rem; line-height: 1.75; color: var(--mm-muted); }
.mighty-page .mm-section-title { font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.2; margin: 0 0 .5rem; }
.mighty-page .mm-section-intro { color: var(--mm-muted); max-width: 75ch; margin: 0 0 1.4rem; }

/* Intro hero */
.mighty-page .mm-hero { position: relative; overflow: hidden; padding: clamp(1.7rem, 5vw, 4rem); margin: .3rem 0 2rem; border: 1px solid var(--mm-line); border-radius: 24px; background: linear-gradient(125deg, rgba(34,126,131,.11), transparent 60%), var(--mm-tint); }
.mighty-page .mm-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -95px; top: -115px; border: 35px solid rgba(34,126,131,.08); border-radius: 50%; pointer-events: none; }
.mighty-page .mm-hero h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.5rem, 5vw, 4.6rem); line-height: 1.07; letter-spacing: -.04em; margin: 0 0 .9rem; color: var(--mm-ink); }
.mighty-page .mm-hero p:last-child { margin-bottom: 0; }

/* Clickable taxonomy / jump navigation */
.mighty-page .mm-topic-nav { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 2.7rem; }
.mighty-page .mm-topic-nav a, .mighty-page .mm-tag { display: inline-flex; align-items: center; padding: .36rem .8rem; border: 1px solid var(--mm-line); border-radius: 100px; font-size: .83rem; font-weight: 650; text-decoration: none; background: var(--mm-card); }
.mighty-page .mm-topic-nav a:hover { background: var(--mm-tint); border-color: var(--mm-accent); }

/* Main editorial card and secondary card grid */
.mighty-page .mm-feature, .mighty-page .mm-card { border: 1px solid var(--mm-line); border-radius: 17px; background: var(--mm-card); box-shadow: var(--mm-shadow); }
.mighty-page .mm-feature { padding: clamp(1.4rem, 3.5vw, 2.7rem); margin-bottom: 3rem; border-left: 5px solid var(--mm-accent); }
.mighty-page .mm-feature h2, .mighty-page .mm-card h3 { margin: .2rem 0 .8rem; line-height: 1.2; }
.mighty-page .mm-feature h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.65rem, 3vw, 2.5rem); }
.mighty-page .mm-feature p { max-width: 72ch; }
.mighty-page .mm-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin: 0 0 3rem; }
.mighty-page .mm-card { padding: 1.5rem; display: flex; flex-direction: column; min-height: 210px; transition: transform .18s ease, box-shadow .18s ease; }
.mighty-page .mm-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(18,54,63,.11); }
.mighty-page .mm-card h3 { font-size: 1.22rem; }
.mighty-page .mm-card p { color: var(--mm-muted); line-height: 1.65; }
.mighty-page .mm-card .mm-card-footer { margin-top: auto; padding-top: .75rem; font-size: .9rem; font-weight: 700; }
.mighty-page .mm-type { font-size: .74rem; letter-spacing: .11em; font-weight: 800; text-transform: uppercase; color: var(--mm-accent-strong); }
.mighty-page .mm-meta { color: var(--mm-muted); font-size: .86rem; }

/* Archive strip: works now with hand-authored entries, later with Quarto listings */
.mighty-page .mm-archive { border-top: 1px solid var(--mm-line); padding-top: 1.7rem; margin-top: 2.4rem; }
.mighty-page .mm-archive-item { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr); gap: 1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--mm-line); }
.mighty-page .mm-archive-item strong { display: block; font-size: 1.04rem; margin-bottom: .25rem; }
.mighty-page .mm-archive-item p { margin: 0; color: var(--mm-muted); font-size: .94rem; }
.mighty-page .mm-note { border-left: 3px solid var(--mm-sand); padding: 1rem 1.2rem; background: var(--mm-tint); border-radius: 0 12px 12px 0; }

/* Optional Quarto listings once enabled */
.mighty-page .quarto-listing .card { border: 1px solid var(--mm-line); border-radius: 17px; overflow: hidden; box-shadow: var(--mm-shadow); background: var(--mm-card); }
.mighty-page .quarto-listing .card-title { font-family: Georgia, 'Times New Roman', serif; }
.mighty-page .quarto-listing .listing-category { border-radius: 100px; }

@media (max-width: 680px) {
  .mighty-page .mm-card-grid { grid-template-columns: 1fr; }
  .mighty-page .mm-archive-item { grid-template-columns: 1fr; gap: .2rem; }
  .mighty-page .mm-card { min-height: auto; }
  .mighty-page .mm-hero { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .mighty-page .mm-card { transition: none; }
  .mighty-page .mm-card:hover { transform: none; }
}
/* Quarto dark mode: preserve legibility without imposing site-wide theme */
body.quarto-dark .mighty-page, [data-bs-theme="dark"] .mighty-page {
  --mm-accent: #83cbd0;
  --mm-accent-strong: #a2dfe1;
  --mm-tint: rgba(131,203,208,.085);
  --mm-line: rgba(166,210,214,.24);
  --mm-shadow: 0 10px 28px rgba(0,0,0,.17);
}
