/* Organichart public pages */
.organichart-page {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

.organichart-page__container {
    max-width: min(72rem, 100%);
}

.organichart-page__header {
    margin-bottom: 2rem;
    text-align: center;
}

.organichart-page__title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.organichart-page__body {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    line-height: 1.65;
}

.organichart-page__intro {
    margin: 0 0 1.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
}

.organichart-page__intro strong {
    font-weight: 700;
}

/* Pasted organichart / committees tables (Word/Excel export) */
.organichart-page__body figure.table {
    margin: 0 0 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1.15rem 1.15rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.organichart-page__body figure.table table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    color: #1e2d3d;
    font-size: 0.875rem;
    line-height: 1.45;
}

.organichart-page__body figure.table td,
.organichart-page__body figure.table th {
    border: none !important;
    padding: 0.45rem 0.65rem !important;
    vertical-align: top !important;
    height: auto !important;
    min-height: 0 !important;
    white-space: normal !important;
}

.organichart-page__body figure.table td:empty,
.organichart-page__body figure.table th:empty {
    padding: 0 !important;
}

/* Legacy pasted tables: drop leading spacer columns (not structured .organichart-table) */
.organichart-page__body figure.table:not(.organichart-table):first-of-type td:nth-child(1),
.organichart-page__body figure.table:not(.organichart-table):first-of-type td:nth-child(2) {
    display: none;
}

.organichart-page__body figure.table:not(.organichart-table) td:nth-child(1) {
    display: none;
}

/* Grey header cells (Name / Tasks / BOD) */
.organichart-page__body figure.table td[style*="background-color:#a6a6a6"],
.organichart-page__body figure.table td[style*="background-color: #a6a6a6"] {
    background-color: #a6a6a6 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.organichart-page__body figure.table td[style*="background-color:#a6a6a6"] span,
.organichart-page__body figure.table td[style*="background-color: #a6a6a6"] span {
    color: #ffffff !important;
}

/* Section separator rows */
.organichart-page__body figure.table td[style*="background-color:#f2f2f2"],
.organichart-page__body figure.table td[style*="background-color: #f2f2f2"] {
    background-color: #f2f2f2 !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    line-height: 1;
}

/* Gold role / section titles */
.organichart-page__body figure.table [style*="color:#f1c40f"],
.organichart-page__body figure.table [style*="color: #f1c40f"] {
    color: #b8860b !important;
}

.organichart-page__body figure.table h4,
.organichart-page__body figure.table h5 {
    margin: 0;
    color: inherit;
    font-weight: 700;
    line-height: 1.35;
}

.organichart-page__body figure.table h4 {
    font-size: 1.05rem;
}

.organichart-page__body figure.table h5 {
    font-size: 0.9rem;
}

.organichart-page__body figure.table strong {
    font-weight: 700;
    color: #152542;
}

.organichart-page__body figure.table i,
.organichart-page__body figure.table em {
    font-style: italic;
    color: #64748b;
}

.organichart-page__body figure.table p {
    margin: 0;
}

.organichart-page__body > p:empty,
.organichart-page__body figure.table + p:empty {
    display: none;
}

/* Structured two-column tables (International Judges, etc.) */
.organichart-page__body figure.table.organichart-table {
    width: 100% !important;
    max-width: 100%;
}

.organichart-page__body figure.table.organichart-table table {
    min-width: 0;
    table-layout: fixed;
}

.organichart-table__caption {
    caption-side: top;
    padding: 0 0 0.85rem;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 700;
    color: #b8860b;
    line-height: 1.35;
}

.organichart-table__period {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    text-transform: none;
    letter-spacing: normal;
}

.organichart-table thead th {
    background-color: #a6a6a6 !important;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.65rem 0.85rem !important;
    border: none !important;
}

.organichart-table tbody td {
    padding: 0.55rem 0.85rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: top !important;
}

.organichart-table tbody tr:last-child td {
    border-bottom: none !important;
}

.organichart-table tbody tr:nth-child(even):not(.organichart-table__sep):not(.organichart-table__section) {
    background-color: #f8fafc;
}

.organichart-table tbody tr:hover:not(.organichart-table__sep):not(.organichart-table__section) {
    background-color: #f1f5f9;
}

.organichart-table td strong {
    color: #152542;
    font-weight: 700;
}

.organichart-table tbody em {
    font-style: italic;
    color: #64748b;
    font-weight: 400;
}

.organichart-table__sep td {
    background-color: #f2f2f2 !important;
    padding: 0.35rem 0 !important;
    border-bottom: none !important;
    line-height: 1;
}

.organichart-table__section td {
    background-color: transparent !important;
    border-bottom: none !important;
    padding-top: 1rem !important;
    padding-bottom: 0.35rem !important;
    font-size: 1.05rem;
    font-weight: 700;
    color: #b8860b;
}

.organichart-table--committees table {
    table-layout: auto;
}

.organichart-table--committees td:nth-child(1) {
    width: 9%;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.organichart-table--committees td:nth-child(2) {
    width: 28%;
    font-size: 0.8125rem;
}

.organichart-table--committees tr.organichart-table__lead td:nth-child(2) {
    color: #b8860b;
    font-weight: 600;
}

.organichart-table--committees td:nth-child(3) {
    width: 18%;
}

.organichart-table--committees td:nth-child(4) {
    width: 28%;
    font-size: 0.8125rem;
    color: #475569;
}

.organichart-table--committees td:nth-child(5) {
    width: 17%;
    font-size: 0.8125rem;
}

.organichart-table--judges td:first-child {
    width: 38%;
    color: #475569;
    font-size: 0.8125rem;
}

.organichart-table--judges td:last-child {
    width: 62%;
}

.organichart-table--ambassadors td:first-child {
    width: 42%;
    color: #475569;
    font-size: 0.8125rem;
}

.organichart-table--ambassadors td:last-child {
    width: 58%;
}

@media (max-width: 767.98px) {
    .organichart-page__body figure.table {
        padding: 0.75rem 0.65rem;
        border-radius: 8px;
    }

    .organichart-page__body figure.table table {
        min-width: 32rem;
        font-size: 0.8125rem;
    }

    .organichart-page__body figure.table.organichart-table table {
        min-width: 0;
    }

    .organichart-table--judges td:first-child,
    .organichart-table--judges td:last-child,
    .organichart-table--ambassadors td:first-child,
    .organichart-table--ambassadors td:last-child,
    .organichart-table--committees td:nth-child(1),
    .organichart-table--committees td:nth-child(2),
    .organichart-table--committees td:nth-child(3),
    .organichart-table--committees td:nth-child(4),
    .organichart-table--committees td:nth-child(5) {
        width: auto;
    }
}
