/*
 * AiPreso blog: index, archives, single post, article block styles.
 * Colours come from the --aip-* tokens in theme.css only, so dark and light follow.
 */

/* ---------- Layout ---------- */

.aip-blog-section {
  padding-block: 2.5rem;
}

.aip-blog-section--head {
  padding-bottom: 0;
}

.aip-blog-section--single {
  padding-top: 2rem;
}

.aip-blog-section > * {
  margin-block: 0;
}

.aip-blog-section > * + * {
  margin-block-start: 1.5rem;
}

/* ---------- Hero ---------- */

.aip-blog-hero__inner {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

/* Scrim keeps small white text AA over the orange part of the gradient. */
.aip-blog-hero__inner > * {
  max-width: 44rem;
}

.aip-blog-hero__title {
  font-family: var(--aip-font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 0 0 1.25rem;
}

.aip-blog-hero__lede {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
  margin: 0 0 1.75rem;
  background: rgba(40, 0, 50, 0.38);
  padding: 1rem 1.25rem;
  border-radius: 12px;
}

/* ---------- Archive head ---------- */

.aip-blog-archive-title {
  font-family: var(--aip-font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  margin: 0;
}

.aip-blog-archive-head .wp-block-term-description {
  color: var(--aip-text-2);
  max-width: 44rem;
}

.aip-blog-archive-head > * {
  margin-block: 0 1rem;
}

/* ---------- Topic chips ---------- */

.aip-blog-chips {
  gap: 0.5rem;
}

/* The categories block renders a <ul>; lay it out as its own wrapping row next to the "All" chip. */
.aip-blog-chips .wp-block-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.aip-blog-chips .wp-block-categories li {
  list-style: none;
  margin: 0;
}

.aip-blog-chip {
  margin: 0;
}

.aip-blog-chip a,
.aip-blog-chips .wp-block-categories a {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--aip-text-1);
  text-decoration: none;
  border: 1px solid var(--aip-border-strong);
  border-radius: 999px;
  padding: 0.5rem 0.875rem;
  min-height: 2.25rem;
}

.aip-blog-chip a:hover,
.aip-blog-chips .wp-block-categories a:hover {
  background: var(--aip-surface-2);
  text-decoration: none;
}

.aip-blog-chips .wp-block-categories .current-cat a,
.aip-blog-chip--all a[aria-current] {
  background: var(--aip-brand-orange);
  border-color: var(--aip-brand-orange);
  color: var(--aip-on-orange);
}

/* ---------- Cards ---------- */

.aip-blog-grid .wp-block-post-template {
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 781px) {
  .aip-blog-grid .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr;
  }
}

.aip-blog-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
}

.aip-blog-card > * {
  margin: 0;
}

.aip-blog-card__image img {
  border-radius: 8px;
  width: 100%;
  object-fit: cover;
}

.aip-blog-topic,
.aip-blog-topic a {
  font-family: var(--aip-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aip-accent-orange);
  text-decoration: none;
  margin: 0;
}

.aip-blog-card__title {
  font-size: 1.25rem;
  line-height: 1.25;
}

.aip-blog-card__title a {
  color: var(--aip-text-1);
  text-decoration: none;
}

.aip-blog-card__title a:hover {
  color: var(--aip-accent-orange);
}

.aip-blog-card__excerpt {
  font-size: 0.9375rem;
  color: var(--aip-text-2);
}

.aip-blog-card__excerpt .wp-block-post-excerpt__more-text {
  display: none;
}

.aip-blog-card__date,
.aip-blog-meta {
  font-size: 0.8125rem;
  color: var(--aip-text-3);
  margin-top: auto;
}

/* ---------- Featured ---------- */

.aip-blog-featured {
  padding: 0;
  overflow: hidden;
  gap: 0;
  margin: 0;
}

.aip-blog-featured > .wp-block-column {
  margin: 0;
}

.aip-blog-featured > .wp-block-column:last-child {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.aip-blog-featured__image,
.aip-blog-featured__image img {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 14rem;
  object-fit: cover;
  background: var(--aip-surface-3);
}

.aip-blog-featured__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 0.75rem 0;
}

.aip-blog-featured__title a {
  color: var(--aip-text-1);
  text-decoration: none;
}

.aip-blog-featured .aip-pill {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.aip-blog-readmore {
  margin-top: 1rem;
  font-weight: 600;
}

.aip-blog-readmore a {
  color: var(--aip-accent-orange);
}

/* ---------- Pagination ---------- */

.aip-blog-pagination {
  margin-top: 2rem;
  gap: 1rem;
}

/* ---------- Newsletter ---------- */

.aip-blog-newsletter {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.aip-blog-newsletter__title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.aip-blog-newsletter p {
  color: var(--aip-text-2);
  margin: 0 0 1rem;
}

/* ---------- Single post ---------- */

.aip-blog-back {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.aip-blog-back a {
  color: var(--aip-text-2);
  text-decoration: none;
}

.aip-blog-back a:hover {
  color: var(--aip-text-1);
}

.aip-blog-eyebrow {
  margin: 0 0 0.75rem;
}

.aip-blog-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.aip-blog-single-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  max-width: 22ch;
  margin: 0 0 1.25rem;
}

.aip-blog-meta {
  gap: 0.5rem 0.75rem;
  margin-top: 0;
  color: var(--aip-text-3);
}

.aip-blog-meta > * {
  margin: 0;
}

.aip-blog-meta__author a {
  color: var(--aip-text-1);
  font-weight: 600;
  text-decoration: none;
}

.aip-blog-avatar img {
  border-radius: 50%;
  display: block;
}

.aip-blog-single-image {
  margin: 2rem 0;
}

.aip-blog-single-image img {
  width: 100%;
  border-radius: 14px;
}

.aip-blog-layout {
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: flex-start;
  margin-top: 2rem;
}

@media (max-width: 781px) {
  /* Sidebar follows the article on small screens. */
  .aip-blog-aside {
    flex-basis: 100% !important;
  }
}

.aip-blog-sticky {
  position: sticky;
  top: calc(var(--aip-header-offset) + 1rem);
}

.admin-bar .aip-blog-sticky {
  top: calc(var(--aip-header-offset) + 3rem);
}

@media (max-width: 781px) {
  .aip-blog-sticky {
    position: static;
  }
}

.aip-blog-cta__title {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.aip-blog-cta p {
  color: var(--aip-text-2);
  font-size: 0.9375rem;
}

/* ---------- Article body ---------- */

.aip-blog-content > * + * {
  margin-block-start: 1.25rem;
}

.aip-blog-content p,
.aip-blog-content li {
  font-family: var(--aip-font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--aip-text-1);
}

.aip-blog-content h2 {
  font-family: var(--aip-font-display);
  font-weight: 700;
  font-size: clamp(1.625rem, 3vw, 1.875rem);
  line-height: 1.2;
  margin-top: 2.5rem;
}

.aip-blog-content h3 {
  font-family: var(--aip-font-display);
  font-weight: 700;
  font-size: 1.375rem;
  margin-top: 2rem;
}

.aip-blog-content ul,
.aip-blog-content ol {
  padding-left: 1.5rem;
}

.aip-blog-content li + li {
  margin-top: 0.5rem;
}

.aip-blog-content li::marker {
  color: var(--aip-accent-orange);
}

/* Pull quote: orange rule, Saira 600 24px. */
.aip-blog-content .wp-block-quote.is-style-aip-pull-quote,
.wp-block-quote.is-style-aip-pull-quote {
  border-left: 4px solid var(--aip-brand-orange);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin-inline: 0;
}

.wp-block-quote.is-style-aip-pull-quote p {
  font-family: var(--aip-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--aip-text-1);
}

/* Code / Markup: Plex Mono 14px. */
.wp-block-code,
.wp-block-code.is-style-aip-markup {
  font-family: var(--aip-font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--aip-canvas-2);
  color: var(--aip-text-1);
  border: 1px solid var(--aip-border);
  border-radius: 8px;
  overflow-x: auto;
}

.wp-block-code code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  white-space: pre;
}

/* Inline code. */
.aip-blog-content :not(pre) > code {
  font-family: var(--aip-font-mono);
  font-size: 0.875em;
  background: var(--aip-surface-3);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Quick answer: the label paragraph inside the box. */
.is-style-aip-quick-answer .aip-eyebrow {
  margin-bottom: 0.5rem;
}

/* FAQ accordion: hairline rows, orange + marker. */
.aip-faq {
  gap: 0;
}

.aip-faq .wp-block-details,
.aip-faq .wp-block-details.is-style-aip-faq-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--aip-hairline);
  padding: 1rem 0;
}

/* The group renders as a grid, so auto side margins would shrink and centre each row. */
.aip-faq > .wp-block-details {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.aip-faq .wp-block-details:last-child {
  border-bottom: 1px solid var(--aip-hairline);
}

.aip-faq .wp-block-details summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.0625rem;
}

.aip-faq .wp-block-details summary::-webkit-details-marker {
  display: none;
}

.aip-faq .wp-block-details summary::after {
  content: "+";
  color: var(--aip-accent-orange);
  font-weight: 600;
}

.aip-faq .wp-block-details[open] summary::after {
  content: "\2212";
}

/* ---------- Author box ---------- */

.aip-blog-author {
  margin-top: 3rem;
  gap: 1.25rem;
  align-items: flex-start;
}

.aip-blog-author > .wp-block-group > * {
  margin: 0;
}

.aip-blog-avatar--lg img {
  border-radius: 50%;
}

.aip-blog-author__name,
.aip-blog-author__name a {
  font-family: var(--aip-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--aip-text-1);
  text-decoration: none;
}

.aip-blog-author__bio {
  color: var(--aip-text-2);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

@media (max-width: 520px) {
  .aip-blog-author {
    flex-direction: column;
  }
}

/* ---------- Keep reading ---------- */

.aip-blog-keep {
  padding-bottom: 4rem;
}

.aip-blog-keep__title {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}

@media (max-width: 781px) {
  .aip-blog-grid--three .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr;
  }
}

