:root {
    --cor-primaria: #1B0043;
    --cor-secundaria: #6B46C1;
    --cor-terciaria: #553C9A;
    --cor-texto-escuro: #4B0082;
    --cor-fundo-claro: #ffffff;
    --cor-fundo-alt: linear-gradient(45deg, #faf9ff 0%, #f3f0ff 100%);
    --cor-texto-claro: #ffffff;
    --cor-texto-geral: #333;
}

* {margin: 0; padding: 0; box-sizing: border-box;}
body {font-family: 'Georgia', serif; line-height: 1.6; color: var(--cor-texto-geral); background-color: var(--cor-fundo-claro);}
.container {max-width: 1200px; margin: 0 auto; padding: 0 20px;}

/* Header */
header {
  background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
  color: var(--cor-texto-claro);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(139, 95, 191, 0.3);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

header.scrolled {
    background: linear-gradient(135deg, rgba(34, 3, 70, 0.95) 0%, rgba(29, 6, 85, 0.95) 100%);
    backdrop-filter: blur(10px);
}

.header-content {display: flex; justify-content: space-between; align-items: center;}
.logo img { height: 50px; display: block; }
nav ul {display: flex; list-style: none; gap: 2rem;}
nav a {color: var(--cor-texto-claro); text-decoration: none; transition: opacity 0.3s ease; font-weight: bold;}
nav a:hover {opacity: 0.8;}

/* Mobile menu button */
.mobile-menu {display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; z-index: 1100;}
.mobile-menu span {display: block; width: 25px; height: 3px; background: var(--cor-texto-claro); border-radius: 2px; transition: all 0.3s ease;}
.mobile-menu.active span:nth-child(1) {transform: rotate(45deg) translate(5px, 5px);}
.mobile-menu.active span:nth-child(2) {opacity: 0;}
.mobile-menu.active span:nth-child(3) {transform: rotate(-45deg) translate(6px, -6px);}

/* Mobile Nav */
@media (max-width: 768px) {
  nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 70vw;
    max-width: 300px;
    height: 50vh;
    background: linear-gradient(180deg, var(--cor-primaria), var(--cor-terciaria));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.25);
    border-radius: 15px 0 0 15px;
  }
  nav ul {flex-direction: column; gap: 1.5rem;}
  nav.active {transform: translateX(0);}
  .mobile-menu {display: flex;}
}

/* Hero */
.hero {background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 50%, var(--cor-terciaria) 100%); color: var(--cor-texto-claro); padding: 120px 0 80px; text-align: center; position: relative; overflow: hidden;}
.hero h1 {font-size: 3.5rem; margin-bottom: 1rem; font-weight: 700; letter-spacing: -2px; color: var(--cor-texto-claro);}
.hero p {font-size: 1.3rem; margin-bottom: 2rem; opacity: 0.9; max-width: 600px; margin-left: auto; margin-right: auto;}
.cta-button {background: var(--cor-fundo-claro); color: var(--cor-secundaria); padding: 15px 40px; border: none; border-radius: 30px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-decoration: none; display: inline-block;}
.cta-button:hover {transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.2); background: #f8f9ff;}

/* Estilos para os botões da secção Hero */
.hero-buttons {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centraliza os botões horizontalmente */
  gap: 1rem; /* Espaço de 16px entre os botões. Ajuste se precisar de mais ou menos. */
  margin-top: 1.5rem; /* Espaço acima do conjunto de botões */
}

/* Sections */
.section {padding: 80px 0;}
.section-alt {background: var(--cor-fundo-alt);}
.section-title {text-align: center; font-size: 2.5rem; margin-bottom: 3rem; color: var(--cor-primaria); font-weight: 300;}
.grid {display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem;}
.card {background: var(--cor-fundo-claro); padding: 2rem; border-radius: 15px; box-shadow: 0 5px 20px rgba(139, 95, 191, 0.1); transition: all 0.3s ease; border: 1px solid #f0f0f0;}
.card:hover {transform: translateY(-5px); box-shadow: 0 15px 40px rgba(139, 95, 191, 0.2);}
.card-icon {width: 60px; height: 60px; background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria)); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.5rem; color: var(--cor-texto-claro);}
.card h3 {color: var(--cor-primaria); margin-bottom: 1rem; font-size: 1.3rem;}

/* Sobre nós */
.about-grid {display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem;}
.about-card {background: var(--cor-fundo-claro); padding: 2rem; border-radius: 15px; text-align: center; box-shadow: 0 5px 15px rgba(139, 95, 191, 0.15); transition: transform 0.3s ease, box-shadow 0.3s ease;}
.about-card:hover {transform: translateY(-5px); box-shadow: 0 10px 25px rgba(139, 95, 191, 0.25);}
.about-card h3 {color: var(--cor-secundaria); margin-bottom: 1rem; font-size: 1.4rem;}
.about-card p {color: #555; font-size: 1rem; line-height: 1.5;}

/* Etapas do processo */
.process-steps {display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-top: 2rem;}
.step {background: var(--cor-fundo-claro); padding: 2rem; border-radius: 15px; text-align: center; box-shadow: 0 5px 15px rgba(139, 95, 191, 0.15); transition: transform 0.3s ease, box-shadow 0.3s ease;}
.step:hover {transform: translateY(-5px); box-shadow: 0 10px 25px rgba(139, 95, 191, 0.25);}
.step-number {width: 50px; height: 50px; margin: 0 auto 1rem; border-radius: 50%; background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria)); color: var(--cor-texto-claro); font-weight: bold; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 10px rgba(107, 70, 193, 0.3);}

/* Footer */
footer {background: linear-gradient(135deg, var(--cor-terciaria) 0%, var(--cor-primaria) 100%); color: var(--cor-texto-claro); padding: 60px 0 20px;}
.footer-content {display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; margin-bottom: 2rem;}
.footer-section h3 {margin-bottom: 1rem; color: var(--cor-texto-claro);}
.footer-section ul {list-style: none; padding: 0;}
.footer-section ul li {margin-bottom: 0.5rem;}
.footer-section a {color: rgba(255,255,255,0.8); text-decoration: none; transition: color 0.3s ease;}
.footer-section a:hover {color: var(--cor-texto-claro);}
.footer-bottom {text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);}
.social-links { display: flex; gap: 1rem; margin-top: 1rem; }
.social-links img { height: 24px; }

/* Responsividade */
@media (max-width: 992px) {
    .hero h1 {font-size: 2.2rem;} 
    .hero p {font-size: 1rem; max-width: 90%;} 
    nav ul {gap: 1rem;}
}
@media (max-width: 480px) {
    .logo {font-size: 1.5rem;} 
    .section-title {font-size: 1.6rem;} 
    .card {padding: 1.5rem;}
}

html {scroll-behavior: smooth;}
@keyframes fadeInUp {from {opacity: 0; transform: translateY(30px);} to {opacity: 1; transform: translateY(0);}}
.fade-in {animation: fadeInUp 0.6s ease-out;}

/* Adicione ou atualize estas regras no seu ficheiro static/style.css */

/* Melhora a grelha de cartões para ser mais responsiva */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Estilização dos cartões de autor */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: justify; /* Justifica o texto para melhor leitura */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem; /* Aumenta o tamanho do nome do autor */
}

.card p, .card ul {
    color: #555;
    line-height: 1.6;
    flex-grow: 1; /* Faz o conteúdo ocupar o espaço disponível */
}

.card ul {
    padding-left: 20px;
    margin-top: 0.5rem;
}

/* Estilo para os links das obras */
.card a {
    color: #11557C; /* Cor principal do seu site */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.card a:hover {
    color: #177199;
    text-decoration: underline;
}

/* Adicione isto ao seu ficheiro static/style.css */

/* Rolagem suave para âncoras */
html {
  scroll-behavior: smooth;
}

/* Destaca o elemento alvo (o livro para o qual o link aponta) */
:target {
  animation: highlight 2s ease-out;
}

@keyframes highlight {
  from {
    background-color: rgba(255, 217, 102, 0.7); /* Amarelo suave */
    box-shadow: 0 0 12px rgba(255, 217, 102, 0.9);
  }
  to {
    background-color: transparent;
    box-shadow: none;
  }
}
