/* Late component overrides. Active extracted rules are colocated under ../components/<route>/<group>/styles.css. */
/* Component groups: c-button, c-logo, essential-reads, footer-menu-legal, footer-menu-subscriber-support, footer-menu-the-hollywood-reporter, george-lucas-says-he-was-going-to-make-3-more-star-wars-movies-b, lrv-unstyle-button, more-stories-by-winston, newsletters-expand-newsletters-menu, o-card, o-figure, o-nav, o-tease-actions, pmc-footer, primary-navigation, read-more-about, search, site-footer, site-header */
/* Add deliberate overrides below; data-capture-group attributes are stable hooks. */

/* Community — sign-in modal, member actions, comments.
   The markup reuses the captured Piano sign-in modal (.tp-backdrop, .tp-modal,
   .piano-id-modal-ver-2), the subscriber account menu and the site's utility
   classes. These rules only switch those parts on (the captured site did it
   from script) and fill the few states the capture never showed. */
.tp-backdrop.is-open,
.join-modal.is-open {
  display: block;
}

.join-modal .tp-iframe-wrapper {
  max-width: calc(100% - 2rem);
}

.a-subscription-account-menu:focus-within ul {
  visibility: visible;
  opacity: 1;
}

.community-field {
  border-radius: 0;
  background-color: var(--color-white, rgb(255, 255, 255));
  color: var(--color-black, rgb(13, 13, 13));
}

textarea.community-field {
  resize: vertical;
}

.community-field:focus {
  outline: none;
  border-color: var(--color-black, rgb(13, 13, 13));
}

.community-actions {
  gap: 0.5rem;
}

.community-action[aria-pressed="true"] {
  color: var(--color-brand-primary, rgb(217, 33, 40));
  border-color: var(--border-color-brand-primary, rgb(217, 33, 40));
}

.community-action[disabled] {
  opacity: 0.6;
}

.community-action__icon--upvote {
  transform: rotate(-90deg);
}

.community-comments li:target {
  background-color: var(--background-color-grey-lightest, rgb(239, 239, 239));
}

/* Honeypot trap for automated comment bots: off-screen and non-interactive for
   humans, left in the DOM as a normal text input so bots fill it. */
.community-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* One black. Every black and near-black in the stylesheets is the site black
   (#0d0d0d); text and icons that never set a colour would still fall back to
   the browser's pure black, so that fallback is set here too. */
html {
  color: var(--color-black, #0d0d0d);
  fill: var(--color-black, #0d0d0d);
}

/* Form controls do not inherit colour; without a rule of their own they keep
   the browser's black. :where() keeps this weaker than any class that sets one. */
:where(button, input, select, textarea) {
  color: var(--color-black, #0d0d0d);
}

/* The site's name set in type where the captured logo image was
   (components/brand/Wordmark.astro). It takes the colour of its link, and its
   sizes give it the width the image had, so the header around it does not move. */
.site-wordmark {
  display: flex;
  align-items: center;
  height: 100%;
  font-family: "Karla", Helvetica, sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.site-wordmark--masthead,
.site-wordmark--menu {
  font-size: 2.5rem;
}

@media (min-width: 78.75rem) {
  .site-wordmark--masthead {
    font-size: 3.125rem;
  }
}

@media (max-width: 22.4375rem) {
  .site-wordmark--bar {
    font-size: 1.125rem;
  }
}

/* The navigation bar's text is black in every state: hovering underlines it
   where links elsewhere turn red. A tapped link keeps its hover state on a
   phone, so red there would not even be brief. (!important answers the
   layouts' own hover rule.) */
.header :is(a, button):hover,
.header :is(a, button):focus-visible {
  color: var(--color-black, #0d0d0d) !important;
}

.header :is(a, button[type="submit"]):hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* The header (components/site/SiteHeader.astro). On desktop the sticky bar's
   name follows the menu button, where the captured bar had a search button
   between them. */
@media (min-width: 62.5rem) {
  .a-header-sticky .a-header-sticky__logo {
    margin-left: 1rem;
  }
}

/* The home page's sections (components/editorial/SectionColumns.astro). The
   captured grid was one row of two columns; with a row per pair of sections it
   needs room between rows, and each left-hand column carries the divider. */
.section-columns .a-article-grid__main {
  row-gap: 2.5rem;
}

@media (min-width: 62.5rem) {
  .section-columns .a-article-grid__main_column:nth-child(odd) {
    padding-right: 1rem;
    border-right: 1px solid var(--border-color-grey-dark, rgb(90, 90, 90));
  }
}

/* The menu (components/site/SiteMenu.astro). The captured header row held a
   search box; without it the row is only the name and the close button, which
   phones already have in the sticky bar. */
@media (max-width: 62.499rem) {
  .mega-menu .mega-menu__header {
    display: none;
  }
}

/* The close button spun its two strokes flat on hover and on focus, and a
   tapped button stays in both: on a phone the X settled into a dash. */
.a-become-close-button--trigger:hover::before,
.a-become-close-button--trigger:focus::before {
  transform: rotateZ(45deg);
}

.a-become-close-button--trigger:hover::after,
.a-become-close-button--trigger:focus::after {
  transform: rotateZ(-45deg);
}

/* The footer (components/site/SiteFooter.astro): name, link groups, copyright. */
.site-footer__inner {
  display: grid;
  gap: 2rem;
}

.site-footer__menus {
  display: grid;
  gap: 1.5rem;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color-grey-dark, rgb(90, 90, 90));
}

.site-footer__privacy-btn {
  color: inherit;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.site-footer__privacy-btn:hover {
  color: var(--color-white, rgb(255, 255, 255));
}

@media (min-width: 48rem) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
    column-gap: 3rem;
  }

  .site-footer__menus {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .site-footer__legal {
    grid-column: 1 / -1;
  }
}

/* Non-blocking editorial consent bar (components/site/ConsentBar.astro).
   Sits at the bottom edge without a backdrop or scroll lock. */
.consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  border-top: 2px solid var(--color-black, #0d0d0d);
  box-shadow: 0 -2px 12px rgba(13, 13, 13, 0.08);
}

.consent-bar[hidden] {
  display: none;
}

.consent-bar__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.consent-bar__actions {
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (min-width: 48rem) {
  .consent-bar__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

/* Zero-CLS editorial ad slots (components/site/AdSlot.astro). */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 1.5rem 0;
  padding: 0.75rem 0.5rem 1rem;
  border-top: 1px solid var(--border-color-grey-light, rgb(224, 224, 224));
  border-bottom: 1px solid var(--border-color-grey-light, rgb(224, 224, 224));
  background-color: var(--background-color-grey-lightest, rgb(248, 248, 248));
  text-align: center;
}

.ad-slot__label {
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.12em;
}

.ad-slot__frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot--leaderboard .ad-slot__frame {
  min-height: 50px;
}

@media (min-width: 48rem) {
  .ad-slot--leaderboard .ad-slot__frame {
    min-height: 90px;
  }
}

.ad-slot--in-article .ad-slot__frame,
.ad-slot--in-feed .ad-slot__frame {
  min-height: 250px;
}

.ad-slot--sidebar {
  margin: 1.5rem 0 0;
}

.ad-slot--sidebar .ad-slot__frame {
  min-height: 250px;
}

@media (min-width: 64rem) {
  .ad-slot--sidebar {
    position: sticky;
    top: 5rem;
  }
}

.ad-slot__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: inherit;
  border: 1px dashed var(--border-color-grey-dark, rgb(120, 120, 120));
  color: var(--color-grey-dark, rgb(90, 90, 90));
}

/* Minimal inline community controls, left Topics rail & nested reply indentation. */
.community-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.community-topics__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.community-topics__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0;
  color: var(--color-grey-dark, rgb(90, 90, 90));
  text-decoration: none;
}

.community-topics__link:hover,
.community-topics__link[aria-current="page"] {
  color: var(--color-brand-primary, rgb(217, 33, 40));
}

@media (min-width: 64rem) {
  .community-shell {
    grid-template-columns: 12.5rem minmax(0, 1fr);
    gap: 2.5rem;
  }

  .community-topics {
    position: sticky;
    top: 5rem;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-color-grey-light, rgb(224, 224, 224));
  }

  .community-topics__list {
    flex-direction: column;
    gap: 0.15rem;
  }

  .community-topics__link {
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--border-color-grey-light, rgb(224, 224, 224));
  }
}

.community-inline-vote {
  color: inherit;
}

.community-inline-vote:hover,
.community-inline-vote[aria-pressed="true"] {
  color: var(--color-brand-primary, rgb(217, 33, 40));
}

.community-badge {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  line-height: 1.2;
}

.community-badge--op {
  background-color: var(--color-black, #0d0d0d);
  border-color: var(--color-black, #0d0d0d);
  color: var(--color-white, #ffffff);
}

.comment-thread {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-thread__item {
  padding: 0.75rem 0 0.25rem;
}

.comment-thread > .comment-thread__item {
  border-bottom: 1px dotted var(--border-color-grey-dark, rgb(140, 140, 140));
  padding-bottom: 0.75rem;
}

.comment-thread__children {
  list-style: none;
  margin: 0.5rem 0 0 0.25rem;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--border-color-grey-light, rgb(224, 224, 224));
}

.comment-thread__reply-box {
  margin-top: 0.5rem;
}

.comment-thread__reply-box[hidden] {
  display: none;
}
