/* Khối "Tại sao chọn chúng tôi" + "Thư viện ảnh" (album + khung xem ảnh) — kiểu trung tính, theme có thể ghi đè màu. */

.aomua-block, .aomua-albums, .aomua-lb, .aomua-pager {
    --of-primary: #0066B2;
    --bl-accent: #f08a24;
    box-sizing: border-box;
}
.aomua-block *, .aomua-albums *, .aomua-lb * { box-sizing: border-box; }

/* --- Tiêu đề khối: căn giữa, in hoa, gạch nhấn bên dưới --------------------- */
.aomua-block { margin-top: 36px; }
.aomua-block-head { max-width: 1100px; margin: 0 auto 26px; text-align: center; }
.aomua-block-title { position: relative; display: inline-block; margin: 0; padding-bottom: 14px; color: #101828; font-size: 20px; font-weight: 700; line-height: 1.35; letter-spacing: 0.01em; text-transform: uppercase; }
.aomua-block-title a { color: inherit; text-decoration: none; }
.aomua-block-title a:hover { color: var(--of-primary); }
.aomua-block-title::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 48px; height: 2px; border-radius: 2px; background: var(--of-primary); transform: translateX(-50%); }
.aomua-block-desc { margin: 14px 0 0; color: #4f5b67; line-height: 1.7; text-wrap: balance; }
.aomua-block-more { margin: 22px 0 0; text-align: center; }
.aomua-block-more a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 20px; border-radius: 999px; color: var(--of-primary); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: background .2s, box-shadow .2s; }
.aomua-block-more a svg { transition: transform .2s; }
.aomua-block-more a:hover { background: #fff; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1); }
.aomua-block-more a:hover svg { transform: translateX(4px); }

/* --- Tại sao chọn chúng tôi: thẻ trắng viền trên, biểu tượng lục giác ----------- */
.aomua-why-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.aomua-why-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.aomua-why-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin-inline: auto; }
.aomua-why-grid--1 { grid-template-columns: minmax(0, 380px); justify-content: center; }
.aomua-why-card { display: flex; flex-direction: column; align-items: center; margin: 0; padding: 26px 22px 24px; border: 1px solid #eef0f2; border-top: 3px solid var(--of-primary); border-radius: 12px; background: #fff; text-align: center; transition: transform .2s ease, box-shadow .2s ease; }
.aomua-why-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1); }
.aomua-why-icon { display: flex; align-items: center; justify-content: center; width: 70px; height: 76px; margin-bottom: 16px; background: var(--bl-accent); color: #fff; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.aomua-why-icon--img { width: auto; min-width: 70px; background: transparent; clip-path: none; }
.aomua-why-icon--img img { width: auto; height: auto; max-width: 96px; max-height: 76px; }
.aomua-why-name { margin: 0 0 10px; color: #101828; font-size: 17px; font-weight: 700; line-height: 1.4; }
/* Mô tả căn trái (căn giữa/đều làm chữ lởm chởm), gọn 5 dòng — đủ nội dung vẫn nằm trong trang + tooltip */
.aomua-why-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; margin: 0; color: #4f5b67; line-height: 1.65; text-align: left; }

/* --- Thư viện ảnh: lưới album ------------------------------------------------- */
.aomua-albums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
/* Thẻ album: ảnh phủ kín thẻ bo tròn, tên album nằm trên dải tối dần ở chân ảnh, số ảnh ở góc trên.
   Rê chuột: thẻ đứng yên, ảnh phóng nhẹ, hiện nút "Xem album". */
.aomua-album { position: relative; display: block; min-width: 0; padding: 0; border: 0; border-radius: 16px; background: #0f172a; color: #fff; font: inherit; text-align: left; overflow: hidden; cursor: pointer; isolation: isolate; }
.aomua-album:focus-visible { outline: 2px solid var(--of-primary); outline-offset: 3px; }
.aomua-album-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.aomua-album-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.22, .8, .24, 1); }
.aomua-album:hover .aomua-album-media img { transform: scale(1.06); }
/* Dải tối dần ở chân ảnh (luôn có, để tên album đọc được) + lớp phủ tối toàn ảnh khi rê chuột */
.aomua-album-ov { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(9, 21, 32, 0) 42%, rgba(9, 21, 32, 0.82) 100%); }
.aomua-album-media::after { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(9, 21, 32, 0.32); opacity: 0; transition: opacity .3s ease; }
.aomua-album:hover .aomua-album-media::after { opacity: 1; }
/* Nút "Xem album" giữa ảnh */
.aomua-album-label { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.aomua-album:hover .aomua-album-label, .aomua-album:focus-visible .aomua-album-label { opacity: 1; transform: none; }
.aomua-album-label > span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.96); color: var(--of-primary); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); }
.aomua-album-label em { font-style: normal; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.aomua-album-count { position: absolute; top: 12px; right: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #101828; font-size: 12px; font-weight: 700; line-height: 1; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.aomua-album-name { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin: 0; color: #fff; font-size: 16px; font-weight: 700; line-height: 1.4; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.aomua-albums-empty { margin: 0; padding: 40px 16px; text-align: center; color: #6b7280; }

.aomua-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }
.aomua-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid #e4e8ee; border-radius: 8px; background: #fff; color: #333; font-weight: 600; text-decoration: none; }
.aomua-pager a.page-numbers:hover { border-color: var(--of-primary); color: var(--of-primary); }
.aomua-pager .current { border-color: var(--of-primary); background: var(--of-primary); color: #fff; }

/* --- Khung xem ảnh: thanh trên (tên + đếm + đóng), trượt ngang, dải ảnh nhỏ ---- */
.aomua-lb { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: rgba(8, 10, 14, 0.96); opacity: 0; transition: opacity .2s ease; }
.aomua-lb[hidden] { display: none; }
.aomua-lb.is-open { opacity: 1; }
.aomua-lb-top { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #fff; }
.aomua-lb-title { overflow: hidden; font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.aomua-lb-right { display: flex; flex: none; align-items: center; gap: 10px; }
.aomua-lb-count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.75; }
.aomua-lb-close, .aomua-lb-nav { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; transition: background .2s; }
.aomua-lb-close { width: 34px; height: 34px; }
.aomua-lb-close svg { width: 18px; height: 18px; }
.aomua-lb-close:hover { background: rgba(255, 255, 255, 0.24); }
.aomua-lb-view { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.aomua-lb-track { display: flex; height: 100%; transition: transform .35s cubic-bezier(.22, .8, .24, 1); will-change: transform; }
.aomua-lb-track.is-dragging { transition: none; }
.aomua-lb-slide { display: flex; flex: 0 0 100%; align-items: center; justify-content: center; padding: 0 12px; }
.aomua-lb-slide img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.aomua-lb-nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; transform: translateY(-50%); }
.aomua-lb-nav svg { width: 22px; height: 22px; }
.aomua-lb-nav:hover { background: var(--of-primary); }
.aomua-lb-nav[hidden] { display: none; }
.aomua-lb-prev { left: 14px; }
.aomua-lb-next { right: 14px; }
.aomua-lb-strip-wrap { flex: none; padding: 10px 14px 16px; overflow-x: auto; scrollbar-width: none; }
.aomua-lb-strip-wrap::-webkit-scrollbar { display: none; }
.aomua-lb-strip { display: flex; justify-content: center; gap: 8px; min-width: min-content; margin: 0 auto; }
.aomua-lb-thumb { flex: none; width: 64px; height: 48px; padding: 0; border: 0; border-radius: 4px; background: none; outline: 2px solid transparent; outline-offset: 1px; overflow: hidden; opacity: 0.45; cursor: pointer; transition: opacity .2s, outline-color .2s; }
.aomua-lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aomua-lb-thumb:hover { opacity: 0.8; }
.aomua-lb-thumb.is-active { opacity: 1; outline-color: var(--of-primary); }
/* Khoá cuộn trang khi đang xem ảnh (album.js bù bề rộng thanh cuộn bằng lề phải của body để trang không xê ngang) */
html.aomua-noscroll { overflow: hidden; }
/* Khung xem ảnh: cuộn/vuốt bên trong không lan ra trang phía sau */
.aomua-lb { overscroll-behavior: contain; touch-action: pan-y; }
.aomua-lb-view { touch-action: pan-y; }
.aomua-lb-strip-wrap { overscroll-behavior: contain; }
/* Ảnh đang tải: vòng xoay giữa khung thay vì khung trống rồi ảnh bật ra */
.aomua-lb-slide { position: relative; }
.aomua-lb-slide::before { content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; border-radius: 50%; animation: aomua-lb-spin .8s linear infinite; }
.aomua-lb-slide.is-loaded::before { display: none; }
.aomua-lb-slide img { position: relative; opacity: 0; transition: opacity .25s ease; }
.aomua-lb-slide.is-loaded img { opacity: 1; }
@keyframes aomua-lb-spin { to { transform: rotate(360deg); } }

@media (max-width: 1199px) {
    .aomua-albums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .aomua-why-grid, .aomua-why-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .aomua-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 600px) {
    .aomua-block { margin-top: 28px; }
    .aomua-block-head { margin-bottom: 18px; }
    .aomua-block-title { font-size: 18px; }
    /* Điện thoại: 2 thẻ một hàng, thẻ gọn (biểu tượng nhỏ, chữ nhỏ), mô tả hiện đủ */
    .aomua-why-grid, .aomua-why-grid--3, .aomua-why-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: none; }
    .aomua-why-card { padding: 16px 12px 14px; }
    .aomua-why-icon { width: 48px; height: 52px; margin-bottom: 10px; }
    .aomua-why-icon svg { width: 24px; height: 24px; }
    .aomua-why-icon--img { min-width: 48px; }
    .aomua-why-icon--img img { max-width: 64px; max-height: 52px; }
    .aomua-why-name { margin-bottom: 6px; font-size: 14.5px; line-height: 1.35; }
    .aomua-why-text { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; font-size: 13px; line-height: 1.5; text-align: center; }   /* hiện đủ nội dung, không cắt dòng */
    .aomua-albums { gap: 10px; }
    .aomua-album { border-radius: 12px; }
    .aomua-album-name { left: 10px; right: 10px; bottom: 10px; font-size: 13.5px; }
    .aomua-album-count { top: 8px; right: 8px; padding: 4px 8px; font-size: 11px; }
    .aomua-lb-nav { width: 36px; height: 36px; }
    .aomua-lb-prev { left: 6px; }
    .aomua-lb-next { right: 6px; }
    .aomua-lb-thumb { width: 52px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    .aomua-lb, .aomua-lb-track, .aomua-why-card, .aomua-album-media img, .aomua-album-media::after, .aomua-album-label { transition: none; }
    .aomua-album:hover .aomua-album-media img { transform: none; }
}
