:root{
  --sdnwt-maroon:#7a1530;
  --sdnwt-red:#a51f3d;
  --sdnwt-bg:#ffffff;
  --sdnwt-text:#2c2230;
  --sdnwt-muted:#776b75;
  --sdnwt-border:rgba(122,21,48,.13);
  --sdnwt-shadow:0 18px 50px rgba(55,18,30,.18);
  --sdnwt-safe-bottom:calc(env(safe-area-inset-bottom, 0px) + 14px);
}
#sdnwt-root{font-family:inherit}
.sdnwt-info-card{
  position:fixed;
  left:18px;
  bottom:18px;
  z-index:9998;
  width:282px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--sdnwt-border);
  border-radius:20px;
  box-shadow:var(--sdnwt-shadow);
  backdrop-filter:blur(12px);
  overflow:hidden;
}
.sdnwt-info-toggle{
  position:absolute;
  top:8px;
  right:8px;
  width:28px;
  height:28px;
  border:0;
  border-radius:9px;
  background:rgba(255,255,255,.16);
  color:#fff;
  font-size:18px;
  font-weight:800;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:2;
}
.sdnwt-clock{padding:16px 18px 14px;background:linear-gradient(135deg,#7a1530,#a51f3d);color:#fff}
.sdnwt-date{font-size:12px;font-weight:650;opacity:.95;margin-bottom:5px}
.sdnwt-time-row{display:flex;align-items:baseline;gap:8px}
.sdnwt-time{font-size:28px;line-height:1;font-weight:800;letter-spacing:.5px}
.sdnwt-wib{font-size:11px;font-weight:800;opacity:.85}
.sdnwt-calendar{padding:13px 14px 14px;background:#fff}
.sdnwt-cal-head{display:grid;grid-template-columns:32px 1fr 32px;align-items:center;gap:5px;margin-bottom:9px}
.sdnwt-cal-head strong{text-align:center;font-size:13px;color:var(--sdnwt-text)}
.sdnwt-cal-head button{border:0;background:#f7edf0;color:var(--sdnwt-maroon);width:30px;height:30px;border-radius:10px;font-size:20px;cursor:pointer}
.sdnwt-weekdays,.sdnwt-days{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}
.sdnwt-weekdays span{font-size:10px;text-align:center;font-weight:800;color:#a28691;padding:3px 0}
.sdnwt-day{height:29px;display:grid;place-items:center;border-radius:9px;font-size:11px;color:#51444c}
.sdnwt-day.is-muted{opacity:.3}
.sdnwt-day.is-today{background:var(--sdnwt-maroon);color:#fff;font-weight:800}
.sdnwt-suggestion-fab{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:9998;
  border:0;
  border-radius:999px;
  background:linear-gradient(135deg,#7a1530,#a51f3d);
  color:#fff;
  box-shadow:0 15px 35px rgba(122,21,48,.28);
  padding:13px 18px;
  display:flex;
  align-items:center;
  gap:9px;
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:transform .2s ease,box-shadow .2s ease;
}
.sdnwt-suggestion-fab:hover{transform:translateY(-2px);box-shadow:0 19px 38px rgba(122,21,48,.33)}
.sdnwt-modal[hidden]{display:none!important}
.sdnwt-modal{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:18px}
.sdnwt-modal-backdrop{position:absolute;inset:0;background:rgba(25,14,19,.55);backdrop-filter:blur(3px)}
.sdnwt-modal-panel{
  position:relative;
  width:min(560px,100%);
  max-height:min(760px,92vh);
  overflow:auto;
  background:#fff;
  border-radius:24px;
  box-shadow:0 28px 80px rgba(24,8,14,.34);
  padding:26px;
}
.sdnwt-close{position:absolute;top:13px;right:13px;width:35px;height:35px;border:0;border-radius:11px;background:#f5eef1;color:#6d263c;font-size:22px;cursor:pointer}
.sdnwt-modal-brand{display:inline-block;color:var(--sdnwt-maroon);font-size:11px;font-weight:900;letter-spacing:1.2px;margin-bottom:5px}
.sdnwt-modal-panel h2{margin:0 0 4px!important;font-size:27px!important;color:var(--sdnwt-text)!important;line-height:1.2!important}
.sdnwt-modal-subtitle{margin:0 0 20px;color:var(--sdnwt-muted);font-size:13px;line-height:1.6}
#sdnwt-suggestion-form{display:grid;gap:14px}
#sdnwt-suggestion-form label{display:grid;gap:6px;color:var(--sdnwt-text);font-size:12px;font-weight:750}
#sdnwt-suggestion-form label small{font-weight:500;color:var(--sdnwt-muted)}
#sdnwt-suggestion-form input[type="text"],
#sdnwt-suggestion-form select,
#sdnwt-suggestion-form textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #dfd4d9;
  background:#fff;
  border-radius:12px;
  padding:11px 12px;
  color:#32262d;
  font:inherit;
  font-size:13px;
  outline:none;
}
#sdnwt-suggestion-form input[type="text"]:focus,
#sdnwt-suggestion-form select:focus,
#sdnwt-suggestion-form textarea:focus{border-color:#9e3651;box-shadow:0 0 0 3px rgba(158,54,81,.09)}
.sdnwt-two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#sdnwt-suggestion-form .sdnwt-anonymous{display:flex;align-items:center;gap:9px;font-weight:650}
.sdnwt-anonymous input{accent-color:var(--sdnwt-maroon)}
.sdnwt-submit{border:0;border-radius:13px;background:linear-gradient(135deg,#7a1530,#a51f3d);color:#fff;padding:12px 16px;font:inherit;font-weight:800;cursor:pointer}
.sdnwt-submit[disabled]{opacity:.65;cursor:not-allowed}
.sdnwt-form-status{min-height:18px;font-size:12px;color:#315d3a}
.sdnwt-form-status.is-error{color:#a32639}
.sdnwt-hp{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important}
body.sdnwt-modal-open{overflow:hidden}

.sdnwt-info-card.is-collapsed{
  width:168px;
  border-radius:18px;
}
.sdnwt-info-card.is-collapsed .sdnwt-calendar{display:none}
.sdnwt-info-card.is-collapsed .sdnwt-clock{padding:12px 14px}
.sdnwt-info-card.is-collapsed .sdnwt-date{font-size:10px;margin-bottom:4px}
.sdnwt-info-card.is-collapsed .sdnwt-time{font-size:22px}
.sdnwt-info-card.is-collapsed .sdnwt-wib{font-size:10px}

@media (max-width:780px){
  .sdnwt-info-card{
    left:12px;
    bottom:calc(78px + var(--sdnwt-safe-bottom));
    width:196px;
    border-radius:18px;
    opacity:.98;
  }
  .sdnwt-clock{padding:12px 14px}
  .sdnwt-time{font-size:21px}
  .sdnwt-date{font-size:11px}
  .sdnwt-calendar{display:none}
  .sdnwt-info-toggle{
    top:6px;
    right:6px;
    width:24px;
    height:24px;
    border-radius:8px;
    font-size:16px;
  }
  .sdnwt-suggestion-fab{
    right:12px;
    bottom:calc(8px + var(--sdnwt-safe-bottom));
    padding:11px 15px;
    font-size:12px;
    gap:8px;
  }
  .sdnwt-suggestion-fab span:first-child{font-size:14px}
}
@media (max-width:480px){
  .sdnwt-info-card{
    width:184px;
    left:10px;
    bottom:calc(76px + var(--sdnwt-safe-bottom));
  }
  .sdnwt-info-card.is-collapsed{
    width:154px;
  }
  .sdnwt-two-col{grid-template-columns:1fr}
  .sdnwt-modal-panel{padding:22px 18px;border-radius:20px}
}
@media (prefers-reduced-motion:reduce){
  .sdnwt-suggestion-fab{transition:none}
}

/* Mobile image anti-crop helper */
@media (max-width: 767px){
  .elementor-widget-image img,
  .elementor-widget-theme-post-featured-image img,
  .elementor-post__thumbnail img,
  .elementor-posts .elementor-post__thumbnail__link img,
  .wp-post-image,
  .attachment-post-thumbnail,
  .post-thumbnail img,
  .entry-content img,
  .wp-block-image img,
  .gallery img,
  .blocks-gallery-item img,
  .wp-block-post-featured-image img{
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
    object-position:center center !important;
  }

  .elementor-post__thumbnail,
  .elementor-posts .elementor-post__thumbnail__link,
  .post-thumbnail,
  .wp-block-post-featured-image{
    height:auto !important;
    min-height:0 !important;
    overflow:visible !important;
  }

  .elementor-image-box-img img,
  .elementor-widget-image-carousel img,
  .swiper-slide img{
    height:auto !important;
    object-fit:contain !important;
    object-position:center center !important;
  }

  header img,
  .site-header img,
  .custom-logo,
  .site-logo img{
    object-fit:contain !important;
  }
}


/* ==========================================================
   v1.1.1 — Targeted mobile image fixes per SD Nugraha menu
   Keeps hero/banner/logo treatment intact; fixes content photos.
   ========================================================== */

@media (max-width: 767px) {

  /* Generic class added only when JS detects probable cropping. */
  img.sdnwt-mobile-photo-safe {
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    max-height:none !important;
    min-height:0 !important;
    aspect-ratio:auto !important;
    object-fit:contain !important;
    object-position:center center !important;
  }

  .sdnwt-mobile-photo-wrap-safe {
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    aspect-ratio:auto !important;
    overflow:visible !important;
    background:#fff !important;
  }

  /* Pages that mainly use cards / publication photos. */
  body.sdnwt-path-akademik main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-berita main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-kegiatan main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-agenda main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-pengumuman main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-prestasi main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-galeri main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-publikasi main img:not(.custom-logo):not([class*="logo"]) {
    max-width:100% !important;
  }

  /* WordPress / Elementor post cards: release fixed thumbnail crop on mobile. */
  body.sdnwt-path-akademik .elementor-post__thumbnail,
  body.sdnwt-path-berita .elementor-post__thumbnail,
  body.sdnwt-path-kegiatan .elementor-post__thumbnail,
  body.sdnwt-path-agenda .elementor-post__thumbnail,
  body.sdnwt-path-pengumuman .elementor-post__thumbnail,
  body.sdnwt-path-prestasi .elementor-post__thumbnail,
  body.sdnwt-path-galeri .elementor-post__thumbnail,
  body.sdnwt-path-publikasi .elementor-post__thumbnail,
  body.sdnwt-path-akademik .post-thumbnail,
  body.sdnwt-path-berita .post-thumbnail,
  body.sdnwt-path-kegiatan .post-thumbnail,
  body.sdnwt-path-agenda .post-thumbnail,
  body.sdnwt-path-pengumuman .post-thumbnail,
  body.sdnwt-path-prestasi .post-thumbnail,
  body.sdnwt-path-galeri .post-thumbnail,
  body.sdnwt-path-publikasi .post-thumbnail {
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    aspect-ratio:auto !important;
    overflow:hidden !important;
    background:#fff !important;
  }

  body.sdnwt-path-akademik .elementor-post__thumbnail img,
  body.sdnwt-path-berita .elementor-post__thumbnail img,
  body.sdnwt-path-kegiatan .elementor-post__thumbnail img,
  body.sdnwt-path-agenda .elementor-post__thumbnail img,
  body.sdnwt-path-pengumuman .elementor-post__thumbnail img,
  body.sdnwt-path-prestasi .elementor-post__thumbnail img,
  body.sdnwt-path-galeri .elementor-post__thumbnail img,
  body.sdnwt-path-publikasi .elementor-post__thumbnail img,
  body.sdnwt-path-akademik .post-thumbnail img,
  body.sdnwt-path-berita .post-thumbnail img,
  body.sdnwt-path-kegiatan .post-thumbnail img,
  body.sdnwt-path-agenda .post-thumbnail img,
  body.sdnwt-path-pengumuman .post-thumbnail img,
  body.sdnwt-path-prestasi .post-thumbnail img,
  body.sdnwt-path-galeri .post-thumbnail img,
  body.sdnwt-path-publikasi .post-thumbnail img {
    position:static !important;
    transform:none !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    aspect-ratio:auto !important;
    object-fit:contain !important;
    object-position:center center !important;
  }

  /* Gallery images: no forced crop, but preserve rounded card corners. */
  body.sdnwt-path-galeri figure,
  body.sdnwt-path-galeri .gallery-item,
  body.sdnwt-path-publikasi figure,
  body.sdnwt-path-publikasi .gallery-item {
    height:auto !important;
    min-height:0 !important;
  }

  body.sdnwt-path-galeri figure img,
  body.sdnwt-path-galeri .gallery-item img,
  body.sdnwt-path-publikasi figure img,
  body.sdnwt-path-publikasi .gallery-item img {
    width:100% !important;
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
    object-position:center center !important;
  }

  /* SPMB: protect the school logo and form illustrations from crop.
     Hero/background sections are intentionally NOT overridden. */
  body.sdnwt-path-spmb main img:not(.custom-logo):not([class*="logo"]),
  body.sdnwt-path-spmb .entry-content img:not(.custom-logo):not([class*="logo"]) {
    max-width:100% !important;
    height:auto !important;
    object-fit:contain !important;
  }

  /* Home: only ordinary content images/cards.
     Exclude hero/banner/background-oriented blocks. */
  body.sdnwt-path-home main .elementor-widget-image:not([class*="hero"]):not([class*="banner"]) img,
  body.sdnwt-path-home main .wp-block-image img,
  body.sdnwt-path-home main article img {
    max-width:100% !important;
    height:auto !important;
  }

  /* Prevent horizontal overflow caused by tall portrait photos/cards. */
  body.sdnwt-path-home main,
  body.sdnwt-path-akademik main,
  body.sdnwt-path-berita main,
  body.sdnwt-path-kegiatan main,
  body.sdnwt-path-agenda main,
  body.sdnwt-path-pengumuman main,
  body.sdnwt-path-prestasi main,
  body.sdnwt-path-galeri main,
  body.sdnwt-path-publikasi main,
  body.sdnwt-path-spmb main {
    overflow-x:hidden;
  }
}

/* Very small phones: give large portrait images more breathing room. */
@media (max-width: 420px) {
  img.sdnwt-mobile-photo-safe {
    border-radius:inherit;
  }

  body.sdnwt-path-akademik .elementor-post,
  body.sdnwt-path-berita .elementor-post,
  body.sdnwt-path-kegiatan .elementor-post,
  body.sdnwt-path-prestasi .elementor-post {
    min-width:0 !important;
  }
}


/* ==========================================================
   v1.1.2 — MOBILE NON-OVERLAY DOCK
   Clock + suggestion become part of page flow under the header.
   ========================================================== */
.sdnwt-mobile-dock {
  display:none;
}

@media (max-width:780px) {
  .sdnwt-mobile-dock {
    display:flex !important;
    position:relative !important;
    z-index:50;
    width:100%;
    box-sizing:border-box;
    align-items:stretch;
    justify-content:space-between;
    gap:10px;
    padding:10px 14px;
    margin:0;
    background:linear-gradient(180deg,#fff9f7 0%,#fff 100%);
    border-bottom:1px solid rgba(122,21,48,.08);
  }

  .sdnwt-mobile-dock .sdnwt-info-card {
    position:relative !important;
    inset:auto !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    z-index:auto !important;
    flex:1 1 auto;
    width:auto !important;
    min-width:0;
    max-width:none;
    margin:0 !important;
    border-radius:15px;
    box-shadow:none;
    overflow:hidden;
    opacity:1;
  }

  .sdnwt-mobile-dock .sdnwt-info-card.is-collapsed {
    width:auto !important;
  }

  .sdnwt-mobile-dock .sdnwt-info-toggle {
    display:none !important;
  }

  .sdnwt-mobile-dock .sdnwt-calendar {
    display:none !important;
  }

  .sdnwt-mobile-dock .sdnwt-clock {
    min-height:62px;
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding:10px 14px !important;
    border-radius:15px;
  }

  .sdnwt-mobile-dock .sdnwt-date {
    margin:0 0 3px !important;
    font-size:10px !important;
    line-height:1.3;
    white-space:normal;
  }

  .sdnwt-mobile-dock .sdnwt-time-row {
    gap:6px;
  }

  .sdnwt-mobile-dock .sdnwt-time {
    font-size:20px !important;
    line-height:1 !important;
  }

  .sdnwt-mobile-dock .sdnwt-wib {
    font-size:9px !important;
  }

  .sdnwt-mobile-dock .sdnwt-suggestion-fab {
    position:relative !important;
    inset:auto !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    z-index:auto !important;
    flex:0 0 auto;
    min-width:126px;
    min-height:62px;
    margin:0 !important;
    padding:10px 13px !important;
    border-radius:15px;
    box-shadow:none;
    justify-content:center;
    font-size:12px !important;
    line-height:1.15;
  }

  /* The dock occupies real layout space, so the first section starts below it. */
  .sdnwt-mobile-dock + main,
  .sdnwt-mobile-dock + #content,
  .sdnwt-mobile-dock + .site-content {
    clear:both;
  }
}

@media (max-width:390px) {
  .sdnwt-mobile-dock {
    gap:8px;
    padding:8px 10px;
  }

  .sdnwt-mobile-dock .sdnwt-clock {
    padding:9px 11px !important;
  }

  .sdnwt-mobile-dock .sdnwt-date {
    font-size:9px !important;
  }

  .sdnwt-mobile-dock .sdnwt-time {
    font-size:18px !important;
  }

  .sdnwt-mobile-dock .sdnwt-suggestion-fab {
    min-width:112px;
    padding:9px 10px !important;
    font-size:11px !important;
  }
}
