/* ==========================================================================
   Consmaterial – bổ sung cho WordPress (admin bar, Contact Form 7)
   ========================================================================== */

/* Admin bar khi đăng nhập */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

/* CF7 – wrapper inline của từng field */
.contact-form .wpcf7-form-control-wrap { display: block; position: relative; }
.contact-form .wpcf7-not-valid { border-color: #d9534f !important; }
.contact-form .wpcf7-not-valid-tip { display: block; margin-top: 4px; color: #c0392b; font-size: 9px; font-weight: 600; }
.contact-form .screen-reader-response { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* CF7 – nút gửi + spinner */
.contact-form .form-submit[disabled] { opacity: .65; cursor: wait; }
.contact-form .wpcf7-spinner { display: none; margin: 8px auto 0; }
.contact-form.submitting .wpcf7-spinner { display: block; visibility: visible; }

/* CF7 – thông báo kết quả (giống .form-status của bản thiết kế) */
.contact-form .wpcf7-response-output { margin: 10px 0 0 !important; padding: 9px 10px !important; border: 0 !important; border-left: 3px solid #286b49 !important; background: #eff8f2; color: #286b49; font-size: 10px; font-weight: 650; line-height: 1.55; }
.contact-form.init .wpcf7-response-output,
.contact-form.resetting .wpcf7-response-output,
.contact-form.submitting .wpcf7-response-output { display: none; }
.contact-form.invalid .wpcf7-response-output,
.contact-form.unaccepted .wpcf7-response-output,
.contact-form.failed .wpcf7-response-output,
.contact-form.aborted .wpcf7-response-output,
.contact-form.spam .wpcf7-response-output { border-left-color: #c0392b !important; background: #fdf1ef; color: #a93226; }

/* Tên thương hiệu lấy từ "Tên trang web" / "Dòng mô tả" → luôn viết hoa như thiết kế */
.brand-wordmark strong, .brand-wordmark small { text-transform: uppercase; }
/* Logo upload từ WordPress có thể không đúng tỉ lệ 39×47 → giữ nguyên tỉ lệ */
.brand img { width: auto; max-width: 120px; }

/* Admin bar (chỉ khi đăng nhập): theme cũ thay logo WP bằng Favicon → giới hạn kích thước */
#wpadminbar #wp-admin-bar-wp-logo > .ab-item img { width: 20px; height: 20px; max-height: 20px; object-fit: contain; vertical-align: middle; }

/* Trang chủ – Bài viết mới nhất (partials/home/news.php), cùng kiểu thẻ "Bài viết liên quan" */
.cm-home-news { padding: 72px 0 80px; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cm-home-news-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.cm-home-news-head h2 { margin: 14px 0 0; color: var(--navy); font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -.03em; }
.cm-home-news-head > a { color: var(--blue); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.cm-home-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.cm-home-news-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color .2s; }
.cm-home-news-card:hover { border-color: var(--blue); }
.cm-home-news-img { aspect-ratio: 1200 / 630; overflow: hidden; background: var(--navy); display: grid; place-items: center; color: rgba(255,255,255,.6); font-weight: 700; }
.cm-home-news-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-home-news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 18px 0; font-size: 13px; color: var(--muted); }
.cm-home-news-tag { padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--blue); font-size: 12px; font-weight: 700; }
.cm-home-news-card h3 { margin: 8px 18px 12px; color: var(--navy); font-size: 17px; line-height: 1.4; }
.cm-home-news-more { margin: auto 18px 20px; color: var(--blue); font-size: 14px; font-weight: 700; }
@media (max-width: 1080px) {
  .cm-home-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cm-home-news-card:nth-child(n+4) { display: none; }
  .cm-home-news-card h3 { font-size: 16px; }
}
@media (max-width: 640px) {
  .cm-home-news { padding: 52px 0 60px; }
  .cm-home-news-head { flex-direction: column; align-items: start; }
  .cm-home-news-grid { grid-template-columns: minmax(0, 1fr); }
}
