/* Fonts: loaded from website/inc/header.php (non-blocking link) to avoid @import render delay */

html {
  scroll-behavior: smooth;
}

/* Skip navigation link — WCAG 2.4.1 */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.65rem 1.5rem;
  background: #1565C0;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 16px rgba(21, 101, 192, 0.4);
  white-space: nowrap;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  color: #fff;
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
  text-decoration: none;
}

/* Bootstrap text-success (#198754) = 4.18:1 ❌ → #146c43 = 5.83:1 ✅ */
.header-text-success { color: #146c43; }
/* Bootstrap text-primary (#0d6efd) = 4.20:1 ❌ → #0a58ca = 5.87:1 ✅ */
.header-text-primary { color: #0a58ca; }
/* Powered-by text: #ed9830 = 2.2:1 ❌ → #9a6a00 = 4.71:1 ✅ */
.powered-by-text { color: #9a6a00; }

a:focus,
a:focus-visible,
a:active,
button:focus,
button:focus-visible,
button:active,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: 3px solid #007bff !important;
  outline-offset: 2px;
}

/* General Styles */
body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
}

/* Header Styles */
header {
  position: absolute;
  width: 100%;
  background-color: transparent;
  padding: 0.75em 0;
}

/* Inner utility pages (accessibility support / statement): fixed bar, aligns to 1200px content */
header.site-header-inner {
  position: relative;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  padding: 0.65rem 0;
}

header.site-header-inner .navbar > .site-header-inner__container {
  max-width: 1200px;
}

header #logo {
  width: 100%;
  max-width: 244px;
}

header #book-taco-logo {
  width: 100%;
  max-width: 296px;
}

#navbarNav ul {
  gap: 9px;
  align-items: center;
}

#navbarNav ul li a {
  color: #FFF;
  font-weight: 600;
  font-size: 20px;
  font-family: 'Nunito', sans-serif;
}

#navbarNav ul li a:hover {
  color: #FFF;
  text-decoration: none;
}

/* Button Styles */
.btn-cta {
  display: inline-flex;
  padding: 16px 24px;
  justify-content: center;
  align-items: center;
  gap: 16px;
  border-radius: 55px;
  color: #0F7A58;
  font-weight: bold;
  font-size: 18px;
  background: linear-gradient(135deg, #E7FFD1, #B8FFA9);
  border: 1px solid #00800017;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-cta:hover,
.btn-cta:active,
.btn-cta:focus-visible {
  background: linear-gradient(135deg, #D4F5BC, #A0E895) !important;
  color: #0C5D43 !important;
}

.card {
  border: 0;
  display: inline-block;
  transition: all 0.3s ease;
}

.card img {
  transition: all 0.3s ease;
  width: 100%;
  border-radius: 10px;
}

.card img:hover {
  transform: scale(1.1);
}

.emoji {
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50.2222%);
  }
}

@keyframes scroll-right {
  0% {
    transform: translateX(-50.2222%);
  }

  100% {
    transform: translateX(0);
  }
}

/* Footer Styles */
footer {
  background: #252525;
  padding: 2em 0;
}

footer a {
  color: #B2B3CF;
  text-decoration: none;
}

footer a:hover {
  cursor: pointer;
  color: #FFF;
}

footer span {
  color: #B2B3CF;
  display: block;
}

/* Inner Header */
#inner-header {
  background: #e9f8ff;
  padding: 1.6em;
}

#inner-header h1 {
  font-weight: bold;
  margin-bottom: 0;
  color: #004379;
}

/* Cookie Banner */
#cookie-banner {
  background: #ffffffcf;
  padding: 1em 1em;
  border-radius: 7px;
  flex-direction: column;
  max-width: 390px;
  margin: 0 auto;
  gap: 10px;
  bottom: 8px;
  align-items: center;
  justify-content: center;
  text-align: center;
  right: 10px;
  left: auto;
  backdrop-filter: blur(5px);
  border: 2px solid #EAEAEA;
  box-shadow: 1px 1px 9px -2px #CCC;
  display: none;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- HERO SECTION --- */
.hero {
  padding: 7.5rem 0 2.25rem;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, #fdf6ec, #edfefc);
}

/* --- DETAILS --- */
.book-details {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

.book-title {
  font-size: 14px;
  font-weight: 700;
  color: #344563;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  min-height: 2.6em;
  /* 2 linhas * 1.3 line-height */
  max-height: 2.6em;
}

.book-author {
  font-size: 12px;
  color: #5a5a5a;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Call to Action Banner Styles */
.cta-banner {
  background: linear-gradient(to bottom right, #FFF4E4 0%, #FFF 75%, #F2FFEE 100%);
  padding-top: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cta-banner img {
  max-width: 100%;
}

.cta-banner .cta-heading {
  color: #394B55;
  font-size: 46px;
  font-style: normal;
  font-weight: 700;
  line-height: 59px;
}

.cta-banner .cta-sub {
  margin-top: 1em;
  color: #1C272D;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 30px;
}

.powered-by-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: auto;
  position: relative;
}

.powered-by-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.powered-by-link:hover {
  background: rgba(237, 152, 48, 0.1);
}

.powered-by-text {
  color: #9a6a00;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.powered-by-logo {
  height: 24px;
  width: auto;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.powered-by-link:hover .powered-by-logo {
  filter: drop-shadow(0 4px 8px rgba(237, 152, 48, 0.2));
}

.powered-by-link:hover .powered-by-text {
  color: #ff8c00;
}

/* Media Queries */
/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767px) {
  .book-grid--cols-7 {
    grid-template-columns: 1fr;
  }

  body {
    padding: 0 !important;
  }

  header {
    z-index: 2;
  }

  header #logo {
    width: 100%;
    max-width: 224px;
  }

  .hero {
    min-height: 34rem;
    padding: 1.5rem 0;
  }

  .hero h1 {
    font-size: 1.75rem;
    padding: 0 1rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero .grade-filters {
    gap: 0.25rem;
    padding: 0 0.5rem;
  }

  .hero .pill-bubble {
    padding: 0.35rem 0.75rem;
    gap: 4px;
  }

  .hero .emoji-wrapper {
    font-size: 1.1rem;
  }

  .btn-cta {
    padding: 10px 18px;
    font-size: 14px;
  }

  .btn-top50 {
    padding: 10px 24px !important;
    font-size: 12px !important;
    width: 90%;
    max-width: 320px;
    text-align: center;
    justify-content: center;
  }

  .btn-top50-content {
    justify-content: center;
    gap: 8px;
  }

  .powered-by-wrapper {
    margin-left: 0;
    margin-top: 4px;
  }
  
  .powered-by-text {
    font-size: 8px;
  }
  
  .powered-by-logo {
    height: 18px;
  }

  .hero > .container .btn-warning {
    width: 100%;
  }

  .navbar-toggler {
    background: #FFF !important;
    color: #A03EEA !important;
  }

  #navbarNav ul {
    align-items: flex-start;
    padding: 2em;
  }

  #navbarNav ul li {
    margin-bottom: 1em;
  }

  #navbarNav ul li a {
    display: block;
    text-align: left;
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 992px) { /* lg */
  .book-grid--cols-7 {
    grid-template-columns: repeat(2, 1fr);
  }

  header {
    z-index: 2;
  }

  .hero {
    min-height: 26rem;
  }
  
  #navbarNav ul li a {
    font-size: 16px;
  }
}

@media (min-width: 992px) and (max-width: 1200px) { /* xl */
  .book-grid--cols-7 {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero {
    min-height: 24rem;
  }
}

@media (min-width: 1200px) and  (max-width: 1400px) { /* xxl */
  .book-grid--cols-7 {
    grid-template-columns: repeat(5, 1fr);
  }

  header #logo {
    width: 364px;
  }
}

@media (min-width: 1400px) and (max-width: 1799px) {
  .book-grid--cols-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (min-width: 1800px) {
  .book-grid--cols-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* ── Modal de link externo ── */
.ext-link-dialog  { max-width: 420px; }
.ext-link-content { border-radius: 16px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.ext-link-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: #e8f0fe; color: #1565C0; font-size: 1.75rem;
}
.ext-link-title { font-size: 1.25rem; font-weight: 700; color: #1a1a2e; margin-bottom: 0.5rem; }
.ext-link-desc  { font-size: 0.9rem; color: #555; line-height: 1.6; margin-bottom: 0; }
.ext-link-btn-continue {
  background: #1565C0; color: #fff; border: none; border-radius: 10px;
  padding: 0.75rem 1.25rem; font-weight: 600; font-size: 0.95rem;
  transition: background 0.2s ease;
}
.ext-link-btn-continue:hover,
.ext-link-btn-continue:focus-visible { background: #0d47a1; color: #fff; outline: 3px solid #ffbf47; outline-offset: 2px; }
.ext-link-btn-cancel {
  background: #f0f0f0; color: #333; border: none; border-radius: 10px;
  padding: 0.75rem 1.25rem; font-weight: 600; font-size: 0.95rem;
  transition: background 0.2s ease;
}
.ext-link-btn-cancel:hover,
.ext-link-btn-cancel:focus-visible { background: #e0e0e0; color: #111; outline: 3px solid #007bff; outline-offset: 2px; }

/* ── Template de páginas públicas (page.php) ── */
.page-hero .container,
.page-breadcrumb .container,
.page-body .container { max-width: 1200px; }

.page-hero { padding: 8rem 0 3rem; background: linear-gradient(to right, #e8f5e9, #e3f2fd); text-align: center; }
.page-hero-title { font-size: 2.25rem; font-weight: 800; color: #1e293b; margin: 0; line-height: 1.2; }
@media (max-width: 767px) {
  .page-hero { padding: 6rem 0 2rem; }
  .page-hero-title { font-size: 1.6rem; }
}

.page-breadcrumb { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0.9rem 0; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.page-breadcrumb .breadcrumb { --bs-breadcrumb-divider: "›"; font-size: 0.875rem; align-items: center; margin: 0; }
.page-breadcrumb .breadcrumb-item { display: flex; align-items: center; gap: 0.3rem; color: #94a3b8; }
.page-breadcrumb .breadcrumb-item a {
  color: #1565C0; text-decoration: none;
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.4rem; border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.page-breadcrumb .breadcrumb-item a:hover { background: #eff6ff; color: #0d47a1; }
.page-breadcrumb .breadcrumb-item.active { color: #334155; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #cbd5e1; font-size: 1rem; line-height: 1; }

.page-back-wrap { display: flex; justify-content: flex-start; }

.page-body { background: #fff; }

.page-content { max-width: 100%; font-size: 1rem; line-height: 1.8; color: #334155; }
.page-content h1, .page-content h2, .page-content h3, .page-content h4 {
  color: #1e293b; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; line-height: 1.3;
}
.page-content h2 { font-size: 1.5rem; }
.page-content h3 { font-size: 1.25rem; }
.page-content h4 { font-size: 1.1rem; }
.page-content p  { margin-bottom: 1.25rem; }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.page-content li { margin-bottom: 0.4rem; }
.page-content a  { color: #1565C0; text-decoration: underline; text-underline-offset: 2px; }
.page-content a:hover { color: #0d47a1; }
.page-content strong { color: #1e293b; }
.page-content hr { border: none; border-top: 1px solid #e2e8f0; margin: 2rem 0; }
.page-content blockquote { border-left: 4px solid #1565C0; padding: 0.5rem 0 0.5rem 1rem; margin-left: 0; color: #475569; font-style: italic; }
.page-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; }
.page-content th, .page-content td { border: 1px solid #e2e8f0; padding: 0.6rem 0.9rem; text-align: left; }
.page-content th { background: #f1f5f9; font-weight: 700; color: #1e293b; }

.page-unavailable { min-height: calc(100vh - 160px); display: flex; align-items: center; justify-content: center; padding: 5rem 1rem; background: linear-gradient(to bottom right, #f8fafc, #f1f5f9); }
.page-unavailable-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 3rem 2.5rem; max-width: 460px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.07); }
.page-unavailable-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; background: #fef2f2; color: #dc2626; font-size: 2rem; margin-bottom: 1.5rem; }
.page-unavailable-title { font-size: 1.5rem; font-weight: 800; color: #1e293b; margin-bottom: 0.75rem; }
.page-unavailable-desc  { font-size: 0.95rem; color: #64748b; line-height: 1.6; margin-bottom: 2rem; }

/* Accessibility statement: "page unavailable" inline layout (matches screenshots) */
.statement-unavailable { background: #fff; }
.statement-unavailable .container { max-width: 1200px; }
.statement-unavailable__title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #7a1e1e;
  margin: 0 0 0.85rem;
  line-height: 1.2;
  text-transform: lowercase;
}
.statement-unavailable__desc {
  color: #6c757d;
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
  line-height: 1.6;
}
.statement-unavailable__slug { margin: 0 0 1.75rem; }
.statement-unavailable__slug code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: #f1f1f5;
  color: #7c1d4a;
  border: 1px solid rgba(124, 29, 74, 0.12);
}
.statement-unavailable__home {
  font-size: 1rem;
  font-weight: 600;
  color: #7cb342;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.statement-unavailable__home:hover { color: #689f38; }
.statement-unavailable__home:focus-visible {
  outline: 3px solid rgba(124, 179, 66, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Footer links de páginas legais */
.footer-page-link { color: #B2B3CF; font-size: 0.85rem; text-decoration: none; transition: color 0.2s; margin: 0 0.5rem; white-space: nowrap; }
.footer-page-link:hover,
.footer-page-link:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 2px; outline: none; }

/* Reduced motion — WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}