/* Thư viện ảnh APECCons: khối ảnh trang chủ + trang /hinh-anh.
   Viết độc lập (tiền tố ag-) vì main.css của Tailwind được biên dịch sẵn, không có bước build lại. */

/* ---------- Khối ảnh trang chủ ---------- */
.ag-sec { background: linear-gradient(180deg, #0f2347 0%, #17306a 100%); color: #fff; border-top: 4px solid #f08132; }
.ag-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.ag-eyebrow { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #f08132; margin: 0 0 .5rem; }
.ag-h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 800; color: #fff; margin: 0; }
.ag-lead { margin: .6rem 0 0; max-width: 48rem; font-size: .875rem; line-height: 1.65; color: #cbd5e1; }
.ag-more { align-self: flex-start; flex-shrink: 0; font-size: .875rem; font-weight: 700; color: #fdba74; text-decoration: none; white-space: nowrap; }
.ag-more:hover { color: #fff; }

.ag-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ag-tile { position: relative; display: block; overflow: hidden; border-radius: 14px; background: #1e293b; color: #fff; text-decoration: none; isolation: isolate; }
.ag-tile--big { grid-column: span 2; aspect-ratio: 3 / 2; }
.ag-tile--sm { aspect-ratio: 4 / 3; }
.ag-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ag-tile:hover img, .ag-tile:focus-visible img { transform: scale(1.05); }
.ag-tile:focus-visible, .ag-card a:focus-visible { outline: 3px solid #f08132; outline-offset: 2px; }
.ag-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 2.2rem .85rem .7rem;
  font-size: .75rem; line-height: 1.4; font-weight: 600;
  background: linear-gradient(0deg, rgba(8, 18, 40, .88) 0%, rgba(8, 18, 40, .5) 55%, rgba(8, 18, 40, 0) 100%);
}
/* Cắt dòng đặt trên phần tử con (không có padding) để không lộ nửa dòng thứ 3 */
.ag-cap > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-tile--big .ag-cap { font-size: .875rem; padding: 3rem 1.1rem .95rem; }
.ag-tile--big .ag-cap > span { -webkit-line-clamp: 3; }

/* Ô cuối: nút "xem thêm" phủ trên một ảnh */
.ag-tile--cta img { filter: brightness(.45) saturate(.8); }
.ag-cta { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 1rem; text-align: center; }
.ag-cta strong { font-size: 1.5rem; line-height: 1; font-weight: 800; color: #fff; }
.ag-cta span { font-size: .8rem; font-weight: 700; color: #fdba74; }
.ag-tile--cta:hover .ag-cta span { color: #fff; }

@media (min-width: 1024px) {
  .ag-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .ag-h2 { font-size: 1.875rem; }
  .ag-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 190px; gap: 14px; }
  .ag-tile--big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .ag-tile--sm { aspect-ratio: auto; }
}

/* ---------- Trang /hinh-anh ---------- */
.ag-page-hero { background: linear-gradient(135deg, #0f2347 0%, #214183 100%); color: #fff; border-bottom: 4px solid #f08132; }
.ag-page-hero h1 { font-size: 1.875rem; line-height: 1.2; font-weight: 800; margin: 0; color: #fff; }
.ag-page-hero p { margin: .75rem 0 0; max-width: 46rem; font-size: .95rem; line-height: 1.65; color: #dbe4f5; }
@media (min-width: 768px) { .ag-page-hero h1 { font-size: 2.5rem; } }

.ag-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.ag-pills a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); }
.ag-pills a:hover { background: #f08132; border-color: #f08132; }
.ag-pills small { font-size: .7rem; font-weight: 700; opacity: .8; }

.ag-album { scroll-margin-top: 6.5rem; }
.ag-album + .ag-album { margin-top: 3rem; }
.ag-album h2 { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin: 0; }
.ag-album > p { margin: .35rem 0 0; font-size: .875rem; color: #475569; max-width: 46rem; }
.ag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 1.1rem; }
@media (min-width: 640px) { .ag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .ag-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ag-card { margin: 0; scroll-margin-top: 6.5rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); display: flex; flex-direction: column; }
.ag-card a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e2e8f0; cursor: zoom-in; }
.ag-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ag-card a:hover img { transform: scale(1.05); }
.ag-card figcaption { padding: .65rem .8rem .8rem; font-size: .75rem; line-height: 1.5; font-weight: 500; color: #334155; }

/* Hộp xem ảnh lớn */
.ag-lb { border: 0; padding: 0; margin: 0; background: transparent; color: #fff; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; }
.ag-lb::backdrop { background: rgba(6, 14, 30, .93); }
.ag-lb-inner { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; height: 100%; padding: 3.25rem 3.5rem 1.25rem; box-sizing: border-box; }
.ag-lb img { max-width: 100%; max-height: calc(100vh - 11rem); width: auto; height: auto; object-fit: contain; border-radius: 8px; background: #0b1730; }
.ag-lb-cap { max-width: 56rem; text-align: center; font-size: .9rem; line-height: 1.55; color: #e2e8f0; min-height: 2.8em; }
.ag-lb-count { position: absolute; top: 1rem; left: 1.1rem; font-size: .8rem; font-weight: 700; color: #94a3b8; }
.ag-lb button { position: absolute; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 999px; font-size: 1.4rem; line-height: 1; color: #fff; background: rgba(255, 255, 255, .14); cursor: pointer; }
.ag-lb button:hover, .ag-lb button:focus-visible { background: #f08132; outline: none; }
.ag-lb-close { top: .75rem; right: .75rem; }
.ag-lb-prev { left: .6rem; top: 50%; transform: translateY(-50%); }
.ag-lb-next { right: .6rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .ag-lb-inner { padding: 3.25rem .5rem 1rem; }
  .ag-lb-prev, .ag-lb-next { top: auto; bottom: 4.3rem; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-tile img, .ag-card img { transition: none; }
  .ag-tile:hover img, .ag-card a:hover img { transform: none; }
}
