/* Header SMK Ma'arif 9 Kebumen */
html.sh-lock { overflow: hidden; }
/* tinggi header menempel: dipakai sidebar situs (style.css) agar tidak tertutup */
:root { --bar-h: 125px; }
@media (max-width: 1100px) { :root { --bar-h: 56px; } }

.sh {
  --sh-from: #0b4a47;
  --sh-to: #137b67;
  --sh-accent: #F5B82E;
  --sh-ink: #12332f;
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(120deg, var(--sh-from), var(--sh-to));
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}
.sh *, .sh *::before, .sh *::after { box-sizing: border-box; }
.sh a, .sh a:hover { color: inherit; text-decoration: none; }
.sh ul { list-style: none; margin: 0; padding: 0; }
.sh img { max-width: none; }
.sh button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sh a:focus-visible, .sh button:focus-visible, .sh input:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 2px; }

.sh-wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

/* ---------- Baris atas ---------- */
.sh-top .sh-wrap { display: flex; align-items: center; gap: 12px; height: 72px; }
.sh-brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.sh-logo { position: relative; flex: none; width: 52px; height: 52px; border-radius: 13px; background: #fff; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.sh-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; opacity: 0; transition: opacity .3s linear; }
.sh-logo img.on { opacity: 1; }
.sh-name { text-transform: uppercase; font-weight: 800; font-size: 1.2rem; letter-spacing: .2px; line-height: 1.15; }

.sh-contact { display: flex; align-items: center; gap: 8px; flex: none; }
.sh-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  font-weight: 600; font-size: .9rem; white-space: nowrap; transition: background .15s;
}
a.sh-pill:hover { background: rgba(255, 255, 255, .2); }
.sh-pill span { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.sh-social { gap: 2px; padding: 0 6px; }
.sh-social a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; transition: background .15s; }
.sh-social a:hover { background: rgba(255, 255, 255, .2); }

.sh-ico { width: 19px; height: 19px; fill: currentColor; flex: none; }
.sh-ico.st, .sh-chev.st { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sh-chev { width: 14px; height: 14px; }

.sh-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.sh-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .12); transition: background .15s; }
.sh-btn:hover { background: rgba(255, 255, 255, .22); }
.sh-burger { display: none; flex-direction: column; align-items: center; justify-content: center; }
.sh-burger i { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .15s; }
.sh-burger i + i { margin-top: 5px; }
.menu-open .sh-burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .sh-burger i:nth-child(2) { opacity: 0; }
.menu-open .sh-burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Pencarian ---------- */
.sh-search { background: rgba(0, 0, 0, .22); padding: 10px 0; }
.sh-search[hidden] { display: none; }
.sh-search form { display: flex; gap: 8px; max-width: 680px; margin: 0 auto; padding: 0 20px; }
.sh-search input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 12px; padding: 0 14px; font: inherit; color: var(--sh-ink); background: #fff; }
.sh-search button { height: 44px; padding: 0 20px; border-radius: 12px; background: var(--sh-accent); color: #3a2e00; font-weight: 700; }

/* ---------- Menu (desktop) ---------- */
.sh-navbar { border-top: 1px solid rgba(255, 255, 255, .16); }
.sh-navwrap { position: relative; }
.sh-menu { display: flex; align-items: center; gap: 2px; height: 52px; }
.sh-menu > .sh-item { position: relative; display: flex; align-items: center; align-self: stretch; }
.sh-row { display: flex; align-items: center; border-radius: 10px; transition: background .15s; }
.sh-link { display: flex; align-items: center; min-height: 38px; padding: 0 11px; font-weight: 700; font-size: .8rem; letter-spacing: .4px; text-transform: uppercase; color: rgba(255, 255, 255, .9); }
.sh-caret { display: grid; place-items: center; width: 22px; height: 38px; margin-left: -8px; padding-right: 4px; opacity: .75; }
.sh-caret .sh-chev { transition: transform .2s; }
.sh-menu > .sh-item.has-sub > .sh-row > .sh-link { padding-right: 4px; }
.sh-menu > .sh-item:hover > .sh-row,
.sh-menu > .sh-item.open > .sh-row { background: rgba(255, 255, 255, .13); }
.sh-menu > .sh-item.active > .sh-row { background: rgba(255, 255, 255, .22); }
.sh-menu > .sh-item.open > .sh-row .sh-chev { transform: rotate(180deg); }

/* dropdown */
.sh-sub {
  position: absolute; left: 0; top: 100%; z-index: 5; min-width: 270px;
  background: #fff; color: var(--sh-ink); padding: 8px;
  border-top: 3px solid var(--sh-accent); border-radius: 0 0 14px 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
}
.sh-menu > .sh-item:nth-last-child(-n+5):not(.mega) > .sh-sub { left: auto; right: 0; }
.sh-sub .sh-link { flex: 1; min-height: 36px; padding: 7px 12px; font-size: .88rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--sh-ink); }
.sh-sub .sh-row:hover { background: #e6f3ef; }
.sh-sub .active > .sh-row > .sh-link { color: var(--sh-to); font-weight: 800; }
.sh-sub .has-sub > .sh-row > .sh-link { font-weight: 800; color: var(--sh-from); }
.sh-sub .sh-caret { display: none; }
.sh-grp { margin: 0 0 6px 14px; padding-left: 8px; border-left: 2px solid #cfe5df; }
.sh-grp .sh-link { font-size: .85rem; font-weight: 500; }
.sh-sub > li { break-inside: avoid; }

.sh-menu > .sh-item.mega { position: static; }
.sh-menu > .sh-item.mega > .sh-sub { left: 20px; right: 20px; columns: 3; column-gap: 12px; padding: 14px; }

@media (hover: hover) and (min-width: 1101px) {
  .sh-menu > .sh-item:hover > .sh-sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
@media (min-width: 1101px) {
  .sh-menu > .sh-item.open > .sh-sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}

.sh-nav-foot { display: none; }

@media (max-width: 1280px) {
  .sh-link { font-size: .74rem; padding: 0 8px; letter-spacing: .2px; }
  .sh-name { font-size: 1.08rem; }
}

/* ---------- Mode HP & tablet ---------- */
@media (max-width: 1100px) {
  .sh-top .sh-wrap { height: 56px; gap: 8px; padding: 0 12px; }
  .sh-top .sh-contact { display: none; }
  .sh-burger { display: flex; }
  .sh-logo { width: 38px; height: 38px; border-radius: 10px; }
  .sh-brand { gap: 9px; }
  .sh-btn { width: 36px; height: 36px; border-radius: 10px; }
  .sh-btn .sh-ico { width: 17px; height: 17px; }
  .sh-burger i { width: 17px; }
  .sh-burger i + i { margin-top: 4px; }
  .menu-open .sh-burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-open .sh-burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .sh-name { font-size: .84rem; }

  .sh-navbar {
    position: absolute; left: 0; right: 0; top: 100%;
    max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain;
    background: linear-gradient(160deg, var(--sh-from), var(--sh-to));
    box-shadow: 0 16px 30px rgba(0, 0, 0, .3);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }
  .menu-open .sh-navbar { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .sh-navwrap { padding: 6px 10px 12px; }

  .sh-menu { display: block; height: auto; }
  .sh-menu > .sh-item { display: block; align-self: auto; }
  .sh-item { border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .sh-item:last-child { border-bottom: 0; }
  .sh-row { align-items: stretch; border-radius: 10px; }
  .sh-link, .sh-sub .sh-link { flex: 1; min-height: 42px; padding: 0 10px; font-size: .8rem; color: #fff; }
  .sh-sub .sh-link { text-transform: none; font-weight: 600; font-size: .8rem; }
  .sh-menu > .sh-item.has-sub > .sh-row > .sh-link { padding-right: 12px; }
  .sh-caret, .sh-sub .sh-caret { display: grid; width: 42px; height: auto; min-height: 42px; margin: 0; padding: 0; opacity: .9; }
  .open > .sh-row > .sh-caret .sh-chev { transform: rotate(180deg); }
  .sh-menu > .sh-item:hover > .sh-row { background: none; }
  .sh-menu > .sh-item.active > .sh-row { background: rgba(255, 255, 255, .16); }

  .sh-sub {
    position: static; display: none; min-width: 0; margin: 0 0 8px; padding: 4px;
    background: rgba(0, 0, 0, .2); color: #fff; border: 0; border-radius: 12px; box-shadow: none;
    opacity: 1; visibility: visible; transform: none; transition: none; columns: auto !important;
  }
  .sh-menu > .sh-item.mega > .sh-sub { left: auto; right: auto; }
  .open > .sh-sub { display: block; }
  .sh-sub .sh-row:hover { background: rgba(255, 255, 255, .1); }
  .sh-sub .active > .sh-row > .sh-link,
  .sh-sub .has-sub > .sh-row > .sh-link { color: #fff; }
  .sh-sub .active > .sh-row > .sh-link { color: var(--sh-accent); }
  .sh-grp { display: none; margin: 0 0 6px 12px; border-left-color: rgba(255, 255, 255, .3); }
  .open > .sh-grp { display: block; }
  .sh-grp .sh-link { min-height: 38px; font-size: .76rem; }

  .sh-nav-foot { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); }
  .sh-nav-foot .sh-contact { display: flex; flex-wrap: wrap; gap: 8px; }
  .sh-nav-foot .sh-pill span { max-width: 60vw; }
  .sh-pill { height: 34px; padding: 0 12px; font-size: .78rem; }
  .sh-social a { width: 30px; height: 30px; }
  .sh-search input, .sh-search button { height: 38px; font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sh *, .sh *::before, .sh *::after { transition: none !important; }
}
