/*
 * An Giang Mới V6 — phần bổ sung cho WordPress (ảnh thật, admin bar, quảng cáo GPT, trang trong).
 * Nạp sau agm-v4/v5/v6.css. Không đổi giao diện trang chủ so với wireframe.
 */

/* Ảnh thật phủ khung placeholder */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb:has(img)::after { display: none; }
.v6-media__type { z-index: 1; }
.agm6-custom-logo img { display: block; width: auto; max-height: 66px; }

/* Thanh quản trị WordPress */
.admin-bar .v4-nav { top: 32px; }
.admin-bar .v6-side__ad { top: 102px; }
@media (max-width: 782px) {
  .admin-bar .v4-nav { top: 46px; }
}
@media (max-width: 980px) {
  .admin-bar .v4-topics { top: 46px; }
}
@media (max-width: 600px) {
  .admin-bar .v4-topics { top: 0; }
}

/* Quảng cáo GPT */
.agm6-ad__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.agm6-slot { display: inline-block; max-width: 100%; }
.agm6-ad .widget { display: flex; justify-content: center; }
.agm6-ad--inline { clear: both; margin: 24px 0; padding: 14px 0; border-top: 1px solid var(--agm-line); border-bottom: 1px solid var(--agm-line); }
.agm6-list .agm6-ad--inline { margin: 0; }
@media (max-width: 719px) {
  [data-min-width='720'] { display: none; }
}

/* ---------- Trang trong ---------- */
.agm6-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 14px; color: var(--agm-muted); font-size: 13px; }
.agm6-crumbs a { color: var(--agm-jade-deep); font-weight: 600; }
.agm6-crumbs span[aria-hidden] { color: var(--agm-line); }
.agm6-page-head { padding-top: 22px; }

.agm6-archive__head { margin-bottom: 24px; border-bottom: 3px solid var(--agm-primary); padding-bottom: 16px; }
.agm6-archive__head h1 { margin: 4px 0 6px; color: var(--agm-primary); font-family: var(--agm-serif); font-size: 32px; line-height: 1.2; }
.agm6-archive__desc { margin: 0; color: var(--agm-muted); font-size: 15px; }
.agm6-archive__head .agm6-searchform { max-width: 520px; margin-top: 14px; }
.agm6-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.agm6-pills a { border: 1px solid var(--agm-line); border-radius: 999px; background: #fff; color: var(--agm-primary); padding: 5px 13px; font-size: 13px; font-weight: 700; }
.theme-v4 .agm6-pills a:hover { border-color: var(--agm-primary); color: var(--agm-primary); }
.theme-v4 .agm6-pills a.is-current { border-color: var(--agm-primary); background: var(--agm-primary); color: #fff; }
.agm6-pills--places a { border-color: var(--agm-pearl); background: var(--agm-pearl-pale); color: var(--agm-pearl-deep); }
.theme-v4 .agm6-pills--places a.is-current { border-color: var(--agm-pearl-deep); background: var(--agm-pearl-deep); }

.agm6-archive__lead { margin-bottom: 8px; }
.agm6-archive__lead .v4-card h3 { margin: 10px 0 8px; font-family: var(--agm-serif); font-size: 26px; line-height: 1.3; }
.agm6-list { display: grid; }
.agm6-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; border-bottom: 1px solid var(--agm-line); padding: 18px 0; }
.agm6-item__body { min-width: 0; }
.agm6-item h2 { margin: 4px 0 6px; font-size: 19px; font-weight: 700; line-height: 1.38; }
.agm6-item .sapo { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14.5px; }
.agm6-item time { display: block; margin-top: 6px; }
.agm6-empty { padding: 28px 0; color: var(--agm-muted); }
.agm6-region-covers { margin: -8px 0 14px; }

/* Phân trang */
.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-links .page-numbers { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; border: 1px solid var(--agm-line); border-radius: 6px; background: #fff; padding: 0 12px; font-size: 14px; font-weight: 700; }
.theme-v4 .nav-links .page-numbers.current { border-color: var(--agm-primary); background: var(--agm-primary); color: #fff; }
.nav-links .dots { border: 0; background: transparent; }

/* Bài viết */
.agm6-article { min-width: 0; }
.agm6-article__head .kicker { font-size: 12px; }
.agm6-article__title { margin: 8px 0 12px; color: var(--agm-ink); font-family: var(--agm-serif); font-size: 34px; line-height: 1.25; }
.agm6-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; font-size: 13px; }
.agm6-article__sapo { margin: 0 0 20px; color: var(--agm-ink); font-size: 18px; font-weight: 600; line-height: 1.6; }
.agm6-article__figure { margin: 0 0 22px; }
.agm6-article__figure img { display: block; width: 100%; height: auto; border-radius: 6px; }
.agm6-article__figure figcaption, .wp-caption-text, .wp-element-caption { margin-top: 6px; color: var(--agm-muted); font-size: 13px; font-style: italic; text-align: center; }
.agm6-content { font-size: 18px; line-height: 1.75; }
.agm6-content > * { max-width: 100%; }
.agm6-content p { margin: 0 0 1.1em; }
.agm6-content h2, .agm6-content h3, .agm6-content h4 { margin: 1.5em 0 .6em; color: var(--agm-primary); font-family: var(--agm-serif); line-height: 1.3; }
.agm6-content h2 { font-size: 25px; }
.agm6-content h3 { font-size: 21px; }
.theme-v4 .agm6-content a { color: var(--agm-jade-deep); text-decoration: underline; text-underline-offset: 3px; }
.agm6-content img, .agm6-content video, .agm6-content iframe { max-width: 100%; height: auto; }
.agm6-content iframe { width: 100%; aspect-ratio: 16 / 9; }
.agm6-content figure, .agm6-content .wp-caption { max-width: 100%; margin: 1.4em 0; }
.agm6-content blockquote { margin: 1.4em 0; border-left: 4px solid var(--agm-jade); background: #fff; padding: 14px 18px; color: var(--agm-ink); font-style: italic; }
.agm6-content blockquote p:last-child { margin-bottom: 0; }
.agm6-content ul, .agm6-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.agm6-content table { width: 100%; margin: 1.4em 0; border-collapse: collapse; font-size: 15px; }
.agm6-content th, .agm6-content td { border: 1px solid var(--agm-line); padding: 8px 10px; text-align: left; }
.agm6-content .agm6-demo-note { border: 1px dashed var(--agm-mist); border-radius: 6px; background: var(--agm-mist-pale); padding: 10px 14px; color: var(--agm-mist-deep); font-size: 14px; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-right: auto; margin-left: auto; }
.wp-block-image img { height: auto; border-radius: 6px; }
.agm6-pages { margin: 18px 0; font-weight: 700; }
.agm6-article__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; clear: both; margin: 26px 0; border-top: 1px solid var(--agm-line); padding-top: 18px; }
.agm6-related { margin-top: 32px; }
.agm6-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* Bình luận */
.agm6-comments { margin-top: 36px; border-top: 1px solid var(--agm-line); padding-top: 24px; }
.agm6-comments__title { margin: 0 0 14px; color: var(--agm-primary); font-size: 19px; }
.agm6-comments__list, .agm6-comments__list .children { margin: 0; padding: 0; list-style: none; }
.agm6-comments__list .children { padding-left: 28px; }
.agm6-comments__list .comment-body { margin-bottom: 14px; border-bottom: 1px solid var(--agm-line); padding-bottom: 14px; }
.agm6-comments__list .comment-meta { color: var(--agm-muted); font-size: 13px; }
.agm6-comments__list .avatar { float: left; margin-right: 10px; border-radius: 50%; }
.comment-form p { margin: 0 0 12px; }
.comment-form label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.comment-form input[type='text'], .comment-form input[type='email'], .comment-form input[type='url'], .comment-form textarea { width: 100%; border: 1px solid var(--agm-line); border-radius: 6px; background: #fff; padding: 9px 12px; }
.comment-form .comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* 404 */
.agm6-404 .agm6-searchform { max-width: 520px; margin-top: 14px; }

@media (max-width: 980px) {
  .agm6-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .agm6-archive__head h1 { font-size: 26px; }
  .agm6-archive__lead .v4-card h3 { font-size: 21px; }
  .agm6-item { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
  .agm6-item h2 { margin-top: 2px; font-size: 16px; }
  .agm6-item .sapo { display: none; }
  .agm6-article__title { font-size: 26px; }
  .agm6-article__sapo { font-size: 16.5px; }
  .agm6-content { font-size: 17px; }
  .agm6-related__grid { grid-template-columns: minmax(0, 1fr); }
  .alignleft, .alignright { float: none; margin: 1em 0; }
}
