/*
Theme Name: Halo
Theme URI: https://hobimedia.com/
Author: Hobimedia
Author URI: https://hobimedia.com/
Description: Theme dịch vụ tối ưu SEO, nhẹ, responsive. Tailwind CSS đã compile sẵn (không dùng CDN), tương thích plugin (wp_body_open, html5, editor-styles).
Version: 2.3.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: Dichvuhalo
*/

/* ================================
   NỘI DUNG TỪ EDITOR (.wp-content)
================================ */
.wp-content {
  font-size: 16px;
  line-height: 1.8;
  color: #111827;
}

/* Tiêu đề trong nội dung: giãn dòng rộng (chữ Việt nhiều dấu) + cỡ chữ co giãn theo màn hình.
   Selector `.wp-content h1` mạnh hơn `.prose-lg h1` (line-height: 1) của Tailwind Typography nên mới ghi đè được. */
.wp-content h1 {
  font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 2rem 0 1rem;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.wp-content h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  font-weight: 700;
  line-height: 1.4;
  margin: 2rem 0 1rem;
  color: #003a87;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.wp-content h3 {
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.5;
  margin: 1.5rem 0 0.75rem;
  overflow-wrap: break-word;
}

.wp-content h4 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
}

.wp-content > :first-child { margin-top: 0; }

.wp-content p {
  margin-bottom: 1rem;
}

.wp-content strong { font-weight: 700; }
.wp-content em { font-style: italic; }

.wp-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.wp-content ol {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.wp-content li { margin-bottom: 0.5rem; }

.wp-content a {
  color: #004aad;
  text-decoration: underline;
}

.wp-content a:hover { color: #dc2626; }

/* ----- Hình ảnh trong nội dung -----
   Mặc định ảnh nằm GIỮA (display:block + margin auto). Trước đây `margin: 1.5rem 0`
   ghi đè margin auto của lớp .aligncenter nên ảnh luôn dính lề trái.
   Ảnh chọn "Căn trái / Căn phải" trong editor vẫn bao quanh chữ trên máy tính. */
.wp-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px -20px rgba(0, 58, 135, 0.45);
}

.wp-content a > img { margin-left: auto; margin-right: auto; }

.wp-content figure,
.wp-content .wp-caption {
  max-width: 100%;
  margin: 1.75rem auto;
  text-align: center;
}
.wp-content figure img,
.wp-content .wp-caption img { margin: 0 auto; }

.wp-content figcaption,
.wp-content .wp-caption-text,
.wp-content .wp-element-caption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #6b7280;
  text-align: center;
}

/* Ảnh/khối căn trái – phải (chỉ trên màn hình rộng) */
.wp-content img.alignleft,
.wp-content figure.alignleft,
.wp-content .wp-caption.alignleft {
  float: left;
  margin: 0.4rem 1.75rem 1rem 0;
  max-width: 50%;
}
.wp-content img.alignright,
.wp-content figure.alignright,
.wp-content .wp-caption.alignright {
  float: right;
  margin: 0.4rem 0 1rem 1.75rem;
  max-width: 50%;
}
.wp-content img.aligncenter,
.wp-content figure.aligncenter,
.wp-content .wp-caption.aligncenter {
  float: none;
  margin-left: auto;
  margin-right: auto;
}
.wp-content img.alignnone { margin-left: auto; margin-right: auto; }
.wp-content h1, .wp-content h2, .wp-content h3, .wp-content hr { clear: both; }

/* Điện thoại: bỏ bao chữ, ảnh luôn ở giữa và đầy khung */
@media (max-width: 640px) {
  .wp-content img.alignleft,
  .wp-content img.alignright,
  .wp-content figure.alignleft,
  .wp-content figure.alignright,
  .wp-content .wp-caption.alignleft,
  .wp-content .wp-caption.alignright {
    float: none;
    max-width: 100%;
    margin: 1.5rem auto;
  }
  .wp-content img { margin: 1.5rem auto; border-radius: 0.6rem; }
}

/* Thư viện ảnh (gallery) và video/iframe nhúng */
.wp-content .gallery,
.wp-content .wp-block-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.75rem 0;
}
.wp-content .gallery-item,
.wp-content .wp-block-gallery figure { flex: 1 1 14rem; max-width: 100%; margin: 0; }
.wp-content .gallery-item img,
.wp-content .wp-block-gallery img { margin: 0 auto; width: 100%; object-fit: cover; }
.wp-content iframe,
.wp-content video {
  display: block;
  max-width: 100%;
  margin: 1.75rem auto;
  border-radius: 0.75rem;
}

.wp-content blockquote {
  border-left: 4px solid #004aad;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #374151;
  font-style: italic;
}

.wp-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.wp-content th,
.wp-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
}

.wp-content th {
  background: #f0f4fa;
  font-weight: 600;
}

/* Căn chỉnh chuẩn WordPress (plugin/editor tương thích) */
.alignleft { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; max-width: 100%; }

/* Ẩn nội dung chỉ dành cho screen-reader (chuẩn WP) */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}
