/* =========================================================
   THE WOUNDED LEGACY
   GENEALOGIA PÚBLICA INDIVIDUAL
   Inspirada em um registro heráldico medieval.
========================================================= */

:root {
    --gene-dark: #1F2032;
    --gene-dark-2: #181927;
    --gene-panel: #26273B;
    --gene-gold: #B29758;
    --gene-gold-2: #C7A866;
    --gene-cream: #E8E2D5;
    --gene-text: #CBC6BD;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(178,151,88,.045),
            transparent 30%
        ),
        #181927;
    color: var(--gene-text);
    font-family: 'Poppins', sans-serif;
}

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


/* PAGE */

.genealogy-page {
    width:
        min(
            1460px,
            calc(100% - 44px)
        );
    margin: 0 auto;
    padding: 28px 0 70px;
}

.genealogy-back-row {
    margin-bottom: 15px;
}

.genealogy-back-row a {
    color:
        rgba(178,151,88,.7);
    font-family: 'Cinzel', serif;
    font-size: 8px;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.genealogy-back-row a:hover {
    color: var(--gene-gold);
}

.genealogy-board {
    position: relative;
    padding: 26px;
    overflow: hidden;
    border:
        1px solid
        rgba(178,151,88,.48);
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(178,151,88,.045),
            transparent 26%
        ),
        linear-gradient(
            180deg,
            #1F2032,
            #181927
        );
    box-shadow:
        0 0 0 7px #181927,
        0 0 0 8px rgba(178,151,88,.18),
        0 26px 70px rgba(0,0,0,.28);
}

.genealogy-board::before {
    content: '';
    position: absolute;
    inset: 8px;
    pointer-events: none;
    border:
        1px solid
        rgba(178,151,88,.08);
}


/* HOUSE HEADER */

.house-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 9px 0 23px;
}

.ornamental-line {
    width:
        min(
            720px,
            78%
        );
    margin: 0 auto 12px;
    display: grid;
    grid-template-columns:
        minmax(0,1fr)
        auto
        minmax(0,1fr);
    align-items: center;
    gap: 14px;
}

.ornamental-line span {
    height: 1px;
    background:
        linear-gradient(
            to right,
            transparent,
            rgba(178,151,88,.72)
        );
}

.ornamental-line span:last-child {
    background:
        linear-gradient(
            to left,
            transparent,
            rgba(178,151,88,.72)
        );
}

.ornamental-line b {
    color: var(--gene-gold);
    font-size: 13px;
}

.ornamental-line-bottom {
    margin-top: 13px;
    margin-bottom: 0;
}

.house-kicker {
    display: block;
    margin-bottom: 4px;
    color:
        rgba(178,151,88,.62);
    font-family: 'Cinzel', serif;
    font-size: 7px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.house-header h1 {
    margin: 0;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size:
        clamp(
            38px,
            4vw,
            62px
        );
    line-height: 1.03;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.house-motto {
    margin-top: 8px;
    color:
        rgba(232,226,213,.82);
    font-family: 'Cinzel', serif;
    font-size: 15px;
    font-style: italic;
    letter-spacing: 1.1px;
}


/* INFO BAND */

.house-info-band {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns:
        .72fr
        .72fr
        1fr
        1.55fr
        1fr;
    border:
        1px solid
        rgba(178,151,88,.42);
}

.house-info-cell {
    min-width: 0;
    min-height: 165px;
    padding: 20px 18px;
    text-align: center;
}

.house-info-cell + .house-info-cell {
    border-left:
        1px solid
        rgba(178,151,88,.35);
}

.house-info-title {
    display: block;
    margin-bottom: 8px;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.house-info-cell p {
    margin: 0;
    color:
        rgba(203,198,189,.76);
    font-family: Georgia, serif;
    font-size: 13px;
    line-height: 1.55;
    font-style: italic;
}

.house-info-cell p strong {
    color: var(--gene-cream);
    font-family: 'Cinzel', serif;
    font-style: normal;
    font-weight: 500;
}

.house-info-cell small {
    display: block;
    margin-top: 8px;
    color:
        rgba(203,198,189,.52);
    font-size: 8px;
}


.house-info-fact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.house-info-fact p {
    font-style: normal;
}

.house-info-fact p strong {
    line-height: 1.45;
}

.house-info-about p {
    text-align: justify;
    text-align-last: left;
}

.house-info-symbol {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.house-info-symbol img {
    max-width: 86px;
    max-height: 86px;
    object-fit: contain;
}

.coat-placeholder {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border:
        1px solid
        rgba(178,151,88,.28);
    color:
        rgba(178,151,88,.5);
    font-family: 'Cinzel Decorative', serif;
    font-size: 30px;
}


/* LINEAGE COMMON */

.lineage-section,
.side-lineages,
.genealogy-notes {
    position: relative;
    z-index: 1;
}

.lineage-heading {
    width:
        min(
            900px,
            90%
        );
    margin: 25px auto 24px;
    display: grid;
    grid-template-columns:
        minmax(30px,1fr)
        auto
        minmax(30px,1fr);
    align-items: center;
    gap: 18px;
}

.lineage-heading span {
    height: 1px;
    background:
        linear-gradient(
            to right,
            transparent,
            rgba(178,151,88,.76)
        );
}

.lineage-heading span:last-child {
    background:
        linear-gradient(
            to left,
            transparent,
            rgba(178,151,88,.76)
        );
}

.lineage-heading h2 {
    margin: 0;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* PRIMARY */

.primary-couple {
    width:
        min(
            760px,
            100%
        );
    margin: 0 auto;
    display: grid;
    grid-template-columns:
        minmax(0,1fr)
        60px
        minmax(0,1fr);
    align-items: center;
}

.primary-couple::before {
    content: '';
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 1px;
    background:
        rgba(178,151,88,.54);
}

.primary-couple > :first-child {
    grid-column: 1;
    grid-row: 1;
}

.primary-couple > :last-child {
    grid-column: 3;
    grid-row: 1;
}

.tree-person-card {
    min-width: 0;
    position: relative;
    padding: 13px 16px;
    text-align: center;
    border:
        1px solid
        rgba(178,151,88,.48);
    background:
        linear-gradient(
            180deg,
            rgba(178,151,88,.05),
            rgba(178,151,88,.015)
        );
    transition:
        border-color .2s ease,
        transform .2s ease,
        background .2s ease;
}

a.tree-person-card:hover {
    transform: translateY(-2px);
    border-color:
        rgba(178,151,88,.78);
    background:
        rgba(178,151,88,.075);
}

.tree-person-card::before {
    content: '';
    position: absolute;
    inset: 4px;
    pointer-events: none;
    border:
        1px solid
        rgba(178,151,88,.07);
}

.tree-person-role {
    margin-bottom: 5px;
    color:
        rgba(178,151,88,.64);
    font-family: 'Cinzel', serif;
    font-size: 7px;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.tree-person-name {
    color: var(--gene-cream);
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 500;
}

.tree-person-meta {
    margin-top: 5px;
    color:
        rgba(203,198,189,.56);
    font-size: 7.5px;
    letter-spacing: .25px;
    text-transform: uppercase;
}

.main-person {
    min-height: 94px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tree-person-card.vacant {
    border-style: dashed;
    opacity: .6;
}

.tree-person-card.vacant .tree-person-name {
    color:
        rgba(178,151,88,.72);
    font-style: italic;
}

.tree-drop-line {
    width: 1px;
    height: 40px;
    margin: 0 auto;
    background:
        rgba(178,151,88,.48);
}

.children-heading {
    width:
        min(
            920px,
            90%
        );
    margin: 0 auto 14px;
    display: grid;
    grid-template-columns:
        minmax(30px,1fr)
        auto
        minmax(30px,1fr);
    align-items: center;
    gap: 12px;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.children-heading span {
    height: 1px;
    background:
        rgba(178,151,88,.28);
}

.primary-children {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(150px,1fr)
        );
    gap: 9px;
}

.child-person {
    min-height: 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.child-person .tree-person-name {
    font-size: 9px;
}

.child-person .tree-person-meta {
    font-size: 6.7px;
}

.branch-empty {
    padding: 18px;
    text-align: center;
    border:
        1px dashed
        rgba(178,151,88,.13);
    color:
        rgba(203,198,189,.42);
    font-size: 8px;
}


/* SIDE BRANCHES */

.side-lineages {
    margin-top: 26px;
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0,1fr)
        );
    border:
        1px solid
        rgba(178,151,88,.38);
}

.side-lineage {
    min-width: 0;
    padding: 21px;
}

.side-lineage + .side-lineage {
    border-left:
        1px solid
        rgba(178,151,88,.34);
}

.side-lineage-heading {
    display: grid;
    grid-template-columns:
        minmax(20px,1fr)
        auto
        minmax(20px,1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 19px;
    text-align: center;
}

.side-lineage-heading > span {
    height: 1px;
    background:
        rgba(178,151,88,.42);
}

.side-lineage-heading h3 {
    margin: 0;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 500;
    text-transform: uppercase;
}

.side-lineage-heading small {
    display: block;
    margin-top: 4px;
    color:
        rgba(203,198,189,.54);
    font-family: 'Cinzel', serif;
    font-size: 7px;
    text-transform: uppercase;
}

.side-couple {
    display: grid;
    grid-template-columns:
        minmax(0,1fr)
        34px
        minmax(0,1fr);
    align-items: center;
}

.side-couple::before {
    content: '';
    grid-column: 2;
    grid-row: 1;
    height: 1px;
    background:
        rgba(178,151,88,.42);
}

.side-couple > :first-child {
    grid-column: 1;
    grid-row: 1;
}

.side-couple > :last-child {
    grid-column: 3;
    grid-row: 1;
}

.side-person {
    min-height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.side-person .tree-person-name {
    font-size: 9.5px;
}

.side-children-heading {
    margin: 18px 0 10px;
    text-align: center;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 8px;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.side-children {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(120px,1fr)
        );
    gap: 7px;
}


/* NOTES */

.genealogy-notes {
    margin-top: 25px;
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0,1fr)
        );
    gap: 18px;
}

.genealogy-notes > div {
    min-height: 160px;
    padding: 21px 28px;
    border:
        1px solid
        rgba(178,151,88,.36);
}

.notes-heading {
    display: grid;
    grid-template-columns:
        minmax(20px,1fr)
        auto
        minmax(20px,1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 11px;
    text-transform: uppercase;
}

.notes-heading span {
    height: 1px;
    background:
        rgba(178,151,88,.38);
}

.genealogy-notes p {
    margin: 0;
    color:
        rgba(203,198,189,.69);
    font-family: Georgia, serif;
    font-size: 12px;
    line-height: 1.65;
    font-style: italic;
}


/* NOT FOUND */

.genealogy-not-found {
    padding: 80px 30px;
    text-align: center;
    border:
        1px solid
        rgba(178,151,88,.16);
    background:
        rgba(13,17,30,.5);
}

.genealogy-not-found > span {
    color:
        rgba(178,151,88,.6);
    font-size: 24px;
}

.genealogy-not-found h1 {
    margin: 10px 0;
    color: var(--gene-cream);
    font-family: 'Cinzel', serif;
    font-size: 29px;
}

.genealogy-not-found p {
    color:
        rgba(203,198,189,.58);
    font-size: 9px;
}

.genealogy-not-found a {
    margin-top: 18px;
    display: inline-flex;
    padding: 10px 15px;
    border:
        1px solid
        rgba(178,151,88,.28);
    color: var(--gene-gold);
    font-family: 'Cinzel', serif;
    font-size: 7.5px;
    text-transform: uppercase;
}


/* RESPONSIVE */

@media (max-width: 1200px) {

    .house-info-band {
        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            );
    }

    .house-info-cell {
        border-top:
            1px solid
            rgba(178,151,88,.20);
    }

    .house-info-cell + .house-info-cell {
        border-left:
            1px solid
            rgba(178,151,88,.28);
    }

    .house-info-cell:nth-child(odd) {
        border-left: 0;
    }

    .house-info-symbol,
    .house-info-responsible {
        grid-column: span 1;
    }

    .house-info-about {
        grid-column: span 2;
    }

}


@media (max-width: 1000px) {

    .house-info-band {
        grid-template-columns: 1fr;
    }

    .house-info-cell,
    .house-info-cell + .house-info-cell,
    .house-info-cell:nth-child(odd) {
        border-left: 0;
        border-top:
            1px solid
            rgba(178,151,88,.28);
    }

    .house-info-about {
        grid-column: auto;
    }

    .side-lineages {
        grid-template-columns: 1fr;
    }

    .side-lineage + .side-lineage {
        border-left: 0;
        border-top:
            1px solid
            rgba(178,151,88,.34);
    }

}

@media (max-width: 720px) {

    .genealogy-page {
        width:
            calc(100% - 24px);
        padding-top: 18px;
    }

    .genealogy-board {
        padding: 16px;
    }

    .primary-couple,
    .side-couple {
        grid-template-columns: 1fr;
    }

    .primary-couple::before,
    .side-couple::before {
        grid-column: 1;
        grid-row: 2;
        width: 1px;
        height: 20px;
        margin: 0 auto;
    }

    .primary-couple > :first-child,
    .side-couple > :first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .primary-couple > :last-child,
    .side-couple > :last-child {
        grid-column: 1;
        grid-row: 3;
    }

    .genealogy-notes {
        grid-template-columns: 1fr;
    }

    .house-header h1 {
        font-size:
            clamp(
                31px,
                10vw,
                44px
            );
    }

}

@media (max-width: 460px) {

    .genealogy-board {
        padding: 12px;
    }

    .lineage-heading h2 {
        font-size: 17px;
    }

    .house-motto {
        font-size: 11px;
    }

    .primary-children,
    .side-children {
        grid-template-columns: 1fr;
    }

}


/* FULL HD */

@media
(min-width: 1600px)
and (min-height: 900px)
and (max-height: 1200px) {

    .genealogy-page {
        width:
            min(
                1530px,
                calc(100% - 64px)
            );
    }

    .genealogy-board {
        padding: 30px;
    }

    .house-header h1 {
        font-size: 64px;
    }

}


/* =========================================================
   CORREÇÃO FINAL — PALETA AZUL TWL
   Mantido por último para vencer regras anteriores.
========================================================= */

html,
body {
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(178,151,88,.035),
            transparent 30%
        ),
        #181927 !important;
}

.site-main {
    background:
        #181927 !important;
}

.genealogy-page {
    background:
        transparent !important;
}

.genealogy-board {
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(178,151,88,.035),
            transparent 27%
        ),
        linear-gradient(
            180deg,
            #1F2032 0%,
            #181927 100%
        ) !important;

    box-shadow:
        0 0 0 7px #181927,
        0 0 0 8px rgba(178,151,88,.18),
        0 26px 70px rgba(0,0,0,.28) !important;
}

.house-info-band,
.lineage-section,
.side-lineages,
.genealogy-notes {
    background:
        transparent !important;
}

.tree-person-card {
    background:
        linear-gradient(
            180deg,
            rgba(38,39,59,.88),
            rgba(31,32,50,.88)
        ) !important;
}

.house-info-cell,
.side-lineage,
.genealogy-notes > div {
    background:
        rgba(31,32,50,.18) !important;
}


/* =========================================================
   AJUSTES — INFORMAÇÕES DA CASA
========================================================= */

.house-info-band {
    align-items: stretch;
}

.house-info-cell {
    min-height: 165px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.house-info-title {
    display: block;
    min-height: 18px;
    margin-bottom: 10px;
    color: var(--gene-gold-2);
    font-family: 'Cinzel', serif;
    font-size: 9px;
    line-height: 1.35;
    letter-spacing: .75px;
    text-transform: uppercase;
}

.house-info-cell p,
.house-info-cell p strong {
    margin: 0;
    color: rgba(232,226,213,.82);
    font-family: Georgia, serif;
    font-size: 11px;
    line-height: 1.55;
    font-style: normal;
    font-weight: 400;
}

.house-info-cell small {
    margin-top: 7px;
    color: rgba(203,198,189,.52);
    font-family: 'Poppins', sans-serif;
    font-size: 7px;
    line-height: 1.4;
}

.house-info-about p {
    width: 100%;
    text-align: center;
    text-align-last: center;
}


/* =========================================================
   UMA ÚNICA LINHAGEM COLATERAL
========================================================= */

.side-lineages.single-lineage {
    grid-template-columns:
        minmax(
            0,
            760px
        );
    justify-content: center;
}

.side-lineages.single-lineage .side-lineage {
    width: 100%;
}

.side-lineages.single-lineage .side-lineage + .side-lineage {
    border-left: 0;
}


/* =========================================================
   APENAS UM RETÂNGULO DE INFORMAÇÕES
========================================================= */

.genealogy-notes {
    grid-template-columns: 1fr;
}

.genealogy-notes > div {
    width: 100%;
}


/* =========================================================
   IDADE NOS CARDS
========================================================= */

.tree-person-name {
    line-height: 1.45;
}


/* =========================================================
   OUTROS INTEGRANTES DA FAMÍLIA
   Usa exatamente a tipografia dos cartões da árvore.
========================================================= */

.other-family-public {
    margin-top: 28px;
    padding: 26px 22px 24px;
    border: 1px solid rgba(178,151,88,.16);
    background: rgba(31,32,50,.14);
}

.other-family-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

/*
 * Os cartões recebem também .tree-person-card e .side-person
 * no HTML. Portanto nome, função, meta, alinhamento e tamanho
 * seguem as mesmas regras das demais linhagens.
 */
.other-family-card {
    min-width: 0;
    text-decoration: none;
}

.other-family-role,
.other-family-name,
.other-family-meta {
    font-family: inherit;
}

@media (max-width: 900px) {
    .other-family-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .other-family-grid {
        grid-template-columns: 1fr;
    }

    .other-family-public {
        padding: 20px 14px;
    }
}




/* CENTRALIZAÇÃO FORÇADA — INFORMAÇÕES DA CASA */
section.genealogy-notes {
  width:min(900px,100%) !important;
  max-width:900px !important;
  margin:25px auto 0 !important;
  display:block !important;
  grid-template-columns:none !important;
}
section.genealogy-notes > div {
  width:100% !important; max-width:none !important; margin:0 !important; min-height:150px;
}
section.genealogy-notes p { text-align:center; }

/* =========================================================
   V7 — OUTROS INTEGRANTES EM GRADE
   Máximo de 3 cartões por linha.
========================================================= */
.other-family-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

.other-family-grid > .other-family-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

@media (max-width: 900px) {
    .other-family-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .other-family-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
