/*
 * Itminan Theme - own header (inc/header/header.php, template-parts/itm-header.php).
 * White, full width, thin line and a soft shadow below; the content sits in a 1280px column in the middle. Navy #2d377d for text,
 * outlines and the user icon; orange for the first button.
 * Phone first: logo (the logo picture itself carries the name; up to 52px high, takes the free space) | user icon | menu button;
 * from 1100px: logo | menu ... buttons + user menu.
 */
header.itm-header.site-header{position:sticky;top:0;z-index:1000;display:block;width:100%;max-width:none!important;margin:0!important;padding:0!important;background:#fff;color:#2d377d;border-bottom:1px solid #e3e7f1;box-shadow:0 4px 16px rgba(31,42,99,.08);font-family:"Hind Siliguri","Noto Sans Bengali","Nirmala UI",sans-serif;line-height:1.4}
.admin-bar header.itm-header.site-header{top:32px}
@media (max-width:782px){.admin-bar header.itm-header.site-header{top:46px}}
.itm-header *{box-sizing:border-box}
.itm-hd-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;max-width:1280px;margin:0 auto;padding:6px 10px 6px 8px}

/* logo: no chip; the picture holds the name, so it is as large as allowed (52px) and takes the free space on a phone */
.itm-header .itm-hd-logo{flex:1 1 auto;min-width:0}
.itm-header .itm-hd-logo a{display:inline-flex;align-items:center;max-width:100%;margin:0;padding:0;background:none;text-decoration:none}
.itm-header .itm-hd-logo img{display:block;width:auto;height:52px;max-width:100%;max-height:none;object-fit:contain;object-position:left center}
.itm-header .itm-hd-site{font-size:20px;font-weight:800;color:#2d377d}

/* menu */
.itm-hd-nav{display:none}
.itm-header .itm-hd-menu{display:flex;align-items:center;flex-wrap:wrap;gap:2px;margin:0;padding:0;list-style:none}
.itm-header .itm-hd-menu li{position:relative;margin:0;padding:0;list-style:none}
.itm-header .itm-hd-menu a{display:block;padding:10px 14px;border-radius:8px;color:#2d377d;font-size:16px;font-weight:600;text-decoration:none;transition:background .15s,color .15s}
.itm-header .itm-hd-menu a:hover,.itm-header .itm-hd-menu a:focus-visible{background:#eef0fb;color:#2d377d}
.itm-header .itm-hd-menu .current-menu-item>a,.itm-header .itm-hd-menu .current-menu-ancestor>a,.itm-header .itm-hd-menu .current_page_item>a{background:#e3e7fa;color:#2d377d;font-weight:700}
.itm-header .itm-hd-menu .sub-menu{position:absolute;left:0;top:100%;z-index:10;min-width:200px;margin:0;padding:6px;list-style:none;background:#fff;border:1px solid #e3e7f1;border-radius:12px;box-shadow:0 14px 34px rgba(31,42,99,.16);opacity:0;visibility:hidden;transform:translateY(6px);transition:opacity .15s,transform .15s,visibility .15s}
.itm-header .itm-hd-menu li:hover>.sub-menu,.itm-header .itm-hd-menu li:focus-within>.sub-menu{opacity:1;visibility:visible;transform:none}
.itm-header .itm-hd-menu .sub-menu a{font-size:15px}

/* buttons: the first is orange, the others have a navy border */
.itm-hd-actions{display:none;align-items:center;gap:8px}
.itm-header a.itm-hd-btn,.itm-header a.itm-hd-btn:hover,.itm-header a.itm-hd-btn:focus{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 16px;border:2px solid #2d377d;border-radius:999px;background:transparent;color:#2d377d;font-size:15px;font-weight:700;text-decoration:none;white-space:nowrap;transition:background .15s,color .15s,border-color .15s}
.itm-header a.itm-hd-btn:hover,.itm-header a.itm-hd-btn:focus-visible{background:#2d377d;color:#fff}
.itm-header a.itm-hd-btn.is-primary,.itm-header a.itm-hd-btn.is-primary:focus{border-color:#f39a2c;background:#f39a2c;color:#1f2a63}
.itm-header a.itm-hd-btn.is-primary:hover,.itm-header a.itm-hd-btn.is-primary:focus-visible{border-color:#e08716;background:#e08716;color:#1f2a63}
.itm-header a.itm-hd-btn:focus-visible{outline:3px solid rgba(45,55,125,.35);outline-offset:2px}

/* phone: logo | user icon | menu button (user menu keeps its own navy-on-white look) */
.itm-hd-mobile{display:flex;align-items:center;flex:0 0 auto;gap:8px}
.itm-header .itm-hd-burger{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin:0;padding:0;border:2px solid #2d377d;border-radius:12px;background:#fff;color:#2d377d;cursor:pointer;box-shadow:none}
.itm-header .itm-hd-burger:hover,.itm-header .itm-hd-burger:focus{background:#2d377d;color:#fff;border-color:#2d377d}
.itm-header .itm-hd-burger:focus-visible,.itm-header .itm-hd-close:focus-visible{outline:3px solid rgba(45,55,125,.35);outline-offset:2px}
.itm-hd-burger-box{display:flex;flex-direction:column;gap:5px;width:20px}
.itm-hd-burger-box span{display:block;height:2px;border-radius:2px;background:currentColor}

/* side panel */
.itm-hd-overlay{position:fixed;inset:0;z-index:1090;background:rgba(10,15,45,.5);opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s}
.itm-hd-overlay.is-open{opacity:1;visibility:visible}
.itm-hd-panel{position:fixed;top:0;right:0;bottom:0;z-index:1100;display:flex;flex-direction:column;gap:6px;width:min(86vw,340px);overflow-y:auto;padding:12px 16px 24px;background:#fff;color:#2d377d;box-shadow:-14px 0 40px rgba(10,15,45,.28);transform:translateX(105%);visibility:hidden;transition:transform .28s ease,visibility 0s linear .28s}
.itm-hd-panel.is-open{transform:none;visibility:visible;transition:transform .28s ease,visibility 0s}
.itm-hd-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;padding-bottom:10px;border-bottom:1px solid #e3e7f1}
.itm-hd-panel-head .itm-hd-logo{flex:1 1 auto}
.itm-header .itm-hd-close{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin:0;padding:0;border:2px solid #2d377d;border-radius:12px;background:#fff;color:#2d377d;font-size:28px;line-height:1;cursor:pointer;box-shadow:none}
.itm-header .itm-hd-close:hover,.itm-header .itm-hd-close:focus{background:#2d377d;color:#fff;border-color:#2d377d}
.itm-hd-panel-nav .itm-hd-menu{display:flex;flex-direction:column;align-items:stretch;gap:2px}
.itm-hd-panel-nav .itm-hd-menu a{padding:13px 12px;font-size:17px}
.itm-hd-panel-nav .itm-hd-menu>li{border-bottom:1px solid #eef0f6}
.itm-hd-panel-nav .itm-hd-menu .sub-menu{position:static;opacity:1;visibility:visible;transform:none;min-width:0;padding:0 0 6px 14px;background:transparent;border:0;box-shadow:none}
.itm-hd-panel-btns{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.itm-hd-panel-btns a.itm-hd-btn{width:100%;min-height:46px;font-size:16px}
body.itm-hd-lock{overflow:hidden}

/* desktop: logo | menu (right after the logo) ... buttons + user menu (pushed to the right) */
@media (min-width:1100px){
	.itm-hd-bar{justify-content:flex-start;gap:16px;padding:8px 16px}
	.itm-header .itm-hd-logo{flex:0 0 auto}
	.itm-header .itm-hd-logo img{height:56px}
	.itm-hd-nav{display:flex;flex:0 1 auto;justify-content:flex-start;min-width:0;margin-left:12px}
	.itm-hd-actions{display:flex;flex:0 0 auto;margin-left:auto;gap:10px}
	.itm-header .itm-hd-nav .itm-hd-menu a{padding:10px 17px;font-size:17px}
	.itm-header .itm-hd-actions a.itm-hd-btn{min-height:44px;padding:9px 22px;font-size:16px}
	.itm-hd-mobile,.itm-hd-overlay,.itm-hd-panel{display:none}
}
/* small phones (360px): the logo keeps its 52px, the two buttons stay on the right */
@media (max-width:420px){
	.itm-hd-bar{gap:8px;padding:5px 8px 5px 6px}
}
/* phone (under 768px): round symbol on the left, then the name as real text over all the free space, then the user icon and the menu button.
   The Bengali line is sized by itm-header.js to the free width (one line, 20px or more at 360px); the clamp below is the no-JS fallback.
   Without a symbol (.itm-hd-has-brand missing) the full logo stays. */
.itm-hd-brand{display:none}
@media (max-width:767px){
	.itm-hd-bar{gap:6px;padding:4px 6px}
	.itm-hd-has-brand .itm-hd-bar>.itm-hd-logo{display:none}
	.itm-header .itm-hd-brand{display:flex;align-items:center;flex:1 1 auto;gap:6px;min-width:0;margin:0;padding:0;color:#2d377d;text-decoration:none}
	.itm-header .itm-hd-mark{display:block;flex:0 0 auto;width:42px;height:42px;max-width:none;object-fit:contain;border-radius:50%}
	.itm-header .itm-hd-name{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;min-width:0;line-height:1.15}
	.itm-header .itm-hd-name-bn{display:block;overflow:hidden;font-size:clamp(14px,calc((100vw - 158px) / 9.65),26px);font-weight:800;line-height:1.2;color:#2d377d;white-space:nowrap}
	.itm-header .itm-hd-name-en{display:block;overflow:hidden;font-size:clamp(9px,calc((100vw - 158px) / 21),13px);font-weight:600;line-height:1.2;color:#6a74b4;white-space:nowrap}
	.itm-hd-mobile{gap:6px}
}
@media (prefers-reduced-motion:reduce){
	.itm-hd-panel,.itm-hd-overlay{transition:none}
}
