/* JORNAL DIÁRIO — página inicial: hero da edição, destaques e inscrição. */

/* POPUP E FORMULÁRIO DE INSCRIÇÃO */

/* Subscription feedback component. */

body.subscription-popup-open {
  overflow: hidden;
}

.subscription-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-top-color: transparent;
  border-radius: 50%;
  animation: subscription-spin 0.75s linear infinite;
}

.subscription-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--kn-modal-gap);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.subscription-popup[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.subscription-popup-backdrop {
  position: absolute;
  inset: 0;
  background: var(--kn-component-overlay);
  backdrop-filter: blur(var(--kn-component-overlay-blur));
}

.subscription-popup-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 2rem;
  border: 1px solid var(--kn-component-border);
  border-radius: var(--kn-component-radius);
  background: var(--kn-component-surface);
  color: var(--text-main);
  box-shadow: var(--kn-component-shadow);
  text-align: center;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.subscription-popup[aria-hidden="false"] .subscription-popup-card {
  transform: translateY(0) scale(1);
}

.subscription-popup-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.subscription-popup.success .subscription-popup-icon {
  background: color-mix(in srgb, var(--primary) 14%, var(--card-bg));
  color: var(--primary);
}

.subscription-popup.error .subscription-popup-icon {
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
}

.subscription-popup-card h3 {
  margin-bottom: 0.65rem;
  font-size: 1.35rem;
}

.subscription-popup-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.subscription-popup-card button {
  width: 100%;
  margin-top: 1.35rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--bg-body);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.subscription-popup-card button:hover {
  background: var(--primary-hover);
}

@media (prefers-reduced-motion: reduce) {
  .subscription-spinner,
  .subscription-popup,
  .subscription-popup-card {
    animation: none !important;
    transition: none !important;
  }
}

/* GENERAL */

.hero {
  max-width: 650px;
  padding: 4rem 3rem;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.preview-section {
  padding: 0 3rem 4rem;
}

.preview-section h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

#featured-news .spotlight-card h2 {
  max-width: 30ch;
  margin-bottom: 0.85rem;
  font-size: 1.8rem;
  line-height: 1.2;
}

/* SUBSCRIPTION */

.subscription-section {
  margin: 0 3rem 4rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: var(--card-bg);
}

.subscription-content {
  max-width: 760px;
}

.subscription-section .eyebrow {
  margin-bottom: 0.6rem;
}

.subscription-section h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.subscription-section p:not(.eyebrow):not(.subscription-message) {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.subscription-form {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 680px;
}

.subscription-form input {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-container);
  color: var(--text-main);
  font: inherit;
  outline: none;
}

.subscription-form input:focus {
  border-color: var(--primary);
}

.subscription-form input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.subscription-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 145px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: var(--bg-body);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.subscription-form button:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.subscription-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.subscription-form button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 2px;
}

.subscription-form button[hidden] {
  display: none;
}

.subscription-form .subscription-secondary-button {
  width: auto;
  border: 1px solid var(--border);
  background: var(--bg-container);
  color: var(--text-main);
  text-align: center;
}

.subscription-form .subscription-secondary-button:hover {
  border-color: var(--primary);
  background: var(--bg-container);
  color: var(--primary);
}

.subscription-section small {
  display: block;
  max-width: 70ch;
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.subscription-message {
  min-height: 1.25rem;
  margin-top: 0.8rem;
  margin-bottom: 0 !important;
  font-size: 0.88rem;
  line-height: 1.5;
}

.subscription-message.success {
  color: var(--primary) !important;
}

.subscription-message.error {
  color: #b42318 !important;
}

@media (max-width: 768px) {
  .subscription-section {
    margin: 0 1.25rem 2.5rem;
    padding: 1.5rem;
  }

  .subscription-form {
    flex-direction: column;
  }

  .subscription-form button {
    width: 100%;
  }

  .subscription-form .subscription-secondary-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .subscription-section {
    margin: 0 1rem 2rem;
    padding: 1.25rem;
  }

  .subscription-section h2 {
    font-size: 1.45rem;
  }
}

@media (max-width: 768px) {
  .hero {
    max-width: none;
    padding: 2.5rem 1.25rem;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }

  .lead {
    font-size: 1rem;
  }

  .preview-section {
    padding: 0 1.25rem 2.5rem;
  }
}

@media (max-width: 480px) {
  #featured-news .spotlight-card {
    padding: 1.25rem;
  }

  #featured-news .spotlight-card h2 {
    font-size: 1.35rem;
  }
}

.subscription-secondary-button {
  display: inline-block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-container);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
}

.subscription-secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.home-civic-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 3rem 1rem;
  padding: 1.6rem 1.8rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 5%, var(--card-bg));
}

.home-civic-teaser h2 {
  max-width: 700px;
  margin: 0.35rem 0 0.55rem;
  font-family: "Playfair Display", serif;
  font-size: 1.55rem;
  line-height: 1.2;
}

.home-civic-teaser p {
  max-width: 720px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.home-civic-teaser .cta-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .home-civic-teaser {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
    margin: 0 1.25rem 1rem;
    padding: 1.3rem;
  }

  .home-civic-teaser h2 {
    font-size: 1.35rem;
  }

  .home-civic-teaser .cta-button {
    text-align: center;
  }
}

/* HOME — hierarquia editorial e leitura responsiva */

.home-page .hero {
  max-width: 820px;
  padding: clamp(2.5rem, 6vw, 4.25rem) clamp(1.25rem, 5vw, 3.5rem) 2.25rem;
}

.home-page .hero .eyebrow {
  margin-bottom: 1rem;
}

.home-page .hero h1 {
  max-width: 16ch;
  font-size: clamp(2.2rem, 5vw, 3.35rem);
  line-height: 1.08;
  text-wrap: balance;
}

.home-page .hero .lead {
  max-width: 62ch;
  margin-bottom: 1.4rem;
  font-size: clamp(1rem, 2vw, 1.08rem);
}

.home-page .preview-section.home-featured-section {
  padding: 0 clamp(1.25rem, 5vw, 3rem) 3.25rem;
}

.home-page .home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 1.25rem;
}

.home-page .home-section-heading .eyebrow {
  margin-bottom: .45rem;
}

.home-page .home-section-heading h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
}

.home-page .home-section-description {
  max-width: 60ch;
  margin-top: .55rem;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.6;
}

.home-page #featured-news .spotlight-card {
  padding: clamp(1.15rem, 3vw, 2rem);
  border-left-width: 4px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, .045);
}

.home-page #featured-news .spotlight-card h2 {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  line-height: 1.22;
  text-wrap: pretty;
}

.home-page .home-civic-teaser {
  margin-top: 0;
}

.home-page .home-civic-teaser,
.home-page .home-history-teaser {
  box-shadow: none;
}

.home-page .subscription-section {
  margin-top: 0;
}

@media (min-width: 1100px) {
  .home-page .home-featured-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: stretch;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    padding: 0 clamp(1.25rem, 5vw, 3rem) 3.25rem;
  }

  .home-page .home-featured-layout > .home-section-heading {
    grid-column: 1 / -1;
  }

  .home-page .preview-section.home-featured-section {
    min-width: 0;
    padding: 0;
  }

  .home-page #featured-news {
    display: flex;
    height: 100%;
  }

  .home-page .home-section-heading {
    margin-bottom: 1rem;
  }

  .home-page .home-section-description {
    margin-bottom: 0;
  }

  .home-edition-link {
    border: 1px solid var(--primary);
    border-radius: 6px;
    text-decoration: none!important;
    padding: 0.45rem 0.75rem;
  }

  .home-edition-link:hover {
    background: var(--primary);
    color: var(--bg-container)!important;
  }

  .home-page #featured-news .spotlight-card .story-image,
  .home-page #featured-news .spotlight-card h2,
  .home-page #featured-news .spotlight-card .home-edition-link {
    grid-column: 1;
  }

  .home-page #featured-news .spotlight-card h2 {
    margin: 0;
    font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  }

  .home-page .home-civic-teaser {
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    margin: 0;
    padding: clamp(1.4rem, 3vw, 2.25rem);
  }

  .home-page .home-civic-teaser h2 {
    font-size: clamp(1.4rem, 2vw, 1.8rem);
  }
}

@media (max-width: 640px) {
  .home-page .hero {
    padding-top: 2.4rem;
    padding-bottom: 1.65rem;
  }

  .home-page .hero h1 {
    max-width: 15ch;
    letter-spacing: -.6px;
  }

  .home-page .preview-section.home-featured-section {
    padding-bottom: 2.4rem;
  }

  .home-page .home-section-description {
    font-size: .86rem;
  }

  .home-page #featured-news .spotlight-card {
    padding: 1.15rem;
  }

  .home-page #featured-news .spotlight-card .story-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .home-page .home-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .65rem;
    padding-inline: 1.25rem;
  }
}

/* Cabeçalho do herói em duas colunas: texto + resumo da edição */

.home-page .hero > .hero-copy {
  max-width: 42rem;
}

@media (min-width: 1024px) {
  .home-page .hero:has(> .hero-copy) {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem);
    align-items: start;
    column-gap: 3rem;
  }
}

@media (min-width: 901px) {
  .home-page #featured-news .spotlight-card.has-no-image {
    grid-template-columns: minmax(0, 1fr);
  }
}

@keyframes subscription-spin {
  to {
    transform: rotate(360deg);
  }
}

.home-page #featured-news .spotlight-card h2,
.home-page #featured-news .spotlight-card .home-edition-link {
  grid-column: 1;
}

.home-page #featured-news .spotlight-card .home-edition-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.5rem;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none!important;
  border: solid 1px var(--primary);
  border-radius: 0.5rem;
  padding: 0.5rem 0.5rem;
  margin: 0.5rem 0 0;
  width: fit-content;
}

.home-page #featured-news .spotlight-card .home-edition-link:hover,
.home-page #featured-news .spotlight-card .home-edition-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (min-width: 901px) {
  .home-page #featured-news .spotlight-card .story-image {
    grid-column: 2;
  }
}

@media (min-width: 1100px) {
  .home-page #featured-news .spotlight-card {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 1.25rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-page #featured-news .spotlight-card .story-image {
    align-self: stretch;
    width: 100%;
    height: auto;
    margin: 0;
    grid-column: 1;
    grid-row: auto;
    max-height: 220px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
}

@media (max-width: 900px) {
  .home-page #featured-news .spotlight-card h2,
  .home-page #featured-news .spotlight-card .home-edition-link {
    grid-column: auto;
  }
}
