/* =========================================================
   main1.css
   Сітка з 3 колонками (Grid)
   Ліва ~18% | Центр ~64% | Права ~18%
   Якщо лівої/правої немає — центр забирає їх ширину
   Класи з префіксом pl3- (не конфліктують з main.css)
   Адаптив: breakpoint 992px
   ========================================================= */

/* ---------- Змінні ---------- */
:root {
    --pl3-max-width:   1200px;
    --pl3-gap:         14px;
    --pl3-padding-x:   20px;
    --pl3-side-bg:     #f8f9fa;    /* світло-сірий, як у хедера */
    --pl3-side-border: #dee2e6;
    --pl3-list-line:   #a9a9a9;
}

/* ---------- Зовнішній контейнер ---------- */
.pl3-layout {
    width: 100%;
    padding: 20px 0 40px;
}

/* Внутрішня сітка: 3 колонки за замовчуванням */
.pl3-inner {
    max-width: var(--pl3-max-width);
    margin: 0 auto;
    padding: 0 var(--pl3-padding-x);

    display: grid;
    /* 18% | решта | 18% */
    grid-template-columns: minmax(160px, 18%) minmax(0, 1fr) minmax(160px, 18%);
    gap: var(--pl3-gap);
    align-items: start;
}

/* Немає лівої колонки → центр + права */
.pl3-inner--no-left {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 18%);
}

/* Немає правої колонки → ліва + центр */
.pl3-inner--no-right {
    grid-template-columns: minmax(160px, 18%) minmax(0, 1fr);
}

/* Немає обох бічних → центр на всю ширину */
.pl3-inner--full {
    grid-template-columns: 1fr;
}

/* ---------- Ліва колонка ---------- */
.pl3-left {
    min-width: 0;
    background-color: var(--pl3-side-bg);
    border: 1px solid var(--pl3-side-border);
    border-radius: 6px;
    padding: 16px;
}

/* ---------- Центр ---------- */
.pl3-center {
    min-width: 0;
}

/* ---------- Права колонка ---------- */
.pl3-right {
    min-width: 0;
    background-color: var(--pl3-side-bg);
    border: 1px solid var(--pl3-side-border);
    border-radius: 6px;
    padding: 16px;
}

/* Базові відступи всередині бічних колонок */
.pl3-left > *:first-child,
.pl3-right > *:first-child {
    margin-top: 0;
}

.pl3-left > *:last-child,
.pl3-right > *:last-child {
    margin-bottom: 0;
}

/* ---------- Списки в бічних колонках ---------- */
.pl3-left ul,
.pl3-right ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    border-bottom: 1.5px solid var(--pl3-list-line);
}

.pl3-left li,
.pl3-right li {
    display: block;
    margin: 0 5px;
    line-height: 1.4;
}

.pl3-left li:first-child,
.pl3-right li:first-child {
    font-weight: bold;
    margin-bottom: 5px;
}

.pl3-left li:last-child,
.pl3-right li:last-child {
    margin-bottom: 5px;
}

.pl3-left ul:last-child,
.pl3-right ul:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.pl3-left ul a,
.pl3-right ul a {
    color: #343a40;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pl3-left ul a:hover,
.pl3-left ul a:focus-visible,
.pl3-right ul a:hover,
.pl3-right ul a:focus-visible {
    color: #0d6efd;
    text-decoration: none;
}

/* =========================================================
   Адаптивність (breakpoint 992px)
   Порядок: центр → ліва → права (під контентом)
   ========================================================= */
@media (max-width: 992px) {

    .pl3-layout {
        padding: 16px 0 32px;
    }

    .pl3-inner,
    .pl3-inner--no-left,
    .pl3-inner--no-right,
    .pl3-inner--full {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }

    .pl3-center {
        order: 1;
    }

    .pl3-left {
        order: 2;
        padding: 14px;
    }

    .pl3-right {
        order: 3;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .pl3-inner,
    .pl3-inner--no-left,
    .pl3-inner--no-right,
    .pl3-inner--full {
        padding: 0 12px;
        gap: 12px;
    }

    .pl3-left,
    .pl3-right {
        padding: 12px;
    }
}