.search-form {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
}

.search-form input {
  width: min(100%, 250px);
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.post-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.post-card__image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #dceefe, #f4f6f8);
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, rgb(0 94 184 / 16%), rgb(88 71 201 / 22%));
}

.post-card:hover .post-card__image img {
  transform: scale(1.025);
}

.post-card__body {
  padding: var(--space-3);
}

.post-card__category {
  color: var(--color-orange);
  font-weight: 700;
}

.post-card__title {
  margin-top: var(--space-1);
}

.post-card__title-link {
  color: inherit;
  text-decoration: none;
}

.post-card__title-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.post-card--hero .post-card__title-link:hover {
  color: #fff;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.post-card__author {
  font-weight: 700;
  color: var(--color-text);
}

.post-card__author::before {
  content: "·";
  margin-right: 0.5rem;
  color: var(--color-muted);
  font-weight: 400;
}

.post-card--hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  height: clamp(340px, 50vh, 620px);
  background: var(--color-primary);
  color: #fff;
  border: 0;
}

.post-card--hero .post-card__image {
  order: 2;
  aspect-ratio: auto;
  min-height: 0;
  height: 100%;
}

.post-card--hero .post-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
}

/* Fixed-height hero cards: clamp the title so long headlines never change the
   card height (every slide stays the same 60–70vh). */
/* stylelint-disable no-descending-specificity, no-duplicate-selectors -- Preserve the legacy stage 1.0.10 cascade. */
.post-card--hero .post-card__title a {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card--hero a,
.post-card--hero time,
.post-card--hero .post-card__meta,
.post-card--hero .post-card__author,
.post-card--hero .post-card__author::before {
  color: #fff;
}

.hero__controls {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}

.category-card {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.icon {
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
}

.category-card .icon {
  width: 54px;
  height: 54px;
  padding: 11px;
  border-radius: 50%;
  background: var(--color-soft);
  color: var(--color-primary);
}

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.ebook-carousel__item {
  min-width: 0;
}

.ebook-carousel.is-enhanced .ebook-carousel__viewport {
  overflow: hidden;
}

.ebook-carousel.is-enhanced .ebook-carousel__track {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  transition: transform 360ms ease;
  will-change: transform;
}

.ebook-carousel.is-enhanced .ebook-carousel__item {
  display: flex;
}

.ebook-carousel.is-enhanced .ebook-carousel__item .ebook-card {
  width: 100%;
}

.ebook-carousel.is-enhanced .ebook-carousel__item {
  flex: 0 0 calc((100% - 3rem) / 3);
}

.ebook-carousel.is-enhanced .ebook-carousel__controls:not([hidden]) {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.ebook-card {
  position: relative;
  display: flex;
  height: 500px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: #fff;
}

.ebook-card a {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-3);
  color: #fff;
  text-decoration: none;
}

/* The book cover fills the whole 500px card. Covers are portrait (~0.71) and
   the card is ~0.75, so object-fit: cover shows essentially the full cover with
   only a few px cropped. `picture` gets display: contents so webp-optimizer
   wrappers don't break the sizing. */
.ebook-card a picture {
  display: contents;
}

.ebook-card a img,
.ebook-card__placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}

.ebook-card__placeholder {
  background: linear-gradient(145deg, rgb(255 255 255 / 30%), transparent);
}

/* Legibility scrim so the label + title read over any cover. */
.ebook-card a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgb(15 18 40 / 88%) 0%, rgb(15 18 40 / 35%) 38%, rgb(15 18 40 / 0%) 62%);
}

.ebook-card__label,
.ebook-card a h3 {
  position: relative;
  z-index: 2;
}

.ebook-card__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.icon-fill {
  fill: currentcolor;
  stroke: none;
}

.icon-solid {
  fill: currentcolor;
  stroke: none;
}

.icon-cut {
  fill: var(--color-primary);
  stroke: none;
}

/* The avatar class may land on the <img> itself or on a <picture> wrapper
   (one-user-avatar + webp optimizers), so style both the element and any
   inner img — border-radius/object-fit only work on the replaced element. */
.author-profile__avatar,
.author-profile__avatar img {
  display: block;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
}

.author-profile__link {
  display: inline-block;
  font-weight: 700;
}

.social-links {
  display: flex;
  gap: 0.2rem;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

/* stylelint-enable no-descending-specificity, no-duplicate-selectors */
.popular-editorial__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 1fr);
  align-items: start;
  gap: clamp(2.5rem, 5vw, 6rem);
}

.popular-editorial__layout--solo {
  grid-template-columns: minmax(0, 1fr);
}

.popular-editorial__featured,
.popular-editorial__item {
  min-width: 0;
}

.popular-editorial__image {
  display: block;
  aspect-ratio: 20 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #dceefe, #f4f6f8);
}

.popular-editorial__image :is(img),
.popular-editorial__image :is(.post-card__placeholder) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-editorial__featured-body {
  padding: clamp(1.25rem, 2vw, 2rem) clamp(0.75rem, 1vw, 1rem) 0;
}

.popular-editorial__featured-category {
  color: var(--color-primary);
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.popular-editorial :is(h3) {
  margin: 0;
}

.popular-editorial :is(h3 a) {
  color: var(--color-text);
  text-decoration: none;
}

.popular-editorial :is(h3 a):hover,
.popular-editorial :is(h3 a):focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
}

.popular-editorial__featured :is(h3) {
  max-width: 16ch;
  margin-top: 1rem;
  font-size: clamp(2.4rem, 4.25vw, 4.6rem);
  font-weight: 900;
  line-height: 0.98;
}

.popular-editorial__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--color-border);
}

.popular-editorial__item {
  padding-block: clamp(1.5rem, 2.6vw, 2.5rem);
  border-bottom: 1px solid var(--color-border);
}

.popular-editorial__tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: 5px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.1em;
}

.popular-editorial__tag:hover,
.popular-editorial__tag:focus-visible {
  background: var(--color-primary);
  color: #fff;
}

.popular-editorial__item :is(h3) {
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 1.8vw, 1.85rem);
  font-weight: 500;
  line-height: 1.15;
}

.popular-editorial__slide[hidden] {
  display: none;
}

.popular-editorial__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.popular-editorial__dots {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
}

.popular-editorial__dot,
.card-carousel__dot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-border);
  cursor: pointer;
}

.popular-editorial__dot.is-active,
.card-carousel__dot.is-active {
  background: var(--color-primary);
}

.popular-editorial__dot:focus-visible,
.card-carousel__dot:focus-visible {
  outline-offset: 2px;
}

.card-carousel__slide[hidden] {
  display: none;
}

.card-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

[data-carousel] {
  touch-action: pan-y pinch-zoom;
}

[data-carousel]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

.whatsapp-widget {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 80;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
}

.whatsapp-widget:hover,
.whatsapp-widget:focus-visible {
  background: #128c7e;
  color: #fff;
}

.whatsapp-widget .icon {
  width: 30px;
  height: 30px;
}
