/* ============================================================================
   HE-FOOTER — вариант 3 «Плотная матрица: контакты в две подколонки».
   House Element / frontend, 29.10.2026.

   Только раскладка. Контент не меняется (см. variant-1).
   Откат = удалить <link> на этот файл из header.php.

   Подключение: после he-task18.css:
     <link href="/local/templates/HouseElement/he-footer.css?v=1" rel="stylesheet">
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. ОБЩИЕ ПРАВКИ (все ширины) — как в варианте 1.
   --------------------------------------------------------------------------- */
.footer .footer__legal,
.footer .footer__legal-link {
    color: rgba(255, 255, 255, 0.72);
}

.footer .footer__copyright {
    margin: 24px 140px 0;
    padding-top: 24px;
}

@media (max-width: 1279.98px) {
    /* юрстрока на планшете тоже не должна рваться: было max-width:460px */
    .footer .footer__legal { max-width: none; }

    .footer .footer-monochrome__phone__link,
    .footer .footer-monochrome__email__link,
    .footer .footer__address-link,
    .footer .footer__legal-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ---------------------------------------------------------------------------
   2. ДЕСКТОП (>=1280px): бренд слева, контакты справа в две подколонки,
   юрстрока — внизу на всю ширину, иконки — внизу справа.
   Телефоны — левая подколонка; почта и адрес — правая; часы — во всю ширину
   контактной зоны. Подколонки разведены по краям зоны (space-between),
   чтобы правая половина не пустовала. Порядок фактов в DOM не меняется.
   --------------------------------------------------------------------------- */
@media (min-width: 1280px) {
    .footer .footer__copyright {
        display: grid !important;
        grid-template-columns: minmax(345px, 1fr) minmax(0, 1.6fr);
        grid-template-areas:
            "logo     contacts"
            "copy     contacts"
            "legal    legal"
            "icons    icons";
        column-gap: 56px;
        row-gap: 20px;
        align-items: start;
        justify-content: normal !important;
    }

    .footer .footer__copyright-left-block,
    .footer .footer__info-section {
        display: contents;
    }

    .footer .footer__info-section > div:first-child { grid-area: logo; }
    .footer .footer__info-block                     { grid-area: contacts; }
    .footer .footer__copyright-text                 { grid-area: copy; }
    .footer .footer__legal                          { grid-area: legal; max-width: none; }

    .footer .footer__copyright-right-block {
        grid-area: icons;
        justify-self: end;
        align-self: end;
        margin-bottom: 0;
        margin-top: 8px;
    }

    /* обёртки контактов — на всю ширину колонки, иначе флекс сжимается
       по контенту и space-between не разводит подколонки по краям */
    .footer .footer__info-block,
    .footer .footer__info-address { display: block; }

    /* контактная зона — сетка 2x4: телефоны слева, почта и адрес справа,
       часы — во всю ширину. Подколонки по max-content, разведены по краям. */
    .footer .footer-monochrome__phone {
        display: grid;
        grid-template-columns: max-content max-content;
        grid-template-rows: auto auto auto auto;
        justify-content: space-between;
        column-gap: 40px;
        row-gap: 8px;
    }

    /* пустой служебный span не должен занимать ячейку сетки */
    .footer .footer-monochrome__phone__title { display: none !important; }

    .footer .footer-monochrome__phone__link:nth-of-type(1) { grid-column: 1; grid-row: 1; }
    .footer .footer-monochrome__phone__link:nth-of-type(2) { grid-column: 1; grid-row: 2; }
    .footer .footer-monochrome__phone__link:nth-of-type(3) { grid-column: 1; grid-row: 3; }
    .footer .footer-monochrome__email__link { grid-column: 2; grid-row: 1; }
    .footer .footer__address-link           { grid-column: 2; grid-row: 2; margin-top: 0; }
    .footer .footer__hours                  { grid-column: 1 / -1; grid-row: 4; margin-top: 0; }

    .footer .footer__legal br { display: none; }
    .footer .footer__legal-link { margin-left: 16px; }
}


/* Правка по слову владельца (29.10.2026): ярлыки соцсетей поднять в одну линию
   с юрстрокой — юрстрока слева, иконки справа в той же нижней строке. */
@media (min-width: 1280px) {
    .footer .footer__copyright {
        grid-template-areas:
            "logo     contacts"
            "copy     contacts"
            "legal    legal";
    }

    .footer .footer__legal {
        padding-right: 230px; /* коридор справа под ряд иконок */
        align-self: center;
    }

    .footer .footer__copyright-right-block {
        grid-area: legal;
        justify-self: end;
        align-self: center;
    }
}
