/* Owner-approved STUDIO-002/003/006/008 presentation changes. */
:root {
  --studio-field-border: #788b84; /* 3.61:1 against white. */
  --studio-field-hover: #536c62;  /* 5.69:1 against white. */
  --studio-field-focus: #704485; /* Existing purple: 7.36:1 against white. */
}

/* STUDIO-008 B: new active-template class keeps historical studies unchanged. */
.studio-reading-nav .subtopic-buttons button {
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  color: #3d4852;
}
.studio-reading-nav .subtopic-buttons button[aria-pressed=true] { color: white; }
.studio-reading-nav .final-article .contents-details nav a {
  font-size: 14px;
  line-height: 1.55;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-block: 10px;
  color: #355970;
}
.studio-reading-nav .contents-details > summary { font-size: 14px; }
.studio-reading-nav .contents-details nav a:focus-visible {
  /* Keep all four sides visible inside the scrollable desktop contents rail. */
  outline: 3px solid var(--purple);
  outline-offset: -3px;
}
.studio-reading-nav .related-topic-links > a,
.studio-reading-nav .reading-aside .related-topic-links > a {
  font-size: 14px;
  line-height: 1.55;
  min-height: 44px;
  color: #355970;
}
.studio-reading-nav .back-to-topic {
  font-size: 13px;
  line-height: 1.5;
  min-height: 44px;
  color: #355970;
}
.studio-reading-nav .contents-details nav a:hover,
.studio-reading-nav .contents-details nav a[aria-current=location] {
  color: #65427c;
  box-shadow: inset 2px 0 #65427c;
  background: #f7f3fa;
}
.studio-reading-nav .related-topic-links > a:hover,
.studio-reading-nav .back-to-topic:hover {
  color: #65427c;
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (max-width: 760px) {
  .studio-reading-nav.has-reading-context .back-to-topic {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }
}
@media (max-width: 580px) {
  .studio-reading-nav .side-note h2 br { display: initial; }
}

/* Compact option A uses the complete, unmodified 2:1 approved anchor. */
.studio-home-welcome.editorial-welcome {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  padding-block: 20px;
  min-height: 322px;
}
.studio-home-welcome .studio-hero-copy,
.studio-home-welcome .studio-art { min-width: 0; }
.studio-home-welcome .studio-art { margin: 0; }
.studio-home-welcome .studio-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  aspect-ratio: 2 / 1;
}
.studio-home-welcome .studio-hero-copy .welcome-right { margin-top: 16px; }
.studio-home-welcome .welcome-right > p { font-size: 14px; }
.studio-home-welcome .entry-links { margin-top: 16px; }
.studio-home-welcome .entry-links a {
  min-height: 44px;
  align-items: center;
  padding-block: 8px;
}

/* Boundaries apply only to the existing search and feedback field components. */
.header-search,
.directory-search > div,
.within-search,
.final-search-label input,
.final-directory-tools input,
.final-directory-tools select,
.start-search input,
.feedback-panel textarea,
.feedback-panel input:not([type=hidden]) {
  border-color: var(--studio-field-border);
}
.header-search:hover,
.directory-search > div:hover,
.within-search:hover,
.final-search-label input:hover,
.final-directory-tools input:hover,
.final-directory-tools select:hover,
.start-search input:hover,
.feedback-panel textarea:hover,
.feedback-panel input:not([type=hidden]):hover {
  border-color: var(--studio-field-hover);
}
.header-search:focus-within,
.directory-search > div:focus-within,
.within-search:focus-within,
.final-search-label input:focus,
.final-directory-tools input:focus,
.final-directory-tools select:focus,
.start-search input:focus,
.feedback-panel textarea:focus,
.feedback-panel input:not([type=hidden]):focus {
  border-color: var(--studio-field-focus);
}
.final-search-label input:focus-visible,
.final-directory-tools input:focus-visible,
.final-directory-tools select:focus-visible,
.start-search input:focus-visible,
.feedback-panel textarea:focus-visible,
.feedback-panel input:not([type=hidden]):focus-visible {
  outline: 3px solid var(--studio-field-focus);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .studio-home-welcome.editorial-welcome { gap: 20px; }
  .studio-home-welcome.editorial-welcome h1 { font-size: 40px; }
}

@media (max-width: 760px) {
  .header-top > .support-button,
  .header-top > .mobile-menu,
  .studio-home-welcome .entry-links { font-size: 13px; }
  .header-top > .support-button,
  .header-top > .mobile-menu { min-height: 44px; flex-shrink: 0; }
}

@media (max-width: 580px) {
  .header-top { column-gap: 10px; }
  .header-top > .support-button { padding-inline: 9px; gap: 8px; }
  .header-top > .mobile-menu { padding-inline: 9px; gap: 6px; }
  .studio-home-welcome.editorial-welcome {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 24px 8px;
  }
  .studio-home-welcome.editorial-welcome h1 { font-size: 43px; }
  .studio-home-welcome .studio-art { width: 100%; margin-top: 8px; }
  .studio-home-welcome .studio-hero-copy .welcome-right { margin-top: 15px; }
  .studio-home-welcome .entry-links { gap: 8px 18px; margin-top: 14px; }
}

@media (max-width: 360px) {
  .header-top { column-gap: 5px; }
  .header-top > .brand { font-size: 20px; }
  .header-top > .support-button,
  .header-top > .mobile-menu { padding-inline: 4px; gap: 4px; }
}

/* STUDIO-003: match the selected homepage library treatment in featured rows. */
.template-home .supporting-topics .row-card .icon { color: #315d86; }
.template-home .supporting-topics .row-card .card-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.template-home .supporting-topics .row-card p {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
  color: #465154;
}
.template-home .supporting-topics .row-card:hover h3,
.template-home .supporting-topics .row-card:focus-visible h3 {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* The discovery link retains a useful destination without JavaScript. */
.studio-search-bridge { min-width: 0; margin: 4px 0 0; }
.studio-search-all {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding-block: 8px;
  color: var(--jade);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.studio-search-all:hover,
.studio-search-all:focus-visible { color: var(--purple); }
.studio-search-all:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}
.template-directory .directory-intro { flex-wrap: wrap; row-gap: 0; }
.template-directory .directory-intro > .studio-search-bridge {
  display: flex;
  justify-content: flex-end;
  flex-basis: 100%;
  margin-top: 0;
}
.template-directory .directory-intro > .studio-search-bridge .studio-search-all {
  width: 39%;
  min-width: 280px;
}
@media (max-width: 950px) {
  .template-directory .directory-intro > .studio-search-bridge { display: block; }
  .template-directory .directory-intro > .studio-search-bridge .studio-search-all {
    width: 100%;
    max-width: 580px;
    min-width: 0;
  }
}

/* STUDIO-006: a clearer Find support label, without changing other arrows. */
a.support-button[href="/find-support/"],
a.outline-button[href="/find-support/"] {
  justify-content: center;
  gap: 0;
  min-height: 46px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 760px) {
  a.support-button[href="/find-support/"],
  a.outline-button[href="/find-support/"] {
    min-height: 44px;
    font-size: 14px;
  }
}

/* Desktop warmth: retain phone/tablet proportions below 1024px. */
@media (min-width: 1024px) {
  .studio-home-welcome.editorial-welcome {
    grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
    gap: 24px;
  }
  .studio-home-welcome .studio-art {
    position: relative;
    width: 100%;
    aspect-ratio: 1774 / 610;
    overflow: hidden;
  }
  .studio-home-welcome .studio-art img {
    position: absolute;
    left: 0;
    top: -29.5081967%;
  }
  /* The full image width is visible. The window retains source y180–790;
     only blank framing is outside it. Original PNG bytes stay unchanged. */
  .studio-home-welcome .entry-links {
    gap: 12px;
    margin-top: 20px;
    font-size: clamp(15px, 1.25vw, 16px);
  }
  .studio-home-welcome .entry-links a {
    max-width: 100%;
    min-height: 48px;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #91aa9f;
    border-radius: 8px;
    background: var(--jade-wash);
  }
  .studio-home-welcome .entry-links a:hover,
  .studio-home-welcome .entry-links a:focus-visible {
    border-color: var(--purple);
    background: var(--plumwash);
    color: var(--purple);
  }
  .template-home .section-heading h2 {
    font-size: clamp(32px, 2.65vw, 36px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--purple);
  }
  .template-home .supporting-topics .row-card h3,
  .template-home:not(.readability-preview) .editorial-topic-grid .topic-card h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #315d86;
  }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .studio-home-welcome.editorial-welcome {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  }
}
