/* =========================================================
 * AVOZOVA - footer-elements.css
 * ---------------------------------------------------------
 * This file holds the CSS of all FOOTER ELEMENTS.
 * The main Footer CSS (base, rows, columns, controls) and the
 * device visibility are in style.css. Header elements are in
 * header-elements.css.
 *
 * COLORS: all colors come from the :root variables of
 * style.css (--avozova-color-*). There is no hardcoded
 * hex/rgb color here.
 *
 * FILE ORDER:
 *   1. Site Title
 *   2. Footer Menu
 *   3. Footer HTML / Text
 *   4. Copyright
 *   5. Widget Area
 *   6. Footer Button
 *   7. Social
 *   8. Responsive (largest to smallest breakpoint)
 *
 * NOTE: the footer device visibility (.avozova-hide-desktop/-tablet/
 * -mobile) is a footer setting, not an element; its rules are in
 * style.css Section 9 (Responsive).
 *
 * NOTE: this file must load AFTER style.css
 * (functions.php dependency = avozova-theme-style).
 * ========================================================= */


/* =========================================================
 * 1. SITE TITLE
 * ---------------------------------------------------------
 * This style applies when a site title is in any footer row/column.
 * The header site title is in header-elements.css.
 * ========================================================= */

.avozova-footer .avozova-site-title {
    color: var(--avozova-color-heading);
    font-size: var(--avozova-font-size-5);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s ease;
}

.avozova-footer .avozova-site-title:hover {
    color: var(--avozova-color-primary);
}


/* =========================================================
 * 2. FOOTER MENU
 * ---------------------------------------------------------
 * PHP:  inc/customizer/footer/elements/footer-menu.php,
 *       avozova_render_footer_menu()
 *       Markup: nav.avozova-footer-menu.avozova-footer-menu-wrap
 *       > ul.avozova-footer-menu-list > li > a
 *
 * This section holds the default look. The values saved in the
 * Customizer (colors, font size, padding, margin) are written by
 * dynamic-css/footer/elements/footer-menu.php, printed in <head>
 * after this stylesheet, so they override the defaults below.
 *
 * Classes added by the PHP (one per Customizer choice):
 *   .avozova-menu-layout-horizontal / -vertical   (Layout)
 *   .avozova-footer-align-left / -center / -right (Alignment)
 *   .avozova-footer-sep-line / -dot               (Separator)
 *   .avozova-footer-hover-underline / -slide      (Hover Style)
 * CSS variables:
 *   --avozova-footer-menu-gap    (inline on the nav, Gap)
 *   --avozova-footer-sep-color   (dynamic CSS, Separator Color)
 *
 * The footer menu is flat (depth 1), so there are no submenu rules.
 * Dropdown menus belong to the header Primary Menu (header-elements.css).
 *
 * Device visibility is not here: see style.css Section 9.
 * ========================================================= */

/* ---------- 2.1 Wrapper + list ---------- */

.avozova-footer-menu {
    display: block;
    width: 100%;
}

.avozova-footer-menu-list {
    list-style: none;

    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;

    gap: var(--avozova-footer-menu-gap, var(--avozova-space-4));
}

.avozova-footer-menu-list a {
    display: inline-block;
    color: var(--avozova-color-text);
    text-decoration: none;
    font-size: var(--avozova-font-size-3);
    transition: color 0.25s ease;
}

.avozova-footer-menu-list a:hover,
.avozova-footer-menu-list a:focus {
    color: var(--avozova-color-primary);
}


/* ---------- 2.2 Layout: Vertical ----------
 * Horizontal is the default (the row above). */

.avozova-menu-layout-vertical .avozova-footer-menu-list {
    flex-direction: column;
    flex-wrap: nowrap;
}


/* ---------- 2.3 Alignment ----------
 * Left is the default.
 * Horizontal layout: the row moves (justify-content).
 * Vertical layout: the items move (align-items). */

.avozova-footer-align-center .avozova-footer-menu-list {
    justify-content: center;
}

.avozova-footer-align-right .avozova-footer-menu-list {
    justify-content: flex-end;
}

.avozova-menu-layout-vertical.avozova-footer-align-center .avozova-footer-menu-list {
    justify-content: flex-start;
    align-items: center;
}

.avozova-menu-layout-vertical.avozova-footer-align-right .avozova-footer-menu-list {
    justify-content: flex-start;
    align-items: flex-end;
}


/* ---------- 2.4 Separator (Horizontal layout only) ----------
 * The mark sits in front of every item except the first.
 * The color comes from --avozova-footer-sep-color (dynamic CSS);
 * when it is not set, the text color is used. */

/* The mark is placed in the middle of the gap, so the item itself
 * keeps its normal layout. */
.avozova-menu-layout-horizontal[class*="avozova-footer-sep-"] .avozova-footer-menu-list > li {
    position: relative;
}

.avozova-menu-layout-horizontal.avozova-footer-sep-line .avozova-footer-menu-list > li + li::before,
.avozova-menu-layout-horizontal.avozova-footer-sep-dot .avozova-footer-menu-list > li + li::before {
    position: absolute;
    top: 0;
    left: calc( var(--avozova-footer-menu-gap, var(--avozova-space-4)) / -2 );
    transform: translateX( -50% );
    color: var(--avozova-footer-sep-color, var(--avozova-color-text));
}

.avozova-menu-layout-horizontal.avozova-footer-sep-line .avozova-footer-menu-list > li + li::before {
    content: "|";
}

.avozova-menu-layout-horizontal.avozova-footer-sep-dot .avozova-footer-menu-list > li + li::before {
    content: "\2022";
}


/* ---------- 2.5 Hover Style ----------
 * None is the default (only the color change from 2.1).
 * The line uses currentColor, so it follows the hover color. */

.avozova-footer-hover-underline .avozova-footer-menu-list a:hover,
.avozova-footer-hover-underline .avozova-footer-menu-list a:focus {
    text-decoration: underline;
}

.avozova-footer-hover-slide .avozova-footer-menu-list a {
    background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
    transition:
        color 0.25s ease,
        background-size 0.3s ease;
}

.avozova-footer-hover-slide .avozova-footer-menu-list a:hover,
.avozova-footer-hover-slide .avozova-footer-menu-list a:focus {
    background-size: 100% 1px;
}


/* =========================================================
 * 3. FOOTER HTML / TEXT
 * ---------------------------------------------------------
 * The extra margin of the first/last paragraph is removed,
 * so the text does not shift up/down in the row.
 * ========================================================= */

.avozova-footer-html {
    color: var(--avozova-color-text);
    font-size: var(--avozova-font-size-3);
    line-height: 1.7;
}

.avozova-footer-html > :first-child {
    margin-top: 0;
}

.avozova-footer-html > :last-child {
    margin-bottom: 0;
}


/* =========================================================
 * 4. COPYRIGHT
 * ========================================================= */

.avozova-footer-copyright p {
    margin: 0;
    color: var(--avozova-color-text);
    font-size: var(--avozova-font-size-2);
}


/* =========================================================
 * 5. WIDGET AREA
 * ---------------------------------------------------------
 * PHP:  footer widget file, avozova_render_footer_widgets()
 *       Markup: .avozova-widget-area > section.widget
 *       > .widget-title
 * The area itself is registered in inc/shared/widget-areas.php
 * (id: footer-widget-area).
 *
 * This section holds the default look. The values saved in the
 * Customizer (colors, gap, padding, margin, border) are written
 * by the Footer Widgets dynamic CSS file, attached to this
 * stylesheet after it, so they override the defaults below.
 *
 * Widget width: no fixed width. Each widget is as wide as its
 * content (flex: 0 1 auto), never wider than the area. Same
 * rule as the header widget area.
 *
 * LAYOUT RULE (same in the left, center and right column):
 * the widget area takes the full width of its footer row.
 * Layout (Customizer > Widget Area > General > Layout):
 *   Side by Side = default. The widgets sit in one row and wrap
 *                  to the next line when there is no space
 *                  (see 5.1 and 5.2).
 *   Stacked      = the PHP adds .avozova-widget-layout-column,
 *                  the widgets sit one below the other, each one
 *                  the full width of the area (5.4).
 * On mobile (<= 768px) the widgets always stack, see section 8.
 *
 * Why the column rules in 5.1: style.css gives every column
 * flex: 1 1 0 (one third of the row), which is too narrow and
 * makes the widgets wrap early. The right column also wraps its
 * content in .avozova-footer-controls, so the rules match the
 * widget area at any depth. Keep the widget area in its own
 * footer row.
 * ========================================================= */

/* ---------- 5.1 Area wrapper ---------- */

.avozova-footer .avozova-footer-column:has( .avozova-widget-area ) {
    flex: 1 1 100%;
}

.avozova-footer .avozova-footer-controls:has( > .avozova-widget-area ) {
    flex: 1 1 100%;
    width: 100%;
}

.avozova-footer .avozova-widget-area {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--avozova-space-3);
    width: 100%;

    margin: 0;
    padding: 0;
    background-color: transparent;
    color: var(--avozova-color-text);
}


/* ---------- 5.2 Single widget ----------
 * Width follows the content. Resets the default widget
 * spacing (margin set for sidebars), the gap of the wrapper
 * above controls the distance instead.
 * The text colour is inherited from the wrapper. */

.avozova-footer .avozova-widget-area .widget {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.avozova-footer .avozova-widget-area .widget-title {
    margin: 0 0 var(--avozova-space-2);
    color: var(--avozova-color-heading);
    font-size: var(--avozova-font-size-4);
}

.avozova-footer .avozova-widget-area .widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.avozova-footer .avozova-widget-area .widget img {
    max-width: 100%;
    height: auto;
}

.avozova-footer .avozova-widget-area .widget p {
    margin: 0;
}


/* ---------- 5.3 Links ---------- */

.avozova-footer .avozova-widget-area a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.avozova-footer .avozova-widget-area a:hover {
    color: var(--avozova-color-primary);
}


/* ---------- 5.4 Layout: Stacked ----------
 * Chosen in the Customizer. The widgets sit one below the other
 * on every device, each one the full width of the area. */

.avozova-footer .avozova-widget-area.avozova-widget-layout-column {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
}


/* =========================================================
 * 6. FOOTER BUTTON
 * ---------------------------------------------------------
 * The header button (.avozova-button) CSS is in header-elements.css.
 * A .avozova-button inside the footer only gets alignment.
 * ========================================================= */

.avozova-footer-button-wrap {
    display: inline-block;
}

.avozova-footer-button {
    display: inline-block;
    padding: var(--avozova-space-2) var(--avozova-space-4);
    border-radius: var(--avozova-radius-2);

    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;

    color: var(--avozova-color-white);
    background-color: var(--avozova-color-primary);
    box-shadow: var(--avozova-shadow-1);

    transition:
        background-color 0.25s ease-in-out,
        opacity 0.25s ease-in-out;
}

.avozova-footer-button:hover,
.avozova-footer-button:focus {
    color: var(--avozova-color-white);
    text-decoration: none;
    opacity: 0.85;
}

.avozova-footer .avozova-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}


/* =========================================================
 * 7. SOCIAL
 * ---------------------------------------------------------
 * The header social icons (.avozova-social-icons) CSS is in
 * header-elements.css.
 *
 * Gap: a fixed --avozova-space-3 (16px) used to be here, which
 * overrode the Customizer "Gap Between Icons" and looked different
 * from the header (default 8px). Now the Customizer variable
 * --avozova-social-gap comes first; the default is 8px (like the header).
 * ========================================================= */

.avozova-footer .avozova-social {
    display: flex;
    align-items: center;
    gap: var(--avozova-social-gap, var(--avozova-space-2));
}


/* =========================================================
 * 8. RESPONSIVE (largest to smallest breakpoint)
 * ========================================================= */

/* ---------- <= 768px (Mobile) ---------- */
@media screen and (max-width: 768px) {

    /* Footer Menu: the horizontal row is centered on mobile.
     * (The vertical layout keeps its Customizer alignment.) */
    .avozova-menu-layout-horizontal .avozova-footer-menu-list {
        justify-content: center;
    }

    /* Widget Area: widgets always stack one below the other.
     * The Customizer gap sets the vertical distance. */
    .avozova-footer .avozova-widget-area {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
    }
}


/* ---------- Reduced motion ----------
 * Visitors who asked their system for less motion get no hover animation. */
@media (prefers-reduced-motion: reduce) {

    .avozova-footer-menu .avozova-footer-menu-list a {
        transition: none;
    }
}