/*
|--------------------------------------------------------------------------
| Funerária LaPaz - Obituário
|--------------------------------------------------------------------------
| Este arquivo cuida apenas da página pública de obituários.
|
| Objetivos:
| - aproximar o layout do obituario.php antigo;
| - preservar o funcionamento atual do Laravel;
| - preparar visual para QR Code do memorial;
| - não interferir no header, footer, home ou memorial individual.
|--------------------------------------------------------------------------
*/

/*--------------------------------------------------------------
# Página / Seção
--------------------------------------------------------------*/
.obituario-section,
.ob-page {
    padding: 70px 0;
    background: linear-gradient(to bottom, #f8f9fb, #edf0f5);
    font-family: "Inter", "Roboto", "Open Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
}

/*
| Compatibilidade com a estrutura antiga:
| <section id="obituario" class="obituario-section py-5">
*/
#obituario {
    scroll-margin-top: 120px;
}

/*--------------------------------------------------------------
# Título da seção
--------------------------------------------------------------*/
.obituario-section .section-title,
.ob-page .ob-header {
    text-align: center;
    padding-bottom: 45px;
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.obituario-section .section-title h2,
.ob-page .ob-kicker {
    font-size: 13px;
    letter-spacing: 1px;
    font-weight: 700;
    padding: 8px 20px;
    margin: 0;
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    color: var(--accent-color);
    display: inline-block;
    text-transform: uppercase;
    border-radius: 50px;
    font-family: var(--default-font);
}

.obituario-section .section-title p,
.ob-page .ob-title {
    color: var(--heading-color);
    margin: 12px 0 0 0;
    font-size: 32px;
    font-weight: 700;
    font-family: var(--heading-font);
    letter-spacing: -0.02em;
}

.obituario-section .section-title p .description-title,
.ob-page .ob-title .description-title {
    color: var(--accent-color);
}

.ob-page .ob-subtitle {
    margin: 0.85rem auto 0;
    color: #64748b;
    font-size: 1.02rem;
    line-height: 1.7;
    max-width: 680px;
}

/*--------------------------------------------------------------
# Busca
--------------------------------------------------------------*/
#search-form {
    background: #f8f9fa;
    border-radius: 12px;
}

#search-form h4 {
    color: #222;
    font-family: var(--heading-font);
    font-weight: 500;
}

#search-input,
#searchInput {
    min-height: 58px;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    font-size: 16px;
    background-color: #ffffff;
    color: #2c3e50;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#search-input::placeholder,
#searchInput::placeholder {
    color: #999999;
    font-weight: 400;
}

#search-input:focus,
#searchInput:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}

/*
| Compatibilidade com o layout atual que usa .ob-search.
*/
.ob-search {
    position: relative;
}

.ob-search .form-control {
    height: 58px;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    padding: 0 1.25rem 0 3.1rem;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    font-size: 1rem;
}

.ob-search .form-control:focus {
    border-color: rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.12);
}

.ob-search-icon {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 4;
}

/*--------------------------------------------------------------
# Lista / Grid
--------------------------------------------------------------*/
#cards-row,
#obituarioGrid {
    align-items: stretch;
}

/*
| No layout antigo os cards eram largos/horizontais.
| Este ajuste ajuda quando o Blade ainda usa colunas pequenas.
*/
#obituarioGrid .ob-item {
    margin-bottom: 1.5rem;
}

/*--------------------------------------------------------------
# Card estilo antigo
--------------------------------------------------------------*/
.obituario-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    cursor: default;
    display: flex;
    align-items: center;

    padding: 16px 20px;
    gap: 20px;
    max-width: 100%;
    height: 100%;
}

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

.obituario-card-img {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.obituario-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback para avatar atual */
.ob-avatar-frame {
    flex-shrink: 0;
}

.obituario-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;

    font-family: "Roboto", "Open Sans", sans-serif;
    color: #333333;
}

.obituario-card-body h5 {
    margin-bottom: 0.35rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: #222222;
    letter-spacing: 0.03em;
    text-transform: capitalize;
    line-height: 1.2;
}

.obituario-card-body p {
    margin: 0.15rem 0;
    color: #555555;
    font-size: 1rem;
    line-height: 1.4;
    letter-spacing: 0.01em;

    display: flex;
    align-items: center;
    gap: 6px;
}

.obituario-card-body p span.icon,
.ob-date-icon {
    font-weight: 600;
    color: #007bff;
    font-size: 1.1rem;
    line-height: 1;
}

.obituario-card-body a.btn,
.obituario-card-body button.btn {
    align-self: flex-start;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    margin-top: 12px;
    font-weight: 600;
    border-radius: 6px;

    text-transform: uppercase;
    letter-spacing: 0.05em;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;

    border: 2px solid #007bff;
    color: #007bff;
    background: transparent;
    text-decoration: none;
}

.obituario-card-body a.btn:hover,
.obituario-card-body a.btn:focus,
.obituario-card-body button.btn:hover,
.obituario-card-body button.btn:focus {
    background-color: #007bff;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/*--------------------------------------------------------------
# Compatibilidade com o card atual do Laravel
--------------------------------------------------------------*/
.ob-card {
    background: #ffffff;
    border-radius: 20px;
    border: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;

    padding: 16px 20px;
    height: 100%;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    overflow: visible;
}

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

.ob-card-top {
    display: none;
}

.ob-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-top: -68px;
    position: relative;
    z-index: 2;
}

.ob-avatar-frame {
    width: 144px;
    height: 144px;
    border-radius: 999px;
    background: #ffffff;
    overflow: hidden;
    border: 5px solid #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.20);
}

.ob-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    object-position: center center;
}

.ob-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #115e59;
    font-size: 3rem;
    font-weight: 850;
}

.ob-card-body {
    flex: 1;
    padding: 0;
    text-align: left;
}

.ob-name {
    margin-bottom: 0.35rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: #222222;
    letter-spacing: 0.03em;
    text-transform: capitalize;
    line-height: 1.2;
}

.ob-dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0.35rem 0 0.45rem;
}

.ob-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;

    color: #555555;
    font-size: 1rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.ob-date-chip-death {
    color: #555555;
}

.ob-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555555;
    font-size: 1rem;
    margin-top: 0.2rem;
}

.ob-location svg {
    color: #007bff;
}

.ob-card-footer {
    padding: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ob-btn,
.ob-btn:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;

    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;

    text-transform: uppercase;
    letter-spacing: 0.05em;

    border: 2px solid #007bff;
    color: #007bff;
    background: transparent;
    text-decoration: none;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.ob-btn:hover {
    background-color: #007bff;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    transform: translateY(-1px);
}

.ob-btn-private {
    cursor: pointer;
}

/*--------------------------------------------------------------
# Datas + ações
--------------------------------------------------------------*/
.dates-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dates-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inline-actions,
.ob-inline-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.action-icon,
.ob-action-icon {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    line-height: 1;
    padding: 0;
    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}

.action-icon:hover,
.ob-action-icon:hover {
    background: #eef2f7;
    color: #007bff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

/*--------------------------------------------------------------
# Modal privado atual
--------------------------------------------------------------*/
#privateMemorialModal[hidden] {
    display: none;
}

#privateMemorialModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
}

.ob-private-modal-card {
    width: min(92vw, 520px);
    background: #ffffff;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    color: #333333;
    text-align: left;
}

.ob-private-modal-card h3 {
    margin: 0 0 14px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #222222;
}

.ob-private-modal-card p {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.5;
    color: #444444;
}

.ob-private-modal-card button {
    margin-top: 10px;
    padding: 8px 18px;
    border: 0;
    border-radius: 8px;
    background: #6c757d;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.ob-private-modal-card button:hover {
    background: #5c636a;
}



/*--------------------------------------------------------------
# Modal QR Code
--------------------------------------------------------------*/
#qrModal .modal-content,
.ob-qr-modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

#qrModal .modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

#qrModal .modal-title {
    font-family: var(--heading-font);
    font-weight: 700;
    color: #0f172a;
}

#qrModal .modal-body {
    background: #f8fafc;
}

#qrImg {
    display: block;
    max-width: 260px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

#qrLink {
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    color: #2563eb;
}

/*--------------------------------------------------------------
# Vazio / paginação
--------------------------------------------------------------*/
/*.ob-empty {
    padding: 3rem 1.5rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

#btn-prev,
#btn-next {
    border-radius: 8px;
}
*/
/*--------------------------------------------------------------
# Responsivo
--------------------------------------------------------------*/
@media (max-width: 767.98px) {

    .obituario-section,
    .ob-page {
        padding: 52px 0;
    }

    .obituario-section .section-title,
    .ob-page .ob-header {
        padding-bottom: 32px;
    }

    .obituario-section .section-title p,
    .ob-page .ob-title {
        font-size: 28px;
    }

    .ob-card,
    .obituario-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
        gap: 15px;
        height: auto;
    }

    .obituario-card-img,
    .ob-avatar-frame {
        width: 100%;
        height: 220px;
    }

    .obituario-card-body,
    .ob-card-body {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .obituario-card-body p,
    .ob-location {
        justify-content: center;
    }

    .ob-card-footer {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    .ob-btn,
    .obituario-card-body a.btn,
    .obituario-card-body button.btn {
        align-self: center;
    }

    .dates-actions {
        width: 100%;
        justify-content: center;
    }

    .inline-actions,
    .ob-inline-actions {
        margin-left: 0;
    }

    .ob-dates {
        align-items: center;
    }

    .ob-date-chip {
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    #search-form {
        padding: 1.25rem;
    }

    #search-input,
    #searchInput {
        min-height: 54px;
        font-size: 15px;
    }
}

/*--------------------------------------------------------------
# Busca do obituário - largura horizontal maior
--------------------------------------------------------------*/
.obituario-section .section-title {
    max-width: 1100px;
}

.obituario-search-area {
    width: 100%;
    max-width: 850px;
    margin: 48px auto 0 auto;
}

.obituario-search-area #search-form {
    width: 100%;
    padding: 36px 42px;
    border-radius: 16px;
}

.obituario-search-area #search-form h4 {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 24px;
}

.obituario-search-area #search-input {
    width: 100%;
    height: 72px;
    min-height: 72px;
    font-size: 22px;
    padding: 14px 24px;
    border-radius: 14px;
}

@media (max-width: 575.98px) {
    .obituario-section .section-title {
        max-width: 100%;
    }

    .obituario-search-area {
        max-width: 100%;
        margin-top: 36px;
    }

    .obituario-search-area #search-form {
        padding: 28px 24px;
    }

    .obituario-search-area #search-form h4 {
        font-size: 26px;
    }

    .obituario-search-area #search-input {
        height: 64px;
        min-height: 64px;
        font-size: 18px;
    }
}

/*--------------------------------------------------------------
# Paginação leve do obituário
--------------------------------------------------------------*/
.ob-pagination-wrap {
    margin: 42px auto 0;
    display: flex;
    justify-content: center;
}

.ob-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ob-page-btn,
.ob-page-info {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
}

.ob-page-btn {
    padding: 0 18px;
    border: 1px solid #dbe4ee;
    background: #ffffff;
    color: #2563eb;
    text-decoration: none;
}

.ob-page-info {
    padding: 0 14px;
    color: #64748b;
}