/* ============================================================
   AIP · Section "Tin tức" (carousel clone cơ chế TOPICS của andrew.ac.jp —
   rebrand palette AIP: Trust Navy #071B3B / Signal Red #C6172E, font Be Vietnam Pro,
   nội dung tiếng Việt, GIỮ NGUYÊN ảnh gốc). Self-contained, chạy trên Splide v4.
   Carousel bleed sang phải tới mép viewport (track overflow:visible + section overflow:hidden).
   ============================================================ */
.aip-topics{
  --aip-navy:#071B3B;
  --aip-red:#C6172E;
  --aip-line:#e3e7ee;
  font-family:"Be Vietnam Pro","Inter",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  background:#fff;
  padding:clamp(72px,8vw,120px) 0;
  overflow:hidden;              /* clip bleed ở mép viewport */
  letter-spacing:-.02em;
}
.aip-topics *,
.aip-topics *::before,
.aip-topics *::after{box-sizing:border-box}
.aip-topics ul{list-style:none;margin:0;padding:0}
.aip-topics button{font:inherit;color:inherit;background:none;padding:0;margin:0}
.aip-topics a{text-decoration:none;color:inherit}
.aip-topics img{max-width:100%;display:block}

/* container capped + centered — cột trái canh trong container, carousel bleed phải */
.aip-topics__wrap{
  width:min(100% - 48px,1280px);
  margin-inline:auto;
  visibility:hidden;                    /* anti-FOUC: ẩn tới khi Splide mount */
}
.aip-topics__wrap.is-initialized{visibility:visible}

.aip-topics__grid{display:flex;align-items:flex-start;gap:50px}

/* ---------- cột trái (heading + arrows + button) ---------- */
.aip-topics__aside{
  width:225px;flex:0 0 225px;
  position:relative;z-index:2;          /* nổi trên mask trắng của carousel */
}
.aip-topics__heading{margin:0;display:flex;flex-direction:column}
.aip-topics__heading .sub{
  order:-1;                             /* eyebrow lên trên */
  font-size:14px;font-weight:600;line-height:1;
  letter-spacing:.18em;text-transform:uppercase;
  color:var(--aip-red);margin-bottom:14px;
}
.aip-topics__heading .main{
  font-size:clamp(40px,4.2vw,58px);font-weight:700;line-height:1.02;
  letter-spacing:-.035em;color:var(--aip-navy);
}

.aip-topics__arrows{display:flex;gap:8px;margin-top:40px}
.aip-topics__arrow{
  position:relative;width:50px;height:50px;border-radius:0;
  border:1px solid var(--aip-line);background:none;cursor:pointer;   /* viền xám nhạt (như gốc) */
  transition:background-color .25s ease,border-color .25s ease;
}
.aip-topics__arrow::after{
  content:"";position:absolute;top:50%;left:54%;width:10px;height:10px;
  border-top:1px solid var(--aip-red);border-left:1px solid var(--aip-red);   /* chevron đỏ */
  transform:translate(-50%,-50%) rotate(-45deg);transition:border-color .25s ease;
}
.aip-topics__arrow--next::after{left:46%;transform:translate(-50%,-50%) rotate(135deg)}
.aip-topics .splide__arrow svg{display:none}   /* dùng chevron ::after, ẩn svg mặc định Splide */
.aip-topics__arrow:hover{background:var(--aip-red);border-color:var(--aip-red)}
.aip-topics__arrow:hover::after{border-color:#fff}
.aip-topics__arrow:disabled{opacity:.35;cursor:default}
.aip-topics__arrow:disabled:hover{background:none}
.aip-topics__arrow:disabled:hover::after{border-color:var(--aip-red)}

.aip-topics a.aip-topics__btn{
  display:inline-flex;align-items:center;gap:10px;margin-top:30px;
  padding:14px 22px;border-radius:999px;background:var(--aip-red);color:#fff;   /* chữ trắng (ép specificity > reset .aip-topics a) */
  font-size:14px;font-weight:600;letter-spacing:-.01em;
  transition:background-color .25s ease;
}
.aip-topics__btn::after{
  content:"";width:18px;height:7px;background:#fff;
  -webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDIwIDciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGxpbmUgeTE9IjMuNSIgeDI9IjE1IiB5Mj0iMy41IiBzdHJva2U9IndoaXRlIi8+PHBhdGggZD0iTTIwIDMuNUwxNC43NSA2LjUzMTA5TDE0Ljc1IDAuNDY4OTExTDIwIDMuNVoiIGZpbGw9IndoaXRlIi8+PC9zdmc+") no-repeat;
  mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDIwIDciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGxpbmUgeTE9IjMuNSIgeDI9IjE1IiB5Mj0iMy41IiBzdHJva2U9IndoaXRlIi8+PHBhdGggZD0iTTIwIDMuNUwxNC43NSA2LjUzMTA5TDE0Ljc1IDAuNDY4OTExTDIwIDMuNVoiIGZpbGw9IndoaXRlIi8+PC9zdmc+") no-repeat;
  -webkit-mask-size:contain;mask-size:contain;
}
.aip-topics a.aip-topics__btn:hover{background:var(--aip-navy)}

/* ---------- cột phải (carousel) + mask trắng che bleed trái ---------- */
.aip-topics__col{flex:1 1 auto;min-width:0;position:relative}
.aip-topics__col::before{
  content:"";position:absolute;top:0;left:0;width:100%;height:100%;
  transform:translateX(-100%);background:#fff;z-index:1;
}
.aip-topics .splide__track{overflow:visible}   /* cho card tràn (bleed) ra phải */

/* ---------- card ---------- */
.aip-topics__card{position:relative;width:250px}
.aip-topics__card a{
  position:relative;display:flex;flex-direction:column;gap:14px;
  height:100%;padding-bottom:20px;
}
.aip-topics__img{overflow:hidden;aspect-ratio:250/167;background:#eceef1;border-radius:8px}
.aip-topics__img img{width:100%;height:100%;object-fit:cover;transition:transform .45s ease-in-out}
.aip-topics__card a:hover .aip-topics__img img{transform:scale(1.08)}

.aip-topics__ttl{
  flex-grow:1;margin:0;font-size:15px;line-height:1.55;font-weight:500;
  letter-spacing:-.015em;color:var(--aip-navy);
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;
}
.aip-topics__date{
  font-size:14px;font-weight:500;letter-spacing:.01em;color:var(--aip-red);
}

/* arrow (→) góc dưới-phải card */
.aip-topics__card::before{
  content:"";position:absolute;bottom:20px;right:0;width:20px;height:7px;z-index:2;
  background:var(--aip-red);
  -webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDIwIDciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGxpbmUgeTE9IjMuNSIgeDI9IjE1IiB5Mj0iMy41IiBzdHJva2U9IndoaXRlIi8+PHBhdGggZD0iTTIwIDMuNUwxNC43NSA2LjUzMTA5TDE0Ljc1IDAuNDY4OTExTDIwIDMuNVoiIGZpbGw9IndoaXRlIi8+PC9zdmc+") no-repeat;
  mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDIwIDciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGxpbmUgeTE9IjMuNSIgeDI9IjE1IiB5Mj0iMy41IiBzdHJva2U9IndoaXRlIi8+PHBhdGggZD0iTTIwIDMuNUwxNC43NSA2LjUzMTA5TDE0Ljc1IDAuNDY4OTExTDIwIDMuNVoiIGZpbGw9IndoaXRlIi8+PC9zdmc+") no-repeat;
  -webkit-mask-size:contain;mask-size:contain;transition:all .3s;
}
/* kẻ xám dưới card + kẻ đỏ quét ngang khi hover */
.aip-topics__card a::before{
  content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--aip-line);
}
.aip-topics__card a::after{
  content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--aip-red);
  clip-path:polygon(0 0,0 0,0 100%,0 100%);animation:aipTopicsClipOut .3s ease forwards;
}
.aip-topics__card a:hover::after,
.aip-topics__card a:focus-visible::after{animation:aipTopicsClipIn .3s ease forwards}
@keyframes aipTopicsClipIn{0%{clip-path:polygon(0 0,0 0,0 100%,0 100%)}100%{clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}}
@keyframes aipTopicsClipOut{0%{clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}100%{clip-path:polygon(100% 0,100% 0,100% 100%,100% 100%)}}

/* ---------- tablet/mobile: xếp dọc ---------- */
@media (max-width:900px){
  .aip-topics__grid{flex-direction:column;gap:28px}
  .aip-topics__aside{width:auto;flex:none;display:flex;flex-direction:column}
  .aip-topics__heading .main{font-size:clamp(34px,9vw,46px)}
  .aip-topics__arrows{order:3;margin-top:28px}
  .aip-topics__btn{order:2;align-self:flex-start;margin-top:22px}
}
@media (prefers-reduced-motion:reduce){
  .aip-topics__img img,.aip-topics__card a::after{transition:none;animation:none}
}
