﻿:root {
  --site-header-height: 80px;
  scroll-padding-top: calc(var(--site-header-height) + 34px);
}

body:has(.site-header) {
  padding-top: var(--site-header-height) !important;
}

.site-header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #ececf4;
  box-shadow: 0 5px 24px rgba(40, 57, 103, .07);
}

.site-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: var(--site-header-height);
  position: relative;
}

.site-brand {
  display: block;
  width: 112px;
}

.site-brand img {
  display: block;
  width: 100%;
}

.site-primary-nav,
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.site-primary-nav {
  justify-content: center;
}

.site-primary-nav a,
.site-menu-button {
  padding: 9px 11px;
  border-radius: 8px;
  color: #34477f;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.site-primary-nav a:hover,
.site-menu-button:hover {
  background: #eff1fb;
}

.site-primary-nav .site-nav-universe {
  background: #485b9e;
  color: #fff;
}

.site-primary-nav .site-nav-universe:hover {
  background: #34477f;
}

.site-primary-nav .site-nav-comics {
  background: #ffe6df;
  color: #773f38;
}

.site-primary-nav .site-nav-comics:hover {
  background: #ffd9cf;
}

.site-primary-nav [aria-current="page"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor;
}

.site-primary-nav .site-nav-universe[aria-current="page"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #485b9e;
}

.site-account {
  text-decoration: none;
}

.site-menu-button {
  border: 1px solid #e7e8f3;
  background: #fff;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-brand-stack {
  position: relative;
  justify-self: start;
}

.site-brand-stack .site-write {
  top: calc(100% + 6px);
  bottom: auto;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
}

.site-header .header-panel,
.site-header .notice {
  padding-inline-start: 90px;
}

.site-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(370px, 100%);
  max-width: none;
  max-height: none;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 0;
  border-left: 1px solid #efecf6;
  background: #fdfaff;
  color: #34477f;
  box-shadow: -16px 0 44px #28396733;
}

.site-drawer[open] {
  animation: site-drawer-enter .22s ease-out;
}

.site-drawer::backdrop {
  background: #202c5b77;
}

body:has(.site-drawer[open]) {
  overflow: hidden;
}

@keyframes site-drawer-enter {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.site-drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #efeaf5;
}

.site-drawer-heading h2 {
  margin: 0;
  font: 700 29px/1 Karma, serif;
}

.site-drawer-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #efeefa;
  color: #34477f;
  font-size: 26px;
}

.site-drawer-group {
  display: grid;
  gap: 6px;
  padding-top: 20px;
}

.site-drawer-group h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.site-drawer-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #fff;
  color: #34477f;
  text-decoration: none;
  font-weight: 800;
}

.site-drawer-group a:hover,
.site-drawer-group a[aria-current] {
  background: #eaedfa;
}

.site-drawer-group a span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: #814b45;
  background: #ffe6df;
}

@media (max-width: 900px) {
  :root { --site-header-height: 106px; }

  .site-header-inner {
    gap: 2px 10px;
    grid-template-columns: auto 1fr;
    grid-template-rows: 52px 48px;
  }

  .site-brand { width: 85px; }

  .site-primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-inline-start: 68px;
    gap: 4px;
    justify-content: flex-end;
  }

  .site-header-actions {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    gap: 6px;
  }

  .site-brand-stack .site-write {
    width: 40px;
    height: 40px;
    margin-left: -20px;
    font-size: 30px;
  }
}

@media (max-width: 430px) {
  .site-header-inner { width: calc(100% - 20px); }
  .site-primary-nav { padding-inline-start: 64px; gap: 3px; }
  .site-primary-nav a { padding: 9px 4px; font-size: 11px; }
  .site-nav-feature span { display: none; }
  .site-menu-label { display: none; }
  .site-header .header-panel,
  .site-header .notice { padding-inline-start: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-drawer[open] { animation: none; }
}

/* Pipa, a guia do FunFiction */
.pipa-guide {
  position: fixed;
  z-index: 21;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(372px, calc(100% - 32px));
  max-height: min(450px, calc(100dvh - 32px));
  overflow: auto;
  padding: 15px 19px 19px;
  border: 1px solid #dedbf1;
  border-radius: 18px;
  background: #fffaf6;
  color: #34477f;
  box-shadow: 0 12px 36px #25336040;
  animation: pipa-enter .32s ease-out both;
}

.pipa-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #edeafb;
  color: #34477f;
  font-size: 24px;
  line-height: 1;
}

.pipa-character {
  position: relative;
  width: 112px;
  height: 70px;
  margin: 0 auto 7px;
}

.pipa-book {
  position: absolute;
  left: 33px;
  top: 10px;
  width: 47px;
  height: 51px;
  border: 2px solid #465197;
  border-radius: 8px 10px 9px 7px;
  background: linear-gradient(90deg, #6b66b5 5px, #a69ce5 5px);
  box-shadow: inset 0 -5px #fff6e8;
  animation: pipa-float 2.6s ease-in-out 5;
}

.pipa-bookmark {
  position: absolute;
  top: -5px;
  right: 5px;
  width: 10px;
  height: 18px;
  background: #ffd090;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}

.pipa-face {
  position: absolute;
  inset: 18px 6px 8px 10px;
  display: flex;
  justify-content: space-between;
}

.pipa-face i {
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: #343969;
  animation: pipa-blink 4s ease-in-out 3;
}

.pipa-face b {
  position: absolute;
  top: 6px;
  left: calc(50% - 4px);
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #343969;
  border-radius: 50%;
}

.pipa-star {
  position: absolute;
  color: #9d62a3;
  animation: pipa-float 3s ease-in-out 4;
}

.pipa-star-left { top: 5px; left: 10px; font-size: 19px; }
.pipa-star-right { right: 5px; bottom: 13px; font-size: 24px; animation-delay: .5s; }

.pipa-content h2 {
  margin: 0 0 6px;
  font: 700 22px/1.1 Karma, serif;
}

.pipa-content p {
  margin: 0 0 13px;
  color: #454962;
  font-size: 14px;
  line-height: 1.5;
}

.pipa-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 13px;
  border: 0;
  border-radius: 8px;
  background: #485b9e;
  color: white;
  text-decoration: none;
  font-weight: 800;
}

.pipa-close:hover { background: #e4def9; }
.pipa-action:hover { background: #34477f; }

@keyframes pipa-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pipa-float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

@keyframes pipa-blink {
  0%, 88%, 100% { transform: scaleY(1); }
  93% { transform: scaleY(.15); }
}

@media (prefers-reduced-motion: reduce) {
  .pipa-guide, .pipa-book, .pipa-star, .pipa-face i { animation: none; }
}

@media (max-width: 350px) {
  .site-primary-nav { gap: 2px; }
  .site-primary-nav a { padding-inline: 3px; font-size: 10px; }
}
