/* templates/blocks/slider-1/style.css */
/* Slider-1: LEFT (hero slider) + RIGHT (2×2 grid) — synced with Block-1 meta icons */

/* ===== Wrapper ===================================================== */
.pf-s1 {
  width: var(--pf-container-w, 100%);
  margin: 0 auto var(--pf-bottom-space, 36px);
  padding: var(--pf-pad, 0);

  border-style: var(--pf-b-style, solid);
  border-width: var(--pf-b-width, 0);
  border-color: var(--pf-b-color, transparent);
  border-radius: var(--pf-b-radius, 12px);
  box-shadow: var(--pf-shadow, none);
  background-color: var(--pf-bg, transparent);

  /* container queries scope */
  container-type: inline-size;
}

/* ===== Header ====================================================== */
.pf-s1-head {
  display: flex;
  flex-direction: column;
  align-items: var(--pf-head-align, flex-start);
  position: relative;
  padding: var(--pf-head-pad, 0);
  margin: var(--pf-head-m, 0 0 16px 0);
}
.pf-s1-head .pf-title-wrap {
  display: flex;
  align-items: center;
  justify-content: var(--pf-head-align, flex-start);
  width: 100%;
  background: var(--pf-head-bg, transparent);
  color: var(--pf-head-color, inherit);
  flex-wrap: wrap;
  gap: 15px;
}
.pf-s1-head .pf-title {
  margin: 0;
  line-height: 1.25;
  font-size: var(--pf-head-fs, 1.5rem);
  font-weight: var(--pf-head-fw, 700);
  font-style: var(--pf-head-fstyle, normal);
  text-transform: var(--pf-head-tt, none);
}
.pf-s1-head .pf-title a { color: inherit; text-decoration: none; }

/* Decorative line */
.pf-s1-head[data-line="1"][data-line-pos="bottom"]::after,
.pf-s1-head[data-line="1"][data-line-pos="top"]::before {
  content: "";
  display: block;
  position: relative;
  height: var(--pf-head-line-thickness, 3px);
  width: var(--pf-head-line-len, 40%);
  background: var(--pf-head-line-color, currentColor);
  border-radius: 2px;
}
.pf-s1-head[data-line="1"][data-line-pos="bottom"]::after { margin-top: var(--pf-head-line-offset, 6px); }
.pf-s1-head[data-line="1"][data-line-pos="top"]::before { margin-bottom: var(--pf-head-line-offset, 6px); }

/* ===== Layout: 2 columns ========================================== */
.pf-s1-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pf-gap, 20px);
}

/* reset card chrome */
.pf-s1 .pf-pcard {
  border-width: 0 !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  background: transparent;
}
.pf-s1 .pf-body-inner { width: 100%; }

/* ================================================================== */
/* LEFT: SLIDER (hero)                                                */
/* ================================================================== */
.pf-s1-left {
  grid-column: 1;
  padding: var(--pf-s1-left-pad, 0);
  margin: var(--pf-s1-left-m, 0);
  display: block;
}

/* viewport + track */
.pf-s1-left-slider .pf-sld-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--pf-thumb-radius, 6px);
}
.pf-s1-left-slider .pf-sld-track {
  display: flex;
  width: 100%;
  transition: transform var(--pf-sld-speed, 400ms) ease;
}
.pf-s1-left-slider .pf-sld-item {
  /* Mỗi trang = 100% chiều rộng, chia đều theo số visible */
  flex: 0 0 calc(100% / var(--pf-sld-vis, 1));
  padding-right: 0;
}
.pf-s1-left-slider .pf-sld-item .pf-pcard {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--pf-thumb-radius, 6px);
}

/* Overlay (text/meta over image) */
.pf-s1-left .pf-pcard { position: relative; }
.pf-s1-left .pf-pcard .pf-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--pf-thumb-radius, 6px);
}
.pf-s1-left .pf-pcard .pf-thumb::before {
  content:"";
  display:block;
  padding-top: var(--pf-left-thumb-ratio, var(--pf-thumb-ratio, 56.25%));
}
.pf-s1-left .pf-pcard .pf-thumb img {
  position:absolute; inset:0; width:100%; height:100%;
  object-fit: var(--pf-thumb-fit, cover);
  object-position: center var(--pf-thumb-valign, 50%);
}
.pf-s1-left .pf-pcard .pf-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.75) 100%);
  color: #fff;
}
.pf-s1-left .pf-pcard .pf-title { margin: 0; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pf-s1-left .pf-pcard .pf-meta { color: #e5e7eb; }

/* arrows */
.pf-s1-left-slider .pf-sld-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 999px; border: 0;
  background: rgba(15,23,42,.55); color: #fff; cursor: pointer;
  display:flex; align-items:center; justify-content:center;
  z-index: 5;
}
.pf-s1-left-slider .pf-sld-prev { left: 8px; }
.pf-s1-left-slider .pf-sld-next { right: 8px; }
.pf-s1-left-slider .pf-sld-arrow:hover { background: rgba(15,23,42,.75); }

/* dots */
.pf-s1-left-slider .pf-sld-dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 6;
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.pf-s1-left-slider .pf-sld-dot {
  width: 8px; height: 8px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.6); cursor: pointer;
}
.pf-s1-left-slider .pf-sld-dot.is-active { background: #fff; }

/* LEFT excerpt (optional) */
.pf-s1-left[data-excerpt="0"] .pf-excerpt { display: none !important; }
.pf-s1-left .pf-excerpt {
  width: 100%;
  box-sizing: border-box;
  display: -webkit-box;
  -webkit-line-clamp: var(--pf-excerpt-lines, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: var(--pf-excerpt-align, left);
  column-count: var(--pf-excerpt-cols, 1);
  column-gap: var(--pf-excerpt-gap, 0px);
}

/* ================================================================== */
/* RIGHT: 2×2 GRID TILES (overlay like left)                          */
/* ================================================================== */
.pf-s1-right {
  grid-column: 2;
  padding: var(--pf-s1-right-pad, 0);
  margin: var(--pf-s1-right-m, 0);
  /* sẽ kế thừa màu nền nếu set trong inline style (right_card_bg) */
  background: inherit;
}
.pf-s1-right-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--pf-s1-right-gap, 15px);
}
.pf-s1-right-grid .pf-pcard {
  position: relative;
  border-radius: var(--pf-thumb-radius, 6px);
  overflow: hidden;
  aspect-ratio: var(--pf-right-grid-ratio, 1 / 1);
}
.pf-s1-right-grid .pf-pcard .pf-thumb { position: relative; display:block; height:100%; }
.pf-s1-right-grid .pf-pcard .pf-thumb::before { display: none; }
.pf-s1-right-grid .pf-pcard .pf-thumb img {
  position:absolute; inset:0; width:100%; height:100%;
  object-fit: var(--pf-thumb-fit, cover); object-position: center;
  display:block;
}
.pf-s1-right-grid .pf-pcard .pf-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.8) 100%);
  color: #fff;
}
.pf-s1-right-grid .pf-pcard .pf-title { margin: 0; color:#fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pf-s1-right-grid .pf-pcard .pf-meta { color:#e5e7eb; }

/* ===== Category tag positioning (both sides) ======================= */
.pf-s1 .pf-thumb { position: relative; }
.pf-s1 .pf-thumb > .pf-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
}
.pf-s1 [data-catalign="right"] .pf-thumb > .pf-badge { left: auto; right: 8px; }
.pf-s1 [data-catalign="center"] .pf-thumb > .pf-badge { left: 50%; transform: translateX(-50%); }

.pf-s1 [data-catalign="left"] .pf-body,
.pf-s1 [data-catalign="left"] .pf-body-inner { text-align: left; }
.pf-s1 [data-catalign="center"] .pf-body,
.pf-s1 [data-catalign="center"] .pf-body-inner { text-align: center; }
.pf-s1 [data-catalign="right"] .pf-body,
.pf-s1 [data-catalign="right"] .pf-body-inner { text-align: right; }

.pf-s1 .pf-body .pf-badge { display: inline-block; }

/* ===== Text & Meta ================================================= */
.pf-s1 .pf-pcard .pf-title a { text-decoration: none; color: inherit; }

/* --- Meta container (identical spacing with block-1) --- */
.pf-s1 .pf-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pf-meta-gap, 8px);
  justify-content: var(--pf-meta-justify, flex-start);
}
.pf-s1 .pf-meta-item { display: inline-flex; align-items: center; gap: .4em; line-height: 1; }

/* --- ICON SYNC with Block-1 (force identical look) --- */
.pf-s1 .pf-meta-item .pf-meta-icon,
.pf-s1 .pf-meta-item svg.pf-meta-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7px;
  flex-shrink: 0;
}
.pf-s1 .pf-meta-item .pf-meta-icon *,
.pf-s1 .pf-meta-item svg.pf-meta-icon * {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.7px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke;
}

/* ===== Front-end toggles (data-attr) =============================== */
.pf-s1 [data-thumb="0"] .pf-thumb,
.pf-s1 [data-cat="0"] [data-meta="category"],
.pf-s1 [data-meta="0"] .pf-meta,
.pf-s1 [data-author="0"] [data-meta="author"],
.pf-s1 [data-date="0"] [data-meta="date"],
.pf-s1 [data-excerpt="0"] .pf-excerpt { display: none !important; }

/* ===== Equal-height frame like Slider-2 ============================= */
/* Khi JS đặt data-eq và --pf-col-h, cột phải cao bằng cột trái & nền phủ kín */
.pf-s1[data-eq="1"] .pf-s1-right {
  height: var(--pf-col-h, auto);
  min-height: var(--pf-col-h, auto);
  align-content: start; /* grid items dính lên trên */
}

/* ===== Container Queries (stack on small) ========================== */
@container (max-width: 768px) {
  .pf-s1-grid { grid-template-columns: 1fr; gap: var(--pf-gap-m, var(--pf-gap, 20px)); }
  .pf-s1-left, .pf-s1-right { grid-column: 1 / -1; width: 100%; }
  /* trên mobile bỏ equal-height */
  .pf-s1[data-eq="1"] .pf-s1-right { height:auto; min-height:0; }
}

/* Mobile tuning */
@container (max-width: 700px) {
  .pf-s1-left-slider .pf-sld-arrow { width: 36px; height: 36px; }
  .pf-s1 .pf-pcard .pf-title { font-size: clamp(1rem, 2vw + .9rem, 1.25rem); }
}

/* ===== Fallback when container queries unsupported ================= */
@supports not (container-type: inline-size) {
  @media (max-width: 768px) {
    .pf-s1-grid { grid-template-columns: 1fr; }
    .pf-s1-left, .pf-s1-right { grid-column: auto; }
    .pf-s1[data-eq="1"] .pf-s1-right { height:auto; min-height:0; }
  }
}

/* ===== Builder Preview tweaks (optional visual only) =============== */
.b-block-preview .pf-s1 .pf-pcard { background: #1e2b3b; color: #cbd5e1; }
.b-block-preview .pf-s1 .pf-meta { color: #94a3b8; }
.b-block-preview .pf-s1 a { color: #f1f5f9; }

/* Remove underline on category badge (and any link look) */
.pf-s1 .pf-badge a{
  text-decoration: none !important;
  border-bottom: 0 !important;   /* đề phòng theme dùng border-bottom làm “gạch chân” */
  box-shadow: none !important;    /* đề phòng theme dùng box-shadow để gạch chân */
}
.pf-s1 .pf-badge a:hover,
.pf-s1 .pf-badge a:focus{
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}