/**
 * Tammia Theme — Homepage Elements CSS
 * File: themes/tammia_theme/css/tammia-homepage.css
 *
 * Daftarkan di tammia_theme.libraries.yml:
 *
 *   homepage-elements:
 *     css:
 *       theme:
 *         css/tammia-homepage.css: {}
 *     js:
 *       js/tammia-announcement.js: {}
 *
 * Attach di page.html.twig atau hook_preprocess_page:
 *   {{ attach_library('tammia_theme/homepage-elements') }}
 */


/* ============================================================
   1. ANNOUNCEMENT BAR
   ============================================================ */

.region-announcement-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  width: 100%;  
}

.tammia-announcement-bar {
  background-color: #1a9e7a;
  color: #ffffff;
  padding: 8px 48px 8px 16px; /* kanan lebih lebar untuk tombol close */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  position: relative;
  min-height: 38px;
}

/* Tiap item pesan */
.tammia-announcement-bar .ann-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Pemisah antar item */
.tammia-announcement-bar .ann-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

/* Badge kecil di dalam teks (contoh: "HEMAT") */
.tammia-announcement-bar .ann-badge {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Tombol tutup (×) */
.tammia-announcement-bar .ann-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.tammia-announcement-bar .ann-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Animasi hide saat close diklik (via JS) */
.tammia-announcement-bar.ann-hidden {
  display: none;
}

/* Responsif: sembunyikan item kedua & ketiga di layar kecil */
@media (max-width: 767px) {
  .tammia-announcement-bar {
    gap: 0;
    justify-content: flex-start;
    padding-left: 12px;
  }
  .tammia-announcement-bar .ann-item:not(:first-child),
  .tammia-announcement-bar .ann-separator {
    display: none;
  }
}


/* ============================================================
   2. TRUST BADGE / USP BAR
   ============================================================ */

.tammia-trust-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  margin: 24px 0;
}

.trust-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
}

.trust-divider {
  width: 1px;
  background: #e5e7eb;
  align-self: stretch;
  flex-shrink: 0;
}

/* Icon container */
.trust-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trust-icon svg {
  width: 22px;
  height: 22px;
}

.trust-icon--green  { background: #e8f8f2; color: #0f6e56; }
.trust-icon--blue   { background: #e6f1fb; color: #185fa5; }
.trust-icon--amber  { background: #faeeda; color: #854f0b; }
.trust-icon--teal   { background: #e1f5ee; color: #1a9e7a; }

.trust-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trust-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a1a;
  display: block;
  line-height: 1.2;
}

.trust-sub {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.35;
  display: block;
}

/* Responsif: 2 kolom di tablet, 1 kolom di mobile */
@media (max-width: 991px) {
  .tammia-trust-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 10px;
  }
  .trust-divider { display: none; }
  .trust-item {
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
  }
  .trust-item:nth-child(2n) { border-right: none; }
  .trust-item:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 575px) {
  .tammia-trust-bar {
    grid-template-columns: 1fr;
  }
  .trust-item { border-right: none !important; }
  .trust-item:last-child { border-bottom: none; }
}


/* ============================================================
   3. TESTIMONI — Views Slick Carousel
   ============================================================
   Struktur Views yang diperlukan:
   - View mode: Teaser (atau custom display mode)
   - Style: Slick Carousel (module: slick_views)
   - Row: Fields
   
   CSS di bawah ini meng-override style default Slick
   agar sesuai dengan desain Tammia.
   ============================================================ */

/* Wrapper section testimoni */
.tammia-testimonial-section {
  padding: 48px 0;
}

.tammia-testimonial-section .section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.tammia-testimonial-section .section-sub {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 28px;
}

/* Kartu testimoni individual */
.testimonial-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 10px 16px; /* margin kiri-kanan agar shadow tidak terpotong */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.testimonial-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Bintang rating */
.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
}

.testimonial-stars .star {
  font-size: 14px;
  color: #f59e0b;
  line-height: 1;
}

.testimonial-stars .star--empty {
  color: #d1d5db;
}

/* Isi teks testimoni */
.testimonial-body {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.65;
  flex: 1; /* dorong footer ke bawah */
  margin-bottom: 16px;
  font-style: italic;
  position: relative;
}

/* Tanda kutip dekoratif */
.testimonial-body::before {
  content: '\201C'; /* " */
  font-size: 3rem;
  color: #1a9e7a;
  opacity: 0.18;
  position: absolute;
  top: -10px;
  left: -4px;
  line-height: 1;
  font-style: normal;
}

/* Footer kartu: avatar + nama + badge */
.testimonial-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}

/* Avatar inisial */
.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e1f5ee;
  color: #0f6e56;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  /* Jika menggunakan field foto: */
  overflow: hidden;
}

.testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial-meta {
  flex: 1;
  min-width: 0;
}

.testimonial-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.testimonial-location {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Badge "Pembeli Terverifikasi" */
.testimonial-verified {
  background: #e8f8f2;
  color: #0f6e56;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Override Slick dots ── */
.tammia-testimonial-section .slick-dots {
  bottom: -28px;
}

.tammia-testimonial-section .slick-dots li button::before {
  font-size: 8px;
  color: #1a9e7a;
  opacity: 0.3;
}

.tammia-testimonial-section .slick-dots li.slick-active button::before {
  opacity: 1;
  color: #1a9e7a;
}

/* ── Override Slick arrows ── */
.tammia-testimonial-section .slick-prev,
.tammia-testimonial-section .slick-next {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: background 0.2s, border-color 0.2s;
}

.tammia-testimonial-section .slick-prev { left: -18px; }
.tammia-testimonial-section .slick-next { right: -18px; }

.tammia-testimonial-section .slick-prev:hover,
.tammia-testimonial-section .slick-next:hover {
  background: #1a9e7a;
  border-color: #1a9e7a;
}

.tammia-testimonial-section .slick-prev::before,
.tammia-testimonial-section .slick-next::before {
  color: #6b7280;
  font-size: 16px;
  opacity: 1;
}

.tammia-testimonial-section .slick-prev:hover::before,
.tammia-testimonial-section .slick-next:hover::before {
  color: #ffffff;
}