/* ============================================================
   Brittany's Hope — Sponsor Portal Styles
   Aesthetic: Warm editorial · Soft terracotta & sage · Refined
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables ────────────────────────────────────────────── */
.bh-portal {
    --bh-cream:        #FAF7F2;
    --bh-warm-white:   #FFFDF9;
    --bh-terracotta:   #C4634A;
    --bh-terracotta-lt:#E8907A;
    --bh-gold:         #D4A853;
    --bh-sage:         #7A9E7E;
    --bh-sage-lt:      #B8D4BB;
    --bh-charcoal:     #2C2C2C;
    --bh-mid:          #6B6560;
    --bh-light:        #B5AFA8;
    --bh-border:       #E8E2DA;
    --bh-shadow:       0 4px 24px rgba(44, 35, 28, .08);
    --bh-shadow-hover: 0 12px 40px rgba(44, 35, 28, .14);
    --bh-radius:       16px;
    --bh-radius-sm:    8px;
    --bh-font-display: 'Playfair Display', Georgia, serif;
    --bh-font-body:    'DM Sans', system-ui, sans-serif;

    font-family: var(--bh-font-body);
    color: var(--bh-charcoal);
    background: var(--bh-cream);
    padding: 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Portal Header ──────────────────────────────────────────── */
.bh-portal-header {
    background: linear-gradient(135deg, var(--bh-terracotta) 0%, #A84E38 100%);
    border-radius: var(--bh-radius);
    padding: 48px 52px 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.bh-portal-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}

.bh-portal-header::after {
    content: '';
    position: absolute;
    bottom: -80px; left: 30%;
    width: 360px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}

.bh-portal-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.bh-header-eyebrow {
    display: block;
    font-family: var(--bh-font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .75;
    margin-bottom: 6px;
}

.bh-header-name {
    font-family: var(--bh-font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    color: #fff;
}

.bh-header-stat {
    text-align: right;
    flex-shrink: 0;
}

.bh-stat-number {
    display: block;
    font-family: var(--bh-font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.bh-stat-label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    opacity: .8;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.bh-header-tagline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 14px;
    font-style: italic;
    opacity: .85;
    position: relative;
    z-index: 1;
}

.bh-heart-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    color: var(--bh-gold);
}

/* ── Children Grid ──────────────────────────────────────────── */
.bh-children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
}

/* ── Child Card ──────────────────────────────────────────────── */
.bh-child-card {
    background: var(--bh-warm-white);
    border-radius: var(--bh-radius);
    box-shadow: var(--bh-shadow);
    overflow: hidden;
    transition: box-shadow .3s ease, transform .3s ease;
    border: 1px solid var(--bh-border);
	    display: flex;
	    align-items: flex-start;
}

.bh-child-card:hover {
    box-shadow: var(--bh-shadow-hover);
    transform: translateY(-3px);
}

/* ── Photo Strip ─────────────────────────────────────────────── */
.bh-card-photos {
    position: relative;
    height: 280px;
    background: var(--bh-sage-lt);
    overflow: hidden;
	            width: 180px;
	    flex-shrink: 0;
}

.bh-child-photo-wrap {
	    position: relative;
	            width: 180px;
	    flex-shrink: 0;
	    overflow: hidden;
}


.bh-child-photo {
	    width: 100%;
	    height: 100%;
	    object-fit: cover;
	    display: block;
	            min-height: 240px;
}
.bh-photo {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bh-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.bh-child-card:hover .bh-photo-primary img {
    transform: scale(1.03);
}

/* Secondary photo — small inset bottom-right */
.bh-photo-secondary {
    inset: auto;
    width: 110px;
    height: 110px;
    bottom: 14px;
    right: 14px;
    border-radius: 12px;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

/* Initials fallback */
.bh-photo-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--bh-sage) 0%, var(--bh-sage-lt) 100%);
}

.bh-photo-initials span {
    font-family: var(--bh-font-display);
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
}

/* Country badge */
.bh-country-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(44, 35, 28, .72);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 20px;
}

/* ── Card Body ───────────────────────────────────────────────── */
.bh-card-body {
    padding: 28px 28px 24px;
}

.bh-child-info {
	    flex: 1;
	    min-width: 0;
	    padding: 28px 28px 24px;
}

/* Identity */
.bh-card-identity {
    margin-bottom: 14px;
}

.bh-child-name {
    font-family: var(--bh-font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--bh-charcoal);
    margin: 0 0 8px;
    line-height: 1.15;
}

.bh-child-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bh-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bh-cream);
    border: 1px solid var(--bh-border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 400;
    color: var(--bh-mid);
    padding: 3px 10px;
}

.bh-meta-chip svg {
    width: 12px; height: 12px;
    flex-shrink: 0;
}

/* Bio */
.bh-child-bio {
    font-size: 14px;
    line-height: 1.65;
    color: var(--bh-mid);
    margin: 0 0 20px;
}

/* ── Anniversary Strip ───────────────────────────────────────── */
.bh-anniversary-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(90deg, rgba(196,99,74,.08) 0%, rgba(212,168,83,.06) 100%);
    border: 1px solid rgba(196,99,74,.15);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
}

.bh-anniversary-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--bh-terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bh-anniversary-icon svg {
    width: 18px; height: 18px;
    color: #fff;
}

.bh-anniversary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bh-anniversary-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--bh-charcoal);
}

.bh-anniversary-duration {
    font-size: 12px;
    color: var(--bh-terracotta);
    font-style: italic;
}

/* ── Tabs (Update / Letter) ──────────────────────────────────── */
.bh-card-tabs {
    border: 1px solid var(--bh-border);
    border-radius: 12px;
    overflow: hidden;
}

.bh-tabs-nav {
    display: flex;
    background: var(--bh-cream);
    border-bottom: 1px solid var(--bh-border);
}

.bh-tab-btn {
    flex: 1;
    padding: 10px 16px;
    font-family: var(--bh-font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bh-light);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    margin-bottom: -1px;
}

.bh-tab-btn:hover {
    color: var(--bh-charcoal);
}

.bh-tab-btn.bh-tab-active {
    color: var(--bh-terracotta);
    border-bottom-color: var(--bh-terracotta);
    background: var(--bh-warm-white);
}

.bh-tab-panel {
    display: none;
    padding: 18px 20px;
}

.bh-tab-panel.bh-panel-active {
    display: block;
}

.bh-tab-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--bh-mid);
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bh-border) transparent;
}

.bh-tab-content p:first-child { margin-top: 0; }
.bh-tab-content p:last-child  { margin-bottom: 0; }

/* Letter styling — slight handwritten feel */
.bh-letter {
    font-style: italic;
    background: repeating-linear-gradient(
        transparent,
        transparent 27px,
        rgba(196,99,74,.07) 28px
    );
    padding-top: 4px;
}

/* ── State Screens ───────────────────────────────────────────── */
.bh-portal-state {
    text-align: center;
    padding: 72px 32px;
    background: var(--bh-warm-white);
    border-radius: var(--bh-radius);
    border: 1px solid var(--bh-border);
}

.bh-state-icon {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    color: var(--bh-terracotta);
    opacity: .7;
}

.bh-state-icon svg {
    width: 100%; height: 100%;
}

.bh-portal-state h2 {
    font-family: var(--bh-font-display);
    font-size: 1.6rem;
    margin: 0 0 10px;
    color: var(--bh-charcoal);
}

.bh-portal-state p {
    font-size: 15px;
    color: var(--bh-mid);
    margin: 0 0 8px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Button ──────────────────────────────────────────────────── */
.bh-btn-primary {
    display: inline-block;
    margin-top: 20px;
    background: var(--bh-terracotta);
    color: #fff !important;
    font-family: var(--bh-font-body);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background .2s, transform .15s;
}

.bh-btn-primary:hover {
    background: #A84E38;
    transform: translateY(-1px);
}

/* ── Portal Footer ───────────────────────────────────────────── */
.bh-portal-footer {
    margin-top: 40px;
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--bh-border);
}

.bh-portal-footer p {
    font-size: 13px;
    color: var(--bh-light);
    margin: 4px 0;
}

.bh-portal-footer a {
    color: var(--bh-terracotta);
    text-decoration: none;
}

.bh-portal-footer a:hover {
    text-decoration: underline;
}

.bh-cache-note {
    font-size: 11px !important;
    opacity: .6;
}

/* ── Error detail (admin only) ───────────────────────────────── */
.bh-error-detail {
    font-size: 11px;
    background: #fff3f3;
    border: 1px solid #fcc;
    border-radius: 6px;
    padding: 10px;
    text-align: left;
    max-width: 600px;
    margin: 12px auto 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media ( max-width: 640px ) {
    .bh-portal-header {
        padding: 32px 24px 28px;
    }

    .bh-header-name {
        font-size: 2rem;
    }

    .bh-stat-number {
        font-size: 2.5rem;
    }

    .bh-portal-header-inner {
        flex-direction: column;
        gap: 12px;
    }

    .bh-header-stat {
        text-align: left;
    }

    .bh-children-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .bh-card-photos {
        height: 220px;
		        width: 100%;
    }

	    .bh-child-card {
			        flex-direction: column;
		}
}
		

/* ── Fade-in animation on load ───────────────────────────────── */
@keyframes bhFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bh-portal-header {
    animation: bhFadeUp .5s ease both;
}

.bh-child-card {
    animation: bhFadeUp .5s ease both;
}

.bh-child-card:nth-child(1) { animation-delay: .1s; }
.bh-child-card:nth-child(2) { animation-delay: .2s; }
.bh-child-card:nth-child(3) { animation-delay: .3s; }
.bh-child-card:nth-child(4) { animation-delay: .4s; }
.bh-child-card:nth-child(5) { animation-delay: .5s; }
