/* =========================================================
 * AVOZOVA - header-elements.css
 * ---------------------------------------------------------
 * This file holds the CSS of all HEADER ELEMENTS.
 * The main Header/Footer CSS (container, rows, columns,
 * controls) is in style.css. Footer elements are in
 * footer-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:
 *   0. Site Title
 *   1. Primary Menu
 *      (Wrapper, List, Submenu, Divider, Animation, Hover,
 *      boxed plus/minus icon, boxed items)
 *   2. Unified Expanding Search
 *      (Slide, Inline, Dropdown, Overlay styles)
 *   3. Buttons (Button 1 + Button 2)
 *   4. Social Icons
 *   5. Widget Area
 *   6. Responsive (largest to smallest breakpoint)
 *      (Device visibility, Primary Menu hidden up to 1024px,
 *      Site Title, Search and Widget Area)
 *
 * NOTE: this file must load AFTER style.css
 * (functions.php dependency = avozova-theme-style).
 * ========================================================= */


/* =========================================================
 * 0. SITE TITLE
 * ---------------------------------------------------------
 * The footer site title is styled by its own rule in
 * footer-elements.css. The Customizer title color/size can
 * override this through dynamic CSS.
 *
 * Default color = brand copper (--avozova-color-primary),
 * hover = gold (--avozova-color-gold), the same pair as the
 * global links in style.css. Both are variables, so a Night
 * Mode / palette change also reaches the title.
 * ========================================================= */

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

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



/* =========================================================
 * 1. PRIMARY MENU
 * ---------------------------------------------------------
 * PHP:  primary-menu.php (avozova_render_primary_menu)
 *       Markup: nav.avozova-primary-menu-wrap > ul.avozova-menu
 * Dynamic CSS: dynamic-css/header/primary-menu.php
 *       (color, font size, padding, margin, submenu background,
 *       top offset, border width/color/radius). It prints after
 *       this file, so keep the selectors here no heavier than
 *       the dynamic ones, otherwise the Customizer values lose.
 *
 * Desktop (>= 1025px) = one horizontal line in the header. Submenus
 * are always vertical. On tablet and mobile (<= 1024px) the header
 * menu is hidden (section 6.3); the same menu lives inside the
 * Off-Canvas there (off-canvas.css, section 11).
 * Classes added by PHP:
 *   .avozova-align-left / -center / -right
 *   .avozova-hover-slide / -zoom
 *   .avozova-submenu-divider
 *   .avozova-submenu-anim-fade / -slide-down / -scale / -flip
 *     (the list of types = avozova_pm_submenu_animation_choices()
 *     in primary-menu.php; CSS in section 1.5)
 *   .avozova-hide-desktop / -tablet / -mobile (see section 6)
 * Classes added to <body> by the dynamic CSS file (section 1.9):
 *   .avozova-pm-items-plain / .avozova-pm-icon-plain /
 *   .avozova-pm-icon-none / .avozova-pm-fill-off
 * JS: script.js (Primary Menu Dropdown) adds .is-open to a parent <li> on click
 *   (header: desktop only, Off-Canvas: every screen size) to open its dropdown.
 * ========================================================= */

/* ---------- 1.1 Wrapper + alignment ---------- */

.avozova-primary-menu-wrap {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}

.avozova-primary-menu-wrap.avozova-align-left   { justify-content: flex-start; }
.avozova-primary-menu-wrap.avozova-align-center { justify-content: center; }
.avozova-primary-menu-wrap.avozova-align-right  { justify-content: flex-end; }


/* ---------- 1.2 Menu list (single line) ---------- */

.avozova-primary-menu-wrap .avozova-menu,
.avozova-primary-menu-wrap .avozova-menu .sub-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.avozova-primary-menu-wrap .avozova-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.avozova-primary-menu-wrap .avozova-menu > li {
    position: relative;
    display: block;
    flex: 0 0 auto;
    white-space: nowrap;
}

.avozova-primary-menu-wrap .avozova-menu > li > a {
    position: relative;
    display: block;
    padding: var(--avozova-space-2) var(--avozova-space-3);
    color: var(--avozova-color-heading);
    font-size: var(--avozova-font-size-3);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
}

.avozova-primary-menu-wrap .avozova-menu > li > a:hover,
.avozova-primary-menu-wrap .avozova-menu > li.current-menu-item > a,
.avozova-primary-menu-wrap .avozova-menu > li.current-menu-ancestor > a {
    color: var(--avozova-color-primary);
}


/* ---------- 1.3 Submenu (always vertical, opens on click) ----------
 * The first submenu level is a rounded card. Nested submenu
 * levels expand downward inside that same card. Items get their
 * own rounded hover background and a small slide to the right.
 * Border / background / radius saved in the Customizer are
 * written by the dynamic CSS file and override the defaults.
 */

.avozova-primary-menu-wrap .avozova-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    display: block;
    box-sizing: border-box;
    width: var(--avozova-submenu-width, 180px);
    padding: var(--avozova-space-2);

    background: var(--avozova-color-surface);
    border: 1px solid var(--avozova-color-border);
    border-radius: var(--avozova-radius-3);
    box-shadow:
        0 14px 34px color-mix(in srgb, var(--avozova-color-heading) 14%, transparent),
        0 2px 6px color-mix(in srgb, var(--avozova-color-heading) 8%, transparent);

    opacity: 0;
    visibility: hidden;
}

/* First level: a small gap between the menu bar and the card */
.avozova-primary-menu-wrap .avozova-menu > li > .sub-menu {
    top: calc(100% + var(--avozova-space-2));
}

/* Nested submenus expand downward inside the same dropdown panel */
.avozova-primary-menu-wrap .avozova-menu .sub-menu .sub-menu {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    display: none;
    width: 100%;
    padding: 0 0 0 var(--avozova-space-3);

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Show a nested submenu when its own parent item is opened */
.avozova-primary-menu-wrap .avozova-menu .sub-menu li.is-open > .sub-menu {
    display: block;
}

/* Opens on click: script.js adds .is-open to the parent <li> */
.avozova-primary-menu-wrap .avozova-menu li.is-open > .sub-menu {
    opacity: 1;
    visibility: visible;
}

.avozova-primary-menu-wrap .avozova-menu .sub-menu li {
    position: relative;
    display: block;
    white-space: normal;
}

.avozova-primary-menu-wrap .avozova-menu .sub-menu a {
    display: block;
    padding: var(--avozova-space-2) var(--avozova-space-3);
    border-radius: var(--avozova-radius-2);
    color: var(--avozova-color-heading);
    font-size: var(--avozova-font-size-3);
    text-decoration: none;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        padding-left 0.2s ease;
}

.avozova-primary-menu-wrap .avozova-menu .sub-menu a:hover,
.avozova-primary-menu-wrap .avozova-menu .sub-menu li.current-menu-item > a {
    background-color: color-mix(in srgb, var(--avozova-color-primary) 9%, transparent);
    color: var(--avozova-color-primary);
}

.avozova-primary-menu-wrap .avozova-menu .sub-menu a:hover {
    padding-left: calc(var(--avozova-space-3) + 4px);
}


/* ---------- 1.4 Submenu: item divider ---------- */

.avozova-submenu-divider .sub-menu > li:not(:last-child) {
    border-bottom: 1px solid var(--avozova-color-border);
}


/* ---------- 1.5 Submenu: open animations ----------
 * The closed state (opacity 0, visibility hidden) and the open
 * state (.is-open) are in section 1.3. Every animation below only
 * adds a start position (closed) and resets it when open, so
 * opacity / visibility and the transform move together.
 *
 * Added to the wrapper by PHP: .avozova-submenu-anim-{key}
 * Types: fade, slide-down, scale, flip   (none = no class)
 * To add a type: add it in avozova_pm_submenu_animation_choices()
 * (primary-menu.php), add its class to the transition list below,
 * then write its closed + open rules like the ones here. */

/* Shared transition for all types */
.avozova-submenu-anim-fade .sub-menu,
.avozova-submenu-anim-slide-down .sub-menu,
.avozova-submenu-anim-scale .sub-menu,
.avozova-submenu-anim-flip .sub-menu {
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Fade: rises a little and settles */
.avozova-submenu-anim-fade .sub-menu {
    transform: translateY(8px) scale(0.98);
    transform-origin: top left;
}

.avozova-submenu-anim-fade li.is-open > .sub-menu {
    transform: translateY(0) scale(1);
}

/* Slide Down: drops in from above */
.avozova-submenu-anim-slide-down .sub-menu {
    transform: translateY(-12px);
    transform-origin: top center;
}

.avozova-submenu-anim-slide-down li.is-open > .sub-menu {
    transform: translateY(0);
}

/* Scale: grows from a smaller size */
.avozova-submenu-anim-scale .sub-menu {
    transform: scale(0.9);
    transform-origin: top left;
}

.avozova-submenu-anim-scale li.is-open > .sub-menu {
    transform: scale(1);
}

/* Flip: swings open from its top edge */
.avozova-submenu-anim-flip .sub-menu {
    transform: perspective(700px) rotateX(-18deg);
    transform-origin: top center;
}

.avozova-submenu-anim-flip li.is-open > .sub-menu {
    transform: perspective(700px) rotateX(0deg);
}


/* ---------- 1.6 Hover styles (Slide / Zoom) ---------- */

.avozova-hover-slide .avozova-menu > li > a::after {
    content: "";
    position: absolute;
    left: var(--avozova-space-3);
    right: var(--avozova-space-3);
    bottom: 4px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.avozova-hover-slide .avozova-menu > li:hover > a::after,
.avozova-hover-slide .avozova-menu > li:focus-within > a::after {
    transform: scaleX(1);
}

.avozova-hover-zoom .avozova-menu > li:hover > a {
    transform: scale(1.08);
}


/* ---------- 1.7 Dropdown icon (boxed + / -) + click to open ----------
 * WordPress itself draws NO icon. It only adds the class
 * .menu-item-has-children to items that have child items, so the
 * theme draws the icon with CSS (no PHP needed).
 *
 * ONE icon for two menus: the Header menu (.avozova-primary-menu-wrap)
 * and the Off-Canvas menu (.avozova-off-canvas__navigation-list) share
 * the same rules below, so the icon is drawn in one place only.
 *
 * Click: script.js toggles .is-open on the parent <li>.
 *   Closed = plus (+) in a sharp box (border only).
 *   Hover  = the box gets a light fill.
 *   Open   = the box is filled, the vertical bar shrinks smoothly
 *            and only the minus (-) is left.
 *
 * The icon is its own box (::before): the border is the box, the
 * + / - are two gradient bars (sharp corners, border-radius 0).
 * Colors are currentColor, so they follow the link text color and
 * its hover color. ::before is used because ::after is already used
 * by the Slide hover underline (1.6).
 *
 * Customizer (dynamic CSS, :root) can set:
 *   --avozova-pm-icon-size   box size, always an ODD number of px
 *   --avozova-pm-icon-color  icon color (fallback = link color)
 *   --avozova-pm-border-color   Customizer "Border Color"  (icon box + item boxes)
 *   --avozova-pm-border-width   Customizer "Border Width"  (icon box + item boxes)
 *   --avozova-pm-border-radius  Customizer "Border Radius" (icon box + item boxes)
 *
 * CENTERING: the bars are placed from the OUTER edge of the box
 * (background-origin: border-box), so the plus stays centered whatever
 * border width is chosen. Bar length = size - 12px, thickness = 3px.
 * With an ODD size both gaps are whole pixels = exactly centered.
 * Keep the size odd.
 *
 * BORDER: width, color and radius of the icon box come from the
 * Customizer "Border Width / Color / Radius" (--avozova-pm-border-*),
 * the same values as the item boxes (1.8) and the submenu.
 */

.avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a,
.avozova-off-canvas__navigation-list li.menu-item-has-children > a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--avozova-space-3);
    cursor: pointer;
}

.avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a::before,
.avozova-off-canvas__navigation-list li.menu-item-has-children > a::before {
    --avozova-pm-bar: currentColor;

    content: "";
    order: 1;
    flex-shrink: 0;
    display: block;
    box-sizing: border-box;
    width: var(--avozova-pm-icon-size, 23px);
    height: var(--avozova-pm-icon-size, 23px);
    color: var(--avozova-pm-icon-color, currentColor);
    border-style: solid;
    border-width: var(--avozova-pm-border-width, 2px);
    border-color: var(--avozova-pm-border-color, currentColor);
    border-radius: var(--avozova-pm-border-radius, 0);

    /* Plus = horizontal bar + vertical bar, both centered */
    background-color: transparent;
    background-image:
        linear-gradient(var(--avozova-pm-bar), var(--avozova-pm-bar)),
        linear-gradient(var(--avozova-pm-bar), var(--avozova-pm-bar));
    background-repeat: no-repeat;
    background-position: center, center;
    background-size:
        calc(100% - 12px) 3px,
        3px calc(100% - 12px);
    background-origin: border-box;

    transition:
        background-size 0.25s ease,
        background-color 0.25s ease,
        border-color 0.25s ease;
}

/* Hover: light fill inside the icon box */
.avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a:hover::before,
.avozova-off-canvas__navigation-list li.menu-item-has-children > a:hover::before {
    background-color: color-mix(in srgb, currentColor 14%, transparent);
}

/* Open: box filled, vertical bar shrinks to 0 = minus (-).
 * The bars take the page background color so they show on the fill.
 * This rule comes after the hover rule on purpose (same weight). */
.avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children.is-open > a::before,
.avozova-off-canvas__navigation-list li.menu-item-has-children.is-open > a::before {
    --avozova-pm-bar: var(--avozova-color-bg);

    background-color: currentColor;
    background-size:
        calc(100% - 12px) 3px,
        3px 0px;
}

/* Nested levels (Header menu): keep the icon box at the far edge */
.avozova-primary-menu-wrap .avozova-menu .sub-menu li.menu-item-has-children > a {
    justify-content: space-between;
}


/* ---------- 1.8 Boxed menu items (Header menu, top level) ----------
 * Every top-level item gets its own box: border + corners (default
 * 1px, sharp) with a small gap between the boxes. Width, color and
 * radius follow the Customizer Border group (see 1.7). The
 * dropdown icon (1.7) is a second, smaller box inside it. Padding of
 * the box still comes from the Customizer "Menu Padding" (dynamic CSS).
 * To go back to plain items, delete this whole section 1.8. */

.avozova-primary-menu-wrap .avozova-menu {
    gap: var(--avozova-space-2);
}

.avozova-primary-menu-wrap .avozova-menu > li > a {
    border-style: solid;
    border-width: var(--avozova-pm-border-width, 1px);
    border-color: var(--avozova-pm-border-color, var(--avozova-color-border));
    border-radius: var(--avozova-pm-border-radius, 0);
    transition:
        color 0.25s ease,
        transform 0.25s ease,
        border-color 0.25s ease,
        background-color 0.25s ease;
}

.avozova-primary-menu-wrap .avozova-menu > li > a:hover,
.avozova-primary-menu-wrap .avozova-menu > li.current-menu-item > a,
.avozova-primary-menu-wrap .avozova-menu > li.current-menu-ancestor > a,
.avozova-primary-menu-wrap .avozova-menu > li.is-open > a {
    border-color: var(--avozova-color-primary);
}


/* ---------- 1.9 Style switches (Customizer > Primary Menu > Design) ----------
 * The defaults above are the "boxed" look. These rules switch parts of
 * it off. The classes are added to <body> by dynamic-css/header/
 * primary-menu.php (body_class), so the Header menu and the Off-Canvas
 * menu follow the same choice:
 *   .avozova-pm-items-plain  Menu Item Style = Plain  (no box round items)
 *   .avozova-pm-icon-plain   Icon Style = Plain + / -  (no box round icon)
 *   .avozova-pm-icon-none    Icon Style = None         (no icon at all)
 *   .avozova-pm-fill-off     Icon Fill = off           (no hover / open fill)
 * Each selector is heavier than the default rule it replaces, because it
 * starts with "body.class".
 *
 * Plain icon centering: box = size - 8px, no border, bars = box - 4px
 * (length) x 3px. Size is odd, so every gap is a whole pixel. */

/* Menu Item Style = Plain: no border, no gap between items */
body.avozova-pm-items-plain .avozova-primary-menu-wrap .avozova-menu {
    gap: 0;
}

body.avozova-pm-items-plain .avozova-primary-menu-wrap .avozova-menu > li > a {
    border: 0;
}

/* Icon Style = None */
body.avozova-pm-icon-none .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a::before,
body.avozova-pm-icon-none .avozova-off-canvas__navigation-list li.menu-item-has-children > a::before {
    display: none;
}

/* Icon Style = Plain + / - (no box) */
body.avozova-pm-icon-plain .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a::before,
body.avozova-pm-icon-plain .avozova-off-canvas__navigation-list li.menu-item-has-children > a::before {
    width: calc(var(--avozova-pm-icon-size, 23px) - 8px);
    height: calc(var(--avozova-pm-icon-size, 23px) - 8px);
    border: 0;
    background-size:
        calc(100% - 4px) 3px,
        3px calc(100% - 4px);
}

body.avozova-pm-icon-plain .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a:hover::before,
body.avozova-pm-icon-plain .avozova-off-canvas__navigation-list li.menu-item-has-children > a:hover::before {
    background-color: transparent;
}

body.avozova-pm-icon-plain .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children.is-open > a::before,
body.avozova-pm-icon-plain .avozova-off-canvas__navigation-list li.menu-item-has-children.is-open > a::before {
    --avozova-pm-bar: currentColor;

    background-color: transparent;
    background-size:
        calc(100% - 4px) 3px,
        3px 0px;
}

/* Icon Fill = off: the boxed icon stays an outline (no hover / open fill) */
body.avozova-pm-fill-off .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a:hover::before,
body.avozova-pm-fill-off .avozova-off-canvas__navigation-list li.menu-item-has-children > a:hover::before {
    background-color: transparent;
}

body.avozova-pm-fill-off .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children.is-open > a::before,
body.avozova-pm-fill-off .avozova-off-canvas__navigation-list li.menu-item-has-children.is-open > a::before {
    --avozova-pm-bar: currentColor;

    background-color: transparent;
}


/* ---------- 1.10 Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {

    .avozova-primary-menu-wrap .avozova-menu > li > a,
    .avozova-primary-menu-wrap .avozova-menu li.menu-item-has-children > a::before,
    .avozova-off-canvas__navigation-list li.menu-item-has-children > a::before,
    .avozova-primary-menu-wrap .avozova-menu .sub-menu a,
    .avozova-hover-slide .avozova-menu > li > a::after,
    .avozova-submenu-anim-fade .sub-menu,
    .avozova-submenu-anim-slide-down .sub-menu,
    .avozova-submenu-anim-scale .sub-menu,
    .avozova-submenu-anim-flip .sub-menu {
        transition: none;
    }
}



/* =========================================================
 * 2. UNIFIED EXPANDING SEARCH
 * ---------------------------------------------------------
 * PHP:  search.php  (wrapper classes:
 *       .avozova-search-style-slide / -inline / -dropdown / -overlay)
 * JS:   script.js toggles .avozova-search-open on the box.
 *       For the overlay style it also toggles
 *       body.avozova-search-overlay-open (scroll lock).
 * The toggle button look (size/shape/colors) is in
 * avozova-buttons.css (.avozova-search-toggle).
 *
 * Open/close uses width + opacity + visibility (no display
 * switching), so the animation is smooth and the closed
 * input cannot be focused with the Tab key.
 * ========================================================= */

/* ---------- 2.1 Wrapper ---------- */

.avozova-search {
    --avozova-search-width: 260px; /* 190px on mobile, see the responsive section */

    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--avozova-space-2);
}

.avozova-search-toggle {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    cursor: pointer;
}


/* ---------- 2.2 Search box: closed state (shared base) ---------- */

.avozova-search-box {
    position: absolute;
    right: 100%;
    margin-right: var(--avozova-space-2);
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;

    width: 0;
    overflow: hidden;
    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        width 0.3s ease,
        opacity 0.2s ease,
        visibility 0.3s ease,
        margin 0.3s ease;
}

/* ---------- 2.3 Search box: open state (shared) ---------- */

.avozova-search-box.avozova-search-open,
.avozova-search.is-open .avozova-search-box {
    width: var(--avozova-search-width);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.avozova-search-box form {
    display: flex;
    align-items: center;
    width: var(--avozova-search-width);
    margin: 0;
}

.avozova-search-box input[type="search"] {
    display: block;
    width: 100%;
    height: var(--avozova-height-2);
    padding: 0 var(--avozova-space-3);
    box-sizing: border-box;

    border: 1px solid var(--avozova-color-border);
    border-radius: var(--avozova-radius-3);
    background: var(--avozova-color-bg);
    color: var(--avozova-color-heading);

    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.avozova-search-box input[type="search"]:focus {
    border-color: var(--avozova-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--avozova-color-primary) 20%, transparent);
}

/* Placeholder fades in after the box has opened, so it is not shown half-cut */
.avozova-search-box input[type="search"]::placeholder {
    color: var(--avozova-color-text);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avozova-search-box.avozova-search-open input[type="search"]::placeholder,
.avozova-search.is-open .avozova-search-box input[type="search"]::placeholder {
    opacity: 0.8;
    transition-delay: 0.15s;
}


/* ---------- 2.4 Style: Slide ----------
 * Floats to the LEFT of the icon (pill shape) and does not
 * push other header items. Uses the shared base above. */

.avozova-search-style-slide .avozova-search-box {
    border-radius: 999px;
}

.avozova-search-style-slide .avozova-search-box input[type="search"] {
    padding: 0 var(--avozova-space-4);
    border-radius: 999px;
}


/* ---------- 2.5 Style: Inline ----------
 * Sits in the normal flow, to the RIGHT of the icon, and
 * pushes the neighbouring header items while it opens. */

.avozova-search-style-inline {
    gap: 0; /* spacing is handled by the box margin, so a closed box leaves no extra gap */
}

.avozova-search-style-inline .avozova-search-box {
    position: static;
    transform: none;
    right: auto;
    top: auto;
    margin: 0;
}

.avozova-search-style-inline .avozova-search-box.avozova-search-open,
.avozova-search-style-inline.is-open .avozova-search-box {
    margin-left: var(--avozova-space-2);
}


/* ---------- 2.6 Style: Dropdown ----------
 * A small panel that drops DOWN from the icon, right edge
 * aligned with the icon. Fixed width (no width animation),
 * it fades and moves down a little instead. */

.avozova-search-style-dropdown .avozova-search-box {
    top: calc(100% + var(--avozova-space-2));
    right: 0;
    margin: 0;
    z-index: 50;

    width: var(--avozova-search-width);
    padding: var(--avozova-space-2);
    overflow: visible;

    border: 1px solid var(--avozova-color-border);
    border-radius: var(--avozova-radius-3);
    background: var(--avozova-color-surface);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--avozova-color-heading) 15%, transparent);

    transform: translateY(-8px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.25s ease;
}

.avozova-search-style-dropdown .avozova-search-box.avozova-search-open,
.avozova-search-style-dropdown.is-open .avozova-search-box {
    transform: translateY(0);
}

.avozova-search-style-dropdown .avozova-search-box form {
    width: 100%;
}


/* ---------- 2.7 Style: Fullscreen Overlay ----------
 * Covers the whole screen with a blurred layer and a large
 * centered input. Has its own close button
 * (.avozova-search-close, only printed for this style).
 * NOTE: position: fixed does not work inside a parent that
 * has transform / filter / backdrop-filter. If the overlay
 * only covers the header, check the header's CSS. */

.avozova-search-style-overlay .avozova-search-box {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    margin: 0;
    padding: var(--avozova-space-4);
    overflow: hidden;

    background: color-mix(in srgb, var(--avozova-color-bg) 94%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);

    transform: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.avozova-search-style-overlay .avozova-search-box form {
    width: min(680px, 100%);
}

.avozova-search-style-overlay .avozova-search-box input[type="search"] {
    height: calc(var(--avozova-height-2) * 1.5);
    padding: 0 var(--avozova-space-4);
    font-size: 1.25rem;
}

/* Close button (overlay only) */
.avozova-search-close {
    position: absolute;
    top: var(--avozova-space-4);
    right: var(--avozova-space-4);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;

    border: 1px solid var(--avozova-color-border);
    border-radius: 50%;
    background: var(--avozova-color-surface);
    color: var(--avozova-color-heading);

    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.avozova-search-close:hover {
    background: var(--avozova-color-primary);
    border-color: var(--avozova-color-primary);
    color: var(--avozova-color-bg);
}

/* Page scroll lock while the overlay is open (class set by script.js) */
body.avozova-search-overlay-open {
    overflow: hidden;
}


/* ---------- 2.8 Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {

    .avozova-search-box,
    .avozova-search-box input[type="search"]::placeholder {
        transition: none;
    }
}


/* =========================================================
 * 3. BUTTONS (Header Button + Button 2)
 * ---------------------------------------------------------
 * FILE: button.php
 * Colors can be overridden by the Customizer inline/dynamic
 * CSS (--avozova-btn-*). When a Customizer variable is not set,
 * the theme tokens (primary / white) become the fallback,
 * so a button is never transparent.
 * The footer button (.avozova-footer-button) is in section 6
 * of footer-elements.css.
 * ========================================================= */

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

    font-weight: 600;
    line-height: normal;
    text-align: center;
    text-decoration: none;

    color: var(--avozova-btn-text-color, var(--avozova-color-white));
    background-color: var(--avozova-btn-bg-color, var(--avozova-color-primary));

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

.avozova-button:hover {
    color: var(--avozova-btn-text-hover, var(--avozova-btn-text-color, var(--avozova-color-white)));
    background-color: var(--avozova-btn-bg-hover, var(--avozova-btn-bg-color, var(--avozova-color-primary)));
    text-decoration: none;
    opacity: 0.85;
}

/* Button 2 Customizer Colors */
.avozova-button.avozova-button-2 {
    color: var(--avozova-btn-2-text-color, var(--avozova-color-white));
    background-color: var(--avozova-btn-2-bg-color, var(--avozova-color-primary));
}

.avozova-button.avozova-button-2:hover {
    color: var(--avozova-btn-2-text-hover, var(--avozova-btn-2-text-color, var(--avozova-color-white)));
    background-color: var(--avozova-btn-2-bg-hover, var(--avozova-btn-2-bg-color, var(--avozova-color-primary)));
}


/* =========================================================
 * 4. SOCIAL ICONS
 * ---------------------------------------------------------
 * FILE: social.php
 * --avozova-social-* are set by the Customizer; the :root tokens are the fallback.
 * The footer social layout (.avozova-footer .avozova-social)
 * is in section 7 of footer-elements.css.
 * ========================================================= */

.avozova-social-icons {
    display: inline-flex;
    align-items: center;
    gap: var(--avozova-social-gap, var(--avozova-space-3));
}

.avozova-social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--avozova-social-size, var(--avozova-font-size-4));
    color: var(--avozova-social-color, inherit);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.avozova-social-icons a:hover {
    color: var(--avozova-social-hover-color, var(--avozova-color-primary));
}


/* =========================================================
 * 5. WIDGET AREA
 * ---------------------------------------------------------
 * PHP:  header widget file, avozova_render_header_widget()
 *       Markup: .avozova-header-widget-area > section.widget
 *       (.avozova-header-widget-item) > .avozova-header-widget-title
 * The area itself is registered in inc/shared/widget-areas.php
 * (id: avozova-header-widget).
 *
 * This section holds the default look. The values saved in the
 * Customizer (colors, gap, padding, margin) are written by the
 * Header Widget Area 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.
 * Layout (Customizer > Widget Area > General > Layout):
 *   Side by Side = default, widgets in one row (5.1).
 *   Stacked      = the PHP adds .avozova-widget-layout-column (5.4).
 * On mobile (<= 768px) the widgets always stack, see section 6.
 * The footer widget area is in footer-elements.css and follows
 * the same width rule.
 * ========================================================= */

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

.avozova-header-widget-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--avozova-space-3);

    margin: 0;
    padding: 0;
    background-color: transparent;
    color: inherit;
}


/* ---------- 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. */

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

.avozova-header-widget-area .widget-title {
    margin: 0 0 var(--avozova-space-1);
    color: var(--avozova-color-heading);
    font-size: var(--avozova-font-size-3);
    font-weight: 600;
    line-height: 1.3;
}

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

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

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


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

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

.avozova-header-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-header-widget-area.avozova-widget-layout-column {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
}


/* =========================================================
 * 6. RESPONSIVE (largest to smallest breakpoint)
 * ---------------------------------------------------------
 * 6.1 <= 1024px   Primary Menu hidden in the header
 * 6.2 <= 768px    Mobile (site title, search, widgets)
 *
 * The device visibility classes (.avozova-hide-desktop / -tablet /
 * -mobile) are added by PHP and are written once, in style.css
 * (Responsive section). They are not repeated here.
 * ========================================================= */

/* ---------- 6.1 <= 1024px (Primary Menu) ----------
 * The one-line menu is only for desktop / laptop. On tablet and
 * mobile it is hidden in the header and the same menu is shown
 * inside the Off-Canvas instead (off-canvas.css, section 11).
 * The 1024px value must match script.js (Primary Menu Dropdown,
 * pmDesktop = min-width 1025px) and off-canvas.css (section 14). */
@media (max-width: 1024px) {

    .avozova-primary-menu-wrap {
        display: none;
    }
}


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

    .avozova-site-title {
        font-size: var(--avozova-font-size-4);
    }

    .avozova-search {
        --avozova-search-width: 190px;
    }

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


/* ---------- 6.3 <= 1024px (Primary Menu) ----------
 * The one-line menu is only for desktop / laptop. On tablet and
 * mobile it is hidden in the header and the same menu is shown
 * inside the Off-Canvas instead (off-canvas.css, section 11).
 * The 1024px value must match script.js (Primary Menu Dropdown,
 * pmDesktop = min-width 1025px) and off-canvas.css (section 14). */
@media (max-width: 1024px) {

    .avozova-primary-menu-wrap {
        display: none;
    }
}


/* ---------- 6.4 <= 800px (Mobile header) ---------- */
@media (max-width: 800px) {

    .avozova-site-title {
        font-size: var(--avozova-font-size-4);
    }
}


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

    .avozova-hide-mobile {
        display: none !important;
    }

    .avozova-search {
        --avozova-search-width: 190px;
    }

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