/* ==========================================================================
   Just Security — 9/11 Reflections cards
   Namespaced under .js911 so it can live inside .post-body .post-primary
   without fighting the justsecurity25 theme. Brand tokens mirror ps2.css.
   Spacing follows an 8px grid. One accent color: --js-teal.

   Collapsed: headshot, name, identifier, pull quote, Read more.
   Expanded:  the card spans the full row and splits 35% / 65% like a post
              page (sidebar | content): the left column keeps the headshot,
              name, identifier, quote, and Show less; the essay sits on the
              right. On one column everything stacks.
   ========================================================================== */

.js911 {
  --js-teal: #115d72;
  --js-space: #04151F;
  --js-onyx: #494E51;
  --js-iron: #6B6E70;
  --js-french-gray: #929396;
  --js-platinum: #EFF1F3;
  --js-seasalt: #F7F9F9;
  --js-radius: 6px;
  --js911-ease: 300ms ease-out;
  --js911-sticky-top: 96px;    /* clears the fixed masthead when scrolling */

  container-type: inline-size;
  margin: 0 0 48px;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  color: var(--js-space);
  line-height: 1.5;
}
.js911 *,
.js911 *::before,
.js911 *::after { box-sizing: border-box; }

/* Screen-reader-only text */
.js911 .js911-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Grid: mobile first (1 col) → 2 cols → 3 cols, driven by the container's
   own width so it works in the full-width and the standard post templates.
   -------------------------------------------------------------------------- */
.js911 .js911-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;        /* each row's cards match that row's tallest card */
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Card (collapsed)
   -------------------------------------------------------------------------- */
.js911 .js911-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 24px;
  background: var(--js-seasalt);
  border: 0;
  border-radius: var(--js-radius);
  text-align: left;
}
/* .js911-side groups head + quote + button; invisible as a box when collapsed */
.js911 .js911-side { display: contents; }

/* Header: headshot + name + role */
.js911 .js911-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.js911 .js911-avatar,
.js911 .js911-initials {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--js-platinum);
}
.js911 .js911-avatar {
  display: block;
  object-fit: cover;
  object-position: center top;
}
.js911 .js911-initials {
  display: grid;
  place-items: center;
  font: 500 20px/1 'Noto Serif', serif;
  color: var(--js-teal);
  letter-spacing: 0.02em;
}
.js911 .js911-who { min-width: 0; }
.js911 .js911-card .js911-name {
  margin: 0;
  padding: 0;
  font: 700 20px/28px 'Noto Serif', serif;
  letter-spacing: 0.01em;
  color: var(--js-space);
  text-wrap: balance;
}
.js911 .js911-card a.js911-link {
  color: var(--js-teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  border-radius: 2px;
  transition: color 200ms ease-out, text-decoration-thickness 200ms ease-out;
}
.js911 .js911-card a.js911-link:hover {
  color: var(--js-space);
  text-decoration-thickness: 2px;
}
.js911 .js911-card a.js911-link:focus-visible {
  outline: 2px solid var(--js-teal);
  outline-offset: 2px;
}
.js911 .js911-card .js911-role {
  margin: 4px 0 0;
  padding: 0;
  font: 500 16px/24px 'Roboto', sans-serif;
  letter-spacing: 0.01em;
  color: var(--js-onyx);
  text-wrap: pretty;
}

/* Pull quote — the card's centerpiece */
.js911 .js911-card .js911-quote {
  flex: 1 1 auto;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
  font: italic 400 18px/28px 'Noto Serif', serif;
  letter-spacing: 0;
  color: var(--js-space);
}
.js911 .js911-card .js911-quote p {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
}
.js911 .js911-card .js911-quote p::before { content: "\201C"; color: var(--js-teal); font-style: normal; }
.js911 .js911-card .js911-quote p::after  { content: "\201D"; color: var(--js-teal); font-style: normal; }

/* Full text: hidden until the card is open */
.js911 .js911-card .js911-full { display: none; }
.js911 .js911-card .js911-full p {
  margin: 0 0 16px;
  padding: 0;
  font: 400 16px/24px 'Roboto', sans-serif;
  letter-spacing: 0.02em;
  color: var(--js-space);
}
.js911 .js911-card .js911-full p:last-child { margin-bottom: 0; }

/* Primary action: Read more / Show less */
.js911 .js911-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 24px 0 0;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--js-radius);
  background: var(--js-teal);
  color: var(--js-seasalt);
  font: 500 16px/24px 'Roboto', sans-serif;
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: inset 0 0 0 2px transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 200ms ease-out, color 200ms ease-out, box-shadow 200ms ease-out;
}
.js911 .js911-toggle:hover { background: var(--js-space); color: var(--js-seasalt); }
.js911 .js911-toggle:active { background: var(--js-onyx); }
.js911 .js911-toggle:focus-visible {
  outline: 2px solid var(--js-teal);
  outline-offset: 2px;
}
.js911 .js911-toggle svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--js911-ease);
}
/* Expanded: secondary treatment so the open card reads as "in progress" */
.js911 .js911-card.is-open .js911-toggle {
  background: transparent;
  color: var(--js-teal);
  box-shadow: inset 0 0 0 2px var(--js-teal);
}
.js911 .js911-card.is-open .js911-toggle:hover { background: var(--js-platinum); color: var(--js-space); box-shadow: inset 0 0 0 2px var(--js-space); }
.js911 .js911-card.is-open .js911-toggle:active { background: var(--js-platinum); }
.js911 .js911-card.is-open .js911-toggle svg { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   Card (expanded)
   -------------------------------------------------------------------------- */
.js911 .js911-card.is-open .js911-full { display: block; }
.js911 .js911-card.is-open .js911-quote { flex: 0 0 auto; }

/* One column: head, quote, essay, then Show less at the end */
.js911 .js911-card.is-open .js911-full { padding-top: 24px; }
.js911 .js911-card.is-open .js911-toggle { order: 1; }

/* Two or three columns: full-row card split 35% / 65% like .post-body */
@container (min-width: 640px) {
  .js911 .js911-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .js911 .js911-card.is-open {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
    column-gap: 32px;
    align-items: start;
    padding: 32px;
  }
  .js911 .js911-card.is-open .js911-side {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--js911-sticky-top);
  }
  .js911 .js911-card.is-open .js911-full { padding-top: 0; }
  .js911 .js911-card.is-open .js911-toggle { order: 0; }
}
@container (min-width: 960px) {
  .js911 .js911-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Fallback for browsers without container queries */
@supports not (container-type: inline-size) {
  @media (min-width: 768px) {
    .js911 .js911-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .js911 .js911-card.is-open {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
      column-gap: 32px;
      align-items: start;
      padding: 32px;
    }
    .js911 .js911-card.is-open .js911-side { display: flex; flex-direction: column; position: sticky; top: var(--js911-sticky-top); }
    .js911 .js911-card.is-open .js911-full { padding-top: 0; }
    .js911 .js911-card.is-open .js911-toggle { order: 0; }
  }
  @media (min-width: 1200px) {
    .js911 .js911-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
}

/* --------------------------------------------------------------------------
   Loading (skeleton), status, and error states
   -------------------------------------------------------------------------- */
.js911 .js911-skel { pointer-events: none; }
.js911 .js911-skel .js911-bone {
  background: var(--js-platinum);
  border-radius: 4px;
  height: 16px;
}
.js911 .js911-skel .js911-bone.is-round { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.js911 .js911-skel .js911-bone.is-title { width: 60%; height: 20px; }
.js911 .js911-skel .js911-bone.is-role  { width: 80%; height: 14px; margin-top: 8px; }
.js911 .js911-skel .js911-bone.is-line  { margin-top: 12px; }
.js911 .js911-skel .js911-bone.is-short { width: 70%; }
.js911 .js911-skel .js911-bone.is-btn   { height: 48px; margin-top: 24px; border-radius: var(--js-radius); }
.js911 .js911-skel .js911-lines { margin-top: 24px; }
.js911 .js911-skel .js911-lines .js911-bone:first-child { margin-top: 0; }

.js911 .js911-status {
  margin: 0 0 16px;
  font: 400 14px/20px 'Roboto', sans-serif;
  color: var(--js-iron);
}
.js911 .js911-error {
  grid-column: 1 / -1;
  max-width: 640px;
  margin: 0;
  padding: 24px;
  border-radius: var(--js-radius);
  background: var(--js-seasalt);
}
.js911 .js911-error p {
  margin: 0 0 16px;
  font: 400 16px/24px 'Roboto', sans-serif;
  color: var(--js-space);
}
.js911 .js911-error .js911-toggle { width: auto; min-width: 160px; margin-top: 0; }

/* --------------------------------------------------------------------------
   Motion preferences & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  /* Expand/collapse reflow: each card morphs to its new place (View Transitions API) */
  :root.js911-vt::view-transition-group(*) {
    animation-duration: 350ms;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  :root.js911-vt::view-transition-old(root),
  :root.js911-vt::view-transition-new(root) { animation-duration: 350ms; }
  .js911 .js911-card.is-open .js911-full { animation: js911-fade 350ms ease-out 100ms both; }
  @keyframes js911-fade { from { opacity: 0; } to { opacity: 1; } }
  .js911 .js911-skel .js911-bone { animation: js911-pulse 1.2s ease-in-out infinite; }
  @keyframes js911-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
}
@media (prefers-reduced-motion: reduce) {
  .js911 * { transition: none !important; animation: none !important; }
}
@media print {
  .js911 .js911-grid { display: block; }
  .js911 .js911-card { display: block; margin-bottom: 24px; break-inside: avoid; }
  .js911 .js911-card .js911-full { display: block; padding-top: 24px; }
  .js911 .js911-toggle { display: none; }
}
