/*
Theme Name: Greenfix24h
Theme URI: https://greenfix24h.com
Author: Greenfix Team
Description: A modern, high-performance WordPress theme converted from Lovable React frontend. Optimized for SEO (Rank Math), Speed, and UX.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: greenfix24h
*/

/* 
   This stylesheet contains core theme metadata.
   Most styling is handled via Tailwind CSS Play CDN in functions.php.
   Custom base styles and component utilities are injected into header.php.
*/

/* Reset & Base */
img {
    max-width: 100%;
    height: auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: hsl(150 10% 97%);
}
::-webkit-scrollbar-thumb {
    background: hsl(160 65% 35% / 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(160 65% 35% / 0.5);
}

/* Selection */
::selection {
    background: hsl(160 65% 35% / 0.2);
    color: hsl(160 65% 35%);
}

/* Accessibility */
.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;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link {
    left: -9999px;
    position: absolute;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 999;
}

.skip-link:focus {
    background-color: white;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
}

/* ═══════════════════════════════════════════════════════════
   PROSE-CUSTOM — Nội dung bài viết & dịch vụ
   Fix: Ảnh tràn khung, responsive mobile
   ═══════════════════════════════════════════════════════════ */

/* Container bao ngoài không được tràn */
.prose-custom {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix ảnh tràn — override cả width attribute và inline style */
.prose-custom img,
.prose-custom figure img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    border-radius: 0.5rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

/* Figure & caption */
.prose-custom figure {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.prose-custom figcaption {
    font-size: 0.8125rem;
    color: hsl(210 10% 50%);
    text-align: center;
    margin-top: 0.375rem;
}

/* Headings */
.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5 {
    font-weight: 700;
    line-height: 1.35;
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
    color: hsl(210 25% 15%);
}
.prose-custom h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
.prose-custom h3 { font-size: clamp(1.05rem, 2.5vw, 1.25rem); }
.prose-custom h4 { font-size: clamp(0.95rem, 2vw, 1.1rem); }

/* Paragraph */
.prose-custom p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: hsl(210 15% 30%);
}

/* Lists */
.prose-custom ul,
.prose-custom ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.prose-custom li {
    margin-bottom: 0.375rem;
    line-height: 1.7;
    color: hsl(210 15% 30%);
}

/* Links */
.prose-custom a {
    color: hsl(160 65% 35%);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.prose-custom a:hover {
    color: hsl(160 65% 28%);
}

/* Blockquote */
.prose-custom blockquote {
    border-left: 4px solid hsl(160 65% 35%);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: hsl(160 65% 35% / 0.05);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: hsl(210 15% 35%);
}

/* Table — responsive */
.prose-custom table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
}
.prose-custom th,
.prose-custom td {
    padding: 0.625rem 0.875rem;
    border: 1px solid hsl(150 10% 88%);
    text-align: left;
}
.prose-custom th {
    background: hsl(160 65% 35% / 0.08);
    font-weight: 600;
    color: hsl(210 25% 15%);
}
.prose-custom tr:nth-child(even) td {
    background: hsl(150 15% 97%);
}

/* Video & iframe embed — responsive */
.prose-custom iframe,
.prose-custom embed,
.prose-custom video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.25rem 0;
}

/* `<iframe>` và `<embed>` không có tỉ lệ nội tại, nên `height: auto` ở trên rơi về
   150px mặc định — đó là lý do video từng bị bóp còn 364x150px. `<video>` có tỉ lệ
   nội tại nên KHÔNG áp rule này vào (ép 16/9 sẽ làm méo video). */
.prose-custom iframe,
.prose-custom embed {
    aspect-ratio: 16 / 9;
}

/* Iframe YouTube đã được gf_wrap_video_iframe() bọc trong .gf-embed mang đúng tỉ lệ
   gốc của từng video (video trang Bình Dương là video DỌC 411x731, không phải 16/9),
   nên bỏ tỉ lệ dự phòng ở trên đi. */
.prose-custom .gf-embed > iframe {
    aspect-ratio: auto;
}

/* WordPress alignment classes */
.prose-custom .aligncenter {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
}
.prose-custom .alignleft {
    float: left;
    margin-right: 1.5rem !important;
    margin-bottom: 0.75rem;
    max-width: 50% !important;
}
.prose-custom .alignright {
    float: right;
    margin-left: 1.5rem !important;
    margin-bottom: 0.75rem;
    max-width: 50% !important;
}

/* Mobile: bỏ float alignment */
@media (max-width: 640px) {
    .prose-custom .alignleft,
    .prose-custom .alignright {
        float: none !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
/* Sidebar single — responsive layout */
.gf-sidebar-aside {
    border-top: 1px solid hsl(150 10% 88%);
    padding-top: 2rem;
    margin-top: 2rem;
}

@media (min-width: 1024px) {
    .gf-sidebar-aside {
        border-top: none !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}
