/* ============================================================
   Memorial / Legacy Gallery — sistema de diseño centralizado
   ============================================================ */

:root {
    --brand-green: #104D2E;
    --brand-green-soft: rgba(16, 77, 46, 0.08);
    --brand-green-border: rgba(16, 77, 46, 0.15);
    --brand-indigo: #212155;
    --brand-indigo-soft: rgba(33, 33, 85, 0.08);
    --brand-indigo-border: rgba(33, 33, 85, 0.15);
    --accent-amber: #FFC857;
    --soft-sand: #F7F4EF;
    --ink: #0A1A1A;
    --paper: #ffffff;
    --paper-soft: #f7f8fd;
    --paper-warm: #faf8f3;
    --text-strong: #1a2330;
    --text-soft: #5a6573;

    --shadow-sm: 0 6px 16px rgba(16, 77, 46, 0.06);
    --shadow-md: 0 18px 40px rgba(16, 77, 46, 0.08);
    --shadow-lg: 0 30px 80px rgba(16, 77, 46, 0.12);

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Tipografía global ---------- */
body {
    font-family: var(--font-sans);
    color: var(--text-strong);
}
.font-serif,
.memorial-title,
.memorial-hero h1,
.memorial-hero .display-5,
.portrait-name {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.title-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: .72rem;
    color: var(--brand-green);
    font-weight: 700;
}
.title-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-amber), rgba(255, 200, 87, 0.2));
    flex-shrink: 0;
}
.memorial-hero--cover .title-eyebrow::before {
    background: linear-gradient(90deg, var(--accent-amber), rgba(255, 255, 255, 0.2));
}

.sembranza-text {
    font-family: var(--font-serif);
    font-size: 1.18rem;
    line-height: 1.7;
    color: #2f3944;
    font-weight: 500;
}

/* ---------- Hero conmemorativo ---------- */
.memorial-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: radial-gradient(circle at 15% 20%, rgba(16, 77, 46, .08), transparent 45%),
                radial-gradient(circle at 80% 0%, rgba(33, 33, 85, .09), transparent 50%),
                linear-gradient(135deg, var(--paper), var(--paper-soft));
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--brand-indigo-soft);
}
/* Filete dorado superior, sello conmemorativo discreto */
.memorial-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 200, 87, 0.65) 20%,
        var(--accent-amber) 50%,
        rgba(255, 200, 87, 0.65) 80%,
        transparent);
    z-index: 3;
}
.memorial-hero::after {
    content: "";
    position: absolute;
    inset: -120px -120px auto auto;
    width: 280px;
    height: 280px;
    background: radial-gradient(closest-side, rgba(255,200,87,.18), transparent 65%);
    filter: blur(20px);
    opacity: .6;
    pointer-events: none;
}

/* Hero con cover de fondo (mausoleo con imagen de portada) */
.memorial-hero--cover {
    color: #fff;
    border: none;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    background-color: var(--brand-indigo);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.memorial-hero--cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10, 26, 26, 0.20) 0%,
        rgba(10, 26, 26, 0.55) 55%,
        rgba(10, 26, 26, 0.88) 100%);
    pointer-events: none;
}
.memorial-hero--cover::after {
    display: none;
}
.memorial-hero--cover .memorial-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 2rem 2.25rem;
}
.memorial-hero--cover .title-eyebrow,
.memorial-hero--cover h1,
.memorial-hero--cover .lead {
    color: #fff;
}
.memorial-hero--cover .title-eyebrow {
    color: rgba(255, 255, 255, 0.85);
}
.memorial-hero--cover .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Pills, badges, etiquetas ---------- */
.pill-info {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .9rem;
    border-radius: 999px;
    background: var(--brand-green-soft);
    border: 1px solid var(--brand-green-border);
    color: var(--brand-green);
    font-weight: 700;
}
.memorial-hero--cover .pill-info {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.badge-virtual {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border-radius: var(--radius-sm);
    background: var(--brand-indigo-soft);
    color: var(--brand-indigo);
    font-weight: 700;
    border: 1px solid var(--brand-indigo-border);
}
.memorial-hero--cover .badge-virtual {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.badge-protected {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .9rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.25);
}

.life-dates {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .95rem;
    background: var(--brand-green-soft);
    border-radius: 999px;
    color: var(--brand-green);
    font-weight: 700;
    border: 1px solid var(--brand-green-border);
    font-size: .95rem;
}

/* Año grande tipo lápida: 1950 — 2020 */
.life-years {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-strong);
    line-height: 1.2;
}
.life-years .dash {
    display: inline-block;
    position: relative;
    width: 1.6em;
    margin: 0 .15rem;
    font-size: 0;
    vertical-align: middle;
}
.life-years .dash::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 77, 46, .35), transparent);
}
.life-years .dash::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--accent-amber);
    border: 1px solid rgba(16, 77, 46, .25);
    transform: translate(-50%, -50%) rotate(45deg);
}
.memorial-hero--cover .life-years .dash::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
}
.memorial-hero--cover .life-years .dash::after {
    border-color: rgba(255, 255, 255, .4);
}
.memorial-hero--cover .life-years {
    color: #fff;
}

/* ---------- Tarjeta de portada y retrato ---------- */
.cover-figure {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(33, 33, 85, 0.1);
    border: 1px solid rgba(16, 77, 46, 0.12);
}
.portrait-card {
    position: relative;
    border-radius: 18px;
    background: linear-gradient(160deg, #ffffff, var(--paper-warm));
    border: 1px solid rgba(16, 77, 46, 0.12);
    box-shadow: var(--shadow-md);
    padding: .85rem;
}
/* Marco interior dorado fino, como un portarretrato */
.portrait-card::after {
    content: "";
    position: absolute;
    inset: .85rem;
    border: 1px solid rgba(255, 200, 87, 0.55);
    border-radius: 12px;
    pointer-events: none;
    z-index: 2;
}
.portrait-img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    max-height: 420px;
}

/* ---------- Card persona (grid del mausoleo) ---------- */
.person-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(16, 77, 46, 0.08);
    background: linear-gradient(145deg, #fff, #f9fafc);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
/* Filete dorado superior que se revela al pasar el cursor */
.person-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-amber), transparent);
    transform: scaleX(0);
    transition: transform .3s ease;
    z-index: 3;
}
.person-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 50px rgba(16, 77, 46, 0.14);
    border-color: rgba(16, 77, 46, 0.22);
}
.person-card:hover::before {
    transform: scaleX(1);
}
.person-card-media {
    height: 260px;
    background: radial-gradient(circle at 30% 30%, rgba(16, 77, 46, 0.08), transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(33, 33, 85, 0.08), transparent 50%),
                #f8fbf9;
    border-bottom: 1px solid rgba(16, 77, 46, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.person-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.person-card:hover .person-card-img {
    transform: scale(1.04);
}

/* ---------- Botones de marca ---------- */
.btn-brand-outline {
    border: 1.5px solid var(--brand-green);
    color: var(--brand-green);
    background: transparent;
    font-weight: 600;
    transition: background-color .2s ease, color .2s ease;
}
.btn-brand-outline:hover {
    background: var(--brand-green);
    color: #fff;
}
.memorial-hero--cover .btn-brand-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}
.memorial-hero--cover .btn-brand-outline:hover {
    background: #fff;
    color: var(--brand-green);
}

/* ---------- Secciones / grid ---------- */
.grid-section {
    background: linear-gradient(180deg, #fff, #f6f7fb);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.25rem .75rem;
    border: 1px solid rgba(16, 77, 46, 0.08);
}

/* ---------- Cards genéricas con sello memorial ---------- */
.card-memorial {
    border: 1px solid rgba(16, 77, 46, 0.08);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    background: #fff;
}
.card-memorial > .card-header,
.card-memorial .card-header-memorial {
    border-bottom: 1px solid rgba(33, 33, 85, 0.08);
    background: linear-gradient(90deg, rgba(16, 77, 46, 0.06), rgba(33, 33, 85, 0.06));
}

/* ---------- Tarjeta de mausoleo (dashboard / password prompt) ---------- */
.memorial-card {
    border: 1px solid rgba(16, 77, 46, 0.12);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(16, 77, 46, 0.12);
    background: #fff;
}
.memorial-card__header {
    background: linear-gradient(135deg, rgba(16,77,46,.92), rgba(33,33,85,.9));
    color: #fff;
}

/* ---------- Photo grid (galería de fotos del perfil) ---------- */
.photo-card {
    border-radius: 14px;
    border: 1px solid rgba(33, 33, 85, 0.08);
    box-shadow: 0 12px 30px rgba(33, 33, 85, 0.08);
    overflow: hidden;
    background: #fff;
    transition: transform .25s ease, box-shadow .25s ease;
}
.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(33, 33, 85, 0.14);
}
.photo-card img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    background: #f8fbf9;
    cursor: zoom-in;
}

/* ---------- Reel modal (carrusel de fotos) ---------- */
.reel-modal .modal-content {
    background: rgba(0,0,0,0.88);
    border: none;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
}
.reel-modal .modal-dialog { max-width: 780px; }
.reel-modal .carousel-item img {
    max-height: 72vh;
    object-fit: contain;
    background: #000;
}
.reel-modal .close {
    color: #fff;
    opacity: 1;
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 10;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: linear-gradient(135deg, rgba(16,77,46,.92), rgba(33,33,85,.92));
    color: #fff;
    border: none;
    padding: .5rem 1rem;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
    font-weight: 600;
    transition: filter .2s ease, transform .2s ease;
}
.play-btn:hover {
    color: #fff;
    filter: brightness(.95);
    transform: translateY(-1px);
}

/* ---------- QR pill (galería clásica) ---------- */
.qr-pill {
    background: linear-gradient(135deg, rgba(16, 77, 46, 0.12), rgba(33, 33, 85, 0.12));
    color: var(--brand-green);
    border: 1px solid var(--brand-green-border);
}

/* ---------- Animación de entrada sutil ---------- */
@keyframes memorial-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.memorial-fade-up {
    animation: memorial-fade-up .6s ease both;
}
@media (prefers-reduced-motion: reduce) {
    .memorial-fade-up,
    .person-card,
    .person-card-img,
    .photo-card,
    .play-btn {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Botón sólido de marca (CTA primario) ---------- */
.btn-brand {
    border: none;
    background: linear-gradient(135deg, var(--brand-green), #0c3d24);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(16, 77, 46, 0.22);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-brand:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(16, 77, 46, 0.28);
    filter: brightness(1.05);
}
.memorial-hero--cover .btn-brand {
    background: linear-gradient(135deg, var(--accent-amber), #f0b53d);
    color: var(--ink);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}
.memorial-hero--cover .btn-brand:hover {
    color: var(--ink);
}

/* ---------- Ornamento divisor conmemorativo ---------- */
.memorial-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .85rem;
    margin: 1.1rem 0;
    color: var(--accent-amber);
}
.memorial-divider::before,
.memorial-divider::after {
    content: "";
    height: 1px;
    width: clamp(36px, 12vw, 90px);
    background: linear-gradient(90deg, transparent, rgba(16, 77, 46, 0.3));
}
.memorial-divider::after {
    background: linear-gradient(90deg, rgba(16, 77, 46, 0.3), transparent);
}
.memorial-divider__mark {
    width: 9px;
    height: 9px;
    background: var(--accent-amber);
    border: 1px solid rgba(16, 77, 46, 0.3);
    transform: rotate(45deg);
    flex-shrink: 0;
}
.memorial-divider--start {
    justify-content: flex-start;
}
.memorial-divider--start::before {
    display: none;
}
.memorial-divider--start::after {
    width: clamp(48px, 18vw, 140px);
}
.memorial-hero--cover .memorial-divider::before,
.memorial-hero--cover .memorial-divider::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
}
.memorial-hero--cover .memorial-divider--start::after {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent);
}
.memorial-hero--cover .memorial-divider__mark {
    border-color: rgba(255, 255, 255, 0.5);
}

/* ---------- Cabecera de card con sello memorial ---------- */
.card-header-memorial .title-eyebrow,
.card-memorial > .card-header .title-eyebrow {
    color: var(--brand-green);
}

/* ---------- Estado "sin foto" más cuidado ---------- */
.person-card-media .text-muted {
    color: var(--brand-green) !important;
    opacity: .55;
}

/* ---------- Responsive ajustes finos ---------- */
@media (max-width: 575.98px) {
    .memorial-hero { padding: 1.5rem 1.25rem !important; }
    .memorial-hero--cover { min-height: 320px; }
    .memorial-hero--cover .memorial-hero__inner { padding: 1.25rem 1.25rem; }
    .life-years { font-size: 1.5rem; }
    .person-card-media { height: 220px; }
}
