/*
 * PJT — Nossa história
 * Extension stylesheet: page-specific rules only.
 * Loaded after styles.css.
 */

/* Editorial hero ------------------------------------------------------------ */

.story-hero {
  overflow: hidden;
  background: var(--navy);
  color: var(--ivory);
}

.story-hero-layout {
  display: grid;
  min-height: clamp(560px, 64vw, 760px);
  grid-template-areas: 'copy figure';
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  align-items: center;
  gap: clamp(36px, 6vw, 92px);
}

.story-hero-copy {
  grid-area: copy;
  min-width: 0;
  padding-block: clamp(72px, 9vw, 124px);
}

.story-hero-copy h1 {
  max-width: 10ch;
  color: var(--ivory);
  font-size: clamp(2.75rem, 6.2vw, 4.5rem);
  line-height: 0.98;
  text-wrap: balance;
}

.story-hero-copy h1 em {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}

.story-hero .story-lead {
  max-width: 50ch;
  margin-top: 28px;
  color: rgba(247, 245, 238, 0.8);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.78;
}

.story-hero-copy .button-row {
  margin-top: 36px;
}

.story-hero .button {
  transition: transform 180ms ease-out, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.story-hero .text-link {
  color: var(--ivory);
  text-decoration-color: var(--gold);
}

.story-hero .text-link:hover {
  color: var(--gold-light);
}

.story-hero-figure {
  grid-area: figure;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  margin: 0;
  padding-block: clamp(32px, 5vw, 68px);
}

.story-hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(212, 173, 88, 0.48);
  background: var(--navy-deep);
  object-fit: contain;
}

.story-image-caption {
  max-width: 58ch;
  margin-top: 13px;
  padding: 9px 12px;
  background: var(--navy-deep);
  color: rgba(247, 245, 238, 0.78);
  font-size: 0.7rem;
  letter-spacing: 0.025em;
  line-height: 1.55;
}

/* Page-local anchor navigation --------------------------------------------- */

.story-jump {
  position: sticky;
  top: 96px;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 238, 0.97);
  box-shadow: 0 8px 22px rgba(11, 30, 60, 0.05);
}

.story-jump > .container {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}

.story-jump a {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.story-jump a::after {
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  height: 2px;
  background: var(--gold);
  content: '';
  transform: scaleX(0);
  transform-origin: left;
}

.story-jump a:hover,
.story-jump a:focus-visible {
  color: var(--navy);
}

.story-jump a:hover::after,
.story-jump a:focus-visible::after {
  transform: scaleX(1);
}

/* History reading column ---------------------------------------------------- */

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 68fr) minmax(230px, 32fr);
  align-items: start;
  gap: clamp(48px, 8vw, 110px);
}

.story-main {
  min-width: 0;
}

.story-main > p,
.story-main > .story-statement,
.story-chapter > p {
  max-width: 66ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.78;
}

.story-main > p + p,
.story-chapter > p + p {
  margin-top: 20px;
}

.story-main > .eyebrow {
  margin-bottom: 14px;
}

.story-main h2,
.story-chapter h2 {
  max-width: 18ch;
  color: var(--navy);
  font-size: clamp(2.25rem, 4.2vw, 3.25rem);
  line-height: 1.02;
}

.story-chapter {
  scroll-margin-top: 128px;
  margin-top: clamp(56px, 7vw, 94px);
  padding-top: 25px;
  border-top: 1px solid var(--navy);
}

.story-chapter:first-of-type {
  margin-top: clamp(50px, 6vw, 82px);
}

.story-chapter h2 + p,
.story-chapter h3 + p {
  margin-top: 22px;
}

.story-chapter h3 {
  margin-top: 28px;
  color: var(--navy);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.story-statement {
  margin-top: clamp(42px, 6vw, 70px);
  padding: 24px 0 25px;
  border-block: 1px solid var(--line-gold);
  color: var(--navy) !important;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.2vw, 2.8rem) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08 !important;
}

.story-margin {
  position: sticky;
  top: 128px;
  min-width: 0;
  padding: 28px;
  border-top: 2px solid var(--gold);
  background: var(--ivory);
}

.story-margin img {
  width: min(118px, 42%);
  height: auto;
  margin: 0 auto 24px;
  object-fit: contain;
}

.story-margin .eyebrow {
  margin-bottom: 12px;
}

.story-margin p {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.7;
}

.story-margin .text-link {
  margin-top: 22px;
}

/* Timeline ------------------------------------------------------------------ */

.story-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 42px);
  margin-top: 32px;
}

.story-timeline > li {
  position: relative;
  min-width: 0;
  padding-top: 20px;
  border-top: 1px solid var(--navy);
}

.story-timeline > li::before {
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--ivory);
  content: '';
}

.story-date {
  display: block;
  color: var(--gold-muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.35;
  text-transform: uppercase;
}

.story-timeline h3 {
  margin-top: 14px;
  color: var(--navy);
  font-size: clamp(1.45rem, 2.1vw, 1.85rem);
  line-height: 1.06;
}

.story-timeline p {
  margin-top: 11px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.72;
}

/* Contributions: editorial chapters, not a repeated card grid -------------- */

#apoio .section-head {
  align-items: end;
  margin-bottom: 54px;
}

#apoio .section-head h2 {
  max-width: 14ch;
}

#apoio .section-head .lead {
  max-width: 48ch;
}

.story-contributions {
  border-top: 1px solid var(--navy);
}

.story-partner {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 58px);
  padding-block: clamp(30px, 4.4vw, 52px);
  border-bottom: 1px solid var(--line);
}

.story-partner-number {
  align-self: start;
  color: var(--gold-muted);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-style: italic;
  line-height: 1;
}

.story-partner-content {
  min-width: 0;
}

.story-partner-category {
  margin-bottom: 11px;
  color: var(--gold-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.story-partner-heading {
  color: var(--navy);
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: 1.02;
}

.story-partner-content > p:not(.story-partner-category) {
  max-width: 70ch;
  margin-top: 17px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.78;
}

.story-impact {
  max-width: 70ch;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.story-impact summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  list-style: none;
  text-transform: uppercase;
}

.story-impact summary::-webkit-details-marker {
  display: none;
}

.story-impact summary::after {
  color: var(--gold-muted);
  content: '+';
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
}

.story-impact[open] summary::after {
  content: '−';
}

.story-impact > p {
  max-width: 62ch;
  padding: 0 32px 18px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.7;
}

.story-partner-content > .text-link {
  margin-top: 19px;
}

/* Purpose and principles ----------------------------------------------------- */

.section.story-purpose {
  background: var(--white);
}

.story-purpose-layout {
  display: grid;
  grid-template-columns: minmax(0, 61fr) minmax(260px, 39fr);
  align-items: start;
  gap: clamp(46px, 8vw, 116px);
}

.story-purpose-layout > div {
  min-width: 0;
}

.story-purpose h2 {
  max-width: 15ch;
  color: var(--navy);
  font-size: clamp(2.45rem, 4.8vw, 3.75rem);
  line-height: 1;
}

.story-purpose-layout > div > p:not(.eyebrow) {
  max-width: 66ch;
  margin-top: 21px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.78;
}

.story-principles {
  padding-left: clamp(22px, 3vw, 38px);
  border-left: 1px solid var(--gold);
}

.story-principles p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.story-principles p + p {
  margin-top: 25px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.story-principles strong {
  display: block;
  margin-bottom: 7px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.1;
}

/* Invitation ---------------------------------------------------------------- */

.section.story-invitation {
  background: var(--navy);
  color: var(--ivory);
}

.story-invitation .container {
  display: grid;
  grid-template-columns: minmax(0, 64fr) minmax(250px, 36fr);
  align-items: end;
  gap: 48px;
}

.story-invitation h2 {
  max-width: 14ch;
  color: var(--ivory);
  font-size: clamp(2.55rem, 5vw, 4rem);
  line-height: 0.99;
}

.story-invitation p:not(.eyebrow) {
  max-width: 58ch;
  margin-top: 21px;
  color: rgba(247, 245, 238, 0.77);
  font-size: 1.05rem;
  line-height: 1.76;
}

.story-invitation .button-row {
  justify-content: flex-end;
}

.story-invitation .button {
  transition: transform 180ms ease-out, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.story-invitation .text-link {
  color: var(--ivory);
  text-decoration-color: var(--gold);
}

.story-invitation .text-link:hover {
  color: var(--gold-light);
}

/* Source note and homepage teaser ------------------------------------------ */

.story-source-note {
  padding-block: 24px 30px;
  border-top: 1px solid var(--line);
  background: var(--ivory);
}

.story-source-note p.note {
  max-width: 84ch;
  color: var(--ink-muted);
  line-height: 1.65;
}

.story-source-note a {
  color: var(--navy);
  font-weight: 700;
  text-decoration-color: var(--gold);
}

.section.story-home-teaser {
  background: var(--ivory);
}

.story-teaser-layout {
  display: grid;
  grid-template-columns: minmax(0, 56fr) minmax(280px, 44fr);
  align-items: center;
  gap: clamp(38px, 8vw, 112px);
}

.story-teaser-layout > div {
  min-width: 0;
}

.story-teaser-layout h2 {
  max-width: 13ch;
  color: var(--navy);
  font-size: clamp(2.45rem, 4.8vw, 3.75rem);
  line-height: 1;
}

.story-teaser-layout > div > p:not(.eyebrow) {
  max-width: 54ch;
  margin-top: 21px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.78;
}

.story-teaser-layout .button-row {
  margin-top: 30px;
}

.story-teaser-layout figure {
  min-width: 0;
  margin: 0;
}

.story-teaser-layout figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-gold);
  background: var(--white);
  object-fit: contain;
}

.story-home-teaser .story-image-caption {
  background: var(--ivory);
  color: var(--ink-muted);
}

.story-home-teaser .story-teaser-layout figure img[src*='bras'],
.story-home-teaser .story-teaser-layout figure img[src*='crest'],
.story-home-teaser .story-teaser-layout figure img[src*='logo'] {
  width: min(190px, 60%);
  margin-inline: auto;
  border: 0;
  background: transparent;
}

/* Local focus and motion contracts ----------------------------------------- */

.story-jump a:focus-visible,
.story-impact summary:focus-visible,
.story-source-note a:focus-visible,
.story-margin a:focus-visible,
.story-partner-content a:focus-visible,
.story-hero a:focus-visible,
.story-invitation a:focus-visible,
.story-home-teaser a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  text-decoration-thickness: 2px;
}

.story-hero [id],
.story-jump ~ .section [id],
.story-source-note [id] {
  scroll-margin-top: 128px;
}

@media (hover: hover) and (pointer: fine) {
  .story-hero .button:hover,
  .story-invitation .button:hover,
  .story-home-teaser .button:hover {
    transform: translateY(-2px);
  }

  .story-hero .text-link:hover .icon-arrow,
  .story-invitation .text-link:hover .icon-arrow,
  .story-home-teaser .text-link:hover .icon-arrow {
    transform: translateX(2px);
  }
}

/* Responsive composition ---------------------------------------------------- */

@media (max-width: 1080px) {
  .story-hero-layout {
    gap: 36px;
  }

  .story-layout {
    grid-template-columns: minmax(0, 64fr) minmax(220px, 36fr);
    gap: 50px;
  }

  .story-partner {
    gap: 30px;
  }
}

@media (max-width: 820px) {
  .story-hero-layout {
    min-height: auto;
    grid-template-areas:
      'figure'
      'copy';
    grid-template-columns: 1fr;
    gap: 0;
  }

  .story-hero-figure {
    align-self: auto;
    padding-block: 34px 0;
  }

  .story-hero-copy {
    padding-block: 48px 70px;
  }

  .story-hero-copy h1 {
    max-width: 13ch;
  }

  .story-jump {
    top: 80px;
  }

  .story-jump > .container {
    min-height: auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-block: 10px;
    gap: 0 20px;
  }

  .story-jump a {
    min-height: 40px;
    font-size: 0.67rem;
  }

  .story-layout,
  .story-purpose-layout,
  .story-invitation .container,
  .story-teaser-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .story-margin {
    position: static;
    max-width: 560px;
    padding: 24px;
  }

  .story-margin img {
    width: 82px;
    margin-inline: 0;
  }

  .story-timeline {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .story-timeline > li {
    padding-block: 24px;
  }

  .story-timeline > li:first-child {
    padding-top: 20px;
  }

  .story-timeline > li + li {
    border-top-color: var(--line);
  }

  .story-timeline > li::before {
    display: none;
  }

  .story-principles {
    max-width: 560px;
  }

  .story-invitation .button-row {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .story-hero-figure {
    padding-top: 22px;
  }

  .story-hero-figure img {
    min-height: 0;
  }

  .story-image-caption {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 0.67rem;
  }

  .story-hero-copy {
    padding-block: 38px 56px;
  }

  .story-hero-copy h1 {
    font-size: clamp(2.75rem, 13vw, 4rem);
  }

  .story-hero .story-lead {
    margin-top: 22px;
    font-size: 1rem;
  }

  .story-hero-copy .button-row,
  .story-invitation .button-row,
  .story-teaser-layout .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .story-hero-copy .button,
  .story-invitation .button,
  .story-teaser-layout .button {
    width: 100%;
  }

  .story-jump > .container {
    column-gap: 14px;
  }

  .story-jump a {
    min-height: 38px;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .story-layout,
  .story-purpose-layout,
  .story-invitation .container,
  .story-teaser-layout {
    gap: 38px;
  }

  .story-main h2,
  .story-chapter h2 {
    font-size: clamp(2.15rem, 10vw, 2.8rem);
  }

  .story-main > p,
  .story-chapter > p,
  .story-purpose-layout > div > p:not(.eyebrow),
  .story-teaser-layout > div > p:not(.eyebrow) {
    font-size: 1rem;
  }

  .story-partner {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 15px;
    padding-block: 28px 34px;
  }

  .story-partner-number {
    font-size: 1.55rem;
  }

  .story-partner-heading {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .story-impact > p {
    padding-right: 0;
  }

  .story-principles {
    padding-left: 20px;
  }

  .story-invitation h2,
  .story-teaser-layout h2,
  .story-purpose h2 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-jump a::after,
  .story-hero .button,
  .story-invitation .button,
  .story-impact summary::after {
    transition: none;
  }

  .story-jump a:hover::after,
  .story-jump a:focus-visible::after {
    transform: none;
  }
}

@media (forced-colors: active) {
  .story-hero-figure img,
  .story-margin,
  .story-source-note,
  .story-teaser-layout figure img {
    border: 1px solid CanvasText;
  }

  .story-jump a:focus-visible,
  .story-impact summary:focus-visible,
  .story-source-note a:focus-visible,
  .story-margin a:focus-visible,
  .story-partner-content a:focus-visible,
  .story-hero a:focus-visible,
  .story-invitation a:focus-visible,
  .story-home-teaser a:focus-visible {
    outline-color: Highlight;
  }
}

/* Keep the invitation's prose continuous rather than auto-placing each paragraph. */
.story-invitation .container {
  display: block;
}

.story-invitation .button-row {
  justify-content: flex-start;
  margin-top: 32px;
}

.story-invitation p.story-statement {
  max-width: 34ch;
  color: var(--ivory) !important;
}

.story-jump ~ .section[id] {
  scroll-margin-top: 80px;
}

.story-partner-content .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
