/* ==========================================================
   Sonia Luxury Lite — Premium Enhancements (override layer)
   - Tambahan UI/UX desktop + mobile
   - Sidebar + ads slots + share + toc + comments
   - Off-canvas drawer + backdrop + back-to-top
   ========================================================== */

/* A11y */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed !important;
  top: 12px; left: 12px;
  width: auto; height: auto;
  margin: 0;
  padding: 10px 12px;
  background: #111;
  color: #fff;
  border-radius: 10px;
  z-index: 99999;
  clip: auto;
}

/* Layout: content + sidebar (desktop) */
.sws-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}
@media (max-width: 980px) {
  .sws-layout { grid-template-columns: 1fr; }
}

.sws-content { min-width: 0; }

/* Listing (Blog/Arsip/Search) saat ada sidebar:
   2 kolom lebih nyaman daripada 3 (supaya card tidak terlalu sempit & tidak bikin meta wrap). */
@media (min-width: 981px) {
  .sws-layout .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sws-layout .post-card { height: 100%; }
  .sws-layout .post-card .post-link { height: 100%; }
}


/* Blog/Arsip: area tambahan di bawah listing (cocok untuk FAQ) */
.sws-archive-bottom { margin-top: 18px; display: grid; gap: 14px; }
.sws-archive-bottom--full { margin-top: 22px; }
.sws-archive-bottom > * { width: 100%; }

/* Sidebar search: di mobile sudah ada di drawer, jadi sembunyikan agar tidak dobel */
@media (max-width: 980px) {
  .sws-sidebar-search { display: none; }
}


.sws-sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
  display: grid;
  gap: 14px;
}
@media (max-width: 980px) {
  .sws-sidebar { position: static; }
}

/* Sidebar widgets */
.sws-widget {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.74));
  box-shadow: 0 10px 24px rgba(32,23,14,.06);
}
.sws-widget .widget-title {
  margin: 0 0 10px;
  font-size: 1.02rem;
  letter-spacing: .1px;
}
.sws-widget ul { margin: 0; padding-left: 18px; }
.sws-widget li { margin: 8px 0; }
.sws-widget a { color: var(--dark-2); text-decoration: none; }
.sws-widget a:hover { text-decoration: underline; }

/* Make long text more readable on desktop */
.single-card .entry-content > * {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.single-card .entry-content > .alignwide { max-width: 1050px; }
.single-card .entry-content > .alignfull {
  max-width: none;
  width: calc(100% + 34px);
  margin-left: -17px;
  margin-right: -17px;
}
@media (max-width: 680px) {
  .single-card .entry-content > .alignfull {
    width: calc(100% + 28px);
    margin-left: -14px;
    margin-right: -14px;
  }
}

/* Breadcrumbs */
.sws-breadcrumbs {
  margin: 6px 0 14px;
  font-size: .92rem;
  color: rgba(45,38,31,.72);
}
.sws-breadcrumbs ol {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sws-breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.sws-breadcrumbs li::after {
  content: "›";
  opacity: .55;
}
.sws-breadcrumbs li:last-child::after { content: ""; }
.sws-breadcrumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sws-breadcrumbs a:hover { border-bottom-color: rgba(45,38,31,.35); }

/* Header search (DISABLED on desktop: pindah ke sidebar) */
.sws-header-search { display: none !important; }


/* Header: cegah logo & menu tumpang tindih saat menu panjang */
@media (max-width: 1250px) and (min-width: 981px) {
  .sws-header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: 10px;
  }
  .sws-brand { grid-column: 1 / 2; grid-row: 1; }
  .sws-header-actions { grid-column: 2 / 3; grid-row: 1; justify-self: end; }
  .sws-main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .sws-main-nav .menu-list {
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 6px;
  }
}

/* Jika user menaruh Search widget di sidebar, tampilkan bagus */

/* Search form outside header */

.widget .sws-search-field,
.sws-empty .sws-search-field {
  color: var(--text);
  background: rgba(255,255,255,.86);
  border-color: var(--line);
}
.widget .sws-search-field::placeholder,
.sws-empty .sws-search-field::placeholder {
  color: rgba(45,38,31,.6);
}
.widget .sws-search-submit,
.sws-empty .sws-search-submit {
  background: linear-gradient(180deg, #2f8af3, #1f6fcb);
  border-color: rgba(77,146,241,.75);
  color: #fff;
}

/* Off-canvas mobile drawer (override) */
@media (max-width: 980px) {
  .sws-main-nav { display: none; }
  .sws-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .sws-mobile-drawer {
    position: fixed;
    top: 0; right: 0;
    width: min(92vw, 360px);
    height: 100vh;
    max-height: none;
    overflow: auto;
    transform: translateX(105%);
    border-left: 1px solid rgba(231,205,154,.22);
    box-shadow: 0 18px 44px rgba(0,0,0,.35);
    transition: transform .25s ease;
    padding: 0;
    background: linear-gradient(180deg, rgba(34,26,20,.98), rgba(43,33,25,.98));
  }
  .sws-site-header.is-open .sws-mobile-drawer { transform: translateX(0); }

  .sws-mobile-wrap { padding: 14px 0 18px; }
  .sws-mobile-search { margin-bottom: 12px; }

  .sws-mobile-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(231,205,154,.16);
    background: rgba(30,23,18,.96);
    backdrop-filter: blur(10px);
  }
  .sws-mobile-title { color: #f6ead0; font-weight: 800; }
  .sws-drawer-close {
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(231,205,154,.35);
    background: rgba(255,255,255,.04);
    color: #f6ead0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }
  .sws-drawer-close:hover { background: rgba(255,255,255,.07); }

  .sws-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12,8,6,.55);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity .2s ease;
  }
  body.sws-drawer-open .sws-drawer-backdrop {
    opacity: 1;
  }
  body.sws-drawer-open { overflow: hidden; }
}

/* Micro-interactions */
.card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover {
  transform: translateY(-1px);
  border-color: rgba(139,111,66,.55);
  box-shadow: 0 14px 34px rgba(32,23,14,.12);
}
.btn { transition: transform .18s ease, filter .18s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.02); }


/* Card meta badge */
.post-meta-row { gap: 10px; }

/* Card meta row: cegah author/date membungkus jadi 2 baris (biar tinggi card konsisten) */
.post-meta-row {
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.post-cat {
  flex: 0 0 auto;
  max-width: 42%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-author {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-date { flex: 0 0 auto; }

.post-cat {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(207,167,93,.45);
  background: rgba(207,167,93,.12);
  color: rgba(45,38,31,.88);
  font-weight: 900;
  font-size: .82rem;
}
/* Ads slots */
.sws-ad-wrap { margin: 18px 0; }
.sws-ad-slot {
  border-radius: var(--radius);
  border: 1px dashed rgba(139,111,66,.45);
  background: rgba(255,255,255,.60);
  padding: 14px;
}
.sws-ad-slot iframe { max-width: 100%; }

/* Share */
.sws-share {
  margin: 18px 0 6px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  display: grid;
  gap: 10px;
}
.sws-share-label { font-weight: 800; }
.sws-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sws-share-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fcf8f0;
  color: #3d3123;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.sws-share-btn:hover { border-color: rgba(139,111,66,.6); }
.sws-share-btn.is-copy.is-copied { transform: translateY(-1px); }

/* TOC */
.sws-toc {
  max-width: 780px;
  margin: 16px auto 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  overflow: hidden;
}
.sws-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(139,111,66,.25);
}
.sws-toc-title { font-weight: 900; letter-spacing: .1px; }
.sws-toc-toggle {
  border: 1px solid rgba(139,111,66,.35);
  background: rgba(255,255,255,.62);
  color: #3d3123;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}
.sws-toc-list {
  margin: 0;
  padding: 10px 14px 14px;
  list-style: none;
  display: grid;
  gap: 8px;
}
.sws-toc-item a {
  text-decoration: none;
  color: #3d3123;
  border-bottom: 1px dashed transparent;
}
.sws-toc-item a:hover { border-bottom-color: rgba(61,49,35,.35); }
.sws-toc-item.is-h3 { padding-left: 14px; opacity: .92; }
.sws-toc.is-collapsed .sws-toc-list { display: none; }

/* Related */
.sws-related { margin-top: 18px; }
.sws-related-title { margin: 0 0 12px; font-size: 1.25rem; }
.sws-related-grid .post-card { height: 100%; }

/* Comments */
.sws-comments { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.sws-comments-title { margin: 0 0 12px; font-size: 1.25rem; }
.sws-comment-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.sws-comment-body {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
}
.sws-comment-avatar img { border-radius: 999px; }
.sws-comment-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.sws-comment-author a { color: #2c221a; font-weight: 900; text-decoration: none; }
.sws-comment-time { color: rgba(45,38,31,.65); font-size: .92rem; }
.sws-comment-text { margin-top: 8px; }
.sws-comment-actions { margin-top: 10px; font-weight: 800; }
.sws-comment-actions a { text-decoration: none; }
.sws-comment-awaiting { margin: 8px 0 0; font-weight: 800; }
.sws-comment-form { margin-top: 14px; }
.sws-comment-form input,
.sws-comment-form textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}
.sws-comment-form textarea { min-height: 140px; }
.sws-comment-form .submit {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(77,146,241,.75);
  background: linear-gradient(180deg, #2f8af3, #1f6fcb);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.sws-comment-note { margin: 0 0 10px; color: rgba(45,38,31,.72); }

/* Empty states */
.sws-empty { padding: 18px; }
.sws-empty h2 { margin-top: 0; }

/* Pagination */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fcf8f0;
  color: #3d3123;
  text-decoration: none;
  font-weight: 900;
}
.nav-links .page-numbers.current {
  background: linear-gradient(180deg, rgba(207,167,93,.25), rgba(207,167,93,.12));
  border-color: rgba(207,167,93,.55);
}
.nav-links .page-numbers:hover { border-color: rgba(139,111,66,.6); }

/* Footer */
.sws-footer-grid .sws-footer-widgets { margin-top: 12px; display: grid; gap: 12px; }
.sws-footer-grid .widget {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.sws-footer-grid .widget-title { color: #efd5a5; }

/* Back to top button */
.sws-back-to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(231,205,154,.35);
  background: rgba(30,23,18,.92);
  color: #f6ead0;
  z-index: 997;
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.sws-back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slight header compaction on scroll (optional) */
.sws-site-header.is-scrolled .sws-header-inner {
  min-height: 80px;
}
