/* Earnings repository styles.
   Component patterns follow the datacenters tracker stylesheet
   (stats band, filter bar, card grid, pill, lightbox) with ea-
   prefixed classes scoped to the earnings routes. Reading rules
   (limited measure, generous line height) follow runbook Section 13. */

.ea-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.ea-stat {
  border: 1px solid var(--sb-border, #d7dce3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: var(--sb-surface, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ea-stat__value {
  font-size: var(--sb-font-size-stat);
  font-weight: 700;
  line-height: 1.1;
}

.ea-stat__label {
  font-size: 0.85rem;
  opacity: 0.75;
}

.ea-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin: 1.25rem 0 0.75rem;
}

.ea-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
  flex: 1 1 180px;
}

.ea-filter label {
  font-weight: 600;
  font-size: 0.9rem;
}

.ea-filter input,
.ea-filter select {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sb-border, #d7dce3);
  border-radius: 8px;
  font: inherit;
  background: var(--sb-surface, #ffffff);
}

.ea-filter--submit {
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.ea-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--sb-accent, #1e3a8a);
  background: var(--sb-accent, #1e3a8a);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ea-btn--secondary {
  background: transparent;
  color: var(--sb-accent, #1e3a8a);
}

.ea-btn--link {
  background: transparent;
  color: var(--sb-accent, #1e3a8a);
}

.ea-btn:focus-visible,
.ea-clear:focus-visible,
.ea-pill:focus-visible,
.ea-toc__summary:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--sb-color-accent);
  outline-offset: 2px;
}

.ea-clear {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.ea-search-link {
  margin: 0.5rem 0;
}

.ea-count {
  font-weight: 600;
  margin: 0.75rem 0 1rem;
}

.ea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.ea-card {
  border: 1px solid var(--sb-border, #d7dce3);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sb-surface, #ffffff);
  display: flex;
  flex-direction: column;
}

.ea-card__preview img {
  display: block;
  width: 100%;
  height: auto;
}

.ea-card__body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ea-card__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
}

.ea-card__title {
  margin: 0;
  font-size: var(--sb-font-size-card-title);
  line-height: 1.3;
}

.ea-card__title a {
  color: inherit;
  text-decoration: none;
}

.ea-card__title a:hover {
  text-decoration: underline;
}

.ea-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #e8edf5;
  color: #243b6b;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.ea-card__meta {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.8;
}

.ea-card__headline {
  margin: 0;
  font-weight: 600;
  line-height: 1.45;
}

.ea-empty {
  border: 1px dashed var(--sb-border, #d7dce3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0 2rem;
}

.ea-methodology {
  margin: 2.5rem 0 1rem;
  max-width: none;
}

.ea-methodology li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.ea-back {
  margin: 1rem 0 0.5rem;
}

.ea-coverage {
  margin: 0.25rem 0 1rem;
  opacity: 0.85;
}

/* Detail page */

.ea-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.ea-breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  opacity: 0.6;
}

.ea-headerband {
  margin: 1rem 0 0;
}

.ea-headerband__company {
  font-size: var(--sb-font-size-band);
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.ea-headerband__facts {
  margin: 0;
  opacity: 0.85;
}

.ea-standfirst {
  font-size: var(--sb-font-size-standfirst);
  line-height: 1.4;
  font-weight: 600;
  max-width: none;
  margin: 1rem 0 0;
}

.ea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.ea-contents {
  border: 1px solid var(--sb-border, #d7dce3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  max-width: none;
}

.ea-contents h2 {
  margin-top: 0;
}

.ea-toc {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ea-toc__link {
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 400;
  padding: 0.3rem 0;
}

.ea-toc__entry {
  margin: 0.15rem 0;
}

.ea-toc__list {
  list-style: none;
  margin: 0;
  padding-left: 0.75rem;
}

.ea-toc__summary {
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 600;
  min-height: 40px;
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.ea-toc__summary::-webkit-details-marker {
  display: none;
}

/* Disclosure triangle: right-pointing when collapsed, rotated to point
   down when the group is open. A fixed-size flex item, so rotation never
   shifts the layout; the summary text follows it. */
.ea-toc__summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-right: 0.55em;
  border-top: 0.32em solid transparent;
  border-bottom: 0.32em solid transparent;
  border-left: 0.5em solid var(--sb-color-accent);
  transition: transform 0.15s ease-in-out;
}

.ea-toc__group[open] > .ea-toc__summary::before {
  transform: rotate(90deg);
}

.ea-anchor {
  display: block;
  position: relative;
  top: -1rem;
  visibility: hidden;
}

.ea-exhibit__figure {
  margin: 0 0 2rem;
}

.ea-exhibit__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--sb-border, #d7dce3);
  border-radius: 12px;
  overflow: hidden;
  background: none;
  cursor: zoom-in;
}

.ea-exhibit__open img {
  display: block;
  width: 100%;
  height: auto;
}

.ea-exhibit figcaption {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  opacity: 0.8;
}

.ea-doc {
  margin-bottom: 2.5rem;
}

.ea-prose {
  max-width: none;
  line-height: 1.6;
  font-size: var(--sb-font-size-prose);
}

.ea-prose p {
  margin: 0 0 1rem;
}

.ea-prose h3 {
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}

.ea-prose h4 {
  margin: 1.5rem 0 0.6rem;
  line-height: 1.35;
}

.ea-prose .affected {
  font-style: italic;
  opacity: 0.9;
}

.ea-record {
  border-top: 2px solid var(--sb-border, #d7dce3);
  padding-top: 1rem;
  margin-bottom: 2rem;
  max-width: none;
}

.ea-record dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.ea-record dt {
  font-weight: 600;
  font-size: 0.85rem;
}

.ea-record dd {
  margin: 0.15rem 0 0;
}

.ea-disclaimer {
  border-top: 1px solid var(--sb-border, #d7dce3);
  padding-top: 1rem;
  margin-bottom: 2rem;
  max-width: none;
}

.ea-strip {
  margin-bottom: 2rem;
}

.ea-strip__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.ea-follow {
  margin: 1.5rem 0 0;
}

/* Lightbox: the tracker pattern. Overlay covers the viewport, the
   frame centers the full exhibit, reduced motion removes the fade. */

.ea-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ea-lightbox[hidden] {
  display: none;
}

.ea-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.88);
}

.ea-lightbox__frame {
  position: relative;
  margin: 0;
  max-width: min(1100px, 94vw);
  max-height: 92vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
}

.ea-lightbox__img {
  display: block;
  width: 100%;
  height: auto;
}

.ea-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--sb-border, #d7dce3);
  background: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.ea-lightbox__caption {
  margin-top: 0.75rem;
  font-weight: 600;
}

/* Full-text search page */

.ea-search-note {
  max-width: 70ch;
  line-height: 1.55;
}

#ea-pagefind-search {
  max-width: 75ch;
  margin: 1.5rem 0 2rem;
}

@media (max-width: 720px) {
  .ea-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ea-grid,
  .ea-strip__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ea-standfirst {
    font-size: var(--sb-font-size-standfirst-sm);
  }

  .ea-actions .ea-btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ea-lightbox,
  .ea-card,
  .ea-btn,
  .ea-toc__summary::before {
    transition: none;
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media print {
  .sb-shell__header,
  .sb-shell__footer,
  .ea-actions,
  .ea-contents,
  .ea-filters,
  .ea-search-link {
    display: none;
  }

  .ea-prose {
    max-width: none;
  }

  .ea-exhibit__figure {
    break-after: page;
  }
}
