/* ==========================================================================
   Hub de Conhecimento / Publicações IBPLD
   editorial · paper / ink / wine · identidade alinhada à Academia
   ========================================================================== */

:root {
  --pub-paper: #F5F3EE;
  --pub-ivory: #FAF8F4;
  --pub-warm: #F0EBE3;
  --pub-ink: #161719;
  --pub-graphite: #17191B;
  --pub-muted: rgba(22, 23, 25, 0.58);
  --pub-line: rgba(22, 23, 25, 0.1);
  --pub-wine: #4C0911;
  --pub-champagne: #C8B69A;
  --pub-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body:has(.pub-page) {
  --site-container: 1500px;
  --mast-h: 5.5rem;
}

body:has(.pub-page) .proto-mast__bar {
  min-height: var(--mast-h);
  padding-block: 0.45rem;
}

body:has(.pub-page) .proto-mast__link.is-current,
body:has(.pub-page) .proto-mast__link.is-active {
  color: var(--pub-wine);
  font-weight: 700;
}

body:has(.pub-page) .proto-mast__aside {
  display: none;
  align-items: center;
  gap: 0.05rem;
  margin-left: auto;
  padding-left: 0.55rem;
  border-left: 1px solid rgba(22, 23, 25, 0.1);
}

@media (min-width: 1024px) {
  body:has(.pub-page) .proto-mast__nav {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
  }

  body:has(.pub-page) .proto-mast__aside,
  body:has(.pub-page) .proto-mast__student {
    display: inline-flex;
  }
}

.pub-page {
  background: var(--pub-paper);
  color: var(--pub-ink);
  overflow-x: clip;
}

.pub-shell {
  width: 100%;
  max-width: 1520px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4.5vw, 3.25rem);
  box-sizing: border-box;
}

.pub-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pub-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pub-wine);
}

.pub-kicker--light { color: rgba(200, 182, 154, 0.88); }

.pub-h2 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.05rem, 3.8vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.pub-h2--sm {
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  max-width: 18ch;
}

.pub-h2--light {
  color: #FAF8F4;
  max-width: 16ch;
}

.pub-lead {
  margin: 1rem 0 0;
  max-width: 38rem;
  font-size: clamp(1.02rem, 1.45vw, 1.14rem);
  line-height: 1.55;
  color: var(--pub-muted);
}

.pub-section-head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }

.pub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.25rem;
  background: var(--pub-ink);
  color: #F7F5F0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--pub-ink);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.pub-btn:hover,
.pub-btn:focus-visible {
  background: var(--pub-wine);
  border-color: var(--pub-wine);
  color: #F7F5F0;
  outline: none;
}

.pub-btn--ghost {
  background: transparent;
  color: var(--pub-ink);
  border-color: rgba(22, 23, 25, 0.18);
}

.pub-btn--ghost:hover,
.pub-btn--ghost:focus-visible {
  border-color: var(--pub-ink);
  background: transparent;
  color: var(--pub-ink);
}

.pub-btn--light {
  background: #F5F3EE;
  color: #17191B;
  border-color: #F5F3EE;
}

.pub-btn--light:hover,
.pub-btn--light:focus-visible {
  background: var(--pub-champagne);
  border-color: var(--pub-champagne);
  color: #17191B;
}

.pub-btn--outline-light {
  background: transparent;
  color: #F5F3EE;
  border-color: rgba(245, 243, 238, 0.35);
}

.pub-btn--outline-light:hover,
.pub-btn--outline-light:focus-visible {
  background: rgba(245, 243, 238, 0.08);
  color: #FAF8F4;
}

.pub-textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--pub-wine);
  text-decoration: none;
}

.pub-textlink:hover,
.pub-textlink:focus-visible {
  color: var(--pub-ink);
  outline: none;
}

.pub-textlink span {
  display: inline-block;
  transition: transform 200ms var(--pub-ease);
}

.pub-textlink:hover span,
.pub-textlink:focus-visible span {
  transform: translateX(4px);
}

[data-reveal] { opacity: 1; transform: none; }

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 640ms var(--pub-ease), transform 640ms var(--pub-ease);
}

.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* HERO */
.pub-hero {
  padding: clamp(4rem, 7.5vw, 6rem) 0 clamp(2.75rem, 5vw, 4.25rem);
  background:
    radial-gradient(ellipse 50% 45% at 90% 0%, rgba(200, 182, 154, 0.18), transparent 58%),
    linear-gradient(180deg, #F7F5F0 0%, var(--pub-paper) 100%);
  border-bottom: 1px solid var(--pub-line);
}

.pub-hero__shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  align-items: center;
}

.pub-hero__title {
  margin: 0;
  max-width: min(740px, 12em);
  font-size: clamp(2.45rem, 6.5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.pub-hero__title br { display: none; }

.pub-hero__sub {
  margin: 1.15rem 0 0;
  max-width: 38rem;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  color: var(--pub-muted);
}

.pub-hero__notice {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(22, 23, 25, 0.45);
}

.pub-hero__actions {
  margin-top: 1.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pub-hero-card {
  max-width: 320px;
  padding: 1.15rem 1.15rem 1.35rem;
  border: 1px solid rgba(22, 23, 25, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent), var(--pub-warm);
}

.pub-hero-card__label {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pub-wine);
}

.pub-hero-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(22, 23, 25, 0.12);
}

.pub-hero-card__meta {
  margin: 1rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(22, 23, 25, 0.4);
}

.pub-hero-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.pub-hero-mark {
  display: grid;
  gap: 0.35rem;
  min-height: 280px;
  align-content: center;
  padding: 1.5rem;
  border: 1px solid rgba(22, 23, 25, 0.08);
  background: var(--pub-warm);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: rgba(22, 23, 25, 0.12);
}

/* EXPLORE */
.pub-explore {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  background: var(--pub-ivory);
  border-bottom: 1px solid var(--pub-line);
}

.pub-tools {
  display: grid;
  gap: 1.15rem;
}

.pub-search input {
  width: 100%;
  max-width: 520px;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(22, 23, 25, 0.14);
  background: #fff;
  color: var(--pub-ink);
  font: inherit;
  font-size: 0.98rem;
}

.pub-search input:focus-visible {
  outline: 2px solid var(--pub-wine);
  outline-offset: 2px;
}

.pub-filters {
  display: flex;
  gap: 0.35rem 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.pub-filter {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.45rem 0.1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(22, 23, 25, 0.48);
  cursor: pointer;
}

.pub-filter.is-active,
.pub-filter[aria-pressed="true"] {
  color: var(--pub-wine);
  border-bottom-color: var(--pub-wine);
}

.pub-filter:focus-visible {
  outline: 2px solid var(--pub-wine);
  outline-offset: 3px;
}

.pub-themes {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pub-theme {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(22, 23, 25, 0.12);
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(22, 23, 25, 0.55);
  cursor: pointer;
}

.pub-theme.is-active {
  border-color: var(--pub-wine);
  color: var(--pub-wine);
}

.pub-theme:focus-visible {
  outline: 2px solid var(--pub-wine);
  outline-offset: 2px;
}

/* FEATURED */
.pub-featured {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
  background: var(--pub-paper);
  border-bottom: 1px solid var(--pub-line);
}

.pub-featured__shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.pub-featured__type {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(22, 23, 25, 0.42);
}

.pub-featured__name {
  margin: 0.55rem 0 0;
  max-width: 18ch;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.pub-featured__author {
  margin: 0.65rem 0 0;
  color: var(--pub-muted);
  font-weight: 600;
}

.pub-featured__cover {
  margin: 0;
  max-width: 320px;
}

.pub-featured__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 0 22px 48px rgba(22, 23, 25, 0.14);
}

/* BOOKS */
.pub-books {
  padding: clamp(3.5rem, 7vw, 5.75rem) 0;
  background: var(--pub-warm);
  border-bottom: 1px solid var(--pub-line);
}

.pub-catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.pub-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  padding: 1.15rem 0;
  border-top: 1px solid rgba(22, 23, 25, 0.1);
  min-width: 0;
}

.pub-item.is-hidden { display: none; }

.pub-item--lead {
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 0.5rem;
}

.pub-item__cover {
  margin: 0;
}

.pub-item__cover img {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.35);
}

.pub-item--lead .pub-item__cover img {
  max-width: 260px;
}

.pub-item__meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(22, 23, 25, 0.4);
}

.pub-item__title {
  margin: 0.45rem 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.pub-item--lead .pub-item__title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  max-width: 22ch;
}

.pub-item__author {
  margin: 0.45rem 0 0;
  color: var(--pub-muted);
  font-weight: 600;
}

.pub-item__pending {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: rgba(22, 23, 25, 0.42);
  font-weight: 600;
}

.pub-empty {
  margin: 1.5rem 0 0;
  color: var(--pub-muted);
  font-weight: 600;
}

/* BRIDGE */
.pub-bridge {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
  background: var(--pub-paper);
}

.pub-bridge__shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}

.pub-bridge__card {
  max-width: 36rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(22, 23, 25, 0.12);
}

/* CTA */
.pub-cta {
  padding: clamp(4.25rem, 8vw, 6.5rem) 0;
  background:
    radial-gradient(ellipse 42% 48% at 12% 80%, rgba(76, 9, 17, 0.4), transparent 55%),
    var(--pub-graphite);
  color: #F5F3EE;
}

.pub-cta__text {
  margin: 1.05rem 0 0;
  max-width: 34rem;
  color: rgba(245, 243, 238, 0.68);
  line-height: 1.5;
}

.pub-cta__actions {
  margin-top: 1.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

body:has(.pub-page) .sitefoot.sitefoot--compact .sitefoot__shell {
  padding-block: clamp(4.5rem, 6vw, 5.5rem) !important;
}

body:has(.pub-page).course-body,
body:has(.pub-page) .course-body {
  min-height: 0 !important;
  padding-bottom: 0 !important;
}

@media (min-width: 768px) {
  .pub-catalog {
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
  }

  .pub-item--lead {
    grid-column: 1 / -1;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    padding-bottom: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(22, 23, 25, 0.12);
  }

  .pub-bridge__shell {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .pub-featured__shell {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }

  body:has(.pub-page) .sitefoot.sitefoot--compact .sitefoot__shell {
    display: grid;
    grid-template-columns: minmax(200px, 0.9fr) minmax(0, 2.2fr);
  }

  body:has(.pub-page) .sitefoot.sitefoot--compact .sitefoot__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .pub-hero__shell {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.75fr);
    gap: clamp(48px, 6vw, 96px);
  }

  .pub-hero__title {
    font-size: clamp(52px, 4.5vw, 70px);
  }

  .pub-hero__title br { display: block; }

  .pub-catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pub-item--lead {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1440px) {
  .pub-hero__title { font-size: 70px; }
  .pub-h2 { font-size: 52px; }
}

@media (min-width: 1920px) {
  .pub-shell { max-width: 1540px; }
}

@media (min-width: 2560px) {
  body:has(.pub-page) { --site-container: 1560px; }
  .pub-shell { max-width: 1560px; }
  .pub-hero__title { font-size: 72px; }
}
