/* ===========================================================
   Ruang Lensa - penyesuaian modern (dimuat setelah tema warna)
   Berisi gaya untuk komponen baru (Swiper, GLightbox, share)
   dan perbaikan tampilan responsif desktop & mobile.
   =========================================================== */

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; }

/* ---- Slider banner (Swiper) ---- */
.banner-slide { width: 100%; }
.hero-swiper { width: 100%; aspect-ratio: 1024 / 350; max-height: 420px; background: #111; overflow: hidden; --swiper-theme-color: #fff; }
.hero-swiper .swiper-slide { position: relative; }
.hero-swiper .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-caption {
  position: absolute; right: 24px; bottom: 18px; margin: 0; color: #fff; font-size: 28px; font-weight: 400;
  text-shadow: 0 0 14px rgba(0,0,0,.7); text-align: right; max-width: 80%;
}
.hero-swiper .swiper-button-prev, .hero-swiper .swiper-button-next { transform: scale(.6); }

/* ---- Tombol bagikan ---- */
.share-links { display: inline-flex; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.share-btn { display: inline-block; padding: 2px 10px; border-radius: 3px; background: #444; color: #fff !important; font-size: 11px; line-height: 20px; text-decoration: none; }
.share-btn:hover { background: #666; }

/* ---- Video ---- */
.video-embed { position: relative; aspect-ratio: 16 / 9; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Footer ---- */
.footer-social a { color: inherit; text-decoration: underline; }

/* ---- Grid foto / portfolio: item selalu tampil (dulu diatur plugin mixitup) ---- */
.grid .mix { opacity: 1; display: block; }

/* ===========================================================
   RESPONSIF (tablet & ponsel): ganti lebar piksel tetap tema lama
   dengan lebar fleksibel.
   =========================================================== */
@media only screen and (max-width: 1024px) {
  .header-section, .wrapper, .footer-section { width: 100% !important; max-width: 100%; }
  .wrapper { padding-left: 12px; padding-right: 12px; }
  .footer-section { padding-left: 16px; padding-right: 16px; }
  .header-section { overflow: visible; }

  .hero-swiper { aspect-ratio: 16 / 7; }
  .slide-caption { font-size: 20px; right: 14px; bottom: 12px; }

  /* menu: tampil saat tombol ditekan */
  .main-menu { display: none; }
  .main-menu.is-open { display: block; }

  .grid-half, .large-grid figure, .half-feature-image, .send-message, .contact-info,
  .service-large ul li, .blog-content, .footer-contact, .footer-subscribe, .footer-about {
    width: 100% !important; max-width: 100%;
  }
  .sidebar { width: 100% !important; float: none !important; margin-left: 0 !important; }

  /* daftar kartu (galeri, album, portfolio, artikel) menjadi grid fleksibel */
  ul.grid, .portfolio ul, .portfolio2 ul, .gallery-list ul, .service ul {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
    margin: 0 !important; padding: 0; list-style: none; width: 100% !important;
  }
  ul.grid > li, .portfolio ul li, .portfolio2 ul li, .gallery-list ul li, .service ul li {
    width: auto !important; height: auto !important; float: none !important; margin: 0 !important; aspect-ratio: 1 / 1; position: relative; overflow: hidden;
  }
  .portfolio2 ul li { aspect-ratio: auto; overflow: visible; }
  .gallery-list ul.grid li.item { aspect-ratio: auto; min-height: 120px; }
  .img-berita { max-width: 100%; height: auto; }
  ul.grid li img, .portfolio li img, .gallery-list li img { width: 100% !important; height: 100% !important; object-fit: cover; }
}
@media only screen and (max-width: 480px) {
  ul.grid, .portfolio ul, .portfolio2 ul, .gallery-list ul, .service ul { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .footer-section { text-align: left; }
}
@media only screen and (max-width: 1024px) {
  .header-section { position: relative; }
  #navbtn { position: absolute; top: 12px; right: 16px; z-index: 30; float: none; margin: 0; }
  #navbtn img { width: 26px; height: auto; }
}

@media only screen and (max-width: 1024px) {
  body { overflow-x: hidden; }
  .blog-single-content, .content-body, .blog-single-details { overflow-wrap: anywhere; }
}

/* ===========================================================
   Perbaikan tampilan (revisi 1)
   =========================================================== */

/* Desktop lebar: konten ditengah pada area di kanan sidebar (bukan rata kiri) */
@media only screen and (min-width: 1025px) {
  .wrapper { margin-left: max(290px, calc(240px + (100vw - 240px - 1024px) / 2)); }
  .header-section { overflow-y: auto; overflow-x: hidden; }
  .main-menu { position: relative; margin-top: 24px; }
  .social-main { position: relative; margin-top: 24px; padding-bottom: 20px; }
}

/* Judul kartu artikel (beranda) tidak terpotong */
.kotak .head { height: auto; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kotak .blend { min-height: 36px; }

@media only screen and (max-width: 1024px) {
  .kotak { float: none; margin: 0; width: 100%; }
  .kotak .link { width: 100%; height: auto; aspect-ratio: 241 / 200; }
  .kotak .image { width: 100%; height: 100%; object-fit: cover; }
  .kotak .blend { width: 100%; }

  /* Daftar artikel / event: satu kolom, gambar di atas, teks di bawah */
  ul.content-list { display: block; margin: 0; padding: 0; }
  ul.content-list > li { width: 100% !important; float: none !important; margin: 0 0 24px !important; height: auto !important; }
  ul.content-list .thumb-hover, ul.content-list figure { width: 100% !important; float: none !important; margin: 0 0 12px !important; }
  ul.content-list figure img { width: 100%; height: auto; }
  ul.content-list .blog-details { width: 100% !important; float: none !important; margin: 0 !important; }
  ul.content-list .bottom-active, ul.content-list .blog-meta { width: 100% !important; margin-left: 0 !important; }

  /* Form pencarian: kolom teks & tombol sama tinggi */
  #search { display: flex; width: 100%; max-width: 100%; }
  #search input { float: none; height: 40px; box-sizing: border-box; }
  #search input[type="text"] { flex: 1 1 auto; width: auto; min-width: 0; }
  #search input[type="submit"] { flex: 0 0 41px; }
}

/* ---- Peta (iframe Google Maps tanpa API) ---- */
.map-embed { width: 100%; background: #222; }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---- Tombol WhatsApp di halaman kontak ---- */
.wa-button { display: inline-flex; align-items: center; gap: 8px; background: #25d366; color: #fff !important; padding: 10px 18px; border-radius: 4px; text-decoration: none; font-weight: 600; }
.wa-button:hover { background: #1ebe5a; }

/* ---- Tombol mengambang: WhatsApp + kembali ke atas (pojok kanan bawah) ---- */
.floating-actions { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fab { width: 46px; height: 46px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.45); }
.fab-wa { background: #25d366; }
.fab-wa:hover { background: #1ebe5a; }
.fab-top { background: #98B827; font-size: 22px; line-height: 1; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, transform .25s, visibility .25s; }
.fab-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.fab-top:hover { background: #7f9c1f; }

/* Ikon sosial di sidebar kiri tetap rata kanan seperti desain asli */
@media only screen and (min-width: 1025px) {
  .social-main { text-align: right; padding-right: 20px; }
  .social-main ul { margin: 0; }
}
/* Foto "Recent Images": semua tile sama ukuran, gambar dipotong rapi (cover) */
.gallery-list .thumb-hover figure > a > div > img, .gallery-list .thumb-hover img { width: 100%; height: 183px; object-fit: cover; }

/* ---- Footer ikut ditengah di desktop lebar ---- */
@media only screen and (min-width: 1025px) {
  .footer-section { margin-left: max(290px, calc(240px + (100vw - 240px - 1024px) / 2)); }
}

/* ---- Kartu artikel/event di ponsel: padding lebih kecil, tombol "Read more" tidak terpotong ---- */
@media only screen and (max-width: 1024px) {
  .blog-details { padding: 18px 16px; }
  .blog-details h2 a { font-size: 20px; line-height: 1.3; }
  .bottom-active { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; overflow: visible; }
  .bottom-active .blog-meta { float: none; margin: 0; }
  .bottom-active .readmore-button { float: none; margin-right: 56px; } /* sisakan ruang untuk tombol mengambang */
}

/* Lebar 100% sudah termasuk padding (mencegah konten melebar melewati layar di ponsel) */
.wrapper, .footer-section, .header-section { box-sizing: border-box; }
@media only screen and (max-width: 1024px) {
  .blog-content { margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box; }
}

/* ===========================================================
   Revisi 2: lebar kartu = lebar judul, tombol menu rata tengah
   =========================================================== */
@media only screen and (max-width: 1024px) {
  /* .blog-content aslinya table-cell + border kanan 20px sehingga kartu lebih sempit dari judul */
  .blog-content { display: block; width: 100% !important; border-right: 0 !important; }
  ul.content-list, ul.content-list > li, .blog-single-details { width: 100% !important; }

  /* Header mobile: tinggi tetap, logo & tombol menu sama-sama di tengah vertikal */
  .header-section .logo { box-sizing: border-box; height: 52px; padding: 0 !important; display: flex; align-items: center; justify-content: center; border-bottom: 0; }
  .header-section .logo img { width: auto; height: 36px; max-width: 100%; }
  #navbtn { top: 0; right: 0; height: 52px; margin: 0; padding: 0 16px; display: flex; align-items: center; }
  #navbtn a { display: flex; align-items: center; }
  #navbtn img { width: 26px; height: auto; display: block; }
}
@media only screen and (max-width: 1024px) {
  .blog-single-details { padding: 22px 16px 28px !important; }
  .blog-single-details h1 { font-size: 22px; line-height: 1.3; }
}

/* ---- Tabel info (detail portfolio): rapi di desktop, bertumpuk (label di atas isi) di ponsel ---- */
.info-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.info-table th, .info-table td { padding: 10px 14px; border: 1px solid #3a3a3a; text-align: left; vertical-align: top; font-weight: normal; }
.info-table th { width: 140px; color: #fff; background: #333; font-weight: 600; }
.info-table td { color: #aaa; overflow-wrap: anywhere; }
.info-table td a { color: #98B827; }
@media only screen and (max-width: 1024px) {
  .info-table, .info-table tbody, .info-table tr, .info-table th, .info-table td { display: block; width: 100% !important; box-sizing: border-box; }
  .info-table tr { margin-bottom: 12px; border: 1px solid #3a3a3a; }
  .info-table th, .info-table td { border: 0; }
  .info-table th { padding: 8px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #98B827; background: #333; }
}

/* Kartu artikel/event/portfolio di ponsel: teks tidak menempel ke tepi kiri & bawah */
@media only screen and (max-width: 1024px) {
  .content-list .blog-details, .blog-details { padding: 20px 18px 22px !important; }
  .blog-details p { margin-bottom: 14px; }
  .bottom-active { margin-top: 16px; padding-bottom: 4px; }
}
