.container.home-page {
    width: min(100% - 20px, 1400px) !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 16px 0 36px !important;
}
.home-page .section {
    padding: 22px 24px !important;
    margin-bottom: 22px !important;
}
.home-page .section-title {
    font-size: 1.4rem !important;
    margin: 0 0 12px !important;
    padding-bottom: 10px !important;
}
.home-page .section-lede,
.home-page .section > p,
.home-page .section-description {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin: 0 0 16px !important;
    color: #4a5870;
}
.home-page .section-empty {
    text-align: center;
    padding: 18px;
    color: #66758f;
}

/* ===== HERO: background image + overlay text ===== */
.welcome-section {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 58vh !important;
    min-height: 320px !important;
    max-height: 560px !important;
    margin-bottom: 18px !important;
    background-color: #14233f !important;
    background-image: url('../totem.jpeg') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
    animation: clanSlideDown 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
}
.welcome-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.35), rgba(10, 20, 40, 0.55));
    pointer-events: none;
}
.welcome-hero-img { display: none !important; }
.welcome-content {
    position: relative !important;
    z-index: 1;
    background: rgba(0, 0, 0, 0.48) !important;
    padding: 22px 28px !important;
    border-radius: 10px !important;
    text-align: center;
    max-width: min(92vw, 720px);
    border: 1px solid rgba(255, 215, 0, 0.35);
}
.welcome-content h1 {
    color: #fff !important;
    font-size: clamp(1.45rem, 3.2vw, 2.35rem) !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.welcome-content p {
    color: rgba(255,255,255,0.92) !important;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem) !important;
    margin: 10px 0 0 !important;
    line-height: 1.45 !important;
}

/* ===== HISTORY — compact, space-efficient ===== */
.home-history {
    background: #fff;
    border: 1px solid #e4ebf5;
    border-radius: 12px;
    padding: 16px 18px 18px;
    font-size: 0.94rem;
    line-height: 1.55;
    color: #24314a;
}
.home-history h3 {
    font-size: 1rem;
    margin: 14px 0 6px;
    padding-bottom: 5px;
    color: #1E3C72;
    border-bottom: 2px solid #FFD700;
    font-weight: 800;
}
.home-history h3:first-child { margin-top: 0; }
.home-history p,
.home-history .history-intro {
    margin: 0 0 8px;
}
.home-history a { color: #2A5298; font-weight: 700; }

/* Two titles side-by-side */
.history-title-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 10px;
}
.history-title-card {
    background: #f6f9fe;
    border: 1px solid #dce6f5;
    border-left: 3px solid #FFD700;
    border-radius: 8px;
    padding: 8px 10px;
}
.history-title-card strong {
    display: block;
    color: #1E3C72;
    font-size: 0.82rem;
    margin-bottom: 4px;
    line-height: 1.25;
}
.history-title-card p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #4a5870;
}

.home-history ol {
    margin: 6px 0 10px !important;
    padding-left: 0 !important;
    list-style: none !important;
}
.home-history .history-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    list-style: none;
    padding: 0 !important;
    margin: 8px 0 10px !important;
}
.home-history .history-chips li {
    background: #eef3fb;
    border: 1px solid #d5e0f2;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.78rem;
    margin: 0 !important;
    color: #1E3C72;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
}

/* Lutalo lineage — compact 2-column grid */
.home-history .history-lineage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    counter-reset: lineage-n;
}
.home-history .history-lineage-grid li {
    counter-increment: lineage-n;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0 !important;
    padding: 6px 8px;
    background: #f8fafd;
    border: 1px solid #e8eef6;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.35;
}
.home-history .history-lineage-grid li::before {
    content: counter(lineage-n);
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1E3C72;
    color: #FFD700;
    font-weight: 800;
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* ===== EXECUTIVES: 6 / 3 / 2 ===== */
.exec-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px 14px;
    margin-top: 8px;
}
.exec-card {
    background: #fff;
    border: 1px solid #e6edf7;
    border-radius: 16px;
    padding: 16px 10px 14px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(30,60,114,0.07);
    min-width: 0;
}
.exec-avatar {
    width: 112px;
    height: 112px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFD700;
    background: #eef2f8;
    box-shadow: 0 0 0 3px #1E3C72;
}
.exec-avatar img,
.exec-avatar .exec-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}
.exec-avatar .exec-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8aa0c4;
    font-size: 2rem;
}
.exec-card h3 {
    font-size: 0.84rem;
    line-height: 1.3;
    margin: 0 0 4px;
    color: #1E3C72;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.exec-card .exec-role {
    font-size: 0.78rem;
    font-weight: 800;
    color: #2A5298;
    margin: 0;
}
.exec-card .exec-branch,
.exec-card .exec-phone {
    font-size: 0.72rem;
    color: #5b6b86;
    margin: 5px 0 0;
    line-height: 1.3;
}
.exec-card .exec-phone {
    color: #1E3C72;
    text-decoration: none;
    display: block;
    font-weight: 700;
}

/* ===== MEDIA: videos 16:9, photos perfect squares ===== */
.home-page .media-section { gap: 16px !important; }
.home-page .video-row,
.home-page .photo-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
}
.home-page .media-item {
    min-width: 0;
    background: #fff !important;
    border: 1px solid #e4ebf5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(20, 35, 63, 0.06);
}

/* YouTube — normal 16:9 embeds */
.home-page .video-row .media-content.video-content {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    padding-top: 0 !important;
    background: #000 !important;
    position: relative;
    overflow: hidden;
}
.home-page .video-row .media-content.video-content iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Photos — perfect squares, full image visible (not cropped) */
.home-page .photo-row .media-content.photo-content {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    background: #eef3fa !important;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.home-page .photo-row .media-content.photo-content img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block;
    transition: transform 0.35s ease;
}
.home-page .photo-row .media-item:hover .media-content.photo-content img {
    transform: scale(1.03);
}

.home-page .media-caption { padding: 12px 14px !important; }
.home-page .media-caption h3 { font-size: 0.95rem !important; margin: 0 0 4px !important; color: #1E3C72 !important; }
.home-page .media-caption p { font-size: 0.82rem !important; line-height: 1.45 !important; color: #5b6b86 !important; margin: 0 !important; }

/* ===== TREE ===== */
.home-page #family-tree-container {
    min-height: 60vh;
    position: relative;
}
.home-page .person-node {
    width: 120px !important;
    min-height: 50px !important;
    padding: 12px 8px !important;
    font-size: 12px !important;
}
.home-page .section {
    transition: transform 0.3s ease;
}

.home-page .section-title {
    position: relative;
    display: inline-block;
}

.home-page .section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 48px;
    height: 3px;
    background: var(--clan-gold, #FFD700);
    border-radius: 2px;
    transition: width 0.35s ease;
}

.home-page .section:hover .section-title::after {
    width: 72px;
}

.home-page .exec-card,
.home-page .media-item,
.home-page .recent-post-card {
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

.home-page .exec-card:hover,
.home-page .media-item:hover,
.home-page .recent-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(30, 60, 114, 0.14);
}

.home-page .branch-row {
    transition: background 0.22s ease, transform 0.22s ease;
}

.home-page .branch-row:hover {
    transform: translateX(3px);
}

.home-page .btn-view-branch {
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.home-page .btn-view-branch:hover {
    transform: scale(1.12);
}

.home-page .family-tab {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.home-page .family-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(30, 60, 114, 0.12);
}

.home-page .person-node {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

#personDetailsModal,
#familyModal {
    z-index: 2100 !important;
}

#personDetailsModal .site-modal-card,
#familyModal .site-modal-card {
    max-width: 720px !important;
}

.person-details h2 {
    color: #1E3C72;
    font-size: 1.2rem;
    margin: 0 0 12px;
    padding-right: 36px;
}
.person-facts {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}
.person-facts div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    padding: 8px 10px;
    background: #f6f9fe;
    border-radius: 8px;
    font-size: 0.92rem;
}
.person-facts dt { font-weight: 700; color: #1E3C72; margin: 0; }
.person-facts dd { margin: 0; color: #334155; }
.person-children {
    list-style: decimal;
    margin: 8px 0 0;
    padding: 0 0 0 1.4rem;
    display: block;
}
.person-children li {
    margin: 0 0 8px;
    padding: 0;
    line-height: 1.4;
    color: #334155;
}
.person-children a {
    color: #1E3C72;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.person-children a:hover {
    text-decoration: underline;
}

/* ===== STATS / FAMILIES ===== */
.home-page .stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.home-page .stat-card { padding: 12px 14px !important; }
.home-page .chart-main-container { padding: 14px !important; }
.home-page .bar-chart { min-height: 180px !important; }
.home-page .bar-container { width: 52px !important; }
.home-page .bar-label { font-size: 9px !important; }
.home-page .branch-table th,
.home-page .branch-table td { padding: 8px 10px !important; font-size: 0.86rem; }
.home-page .families-header { margin-bottom: 12px !important; }
.family-tabs { display: flex; flex-wrap: wrap; gap: 8px !important; }
.family-tab { min-width: 120px !important; padding: 8px 10px !important; }

/* ===== NEWS: 6 / 3 / 2 ===== */
.home-page .recent-posts-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 14px !important;
}
.home-page .recent-post-card {
    min-width: 0;
    background: #fff !important;
    border: 1px solid #e4ebf5;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(30,60,114,0.06);
    display: flex;
    flex-direction: column;
}
.home-page .recent-post-image {
    display: block !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    background: #1E3C72 !important;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
}
.home-page .recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.home-page .recent-post-image span {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px;
    text-align: center;
}
.home-page .recent-post-content {
    padding: 10px 11px 12px !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.home-page .recent-post-date {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
    color: #2A5298 !important;
}
.home-page .recent-post-title {
    font-size: 0.86rem !important;
    margin: 0 0 6px !important;
    line-height: 1.3 !important;
}
.home-page .recent-post-title a {
    color: #1E3C72;
    text-decoration: none;
}
.home-page .recent-post-excerpt {
    display: block !important;
    font-size: 0.76rem !important;
    color: #5b6b86 !important;
    line-height: 1.4 !important;
    margin: 0 0 8px !important;
    flex: 1;
}
.home-page .read-more {
    align-self: flex-start;
    padding: 5px 10px !important;
    font-size: 0.74rem !important;
    background: #2A5298 !important;
    color: #fff !important;
    border-radius: 6px !important;
    text-decoration: none !important;
}
.home-page .news-more-wrap {
    text-align: center;
    margin-top: 16px;
}
.home-page .view-all-posts {
    display: inline-block;
    background: #1E3C72;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
}

@media (max-width: 1099px) {
    .welcome-section {
        height: 48vh !important;
        min-height: 280px !important;
    }
    .exec-grid,
    .home-page .recent-posts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .home-page .video-row,
    .home-page .photo-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .home-history .history-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .history-title-cards {
        grid-template-columns: 1fr;
    }
    .home-history .history-lineage-grid {
        grid-template-columns: 1fr;
    }
    .home-page .stats-overview { grid-template-columns: 1fr; }
    .exec-avatar { width: 96px; height: 96px; }
}
@media (max-width: 640px) {
    .welcome-section {
        height: 42vh !important;
        min-height: 240px !important;
    }
    .welcome-content { padding: 16px 18px !important; }
    .exec-grid,
    .home-page .recent-posts-grid,
    .home-page .video-row,
    .home-page .photo-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .home-page .section { padding: 16px 14px !important; }
    .home-history { padding: 14px; font-size: 0.94rem; }
    .home-history .history-chips { grid-template-columns: 1fr; }
    .home-history ol li { grid-template-columns: 28px 1fr; padding: 10px; }
    .exec-avatar { width: 84px; height: 84px; }
    .person-facts div { grid-template-columns: 1fr; gap: 2px; }
}

/* Homepage media sections */
.section-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.section-head-row .section-title {
    margin-bottom: 0;
}

.section-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--clan-blue, #2A5298);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}

.section-more-link:hover {
    color: var(--clan-navy, #1E3C72);
}

/* Homepage Hall of Fame uses gallery.css .hof-* (same as Media page) */
.home-page .home-hof-section .hof-grid {
    margin-bottom: 0;
}
