/* ============================================
   Receitas da Rosy - CSS Principal
   ============================================ */

/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* --rosa-primario, --rosa-escuro e --dourado já são definidos pelo
       header.php a partir das configurações do site (theme_primary_color /
       theme_dark_color), por isso não são redeclarados aqui — isso evitaria
       sobrepor o que vem das definições do admin. Os fallbacks usados nas
       regras abaixo (ex: var(--rosa-escuro, #a8345b)) garantem que este
       ficheiro continua a funcionar mesmo isolado. */
    --cacau: #1e140f;
    --cacau-claro: #3a2419;
    --texto: #2e2018;
    --texto-suave: #7a6a61;
    --fundo: #ffffff;
    --fundo-suave: #fdf3ee;
    --borda: #f1dde3;
    --sombra: 0 2px 8px rgba(46, 32, 24, 0.08);
    --sombra-media: 0 4px 16px rgba(46, 32, 24, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', 'Segoe UI', Roboto, -apple-system, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--texto);
    background: var(--fundo);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--rosa-escuro, #a8345b);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--rosa-primario, #e85d8a);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; }

/* ============================================
   HEADER (versão simples, sem Bootstrap)
   ============================================ */
.site-header {
    background: #fff;
    box-shadow: var(--sombra);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
}

.logo {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--rosa-escuro, #a8345b);
    font-weight: 800;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav ul a {
    color: var(--texto);
    font-weight: 500;
}

.main-nav ul a:hover {
    color: var(--rosa-escuro, #a8345b);
}

.nav-auth {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: 2px solid transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--rosa-escuro, #a8345b);
    color: white;
}

.btn-primary:hover {
    background: #8a2c4c;
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    border-color: var(--rosa-escuro, #a8345b);
    color: var(--rosa-escuro, #a8345b);
    background: transparent;
}

.btn-outline:hover {
    background: var(--rosa-escuro, #a8345b);
    color: white;
}

.btn-large {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
}

/* ============================================
   HERO (topo da página)
   ============================================ */
.hero {
    position: relative;
    background: radial-gradient(circle at 75% 30%, rgba(232,93,138,0.18) 0%, transparent 50%),
                linear-gradient(160deg, var(--cacau) 0%, var(--cacau-claro) 100%);
    color: #fbeee7;
    padding: 5rem 0;
    text-align: center;
    overflow: hidden;
}

.hero h1 {
    color: #fffaf6;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    color: #f3e3da;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn-primary {
    background: var(--dourado, #d9a14b);
    color: var(--texto);
}

.hero .btn-primary:hover {
    filter: brightness(1.08);
}

.hero .btn-outline {
    border-color: rgba(251,238,231,0.6);
    color: #fbeee7;
}

.hero .btn-outline:hover {
    background: #fbeee7;
    color: var(--cacau);
}

/* ============================================
   SECÇÕES
   ============================================ */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--fundo-suave);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--texto-suave);
    font-size: 1.1rem;
}

/* ============================================
   GRELHAS
   ============================================ */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--sombra);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-media);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--rosa-primario, #e85d8a), var(--dourado, #d9a14b));
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--rosa-escuro, #a8345b);
    margin-bottom: 0.5rem;
}

/* Card de artigo */
.article-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
}

.article-card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--dourado, #d9a14b), var(--rosa-primario, #e85d8a));
    background-size: cover;
    background-position: center;
}

.article-card-body {
    padding: 1.5rem;
}

.article-card-meta {
    font-size: 0.85rem;
    color: var(--texto-suave);
    margin-bottom: 0.5rem;
}

.article-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.article-card h3 a {
    color: var(--texto);
}

.article-card h3 a:hover {
    color: var(--rosa-escuro, #a8345b);
}

/* ============================================
   CTA (Call to Action)
   ============================================ */
.cta {
    background: var(--rosa-escuro, #a8345b);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta h2 {
    color: white;
}

.cta p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta .btn-primary {
    background: var(--dourado, #d9a14b);
    color: var(--texto);
}

/* ============================================
   ESTATÍSTICAS
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-number {
    font-family: 'Fraunces', serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--rosa-escuro, #a8345b);
    display: block;
}

.stat-label {
    color: var(--texto-suave);
    font-weight: 500;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-box {
    max-width: 450px;
    margin: 3rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--sombra-media);
}

.form-box h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--rosa-escuro, #a8345b);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--texto);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--borda);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--rosa-primario, #e85d8a);
}

.form-box .btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.05rem;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--texto-suave);
}

/* ============================================
   ALERTAS / FLASH
   Nota: as cores dos alertas mantêm o significado semântico universal
   (verde = sucesso, vermelho = erro, amarelo = aviso, azul = informação)
   em vez de seguirem a paleta da marca — trocar isto por rosa confundiria
   quem está a usar o site.
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #b71c1c;
    border-color: #f44336;
}

.alert-warning {
    background: #fff8e1;
    color: #e65100;
    border-color: #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border-color: #2196f3;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--cacau);
    color: #d9bcc4;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.site-footer h3,
.site-footer h4 {
    color: #fffaf6;
    margin-bottom: 1rem;
}

.site-footer ul {
    list-style: none;
}

.site-footer ul li {
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: #d9bcc4;
}

.site-footer a:hover {
    color: #fffaf6;
}

.footer-bottom {
    border-top: 1px solid var(--cacau-claro);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .main-nav ul {
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .section {
        padding: 2.5rem 0;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* ============================================
   NAVBAR Bootstrap personalizada
   ============================================ */

.site-navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(46,32,24,0.06);
    padding: 0.75rem 0;
    transition: box-shadow 0.2s, padding 0.2s;
}

.site-navbar.scrolled {
    box-shadow: 0 2px 8px rgba(46,32,24,0.1);
    padding: 0.5rem 0;
}

/* Logo */
.navbar-brand {
    color: var(--rosa-escuro, #a8345b) !important;
    font-family: 'Fraunces', serif;
    font-size: 1.4rem;
    transition: color 0.2s;
}

.navbar-brand:hover {
    color: var(--rosa-primario, #e85d8a) !important;
}

.navbar-logo {
    max-height: 42px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Itens do menu */
.navbar .nav-link {
    color: var(--texto, #2e2018) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}

.navbar .nav-link:hover {
    color: var(--rosa-escuro, #a8345b) !important;
    background: rgba(232, 93, 138, 0.08);
}

.navbar .nav-link.active {
    color: var(--rosa-escuro, #a8345b) !important;
    font-weight: 600;
}

/* Indicador da página activa */
.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--rosa-escuro, #a8345b);
    border-radius: 2px;
}

@media (max-width: 991px) {
    .navbar .nav-link.active::after {
        display: none;
    }
    .navbar .nav-link.active {
        background: rgba(232, 93, 138, 0.1);
    }
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--borda, #f1dde3);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem !important;
    min-width: 220px;
}

.dropdown-item {
    border-radius: 5px;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: rgba(232, 93, 138, 0.1);
    color: var(--rosa-escuro, #a8345b);
}

.dropdown-item:active,
.dropdown-item.active {
    background: var(--rosa-escuro, #a8345b);
    color: white;
}

/* Pesquisa desktop */
.search-form {
    min-width: 220px;
}

.search-form .form-control {
    border-color: var(--borda, #f1dde3);
}

.search-form .form-control:focus {
    border-color: var(--rosa-primario, #e85d8a);
    box-shadow: 0 0 0 0.2rem rgba(232, 93, 138, 0.15);
}

.search-form .btn-outline-success {
    border-color: var(--rosa-escuro, #a8345b);
    color: var(--rosa-escuro, #a8345b);
}

.search-form .btn-outline-success:hover {
    background: var(--rosa-escuro, #a8345b);
    color: white;
}

/* Avatar do utilizador */
.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--rosa-escuro, #a8345b);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-dropdown .btn {
    border: 1px solid var(--borda, #f1dde3);
    background: #fdf8f6;
    font-weight: 500;
}

.user-dropdown .btn:hover,
.user-dropdown .btn:focus {
    background: #fbeff2;
    border-color: #ecc4d2;
}

/* Botões rosa (override Bootstrap "success", usado como cor da marca) */
.btn-success {
    background: var(--rosa-escuro, #a8345b);
    border-color: var(--rosa-escuro, #a8345b);
}

.btn-success:hover,
.btn-success:focus {
    background: #8a2c4c;
    border-color: #8a2c4c;
}

.btn-outline-success {
    color: var(--rosa-escuro, #a8345b);
    border-color: var(--rosa-escuro, #a8345b);
}

.btn-outline-success:hover {
    background: var(--rosa-escuro, #a8345b);
    border-color: var(--rosa-escuro, #a8345b);
}

/* Toggler hamburger */
.navbar-toggler {
    border: 1px solid var(--borda, #f1dde3);
    padding: 0.4rem 0.6rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(232, 93, 138, 0.2);
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 991px) {
    .site-navbar {
        padding: 0.6rem 0;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-collapse {
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--borda, #f1dde3);
    }

    .navbar .nav-link {
        padding: 0.7rem 0.5rem !important;
        border-radius: 6px;
    }

    .navbar .nav-link i {
        width: 22px;
        text-align: center;
        color: var(--texto-suave, #7a6a61);
    }

    .navbar-nav {
        margin-bottom: 0.75rem !important;
    }

    .dropdown-menu {
        border: none;
        background: #fdf8f6;
        margin: 0.25rem 0 0.5rem 1.5rem !important;
        padding: 0.25rem;
        box-shadow: none;
    }

    .user-dropdown {
        width: 100%;
    }
}