/* ═══════════════════════════════════════════════════════════════════
   TNG This Week in Family History v1.0.0
   Parchment narrative aesthetic — matched to Heritage Map & Brick Walls
   ═══════════════════════════════════════════════════════════════════ */

/* ── Parchment wrapper ────────────────────────────────────────── */
.tng-tw-wrap {
    font-family: "Georgia", "Cambria", "Times New Roman", serif;
    color: #2c2416;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(139,90,43,.018) 3px,
            rgba(139,90,43,.018) 4px
        ),
        radial-gradient(ellipse at 40% 30%, #fdfaf4 0%, #f5eed8 50%, #ede3c8 100%);
    background-color: #faf8f4;
    border: 1px solid #d9cfc0;
    border-radius: 8px;
    padding: 2rem 2rem 1.5rem;
    max-width: 100%;
    line-height: 1.7;
    box-shadow: 0 2px 12px rgba(28,18,10,.10);
    position: relative;
}
/* Foxing speckle */
.tng-tw-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
    background-image:
        radial-gradient(circle 1.5px at 8%  22%, rgba(107,76,30,.06) 50%, transparent 50%),
        radial-gradient(circle 2px   at 82% 38%, rgba(107,76,30,.05) 50%, transparent 50%),
        radial-gradient(circle 1px   at 50% 68%, rgba(107,76,30,.04) 50%, transparent 50%),
        radial-gradient(circle 1.8px at 72% 10%, rgba(107,76,30,.05) 50%, transparent 50%),
        radial-gradient(circle 1.2px at 24% 85%, rgba(107,76,30,.04) 50%, transparent 50%),
        radial-gradient(circle 2px   at 95% 75%, rgba(107,76,30,.06) 50%, transparent 50%);
    z-index: 0;
}
.tng-tw-wrap > * { position: relative; z-index: 1; }

/* ── Header ───────────────────────────────────────────────────── */
.tng-tw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #b8860b;
}
.tng-tw-title {
    font-family: "Georgia", serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #6b4c1e;
    margin: 0;
    letter-spacing: .01em;
}
.tng-tw-week-label {
    display: block;
    font-size: .88rem;
    font-style: italic;
    color: #7a6a58;
    margin-top: .2rem;
}

/* ── Count badges ─────────────────────────────────────────────── */
.tng-tw-counts {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
.tng-tw-count-badge {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2em .6em;
    border-radius: 3px;
    white-space: nowrap;
}
.tng-tw-badge-birth    { background: #edf7f6; color: #1d7a73; border: 1px solid rgba(29,122,115,.18); }
.tng-tw-badge-death    { background: #fdf0ee; color: #c0392b; border: 1px solid rgba(192,57,43,.18); }
.tng-tw-badge-marriage { background: #f5ecd4; color: #8a6d1b; border: 1px solid rgba(138,109,27,.18); }
.tng-tw-badge-baptism  { background: #e8f0f7; color: #3d5a80; border: 1px solid rgba(61,90,128,.18); }
.tng-tw-badge-burial   { background: #f0ebe4; color: #6b4c1e; border: 1px solid rgba(107,76,30,.18); }

/* ── Intro paragraph ──────────────────────────────────────────── */
.tng-tw-intro {
    font-size: .95rem;
    color: #4a3d2e;
    margin-bottom: 1.5rem;
    padding: .75rem 1rem;
    background: linear-gradient(135deg, rgba(245,236,212,.5) 0%, rgba(237,227,200,.3) 100%);
    border-left: 3px solid #b8860b;
    border-radius: 0 6px 6px 0;
}

/* ── Narrative body ───────────────────────────────────────────── */
.tng-tw-narrative {
    font-size: .92rem;
    line-height: 1.75;
}

/* ── Day headings ─────────────────────────────────────────────── */
.tng-tw-day {
    margin-bottom: 1.5rem;
}
.tng-tw-day:last-child {
    margin-bottom: .5rem;
}
.tng-tw-day-heading {
    font-family: "Georgia", serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #6b4c1e;
    margin: 0 0 .6rem 0;
    padding-bottom: .4rem;
    border-bottom: 1px solid #d9cfc0;
    letter-spacing: .01em;
}

/* ── Event paragraphs ─────────────────────────────────────────── */
.tng-tw-event {
    margin: 0 0 .65rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: #2c2416;
}
/* Decorative bullet — event-type colored */
.tng-tw-event::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.tng-tw-birth::before    { background: #1d7a73; }
.tng-tw-death::before    { background: #c0392b; }
.tng-tw-marriage::before { background: #b8860b; }
.tng-tw-baptism::before  { background: #3d5a80; }
.tng-tw-burial::before   { background: #6b4c1e; }

.tng-tw-event strong {
    color: #2c2416;
}

/* ── Profile links ────────────────────────────────────────────── */
.tng-tw-profile-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .72rem;
    font-weight: 600;
    color: #3d5a80;
    text-decoration: none;
    margin-left: .3rem;
    white-space: nowrap;
    transition: color .2s ease;
}
.tng-tw-profile-link:hover {
    color: #2a4060;
    text-decoration: underline;
}

/* ── Empty state ──────────────────────────────────────────────── */
.tng-tw-empty {
    text-align: center;
    font-style: italic;
    color: #7a6a58;
    padding: 1.5rem 1rem;
}

/* ── Footer ornament ──────────────────────────────────────────── */
.tng-tw-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #d9cfc0;
}
.tng-tw-ornament {
    font-size: .85rem;
    color: #b8860b;
    letter-spacing: .3em;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tng-tw-wrap { padding: 1.25rem 1rem 1rem; }
    .tng-tw-header { flex-direction: column; }
    .tng-tw-narrative { font-size: .86rem; }
    .tng-tw-event { padding-left: 1rem; }
}
