/* Module 18 — earthquakes at the trenches. Reuses the site's tokens; the one
   colour of its own is the highlight on rows at or above magnitude 6. */

.qk-hero{ padding: 5.5rem 0 2.5rem; }
.qk-hero h1{
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.9rem, 5.2vw, 3.1rem); line-height: 1.14;
  text-wrap: balance; margin: .3em 0 .5em;
}
.qk-hero .lede{ max-width: 62ch; font-size: 1.06rem; line-height: 1.62;
                color: rgba(var(--ink), .78); }

.qk-now, .qk-month, .qk-history{ margin: 3.4rem 0; }
.qk-now h2, .qk-month h2, .qk-history h2{
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.25rem, 3.4vw, 1.7rem); margin: 0 0 1.1rem;
}
.qk-intro, .qk-prose{ max-width: 66ch; line-height: 1.68;
                      color: rgba(var(--ink), .82); margin: 0 0 1.05em; }

.qk-trench{ margin: 2rem 0; }
.qk-trench h3, .qk-elsewhere h3, .qk-history h3{
  font-family: var(--serif); font-weight: 400; font-size: 1.12rem;
  margin: 0 0 .5rem;
}
.qk-trench h3 a{ text-decoration: none; }
.qk-count{ font-family: var(--sans); font-size: .68rem; letter-spacing: .16em;
           text-transform: uppercase; color: rgba(var(--ink), .5);
           margin-left: .7rem; }

.qk-table{ width: 100%; border-collapse: collapse; margin: .4rem 0 1rem;
           font-size: .92rem; }
.qk-table th, .qk-table td{ padding: .58rem .7rem; text-align: left;
                            border-bottom: 1px solid rgba(var(--ink), .1); }
.qk-table th{ font-family: var(--sans); font-size: .68rem; letter-spacing: .16em;
              text-transform: uppercase; color: rgba(var(--ink), .55);
              font-weight: 400; }
.qk-table td.n, .qk-table th.n{ text-align: right;
                                font-variant-numeric: tabular-nums; }
.qk-date{ font-variant-numeric: tabular-nums; white-space: nowrap;
          color: rgba(var(--ink), .6); }
.qk-table-wrap{ overflow-x: auto; }
.qk-what{ max-width: 46ch; line-height: 1.5; }
.qk-magnote{ font-size: .7rem; color: rgba(var(--ink), .5); white-space: nowrap; }

/* The one editorial emphasis: magnitude 6 and above, and the magnitude-9
   rows of the historical table. The seam working, not background noise. */
.qk-hl td{ background: rgba(255, 170, 140, .07);
           box-shadow: inset 3px 0 0 rgba(255, 160, 120, .5); }

.qk-elsewhere{ margin: 2.4rem 0; }
.qk-list{ margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.8; }

.qk-fresh{ font-size: .78rem; color: rgba(var(--ink), .45); margin-top: .9rem; }
.qk-source{ font-size: .76rem; color: rgba(var(--ink), .45); margin-top: .6rem;
            max-width: 66ch; }
.qk-empty{ color: rgba(var(--ink), .6); font-size: .92rem; }
.qk-more{ font-size: .82rem; color: rgba(var(--ink), .5); margin: -.4rem 0 0; }

.qk-srcbox{
  border: 1px solid rgba(var(--ink), .13); padding: 1rem 1.2rem;
  font-size: .85rem; line-height: 1.6; color: rgba(var(--ink), .65);
  max-width: 74ch; margin: 2.5rem 0;
}
.qk-srcbox b{ color: rgba(var(--ink), .78); }

/* MOBILE — the same 760px seam the rest of the site uses.
   Measured at 390px: the live tables showed When and Mag and clipped the
   trench, the distance and the USGS link with nothing saying they existed;
   the history table was worse — Trench and When visible, the prose column
   (the point of the section) 1,660px of unannounced sideways scroll away. */
@media (max-width: 760px){
  /* dive.css makes every table its own scroll box below 760px. Here the
     wrapper is the scroll box, so the edge shadows below can live on it. */
  .qk-table{ display: table; font-size: .85rem; }
  .qk-table th, .qk-table td{ padding: .5rem .45rem; }
  .qk-table th{ letter-spacing: .08em; }
  /* A date on two lines beats a column nobody can reach. */
  .qk-date{ white-space: normal; }
  /* The USGS link is the one cell that can wrap instead of stretching the
     whole table off the right edge of the screen. */
  .qk-table td:last-child{ min-width: 11ch; }

  /* The wrapper already scrolled; nothing said so. A thin scrollbar, plus
     edge shadows that only appear while there is more table in that
     direction — the covers scroll with the content (background-attachment:
     local) and hide the shadows when everything fits. */
  .qk-table-wrap{
    scrollbar-width: thin; scrollbar-color: rgba(var(--ink), .35) transparent;
    background:
      linear-gradient(90deg,  var(--abyss) 30%, rgba(4,7,13,0)) left  / 26px 100% no-repeat local,
      linear-gradient(270deg, var(--abyss) 30%, rgba(4,7,13,0)) right / 26px 100% no-repeat local,
      linear-gradient(90deg,  rgba(var(--ink), .22), rgba(var(--ink), 0)) left  / 10px 100% no-repeat scroll,
      linear-gradient(270deg, rgba(var(--ink), .22), rgba(var(--ink), 0)) right / 10px 100% no-repeat scroll;
  }
  .qk-table-wrap::-webkit-scrollbar{ height: 7px; }
  .qk-table-wrap::-webkit-scrollbar-thumb{ background: rgba(var(--ink), .28);
    border-radius: 4px; }

  /* The history table stops being a table. Each event becomes a short card:
     trench, date and magnitude on one line, the prose full width beneath.
     Every cell is still on screen — nothing to scroll for, nothing dropped. */
  .qk-history-table{ display: block; }
  .qk-history-table tbody{ display: block; }
  /* The header named columns that no longer sit in columns. Each value now
     labels itself: the trench is a link, the date reads as a date, and the
     magnitude carries its own M below. */
  .qk-history-table thead{ display: none; }
  .qk-history-table tr{
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .7rem;
    padding: .85rem 0 1rem; border-bottom: 1px solid rgba(var(--ink), .1);
  }
  .qk-history-table td{ display: block; padding: 0; border-bottom: 0; }
  .qk-history-table td.n{ text-align: left; }
  /* "9.5" with no Mag header above it is just a number. */
  .qk-history-table td.n b::before{ content: "M"; }
  .qk-history-table .qk-magnote{ white-space: normal; }
  .qk-history-table td.qk-what{ flex: 1 0 100%; max-width: none;
    margin-top: .5rem; line-height: 1.6; }
  /* The magnitude-9 emphasis moves from the cells to the whole card. */
  .qk-history-table tr.qk-hl{ background: rgba(255, 170, 140, .07);
    box-shadow: inset 3px 0 0 rgba(255, 160, 120, .5);
    padding-left: .7rem; padding-right: .5rem; }
  .qk-history-table tr.qk-hl td{ background: transparent; box-shadow: none; }

  /* Same quiet note stocking.html uses over its wide table. */
  .qk-scrollhint{ display: block; font-size: .74rem; letter-spacing: .04em;
    color: rgba(var(--ink), .5); margin: -.2rem 0 .5rem; }
}
@media (min-width: 761px){ .qk-scrollhint{ display: none; } }
