:root {
    --brown-dark: #1a0f0a;
    --brown: #3d2418;
    --gold: #D4AF37;
    --gold-bright: #F0D78C;
    --gold-light: #E8D5A3;
    --gold-glow: rgba(212, 175, 55, 0.45);
    --cream: #F9F4ED;
    --calligraphy-brown: #6F4E37;
    --cream-dark: #F0E6D2;
    --white: #FFFFFF;
    --text: #2a1810;
    --shadow: 0 12px 40px rgba(26, 15, 10, 0.15);
    --shadow-gold: 0 8px 32px rgba(212, 175, 55, 0.2);
    --radius: 14px;
    --font: 'Cairo', 'Tahoma', sans-serif;
    --font-calligraphy: 'Amiri', 'Scheherazade New', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--cream);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    position: relative;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; }

/* خلفية زخارف الخط العربي (ديواني) — مثل الصورة المرجعية */
.calligraphy-wallpaper {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.calligraphy-wallpaper::before {
    content: '';
    position: absolute;
    inset: -20% -10%;
    background-image: url('/images/calligraphy-bg.png');
    background-repeat: repeat;
    background-size: 420px auto;
    background-position: center top;
    opacity: 0.07;
    filter: sepia(0.25) saturate(0.85);
}

/* طبقة ذهبية خفيفة لدمج الزخرفة مع هوية الموقع */
.calligraphy-wallpaper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        165deg,
        rgba(249, 244, 237, 0.35) 0%,
        rgba(249, 244, 237, 0.15) 45%,
        rgba(212, 175, 55, 0.04) 100%
    );
    pointer-events: none;
}

@media (min-width: 1400px) {
    .calligraphy-wallpaper::before {
        background-size: 480px auto;
        opacity: 0.075;
    }
}

@media (max-width: 768px) {
    .calligraphy-wallpaper::before {
        background-size: 320px auto;
        opacity: 0.055;
    }
}

/* زخارف عربية */
.arabic-ornament {
    display: block;
    font-family: var(--font-calligraphy);
    font-size: 2rem;
    color: var(--gold);
    text-align: center;
    line-height: 1;
    text-shadow: 0 0 20px var(--gold-glow);
    margin-bottom: 0.5rem;
}

.arabic-ornament.small {
    display: inline;
    font-size: 1rem;
    margin: 0 0.5rem;
    vertical-align: middle;
}

.ornament-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem auto;
    max-width: 320px;
}

.ornament-divider .ornament-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    position: relative;
}

.ornament-divider .ornament-line::before {
    content: '◆';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.5rem;
    color: var(--gold);
    background: var(--cream);
    padding: 0 0.35rem;
}

.ornament-gem {
    color: var(--gold);
    font-size: 0.75rem;
    text-shadow: 0 0 8px var(--gold-glow);
}

.title-calligraphy {
    font-family: var(--font-calligraphy);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.title-calligraphy-alt {
    font-family: var(--font-calligraphy);
    font-weight: 400;
    font-style: italic;
}

.icon-gold { color: var(--gold); margin-left: 0.35rem; }

.glass-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: var(--shadow), var(--shadow-gold);
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header */
.site-header {
    background: linear-gradient(180deg, var(--brown-dark) 0%, rgba(26, 15, 10, 0.97) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid rgba(212, 175, 55, 0.35);
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.site-header.header-scrolled {
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.15);
    border-bottom-color: var(--gold);
}

.header-ornament {
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--gold-bright), var(--gold), transparent);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* شعار الموقع — موحد في كل الصفحات */
.site-logo {
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: contain;
    background: var(--brown-dark);
    box-shadow: 0 0 16px var(--gold-glow);
    display: block;
    flex-shrink: 0;
}

.site-logo--xs { width: 40px; height: 40px; }
.site-logo--sm { width: 54px; height: 54px; }
.site-logo--md { width: 80px; height: 80px; }
.site-logo--lg { width: 120px; height: 120px; }
.site-logo--xl { width: 100%; height: 100%; max-width: 170px; max-height: 170px; }

.brand-text {
    color: var(--gold-bright);
    font-family: var(--font-calligraphy);
    font-weight: 700;
    font-size: 1.15rem;
}

.main-nav {
    display: flex;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--gold-light);
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border-bottom: 2px solid transparent;
    transition: 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.main-nav a i {
    font-size: 0.85rem;
    color: var(--gold);
    opacity: 0.85;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.12);
    border-bottom-color: var(--gold);
}

.btn-admin {
    background: linear-gradient(135deg, var(--gold), #b8942a);
    color: var(--brown-dark);
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Hero — صفحة الرئيسية */
.hero {
    position: relative;
    min-height: clamp(420px, 55vh, 580px);
    display: flex;
    align-items: center;
    background-color: var(--brown);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.hero-home {
    background-image:
        linear-gradient(105deg, rgba(26, 15, 10, 0.72) 0%, rgba(26, 15, 10, 0.35) 45%, rgba(26, 15, 10, 0.25) 100%),
        var(--hero-bg, none);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 75% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 55%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 4.5rem 0;
    color: var(--white);
    max-width: 680px;
}

.hero-logo {
    margin-bottom: 1rem;
}

.hero-logo .site-logo {
    border-width: 3px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: var(--brown-dark);
    background: linear-gradient(135deg, rgba(250, 246, 239, 0.96), rgba(240, 230, 210, 0.92));
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: var(--shadow-gold);
}

.hero .slogan {
    font-size: 1.4rem;
    color: var(--gold-bright);
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero p {
    font-size: 1.05rem;
    opacity: 0.95;
    line-height: 1.9;
}

/* Search */
.search-section {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    margin-bottom: 3rem;
}

.search-box {
    border-radius: var(--radius);
    padding: 2rem;
}

.search-box h2 {
    color: var(--brown-dark);
    font-family: var(--font-calligraphy);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box > p {
    color: #666;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-form input {
    flex: 1;
    min-width: 200px;
    padding: 0.9rem 1.25rem;
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.search-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown));
    color: var(--gold-bright);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 0.9rem 1.75rem;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.25s;
    box-shadow: 0 4px 16px rgba(26, 15, 10, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brown), var(--brown-dark));
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--brown-dark);
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-family: var(--font);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: 0.25s;
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown));
    color: var(--gold-bright);
    border-color: var(--brown-dark);
}

/* Sections & cards */
.section { padding: 3.5rem 0; position: relative; z-index: 2; }

.section-title {
    text-align: center;
    color: var(--brown-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow), 0 12px 40px var(--gold-glow);
}

.icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--gold);
    border: 2px solid rgba(212, 175, 55, 0.45);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.1);
}

.feature-card h3 {
    color: var(--brown-dark);
    font-family: var(--font-calligraphy);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: #5c4a3a;
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
}

/* About banner */
.about-banner {
    background: linear-gradient(135deg, #E8D5A3 0%, #F5E6C8 40%, #FAF0DC 100%);
    padding: 3.5rem 0;
    border-top: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
    position: relative;
}

.about-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23D4AF37' stroke-opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
}

.about-banner-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.about-banner h2 {
    color: var(--brown-dark);
    font-size: 1.85rem;
}

.about-text { color: var(--text); }

.logo-circle {
    position: relative;
    width: 190px;
    height: 190px;
    border: 4px solid var(--gold);
    border-radius: 50%;
    padding: 10px;
    background: var(--white);
    box-shadow: var(--shadow-gold);
}

.logo-ring {
    position: absolute;
    inset: -8px;
    border: 2px dashed rgba(212, 175, 55, 0.5);
    border-radius: 50%;
    animation: spin-slow 40s linear infinite;
}

@keyframes spin-slow {
    to { transform: rotate(360deg); }
}

.logo-circle .site-logo {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    position: relative;
    z-index: 1;
    border-width: 3px;
}

/* هيدر الصفحات الداخلية — صورة بالعرض كامل */
.page-header {
    position: relative;
    color: var(--gold-light);
    padding: 0;
    text-align: center;
    overflow: hidden;
    min-height: clamp(180px, 22vw, 260px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--gold);
    background: var(--brown-dark);
}

.page-header-bg {
    position: absolute;
    inset: 0;
    background-image: var(--header-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: 0;
}

.page-header-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(26, 15, 10, 0.55) 0%,
        rgba(26, 15, 10, 0.65) 50%,
        rgba(26, 15, 10, 0.75) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.page-header-inner {
    position: relative;
    z-index: 2;
    padding: 2rem 1rem 2.25rem;
    width: 100%;
}

.page-header-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.page-header-logo .site-logo {
    border-width: 3px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.page-header .arabic-ornament {
    color: var(--gold-bright);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.page-header h1 {
    font-size: clamp(1.85rem, 4.5vw, 2.5rem);
    color: var(--gold-bright);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
    margin-bottom: 0.25rem;
}

.page-header .ornament-divider .ornament-line {
    background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

.page-header-subtitle {
    margin-top: 0.75rem;
    font-size: 1.05rem;
    color: rgba(232, 213, 163, 0.95);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.content-page { line-height: 1.9; }

/* Footer */
.site-footer {
    background: linear-gradient(180deg, var(--brown-dark) 0%, #120a06 100%);
    color: var(--gold-light);
    padding: 3rem 0 0;
    margin-top: 3rem;
    position: relative;
    z-index: 2;
}

.footer-ornament-top {
    height: 5px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--gold-bright), var(--gold), transparent);
}

.footer-brand {
    text-align: center;
}

.footer-logo-link {
    display: inline-block;
    margin-bottom: 1rem;
    transition: transform 0.25s;
}

.footer-logo-link:hover {
    transform: scale(1.05);
}

.footer-logo-link .site-logo {
    margin: 0 auto;
    border-width: 3px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding: 2.5rem 0 2rem;
}

.footer-grid h4 {
    color: var(--gold-bright);
    margin-bottom: 1rem;
    font-family: var(--font-calligraphy);
    font-size: 1.2rem;
}

.footer-slogan {
    font-family: var(--font-calligraphy);
    font-style: italic;
    opacity: 0.9;
}

.footer-grid ul { list-style: none; }

.footer-grid ul li { margin-bottom: 0.5rem; }

.footer-grid a:hover { color: var(--gold-bright); }

.contact-line {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.contact-line i {
    color: var(--gold);
    margin-top: 0.2rem;
    width: 1.1rem;
    text-align: center;
}

.footer-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    gap: 0.5rem;
}

.footer-stats .stat-item span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-stats .stat-item i { color: var(--gold); font-size: 0.85rem; }

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-links a {
    width: 42px;
    height: 42px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1rem;
    transition: 0.25s;
}

.social-links a:hover {
    background: linear-gradient(135deg, var(--gold), #b8942a);
    color: var(--brown-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--gold-glow);
}

.footer-bottom {
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    text-align: center;
    padding: 1.25rem;
    font-size: 0.9rem;
    color: rgba(232, 213, 163, 0.75);
}

/* News */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: 0.3s;
}

.news-card:hover {
    box-shadow: var(--shadow-gold);
    transform: translateY(-4px);
}

.news-card img { width: 100%; height: 180px; object-fit: cover; }

.news-card-body { padding: 1.25rem; }

.news-card h3 {
    color: var(--brown-dark);
    font-family: var(--font-calligraphy);
    margin-bottom: 0.5rem;
}

/* شجرة النسب — عقد وخطوط ربط */
.tree-page { padding: 2rem 0 4rem; }

.tree-toolbar {
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.tree-toolbar input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    font-family: var(--font);
}

.tree-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tree-zoom-controls #tree-zoom-level {
    min-width: 44px;
    text-align: center;
    font-weight: 700;
    color: var(--brown-dark);
}

.tree-chart-wrap {
    padding: 2rem 1rem 2.5rem;
    overflow-x: auto;
    overflow-y: visible;
}

.tree-chart {
    min-width: min-content;
    padding: 1rem 0.5rem 2rem;
}

.tree-loading,
.tree-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* هيكل الشجرة — خطوط ربط بين العقد */
.gt-tree,
.gt-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gt-tree {
    display: flex;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s ease;
}

.gt-children {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    padding-top: 2.25rem;
    position: relative;
}

/* خط عمودي من الأب إلى شريط الإخوة */
.gt-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 2.25rem;
    background: linear-gradient(180deg, var(--gold), var(--brown));
    transform: translateX(-50%);
}

.gt-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 2.25rem 0.85rem 0;
    transition: opacity 0.2s;
}

/* نصف الخط الأفقي — يمين */
.gt-children > .gt-branch::before {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 2.25rem;
    border-top: 2px solid var(--gold);
}

/* نصف الخط الأفقي — يسار + عمودي للعقدة */
.gt-children > .gt-branch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 2.25rem;
    border-top: 2px solid var(--gold);
    border-left: 2px solid var(--gold);
    border-radius: 0 0 0 4px;
}

.gt-children > .gt-branch:only-child {
    padding-top: 0;
}

.gt-children > .gt-branch:only-child::before,
.gt-children > .gt-branch:only-child::after {
    display: none;
}

/* العقدة */
.gt-node-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 130px;
    max-width: 180px;
    padding: 0.85rem 1rem 0.75rem;
    background: linear-gradient(180deg, #fff 0%, #faf6f0 100%);
    border: 2px solid var(--gold);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
    box-shadow: 0 4px 14px rgba(44, 24, 16, 0.08);
}

.gt-node-card.is-branch {
    border-width: 3px;
    border-color: var(--brown-dark);
    background: linear-gradient(180deg, #fff9e8 0%, #f5e6c8 100%);
}

.gt-node-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--gold-glow);
}

.gt-node-card.is-active {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown));
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: 0 8px 28px rgba(212, 175, 55, 0.45);
}

.gt-node-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--brown-dark);
    margin-bottom: 0.15rem;
}

.gt-node-card.is-active .gt-node-dot {
    background: var(--gold-bright);
    border-color: #fff;
}

.gt-node-name {
    font-family: var(--font-calligraphy);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.gt-node-meta,
.gt-node-year {
    font-size: 0.78rem;
    opacity: 0.85;
    text-align: center;
}

.gt-branch.search-dim {
    opacity: 0.25;
}

.gt-branch.search-match .gt-node-card {
    box-shadow: 0 0 0 3px var(--gold-bright);
}

.member-detail-panel {
    background: linear-gradient(135deg, var(--cream), var(--cream-dark));
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: none;
}

.member-detail-panel.show { display: block; }

.member-detail-panel h3 { font-family: var(--font-calligraphy); color: var(--brown-dark); }

/* Search filters */
.search-filters-panel h2 {
    font-family: var(--font-calligraphy);
    margin-bottom: 1rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filters-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--brown-dark);
}

.filters-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.results-count {
    margin-bottom: 1rem;
    color: var(--brown);
    font-weight: 600;
}

.badge-branch {
    display: inline-block;
    background: var(--gold);
    color: var(--brown-dark);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    margin-right: 0.5rem;
    font-family: var(--font);
}

.search-hint, .no-results {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* Search results */
.search-results .result-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-right: 4px solid var(--gold);
    transition: 0.2s;
}

.search-results .result-item:hover {
    box-shadow: var(--shadow-gold);
}

.search-results .lineage { color: #666; font-size: 0.9rem; margin-top: 0.5rem; }

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-info { padding: 2rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--brown-dark);
}

.form-group label i { color: var(--gold); }

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    font-family: var(--font);
    background: rgba(255, 255, 255, 0.95);
}

.form-group textarea { min-height: 140px; resize: vertical; }

.form-error { color: #c0392b; font-size: 0.85rem; }

.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; }

.documents-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.documents-filter a {
    padding: 0.5rem 1.1rem;
    border-radius: 24px;
    border: 2px solid var(--gold);
    color: var(--brown-dark);
    transition: 0.2s;
}

.documents-filter a.active,
.documents-filter a:hover {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown));
    color: var(--gold-bright);
    border-color: var(--brown-dark);
}

.document-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.pagination { margin-top: 2rem; text-align: center; }

.pagination a, .pagination span {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    margin: 0 0.15rem;
    border-radius: 8px;
}

.pagination .active {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown));
    color: var(--gold-bright);
}

/* Mobile nav */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 15, 10, 0.97);
    z-index: 2000;
    padding: 3rem 2rem 2rem;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav.open { display: flex; }

.mobile-nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold-bright) !important;
    font-family: var(--font-calligraphy);
    font-size: 1.1rem;
    font-weight: 700;
}

.mobile-nav-brand:hover {
    background: transparent !important;
}

.mobile-nav a {
    color: var(--gold-light);
    font-size: 1.15rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 10px;
}

.mobile-nav a:hover { background: rgba(212, 175, 55, 0.15); }

.mobile-nav a i { color: var(--gold); width: 1.25rem; }

.mobile-nav-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    color: var(--gold);
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

@media (max-width: 992px) {
    .main-nav { display: none; }
    .nav-toggle { display: block; }
}

@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
    .about-banner-inner { grid-template-columns: 1fr; text-align: center; }
    .logo-circle { margin: 0 auto; }
    .gt-node-card { min-width: 110px; max-width: 150px; padding: 0.65rem 0.75rem; }
    .gt-node-name { font-size: 1rem; }
    .gt-branch { padding-left: 0.5rem; padding-right: 0.5rem; }
    .tree-chart-wrap { padding: 1rem 0.25rem; }
}
