/* =========================================================================
   F03 HEADER — ported from the approved layout playground. Prefix ap-.
   Colours/fonts/spacing only from F01 variables.
   Two states: full (logo row + menu row) and .ap-thin (menu row only).
   Phone layout = class ap-m on <html> (below 900 px, or when the menu does not fit).
   ========================================================================= */
html { scroll-padding-top: calc(var(--ap-hdr-nav) + var(--ap-sp-4)); }

.ap-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: box-shadow .2s ease; }
.ap-header.ap-thin { box-shadow: var(--ap-shadow-bar); }
.ap-hdr-spacer { height: calc(var(--ap-hdr-top) + var(--ap-hdr-nav)); }
.ap-header .ap-wrap { padding: 0 var(--ap-side); }

/* ---- row 1: logo + name + Newsletter / Aplikacija / Prijava ---- */
.ap-hdr-top { background: var(--ap-card); height: var(--ap-hdr-top); overflow: hidden; visibility: visible;
	transition: height .2s ease, opacity .2s ease, visibility 0s linear 0s; }
.ap-thin .ap-hdr-top { height: 0; opacity: 0; visibility: hidden; transition: height .2s ease, opacity .2s ease, visibility 0s linear .2s; }
.ap-hdr-top .ap-wrap { height: var(--ap-hdr-top); display: flex; align-items: center; justify-content: space-between; gap: var(--ap-sp-4); }
.ap-brand { display: flex; align-items: center; gap: var(--ap-sp-3); text-decoration: none; color: var(--ap-text); }
.ap-brand:hover { color: var(--ap-text); }
.ap-brand .ap-logo { width: 56px; height: 56px; flex: none; }
.ap-brand-name { display: block; font: 700 30px/1.05 var(--ap-font-head); color: var(--ap-brand-dark); letter-spacing: .2px; }
.ap-brand-sub { display: block; font-size: var(--ap-fs-s); line-height: 1.2; color: var(--ap-muted); margin-top: var(--ap-sp-1); }
.ap-hdr-links { display: flex; align-items: center; gap: var(--ap-sp-1); list-style: none; margin: 0; padding: 0; }
.ap-hdr-links a { display: flex; align-items: center; min-height: var(--ap-touch); padding: 0 var(--ap-sp-4); font-size: var(--ap-fs-m); font-weight: 600;
	color: var(--ap-text); text-decoration: none; border-radius: var(--ap-radius-sm); }
.ap-hdr-links a:hover { background: var(--ap-tint); color: var(--ap-text); }
.ap-hdr-links .ap-prijava a { background: var(--ap-btn); color: var(--ap-btn-ink); margin-left: 6px; }
.ap-hdr-links .ap-prijava a:hover { background: var(--ap-btn-hover); color: var(--ap-btn-ink); }

/* logo: two colours through variables */
.ap-lg-bg { fill: var(--ap-lg-bg); }
.ap-lg-fg { fill: var(--ap-lg-fg); }
.ap-lg-st { stroke: var(--ap-lg-fg); fill: none; }
.ap-brand .ap-logo { --ap-lg-bg: var(--ap-brand); --ap-lg-fg: var(--ap-white); }
.ap-mini-logo .ap-logo { --ap-lg-bg: var(--ap-white); --ap-lg-fg: var(--ap-brand); }

/* ---- row 2: the menu (stays as the thin line) ---- */
.ap-hdr-nav { background: var(--ap-brand); color: var(--ap-on-brand); height: var(--ap-hdr-nav); }
.ap-hdr-nav .ap-wrap { height: 100%; display: flex; align-items: center; }
.ap-hdr-nav :focus-visible { outline-color: var(--ap-warn-y); }
.ap-mini-logo { display: flex; align-items: center; flex: none; width: 0; margin-right: 0; opacity: 0; overflow: hidden; visibility: hidden;
	transition: width .2s ease, margin .2s ease, opacity .2s ease, visibility 0s linear .2s; }
.ap-thin .ap-mini-logo { width: 48px; margin-right: var(--ap-sp-3); opacity: 1; visibility: visible;
	transition: width .2s ease, margin .2s ease, opacity .2s ease, visibility 0s linear 0s; }
.ap-mini-logo .ap-logo { width: 40px; height: 40px; flex: none; }
.ap-mini-logo:focus-visible { outline-offset: -3px; }

#ap-main-nav { flex: 1 1 auto; min-width: 0; height: 100%; }
.ap-menu { list-style: none; display: flex; height: 100%; margin: 0; padding: 0; }
.ap-menu > li { position: relative; flex: none; display: flex; margin: 0; }
.ap-menu > li > a.ap-top { display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 var(--ap-sp-3);
	font-size: var(--ap-fs-menu); font-weight: 600; color: var(--ap-on-brand); text-decoration: none; white-space: nowrap; }
.ap-menu > li > a.ap-top[aria-haspopup]::after { content: ""; flex: none; width: 0; height: 0; margin-top: 2px;
	border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s ease; }
.ap-menu > li > a.ap-top:hover, .ap-menu > li.ap-open > a.ap-top { background: var(--ap-brand-dark); color: var(--ap-on-brand); }
.ap-menu > li.ap-open > a.ap-top::after { transform: rotate(180deg); }
.ap-menu > li.ap-m-only { display: none; }

.ap-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 280px; z-index: 5; list-style: none;
	margin: 0; padding: var(--ap-sp-2) 0; background: var(--ap-card); color: var(--ap-text);
	border-radius: 0 0 var(--ap-radius) var(--ap-radius); box-shadow: var(--ap-shadow-pop); }
.ap-menu > li.ap-open > .ap-sub { display: block; }
.ap-menu > li.ap-edge > .ap-sub { left: auto; right: 0; }
.ap-sub li { margin: 0; }
.ap-sub a { display: flex; align-items: center; min-height: var(--ap-touch); padding: 6px 22px; font-size: var(--ap-fs-m); font-weight: 500;
	color: var(--ap-text); text-decoration: none; }
.ap-sub a:hover, .ap-sub a:focus-visible { background: var(--ap-tint); color: var(--ap-brand-dark); }
.ap-sub :focus-visible { outline: 3px solid var(--ap-focus); outline-offset: -3px; }

.ap-menu-btn { display: none; }

/* narrower windows: the menu squeezes first, then turns into the "Izbornik" button */
html.ap-fit1 .ap-menu > li > a.ap-top { font-size: var(--ap-fs-menu-fit1); padding: 0 9px; }
html.ap-fit1 .ap-menu > li > a.ap-top::after { display: none; }
html.ap-fit2 .ap-menu > li > a.ap-top { font-size: var(--ap-fs-menu-fit2); padding: 0 7px; }
html.ap-fit2 .ap-menu > li > a.ap-top::after { display: none; }

/* ---- phone layout: the thin line = logo + "Izbornik" button ---- */
html.ap-m .ap-header .ap-wrap { padding: 0 var(--ap-sp-3); }
html.ap-m .ap-hdr-links { display: none; }
html.ap-m .ap-brand .ap-logo { width: 44px; height: 44px; }
html.ap-m .ap-brand-name { font-size: 25px; }
html.ap-m .ap-brand-sub { font-size: var(--ap-fs-xs); margin-top: 2px; }
html.ap-m #ap-main-nav { flex: 0 0 0; width: 0; min-width: 0; }
html.ap-m .ap-menu-btn { display: flex; flex: 1 1 auto; align-items: center; justify-content: space-between; min-height: var(--ap-touch); padding: 0 var(--ap-sp-4);
	border: 0; border-radius: var(--ap-radius-sm); background: var(--ap-brand-dark); color: var(--ap-on-brand); font-size: 18px; font-weight: 700; cursor: pointer; }
html.ap-m .ap-bars { width: 22px; height: 2px; background: currentColor; box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor; }
html.ap-m .ap-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; height: auto;
	max-height: calc(100vh - var(--ap-hdr-top) - var(--ap-hdr-nav)); max-height: calc(100dvh - var(--ap-hdr-top) - var(--ap-hdr-nav));
	overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--ap-card); color: var(--ap-text); box-shadow: var(--ap-shadow-pop); }
html.ap-m body.ap-menu-open .ap-menu { display: flex; }
html.ap-m .ap-thin .ap-menu { max-height: calc(100vh - var(--ap-hdr-nav)); max-height: calc(100dvh - var(--ap-hdr-nav)); }
html.ap-m .ap-menu > li, html.ap-m .ap-menu > li.ap-m-only { display: block; border-bottom: 1px solid var(--ap-line); }
html.ap-m .ap-menu > li > a.ap-top { height: auto; min-height: 52px; justify-content: space-between; padding: var(--ap-sp-2) 20px;
	font-size: 18px; color: var(--ap-text); white-space: normal; }
html.ap-m .ap-menu > li > a.ap-top:hover, html.ap-m .ap-menu > li.ap-open > a.ap-top { background: var(--ap-tint); color: var(--ap-text); }
html.ap-m .ap-menu > li > a.ap-top[aria-haspopup]::after { display: block; }
html.ap-m .ap-menu > li > a.ap-top.ap-plain::after { display: none; }
html.ap-m .ap-sub, html.ap-m .ap-menu > li.ap-edge > .ap-sub { position: static; min-width: 0; box-shadow: none; border-radius: 0; background: var(--ap-tint); padding: var(--ap-sp-1) 0 var(--ap-sp-2); }
html.ap-m .ap-sub a { padding-left: 36px; }
html.ap-m .ap-sub a:hover, html.ap-m .ap-sub a:focus-visible { background: var(--ap-card); }
html.ap-m .ap-menu > li.ap-m-only > a.ap-top { font-weight: 600; }
