/* =====================================================
   NOVARIS EDITORIAL HOMEPAGE + ARTICLE LIBRARY
   Loaded after the existing public stylesheet.
   ===================================================== */

.editorial-home,
.editorial-library {
  width: 100%;
}

.editorial-hero {
  width: 100%;
  max-width: none;
  padding-top: clamp(4rem, 7vw, 6.5rem);
  padding-bottom: clamp(3rem, 5vw, 5rem);
}

.editorial-home .editorial-hero h1 {
  width: 100%;
  max-width: 22ch;
  font-size: clamp(3.4rem, 6vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.editorial-home .editorial-hero .lede {
  max-width: 760px;
}

.editorial-section .section-head {
  margin-bottom: 1.6rem;
}

/* -----------------------------------------------------
   TOPICS
   Four equal cards on large screens, then 2 / 1.
   ----------------------------------------------------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.topic-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 265px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(54, 38, 9, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.topic-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 148, 28, 0.55);
  box-shadow: 0 16px 34px rgba(54, 38, 9, 0.1);
}

.topic-card-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 1rem;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 225, 128, 0.62), transparent 52%),
    linear-gradient(135deg, rgba(255, 248, 227, 0.98), rgba(255, 239, 195, 0.9));
  border-bottom: 1px solid var(--line);
}

.topic-card-visual img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.topic-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.2rem;
}

.topic-card-body .eyebrow {
  margin-bottom: 0.45rem;
}

.topic-card-body h3 {
  font-size: clamp(1.18rem, 1.45vw, 1.42rem);
  line-height: 1.18;
}

.topic-count {
  margin: 0.7rem 0 0;
  font-size: 0.94rem;
}

.topic-card-actions {
  margin-top: auto;
  padding-top: 1.1rem;
}

.topic-filter-nav {
  gap: 0.65rem;
  padding-bottom: 0.25rem;
}

/* -----------------------------------------------------
   ARTICLE CARDS
   Wide editorial cards inspired by a magazine/library
   layout. The thumbnail floats so longer text can continue
   below it instead of leaving a blank column.
   ----------------------------------------------------- */

.article-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.15rem;
}

.editorial-article-card {
  display: flow-root;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.35rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(54, 38, 9, 0.065);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.editorial-article-card:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 148, 28, 0.48);
  box-shadow: 0 16px 38px rgba(54, 38, 9, 0.095);
}

.article-thumb-link {
  float: left;
  display: block;
  width: clamp(132px, 16vw, 178px);
  aspect-ratio: 4 / 3;
  margin: 0 1.35rem 0.7rem 0;
  overflow: hidden;
  border: 1px solid rgba(230, 216, 191, 0.98);
  border-radius: 12px;
  background: #fff6dc;
  box-shadow: 0 8px 20px rgba(54, 38, 9, 0.08);
}

.article-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-copy {
  min-width: 0;
}

.article-card-kicker {
  margin: 0 0 0.4rem;
}

.editorial-article-card .article-card-title {
  max-width: none;
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 2.3vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.editorial-article-card .article-meta {
  margin: 0 0 0.7rem;
  color: #6d6254;
  font-size: 0.88rem;
  line-height: 1.5;
}

.editorial-article-card .article-summary {
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.67;
}

.article-card-actions {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
}

.article-card-actions .button {
  min-height: 2.65rem;
  padding: 0.7rem 0.95rem;
}

.editorial-more-link,
.editorial-pagination {
  margin-top: 1.4rem;
}

.editorial-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.editorial-principles > .card {
  height: 100%;
  margin: 0;
}

.editorial-newsletter-card {
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: 14px;
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 225, 128, 0.35), transparent 22rem),
    rgba(255, 255, 255, 0.9);
}

/* -----------------------------------------------------
   ADMIN FEATURED-IMAGE UPLOADER
   Injected by /assets/admin-featured-image.js.
   ----------------------------------------------------- */

.featured-image-uploader {
  margin: 0 0 1rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 240, 0.9);
}

.featured-image-uploader strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.featured-image-uploader p {
  margin: 0.25rem 0 0.7rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.featured-image-uploader input[type="file"] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.featured-image-upload-status {
  min-height: 1.4em;
  margin-top: 0.55rem !important;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.featured-image-upload-status.is-error {
  color: #8b2416;
}

.featured-image-upload-status.is-success {
  color: #28552c;
}

.featured-image-live-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  margin: 0.8rem 0 1rem;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

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

  .editorial-principles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 0;
  }

  .topic-card-visual {
    min-height: 90px;
  }

  .article-thumb-link {
    float: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 1rem;
  }

  .editorial-article-card {
    padding: 1rem;
  }

  .editorial-article-card .article-card-title {
    font-size: clamp(1.65rem, 8vw, 2.15rem);
  }
}


/* =====================================================
   CONSOLIDATED PUBLIC-PAGE FIXES
   ===================================================== */

/*
 * Individual article headings should use the reading column instead of
 * inheriting the old global h2 max-width: 15ch rule.
 */
.article-page h2,
.article-page h3,
.article-page h4 {
  max-width: none;
}

.article-page .section-head {
  display: block;
  width: 100%;
}

.article-page .section-head h2,
.article-page .text-block h2,
.article-page .text-block h3,
.article-page .text-block h4 {
  width: 100%;
  max-width: none;
}

/*
 * TinyMCE can save explicit image/figure widths. Constrain every image and
 * figure inside an article so no inline width can force horizontal overflow.
 */
.article-page,
.article-page > .page,
.article-page > .band,
.article-page .text-block,
.article-page .section-head {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.article-page figure {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

.article-page img {
  display: block;
  width: auto;
  max-width: 100% !important;
  height: auto !important;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.article-page figure img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
}

.article-page iframe,
.article-page video,
.article-page object,
.article-page embed {
  max-width: 100%;
  box-sizing: border-box;
}

.article-page table {
  max-width: 100%;
}

/* Newsletter */
.newsletter-page {
  width: min(100%, 1040px);
  margin-inline: auto;
}

.newsletter-hero {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.newsletter-hero h1 {
  width: 100%;
  max-width: 18ch;
  font-size: clamp(3rem, 5.5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.newsletter-hero .lede {
  max-width: 760px;
}

.newsletter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 38px rgba(54, 38, 9, 0.07);
}

.newsletter-panel h2,
.newsletter-panel h3 {
  max-width: none;
}

.newsletter-benefits {
  margin: 1.2rem 0 0;
  padding-left: 1.25rem;
}

.newsletter-benefits li {
  margin-bottom: 0.65rem;
  color: var(--text);
  line-height: 1.6;
}

.newsletter-status {
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.newsletter-status p {
  margin-top: 0;
}

@media (max-width: 760px) {
  .editorial-home .editorial-hero h1,
  .newsletter-hero h1 {
    max-width: none;
    font-size: clamp(2.7rem, 12vw, 4rem);
  }

  .newsletter-panel {
    grid-template-columns: 1fr;
  }

  .article-page figure,
  .article-page img {
    max-width: 100% !important;
  }
}


/* =====================================================
   NEWSLETTER SIGNUP FORM
   ===================================================== */

.newsletter-signup {
  display: grid;
  gap: 1rem;
}

.newsletter-signup label {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 750;
}

.newsletter-signup input[type="email"] {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.newsletter-signup input[type="email"]:focus {
  outline: 3px solid rgba(212, 148, 28, 0.18);
  border-color: var(--gold);
}

.newsletter-consent {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem !important;
  font-weight: 500 !important;
  line-height: 1.55;
}

.newsletter-consent input {
  width: auto;
  margin-top: 0.25rem;
}

.newsletter-form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.newsletter-form-note a {
  color: var(--gold-dark);
}

.newsletter-signup .button {
  width: fit-content;
}

.newsletter-honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.newsletter-panel .notice {
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .newsletter-signup .button {
    width: 100%;
  }
}

/* Book card near the end of articles (Admin → Book Card).
   A small cover with the text flowing beside and under it. */
.book-card {
  display: flow-root;
  margin: 2.5rem 0;
  padding: 1.25rem 1.4rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.book-card .book-card-cover {
  float: left;
  margin: 0.2rem 1.25rem 0.6rem 0;
  line-height: 0;
}

.article-page .book-card img,
.book-card img {
  display: block;
  width: 120px !important;
  max-width: 120px !important;
  height: auto !important;
  margin: 0;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(60, 40, 10, 0.18);
}

.book-card p {
  margin: 0 0 0.6rem;
}

.book-card .book-card-eyebrow {
  color: var(--gold-dark);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.book-card .book-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.book-card .book-card-title a {
  color: inherit;
  text-decoration: none;
}

.book-card .book-card-title span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
}

.book-card .book-card-lead,
.book-card .book-card-text {
  font-size: 1rem;
  line-height: 1.6;
}

.book-card .book-card-links a {
  font-weight: 700;
}

.book-card .book-card-stores {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.book-card .book-card-stores a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 560px) {
  .book-card {
    padding: 1rem;
  }

  .article-page .book-card img,
  .book-card img {
    width: 84px !important;
    max-width: 84px !important;
  }

  .book-card .book-card-cover {
    margin-right: 0.9rem;
  }
}
