/* ioann-karpovka header: utility bar, logo + wordmark, nav with dropdowns, ochre band.
   Values from docs/design/Site.dc.html (home, desktop + mobile header). */

/* overflow-x: clip keeps the (hidden) right-most dropdown from widening the page. */
.ik-header { position: relative; z-index: 60; background: var(--iskm-cream-50); overflow-x: clip; }

/* Base link styles (base.css underlines every <a>): reset and pin colours on hover. */
.ik-util a,
.ik-header__home,
.ik-nav a { text-decoration: none; }

/* ---------- Utility bar ---------- */
.ik-util { background: var(--iskm-navy); color: var(--iskm-cream); font: 400 13px/1 var(--font-body); }
.ik-util__inner {
    padding-block: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
}
.ik-util__date,
.ik-util__item { display: inline-flex; align-items: center; gap: 8px; }
.ik-util__date-short { display: none; }
.ik-util__end { display: flex; align-items: center; gap: 28px; }
.ik-util__phone,
.ik-util__phone:hover { color: var(--iskm-cream); }
.ik-util__social {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding-left: 24px;
    border-left: 1px solid rgba(237, 233, 220, .3);
}
.ik-util__social-link {
    display: inline-flex;
    color: var(--iskm-cream);
    opacity: .85;
    transition: opacity var(--dur) var(--ease);
}
@media (hover: hover) {
    .ik-util__social-link:hover { opacity: 1; color: var(--iskm-cream); }
}

/* Tap targets: centred >=44px hit area around small glyph links. */
.ik-util__social-link,
.ik-util__phone,
.ik-nav__link { position: relative; }
.ik-util__social-link::after,
.ik-util__phone::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
}

/* ---------- Main row + wordmark ---------- */
.ik-header__main {
    padding-block: 16px;
    min-height: 104px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
}
.ik-header__home {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--iskm-navy);
    flex-shrink: 0;
}
.ik-header__home:hover { color: var(--iskm-navy); }
.ik-header__logo { width: 84px; height: 84px; flex-shrink: 0; }
.ik-header__wordmark { display: flex; flex-direction: column; }
.ik-header__wm1 { font: 700 26px/1 var(--font-title); white-space: nowrap; }
.ik-header__wm2 { font: 700 20px/1 var(--font-title); white-space: nowrap; }
.ik-header__wm3 {
    margin-top: 10px;
    font: 500 12px/1 var(--font-body);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--iskm-mauve-700);
}
.ik-header__actions { display: none; }
.ik-header__burger-close { display: none; }
.ik-header__burger[aria-expanded="true"] .ik-header__burger-open { display: none; }
.ik-header__burger[aria-expanded="true"] .ik-header__burger-close { display: block; }

/* ---------- Nav ---------- */
.ik-nav { min-width: 0; flex: 1 1 auto; display: flex; justify-content: flex-end; }
.ik-nav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ik-nav__item { position: relative; }
.ik-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    font: 500 14px/1.2 var(--font-body);
    color: var(--iskm-navy);
    white-space: nowrap;
    transition: box-shadow var(--dur) var(--ease);
}
.ik-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: max(100%, 44px);
    transform: translateY(-50%);
}
.ik-nav__link:hover { color: var(--iskm-navy); }
@media (hover: hover) {
    .ik-nav__link:hover { box-shadow: inset 0 -2px 0 var(--iskm-ochre); }
}
.ik-nav__item.is-open > .ik-nav__link { box-shadow: inset 0 -2px 0 var(--iskm-ochre); color: var(--iskm-navy); }
.ik-nav__mark {
    position: absolute;
    left: 50%;
    top: -14px;
    width: 12px;
    height: 12px;
    transform: translateX(-50%);
    pointer-events: none;
}

/* ---------- Dropdown ---------- */
/* --ik-drop-shift (set by header.js) drops the panel below the last nav row when the list wraps, so it never covers lower-row items. */
.ik-nav__drop {
    position: absolute;
    top: calc(100% + var(--ik-drop-shift, 0px));
    left: -20px;
    padding-top: 12px;
    z-index: 70;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
@media (hover: hover) {
    .ik-nav:not(.ik-nav--js) .ik-nav__item--has-sub:hover > .ik-nav__drop {
        visibility: visible;
        opacity: 1;
        transition-delay: 0s;
    }
}
.ik-nav:not(.ik-nav--js) .ik-nav__item--has-sub:focus-within > .ik-nav__drop,
.ik-nav__item.is-open > .ik-nav__drop {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}
.ik-nav__item--flip > .ik-nav__drop { left: auto; right: -20px; }
.ik-nav__panel {
    margin: 0;
    list-style: none;
    width: max-content;
    min-width: 260px;
    max-width: 340px;
    background: var(--iskm-paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-float);
    padding: 8px;
}
.ik-nav__sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 8px;
    font: 500 15px/1.3 var(--font-body);
    color: var(--iskm-navy);
    white-space: normal;
    transition: background-color var(--dur) var(--ease);
}
.ik-nav__sublink:hover { background: var(--iskm-cream); color: var(--iskm-navy); }
.ik-nav__sublink:focus-visible { outline-offset: -2px; }
.ik-nav__submark { width: 12px; height: 12px; flex-shrink: 0; }

/* ---------- Band ---------- */
.ik-header__band--mobile { display: none; }

/* ---------- Mobile shell ---------- */
@media not all and (min-width: 768px) {
    .ik-util { font-size: 12px; }
    .ik-util__inner { padding-block: 10px; min-height: 0; flex-wrap: nowrap; gap: 12px; }
    .ik-util__date-icon,
    .ik-util__date-long,
    .ik-util__address,
    .ik-util__phone { display: none; }
    .ik-util__date-short { display: inline; }
    .ik-util__date { min-width: 0; }
    .ik-util__social { gap: 12px; padding-left: 0; border-left: 0; }
    .ik-util__social-link .ik-icon { width: 16px; height: 16px; }
    .ik-util__social-link--max .ik-icon { width: 15px; height: 15px; }

    .ik-header__main { padding-block: 14px; min-height: 0; gap: 12px; }
    .ik-header__home { gap: 12px; min-width: 0; flex-shrink: 1; }
    .ik-header__logo { width: 60px; height: 60px; }
    .ik-header__wm1 { font-size: 20px; white-space: normal; }
    .ik-header__wm2 { font-size: 16px; white-space: normal; }
    .ik-header__wm3 { font-size: 11px; margin-top: 8px; }

    .ik-header__actions { display: flex; flex-shrink: 0; }
    .ik-nav { display: none; }
    .ik-header__band--desktop { display: none; }
    .ik-header__band--mobile { display: block; }
}

/* ---------- Mobile menu (task 5) ---------- */
/* base.css has no [hidden] reset: guard every author display rule. */
.ik-mmenu[hidden],
.ik-mmenu__sub[hidden] { display: none; }

/* Fixed scroller from the header's bottom edge (--ik-mmenu-top, set by JS) to the viewport bottom. */
.ik-mmenu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--ik-mmenu-top, 0px);
    z-index: 55;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* The design passes cream, but its render shows the page ground (cream-50) under the pattern. */
    background: var(--iskm-cream-50);
}
.ik-mmenu__fill { min-height: 100%; }
.ik-mmenu__nav { padding: 28px var(--gutter, 20px) 40px; display: flex; flex-direction: column; }
.ik-mmenu__list,
.ik-mmenu__sub { list-style: none; margin: 0; padding: 0; }
.ik-mmenu a { text-decoration: none; }

.ik-mmenu__top {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 16px 0;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
    font: 600 28px/1.1 var(--font-title);
    color: var(--iskm-navy);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.ik-mmenu__top:hover { color: var(--iskm-navy); }
.ik-mmenu__label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ik-mmenu__mark { width: 14px; height: 14px; flex-shrink: 0; }
.ik-mmenu__top[aria-expanded="true"] .ik-mmenu__mark { display: none; }
.ik-mmenu__chev { flex-shrink: 0; transition: transform var(--dur) var(--ease); }
.ik-mmenu__top[aria-expanded="true"] .ik-mmenu__chev { transform: rotate(180deg); }

.ik-mmenu__sublink {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 12px 0 12px 24px;
    border-bottom: 1px solid var(--line);
    font: 500 20px/1.25 var(--font-title);
    color: var(--iskm-navy-400);
    text-decoration: none;
}
.ik-mmenu__sublink:hover { color: var(--iskm-navy-400); }
@media (hover: hover) {
    .ik-mmenu__sublink:hover { color: var(--iskm-navy); }
}
.ik-mmenu__top:focus-visible,
.ik-mmenu__sublink:focus-visible { outline-offset: -2px; }

.ik-mmenu__info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    font: 400 15px/1.5 var(--font-body);
    color: var(--iskm-navy);
}
.ik-mmenu__info-row { display: flex; align-items: center; gap: 10px; margin: 0; }
.ik-mmenu__info-row .ik-icon { color: var(--iskm-mauve-700); flex-shrink: 0; }

.ik-mmenu__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 28px; }
.ik-mmenu__cta { max-width: 100%; }
.ik-mmenu__social { display: flex; gap: 10px; }
.ik-mmenu__max .ik-icon { width: 20px; height: 20px; }

html.ik-menu-open,
html.ik-menu-open body { overflow: hidden; }

@media (min-width: 768px) {
    .ik-mmenu { display: none; }
}
