/* ============================================================
   Tela inicial estilo "app" — topo ensolarado, busca na Bíblia
   sobreposta, blocos grandes em tons de azul e tela "Mais".
   Usada por pages/dashboard.php e pelos apps do líder e do
   gestor da igreja (includes/home_inicio.php).
   ============================================================ */

:root {
    --home-creme: #fdf6e3;
    --home-tinta: #1f2430;
    --home-tinta-suave: #5d6475;
    --home-azul-1: #1f65a6;
    --home-azul-2: #2271b8;
    --home-azul-3: #1a7fd6;
    --home-azul-4: #2e9ae8;
    --home-azul-icone: #1e88e5;
    --home-laranja: #f5a20a;
    --home-faixa: #0d47a1;
}

/* ---------- Topo (hero) ---------- */
.home-hero,
.lider-header.home-hero,
.igreja-header.home-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background:
        radial-gradient(circle at 80% 26%, rgba(255, 250, 225, 0.95) 0, rgba(255, 228, 150, 0.55) 13%, rgba(255, 205, 90, 0) 36%),
        linear-gradient(180deg, #f8d36a 0%, #f0a73c 42%, #c8651c 78%, #6e2f0e 100%);
    border-radius: 0;
    padding-bottom: 52px;
}

/* campo de trigo estilizado na base do topo */
.home-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 46%;
    z-index: -1;
    background: repeating-linear-gradient(97deg, rgba(110, 50, 8, 0.28) 0 2px, rgba(255, 210, 120, 0.12) 2px 5px, transparent 5px 9px);
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent);
    mask-image: linear-gradient(to top, #000 10%, transparent);
}

/* foto opcional: assets/img/hero-inicio.jpg (ver pages/dashboard.php) */
.home-hero.tem-foto {
    background-size: cover;
    background-position: center 35%;
}
.home-hero.tem-foto::after {
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 30%, rgba(40, 18, 0, 0.6) 100%);
    -webkit-mask-image: none;
    mask-image: none;
}

.home-hero-conteudo {
    position: relative;
    padding: calc(28px + env(safe-area-inset-top)) 22px 0;
}

.home-hero-selo {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}

.home-hero-saudacao {
    margin: 14px 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.home-hero h1,
.home-hero .lider-nome,
.home-hero .igreja-nome-usuario {
    margin: 2px 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 6vw, 38px);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 10px rgba(90, 40, 0, 0.45);
}

.home-hero-mensagem {
    margin: 0;
    max-width: 46ch;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.95;
    text-shadow: 0 1px 6px rgba(90, 40, 0, 0.4);
}

.home-hero .lider-saudacao,
.home-hero .igreja-saudacao {
    text-shadow: 0 1px 6px rgba(90, 40, 0, 0.4);
    opacity: 0.95;
}

/* cartões que já existiam no topo dos apps: claros para contrastar com o dourado */
.home-hero .reuniao-card-hoje,
.home-hero .igreja-card-nome {
    background: rgba(255, 255, 255, 0.92);
    color: #3b2508;
    box-shadow: 0 6px 18px rgba(90, 40, 0, 0.18);
}
.home-hero .reuniao-card-hoje .dot,
.home-hero .igreja-card-nome .dot {
    background: #e08a12;
}

/* ---------- Busca + blocos ---------- */
.home-atalhos {
    position: relative;
    z-index: 1;
}

.home-busca {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    margin: -28px 16px -28px;
    background: #fff;
    border: 1.5px solid #3a3a3a;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.home-busca input {
    flex: 1;
    min-width: 0;
    height: 54px;
    padding: 0 6px 0 18px;
    border: 0;
    background: transparent;
    font-size: 16px; /* evita zoom automático no iOS */
    color: var(--home-tinta);
    outline: none;
    box-shadow: none;
}

.home-busca input::placeholder {
    color: #6b7280;
}

.home-busca button {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 0;
    background: transparent;
    color: #333;
    cursor: pointer;
}

.home-busca:focus-within {
    border-color: var(--home-azul-3);
    box-shadow: 0 0 0 3px rgba(26, 127, 214, 0.25), 0 6px 18px rgba(0, 0, 0, 0.12);
}

.home-busca .home-ico {
    width: 26px;
    height: 26px;
}

.home-blocos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.home-bloco {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: clamp(170px, 46vw, 250px);
    padding: 36px 12px 24px;
    color: #fff !important;
    text-decoration: none !important;
    text-align: center;
    transition: filter 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-bloco:hover,
.home-bloco:focus-visible {
    filter: brightness(1.08);
}

.home-bloco:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
}

.home-bloco:active {
    filter: brightness(0.95);
}

.home-bloco .home-ico {
    width: 58px;
    height: 58px;
    stroke-width: 2;
}

.home-bloco span {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-bloco-1 { background: var(--home-azul-1); }
.home-bloco-2 { background: var(--home-azul-2); }
.home-bloco-3 { background: var(--home-azul-3); }
.home-bloco-4 { background: var(--home-azul-4); }

/* ---------- Dashboard (site com menu lateral) ---------- */
.home-inicio {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    background: var(--home-azul-1);
}

.home-inicio .home-hero {
    min-height: 230px;
}

@media (min-width: 900px) {
    .home-inicio .home-hero-conteudo {
        padding: 40px 40px 0;
    }
    .home-inicio .home-busca {
        max-width: 640px;
        margin-left: 40px;
    }
    .home-inicio .home-blocos {
        grid-template-columns: repeat(4, 1fr);
    }
    .home-inicio .home-bloco {
        min-height: 190px;
    }
}

@media (max-width: 768px) {
    /* no celular o topo encosta nas bordas da tela, como em app */
    .home-inicio {
        margin: -1rem -1rem 20px;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .home-inicio {
        margin: -0.75rem -0.75rem 20px;
    }
}

/* ---------- Apps do líder e do gestor ---------- */
.home-atalhos--app {
    margin: -18px -16px 22px;
}

/* ---------- Telas sobrepostas ("Mais" e "Palavra do Dia") ---------- */
body.home-tela-aberta {
    overflow: hidden;
}

.home-tela {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(30, 20, 5, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.home-tela[hidden] {
    display: none;
}

.home-tela.is-aberta {
    opacity: 1;
}

.home-tela-caixa {
    width: 100%;
    max-width: 640px;
    overflow-y: auto;
    background: var(--home-creme);
    color: var(--home-tinta);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateY(12px);
    transition: transform 0.2s ease;
}

.home-tela.is-aberta .home-tela-caixa {
    transform: none;
}

@media (min-width: 700px) {
    .home-tela {
        align-items: center;
        padding: 24px;
    }
    .home-tela-caixa {
        max-height: 86vh;
        border-radius: 22px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    }
}

.home-tela-topo {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
    background: linear-gradient(180deg, rgba(253, 246, 227, 0.97), rgba(253, 246, 227, 0.9));
    backdrop-filter: blur(6px);
}

.home-tela-topo h2 {
    margin: 0;
    text-align: center;
    font-size: 22px;
    font-weight: 500;
    color: var(--home-tinta);
}

.home-tela-voltar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--home-tinta);
    cursor: pointer;
}

.home-tela-voltar:hover {
    background: rgba(0, 0, 0, 0.06);
}

.home-tela-voltar .home-ico {
    width: 26px;
    height: 26px;
    stroke-width: 2.2;
}

/* grade de ícones da tela "Mais" */
.home-mais-grade {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px 14px;
    padding: 18px 18px 8px;
}

.home-mais-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--home-tinta) !important;
    text-decoration: none !important;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.home-mais-icone {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 112px;
    aspect-ratio: 1;
    border-radius: 24px;
    background: #f6f7fc;
    color: var(--home-azul-icone);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    transition: transform 0.15s ease;
}

.home-mais-item:hover .home-mais-icone,
.home-mais-item:focus-visible .home-mais-icone {
    transform: translateY(-2px);
}

.home-mais-item:focus-visible {
    outline: none;
}

.home-mais-item:focus-visible .home-mais-icone {
    box-shadow: 0 0 0 3px var(--home-azul-3), 0 8px 16px rgba(0, 0, 0, 0.14);
}

.home-mais-icone .home-ico {
    width: 46%;
    height: 46%;
}

.home-mais-icone.tem-novidade {
    color: var(--home-laranja);
    padding-top: 16px;
}

.home-mais-icone em {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 4px 0;
    background: var(--home-faixa);
    color: #fff;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 24px 24px 0 0;
}

.home-mais-rotulo {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* Palavra do Dia */
.home-tela-modal {
    align-items: flex-end;
}

.home-tela-modal .home-tela-caixa {
    max-height: 90vh;
    border-radius: 22px 22px 0 0;
}

@media (min-width: 700px) {
    .home-tela-modal {
        align-items: center;
    }
    .home-tela-modal .home-tela-caixa {
        max-width: 520px;
        border-radius: 22px;
    }
}

.home-palavra-corpo {
    padding: 4px 26px 8px;
}

.home-palavra-texto {
    margin: 6px 0 14px;
    padding: 0;
    border: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    line-height: 1.5;
    color: var(--home-tinta);
}

.home-palavra-ref {
    margin: 0;
    font-weight: 700;
    color: #9a5b0b;
}

.home-palavra-traducao {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--home-tinta-suave);
}

.home-palavra-carregando,
.home-palavra-erro {
    padding: 24px 0;
    text-align: center;
    color: var(--home-tinta-suave);
}

.home-palavra-erro {
    color: #b42318;
}

.home-palavra-acoes {
    display: flex;
    gap: 10px;
    padding: 14px 26px 0;
}

.home-palavra-acoes[hidden] {
    display: none;
}

.home-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border: 1.5px solid var(--home-azul-2);
    border-radius: 12px;
    background: transparent;
    color: var(--home-azul-2) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
}

.home-btn-primario {
    background: var(--home-azul-2);
    color: #fff !important;
}

.home-ico {
    display: block;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .home-tela,
    .home-tela-caixa,
    .home-bloco,
    .home-mais-icone {
        transition: none;
    }
}
