@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;800&display=swap");

:root {
  --bg: #fff7fc;
  --surface: #ffffff;
  --surface-2: #fff0fa;
  --text: #1b2440;
  --muted: #4f5b7a;
  --primary: #ff5aa5;
  --primary-2: #5ad7ff;
  --accent: #ffd166;
  --border: rgba(27, 36, 64, 0.14);
  --shadow: 0 16px 30px rgba(27, 36, 64, 0.14);
  --radius: 22px;
  --container: 1100px;
  --drawer-width: min(340px, 92vw);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family:
    Nunito,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(
      1100px 520px at 10% 0%,
      rgba(255, 90, 165, 0.25),
      transparent 60%
    ),
    radial-gradient(
      1000px 560px at 90% 10%,
      rgba(90, 215, 255, 0.28),
      transparent 62%
    ),
    radial-gradient(
      900px 520px at 50% 100%,
      rgba(255, 209, 102, 0.24),
      transparent 65%
    ),
    linear-gradient(180deg, #fffafc 0%, var(--bg) 100%);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Destaque das opções de compra (overlay + modal) */
body.purchase-overlay-open {
  overflow: hidden;
}

.purchase-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 36, 64, 0.55);
  backdrop-filter: blur(2px);
  z-index: 800;
  opacity: 0;
  transition: opacity 0.18s ease;
}
body.purchase-overlay-open .purchase-overlay {
  opacity: 1;
}

body.purchase-overlay-open #onde-comprar {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, 92vw);
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 16px;
  z-index: 810;
}
body.purchase-overlay-open #onde-comprar .panel {
  border: 2px solid rgba(255, 90, 165, 0.35);
  box-shadow: 0 26px 55px rgba(27, 36, 64, 0.24);
}
body.purchase-overlay-open #onde-comprar h2 {
  display: none;
}

.site {
  min-height: 100vh;
  transform: translateX(0);
}

a {
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #0b1020;
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 1000;
}
.skip-link:focus {
  left: 10px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(27, 36, 64, 0.1);
}

/* Evita que anchors fiquem escondidas atrás do header sticky */
#onde-comprar {
  scroll-margin-top: 90px;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 12px;
  box-shadow: 0 14px 26px rgba(27, 36, 64, 0.12);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.75);
}
.brand .custom-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--accent) 55%,
    var(--primary-2) 100%
  );
  box-shadow: 0 14px 26px rgba(255, 90, 165, 0.22);
}
.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-title strong {
  font-size: 15px;
  letter-spacing: 0.2px;
}
.brand-title span {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav,
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav li {
  margin: 0;
  padding: 0;
}
.nav a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.nav a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(27, 36, 64, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}
.nav-toggle:active {
  transform: translateY(0);
}
.nav-toggle-bars {
  width: 18px;
  height: 12px;
  position: relative;
  display: inline-block;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after,
.nav-toggle-bars {
  background: transparent;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(27, 36, 64, 0.78);
  border-radius: 999px;
}
.nav-toggle-bars::before {
  top: 0;
  box-shadow: 0 5px 0 rgba(27, 36, 64, 0.78);
}
.nav-toggle-bars::after {
  bottom: 0;
}

.drawer {
  position: fixed;
  top: 72px;
  right: 0;
  height: calc(100vh - 72px);
  width: var(--drawer-width);
  z-index: 40;
  padding: 70px 12px 12px 12px;
  display: none;
}
.drawer[hidden] {
  display: none;
}
.drawer:not([hidden]) {
  display: block;
}
.drawer-inner {
  height: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(27, 36, 64, 0.16);
  padding: 12px;
  overflow: auto;
}
.drawer-nav {
  display: grid;
  gap: 10px;
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: nowrap;
}
.drawer-nav li {
  width: 220%;
}
.drawer-nav a {
  display: block;
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(27, 36, 64, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 900px) {
  body.nav-open .site {
    transform: translateX(calc(-1 * var(--drawer-width)));
  }

  .drawer {
    top: 72px;
    height: calc(100vh - 72px);
  }
}

body[data-page="inicio"] .nav a[data-nav="inicio"],
body[data-page="biografia"] .nav a[data-nav="biografia"],
body[data-page="livros"] .nav a[data-nav="livros"],
body[data-page="apresentacoes"] .nav a[data-nav="apresentacoes"],
body[data-page="contactos"] .nav a[data-nav="contactos"],
.nav .current-menu-item > a,
.nav .current_page_item > a,
.nav .current-menu-ancestor > a {
  color: var(--text);
  background: rgba(255, 90, 165, 0.16);
  border-color: rgba(255, 90, 165, 0.28);
}

.hero {
  padding: 36px 0 10px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.4fr;
  gap: 22px;
  align-items: stretch;
}
.hero-grid.single-livro {
  grid-template-columns: 1.2fr 0.8fr;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.78)
  );
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 22px;
}
.hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.4px;
}
.hero-copy.single-livro h1 {
  font-size: clamp(22px, 2.4vw, 36px);
}
.hero-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(27, 36, 64, 0.08);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn.primary {
  background: linear-gradient(135deg, rgb(255 223 236), rgb(234 187 199));
  border-color: rgba(27, 36, 64, 0.1);
}
.btn.primary:hover {
  filter: brightness(1.02);
}

.hero-photo {
  overflow: hidden;
  position: relative;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}
.hero-photo .photo-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(27, 36, 64, 0.12);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 18px 0 30px;
}
.section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}
.section p.lead {
  margin: 0 0 16px;
  color: var(--muted);
}

.carousel {
  position: relative;
  padding: 18px;
  border: 2px dashed rgba(255, 90, 165, 0.35);
  background:
    radial-gradient(
      420px 240px at 10% 0%,
      rgba(255, 209, 102, 0.22),
      transparent 55%
    ),
    radial-gradient(
      420px 240px at 90% 10%,
      rgba(90, 215, 255, 0.22),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0.86)
    );
}
.carousel::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border-radius: calc(var(--radius) - 8px);
  background-image:
    radial-gradient(rgba(255, 90, 165, 0.2) 2px, transparent 2px),
    radial-gradient(rgba(90, 215, 255, 0.18) 2px, transparent 2px),
    radial-gradient(rgba(255, 209, 102, 0.18) 2px, transparent 2px);
  background-size:
    34px 34px,
    38px 38px,
    42px 42px;
  background-position:
    0 0,
    12px 16px,
    20px 10px;
  opacity: 0.4;
}
.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(190px, 62vw, 260px);
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  position: relative;
  z-index: 1;
}

.carousel-track::-webkit-scrollbar {
  height: 10px;
}
.carousel-track::-webkit-scrollbar-track {
  background: rgba(27, 36, 64, 0.06);
  border-radius: 999px;
}
.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(27, 36, 64, 0.18);
  border-radius: 999px;
}
.carousel-track::-webkit-scrollbar-thumb:hover {
  background: rgba(27, 36, 64, 0.26);
}

.book-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 26px rgba(27, 36, 64, 0.12);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  scroll-snap-align: start;
}
.book-card:hover {
  transform: translateY(-2px);
}
.book-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.book-card .book-body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.book-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}
.book-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.book-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(27, 36, 64, 0.14);
  color: rgba(27, 36, 64, 0.72);
  font-size: 12px;
  background: rgba(255, 209, 102, 0.28);
}

.carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(27, 36, 64, 0.08);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}
.icon-btn:active {
  transform: translateY(0);
}

.carousel .icon-btn {
  border-color: rgba(27, 36, 64, 0.12);
  background: linear-gradient(
    135deg,
    rgba(255, 90, 165, 0.25),
    rgba(90, 215, 255, 0.25)
  );
}
.carousel .icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(27, 36, 64, 0.18);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}
.dot:hover {
  transform: scale(1.08);
}
.dot[aria-current="true"] {
  background: rgba(255, 90, 165, 0.85);
  border-color: rgba(255, 90, 165, 0.85);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.contact-form-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}
.panel h3 {
  margin: 0 0 8px;
}
.panel p {
  margin: 0;
  color: var(--muted);
}

body[data-page="inicio"] .panel .wp-block-post-excerpt,
body[data-page="inicio"] .panel .wp-block-post-featured-image {
  display: none;
}

.form {
  display: grid;
  gap: 12px;
}
.label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.input,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
}
.textarea {
  min-height: 130px;
  resize: vertical;
}
.input:focus,
.textarea:focus {
  border-color: rgba(255, 90, 165, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 90, 165, 0.14);
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding: 22px 0;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.small {
  font-size: 12px;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-grid.single-livro {
    grid-template-columns: 1fr;
  }
  .hero-photo img {
    min-height: 240px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .desktop-nav {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

body[data-page="inicio"] {
  background:
    url("../img/bg-waves.svg") bottom center / cover no-repeat,
    radial-gradient(
      1100px 520px at 10% 0%,
      rgba(255, 90, 165, 0.2),
      transparent 60%
    ),
    radial-gradient(
      1000px 560px at 90% 10%,
      rgba(90, 215, 255, 0.22),
      transparent 62%
    ),
    radial-gradient(
      900px 520px at 50% 100%,
      rgba(255, 209, 102, 0.18),
      transparent 65%
    ),
    linear-gradient(180deg, #fffafc 0%, var(--bg) 100%);
}
