/* =====================================================
   CODEX SECTION
   Usa las variables y reglas globales del stylesheet base
===================================================== */

/* =========================
   LAYOUT
========================= */

.codex-layout {
    display: grid;
    grid-template-columns: 280px 1fr;

    background: var(--color-white);
    border: 1px solid #d7e2ee;
    border-radius: 10px;
    box-shadow: 0 8px 35px rgba(0, 20, 40, .08);

    overflow: visible;
}

/* =========================
   SIDEBAR / INDEX
========================= */

.matter-index {
    position: sticky;
    top: 2rem;

    align-self: start;
    height: fit-content;

    display: flex;
    flex-direction: column;
    gap: .2rem;

    padding: 1.25rem 0;

    background: #eef3fb;
    border-right: 1px solid #d7e2ee;
}

.index-item {
    width: 100%;
    padding: .95rem 1.8rem;

    border: none;
    background: transparent;

    text-align: left;
    font-size: .95rem;
    font-weight: 500;
    color: var(--color-text);

    cursor: pointer;

    transition:
        background-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.index-item:hover {
    background: rgba(30, 111, 159, .06);
    color: var(--color-primary);
    transform: translateX(2px);
}

.index-item:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: -2px;
}

.index-item.active-item {
    background: rgba(30, 111, 159, .12);
    color: var(--color-primary);
    font-weight: 600;

    border-left: 3px solid var(--color-secondary);
    padding-left: calc(1.8rem - 3px);
}

/* =========================
   CONTENT
========================= */

.content-panel {
    padding: 3rem;
}

.matter-content {
    width: 100%;
}

/* =========================
   TITLES
========================= */

.matter-title,
.mobile-matter-title {
    position: relative;
    display: inline-block;

    margin-bottom: .8rem;
    color: var(--color-primary);
}


/* =========================
   SUBTITLE
========================= */

.matter-subtitle,
.mobile-matter-subtitle {
    margin: 1rem 0 1.5rem;

    font-style: italic;
    color: #4a6d8a;
}

/* =========================
   DESCRIPTION
========================= */

.matter-description,
.mobile-matter-description {
    color: var(--color-text);
}

.matter-description {
    margin-bottom: 2rem;
}

.mobile-matter-description {
    margin-bottom: 1.5rem;
}

.matter-description::first-letter {
    font-family: "Baskerville Old Face",serif;

    float: left;

    padding-right: .45rem;
    padding-top: .15rem;

    font-size: 3.8rem;
    line-height: .75;
    font-weight: 600;

    color: var(--color-secondary);
}

/* =========================
   TAGS
========================= */

.competency-row,
.mobile-competency-row {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.competency-tag,
.mobile-competency-tag {
    padding: .6rem 1rem;

    background: #eef3fb;
    border-left: 3px solid #9fbfd8;

    font-size: .84rem;
    color: var(--color-text);

    transition:
        background-color .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.competency-tag:hover {
    background: #dce8f2;
    border-left-color: var(--color-secondary);
    transform: translateX(2px);
}

/* =========================
   MOBILE
========================= */

.mobile-sections {
    display: none;
}

@media (max-width: 800px) {

    .codex-layout {
        display: none;
    }

    .mobile-sections {
        display: flex;
        flex-direction: column;
    }

    .mobile-matter-section {
        padding: 2rem 1.4rem;

        background: var(--color-white);
        border-bottom: 1px solid #d7e2ee;
    }

    .mobile-matter-section:first-child {
        border-radius: 10px 10px 0 0;
    }

    .mobile-matter-section:last-child {
        border-radius: 0 0 10px 10px;
        border-bottom: none;
    }
}