/* =========================================================
   Giao diện nâng cấp – Trạm Y tế xã Nam Ban Lâm Hà
   ========================================================= */

/* Tên đơn vị xuống thành hai dòng rõ ràng */
.parent-agency {
    color: #506d65;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .35px;
    text-transform: uppercase;
}

.site-name {
    margin-top: 3px;
    color: #006a55;
    font-size: clamp(25px, 2.3vw, 36px);
    font-weight: 900;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.top-domain {
    color: #fff;
    font-weight: 700;
}

.top-domain:hover {
    color: #ffdf68;
}

/* Banner thấp hơn, ảnh tươi và khung chữ ở góc phải */
.hero,
.default-hero.image-hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: #d9ebe6;
}

.default-hero.image-hero::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .06) 0%,
            rgba(255, 255, 255, .12) 45%,
            rgba(0, 73, 60, .08) 100%
        );
}

.hero .slide img,
.default-hero.image-hero > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 65% 28%;
    image-rendering: auto;
    filter: saturate(1.12) contrast(1.05) brightness(1.04);
    transform: translateZ(0);
}

.default-hero.image-hero .hero-caption {
    position: absolute;
    z-index: 2;
    top: 34px;
    right: 5%;
    bottom: auto;
    left: auto;
    width: min(620px, 48%);
    padding: 22px 28px;
    color: #fff;
    background: rgba(0, 91, 73, .50);
    border: 1px solid rgba(255, 255, 255, .35);
    border-right: 6px solid #ffd044;
    border-left: 0;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 10px 28px rgba(0, 56, 45, .18);
    backdrop-filter: blur(3px);
}

.default-hero.image-hero .hero-caption h1 {
    margin: 0 0 5px;
    color: #fff;
    font-size: clamp(25px, 2.2vw, 36px);
    font-weight: 900;
    line-height: 1.25;
    text-align: right;
}

.default-hero.image-hero .hero-caption p {
    margin: 0;
    color: #f7fffc;
    font-size: 18px;
    text-align: right;
}

/* Slider do quản trị tải lên */
.hero .slide span {
    top: 32px;
    right: 5%;
    bottom: auto;
    left: auto;
    max-width: 620px;
    background: rgba(0, 91, 73, .54);
    border-right: 6px solid #ffd044;
    border-left: 0;
    border-radius: 8px 0 0 8px;
    backdrop-filter: blur(3px);
}

/* Ảnh bài viết giữ độ nét và màu sắc tự nhiên */
.post-card img,
.post-row img,
.article-cover,
.article-gallery img {
    image-rendering: auto;
    filter: saturate(1.07) contrast(1.035);
    backface-visibility: hidden;
}

.post-card {
    border: 1px solid #cfe4dd;
    box-shadow: 0 8px 24px rgba(0, 89, 70, .10);
    transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 89, 70, .17);
}

.post-card h3 a,
.post-row h2 a {
    color: #00634f;
    font-weight: 800;
}

.post-card h3 a:hover,
.post-row h2 a:hover {
    color: #b74712;
}

.post-row {
    padding: 15px;
    border: 1px solid #d9e8e3;
    border-left: 5px solid #0a8a6d;
    border-radius: 7px;
    background: linear-gradient(90deg, #f0fbf7, #fff 45%);
    box-shadow: 0 5px 16px rgba(0, 91, 73, .07);
}

.widget .link-list a {
    color: #155f50;
    font-weight: 700;
}

.widget .link-list a:hover {
    color: #b74712;
    background: #effaf6;
}

/* Nhãn tin mới */
.post-meta-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.new-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    color: #fff;
    background: #dc2626;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .5px;
    line-height: 1;
    box-shadow: 0 2px 7px rgba(220, 38, 38, .25);
    animation: newPulse 1.8s infinite;
}

.new-text {
    color: #dc2626;
    font-size: 10px;
    font-weight: 900;
    vertical-align: top;
}

@keyframes newPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .68; }
}

.search-group {
    margin-top: 32px;
}

.search-group > h2 {
    padding-bottom: 8px;
    color: #00634f;
    border-bottom: 2px solid #0a8a6d;
}

.search-result {
    padding: 18px;
    border: 1px solid #dbe9e4;
    border-radius: 7px;
    background: #fff;
}

.search-result + .search-result {
    margin-top: 12px;
}

.search-result h3 {
    margin: 5px 0;
    font-size: 20px;
}

.form-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 800px) {
    .topbar-inner span:first-child {
        display: block;
    }

    .hero,
    .default-hero.image-hero {
        height: 360px;
    }

    .hero .slide img,
    .default-hero.image-hero > img {
        object-position: 62% 28%;
    }

    .default-hero.image-hero .hero-caption {
        top: 15px;
        right: 15px;
        left: 15px;
        width: auto;
        padding: 14px 16px;
    }

    .default-hero.image-hero .hero-caption h1 {
        font-size: 21px;
    }

    .default-hero.image-hero .hero-caption p {
        font-size: 14px;
    }

    .post-row {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .new-badge {
        animation: none;
    }
}

/* =========================================================
   RESPONSIVE HOÀN CHỈNH - ĐIỆN THOẠI VÀ MÁY TÍNH BẢNG
   Giữ trong theme-v2.css, không cần tách file hero riêng.
   ========================================================= */
@media (max-width: 800px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: calc(100% - 24px);
    }

    .topbar-inner {
        display: block;
        padding: 8px 0;
        line-height: 1.5;
    }

    .topbar-inner span {
        display: block;
        overflow-wrap: anywhere;
    }

    .topbar-inner span + span {
        margin-top: 3px;
    }

    .top-domain {
        overflow-wrap: anywhere;
    }

    .branding {
        align-items: center;
        gap: 11px;
        padding: 10px 0;
    }

    .branding > div {
        min-width: 0;
    }

    .logo {
        width: 68px;
        height: 68px;
        flex: 0 0 68px;
    }

    .parent-agency {
        font-size: 11px;
        line-height: 1.35;
    }

    .site-name {
        font-size: 20px;
        line-height: 1.2;
        letter-spacing: .2px;
        overflow-wrap: anywhere;
    }

    .slogan {
        font-size: 13px;
        line-height: 1.35;
    }

    .menu-toggle {
        min-height: 46px;
        font-size: 16px;
    }

    .nav-inner > ul.open {
        display: flex;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    .main-nav a {
        padding: 11px 14px;
    }

    .hero,
    .default-hero.image-hero {
        height: 310px;
    }

    .hero .slide img,
    .default-hero.image-hero > img {
        object-position: 60% center;
    }

    .default-hero.image-hero .hero-caption,
    .hero .slide span {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        padding: 12px 14px;
        background: rgba(0, 91, 73, .34);
        border: 1px solid rgba(255, 255, 255, .35);
        border-right: 4px solid #ffd044;
        border-left: 0;
        border-radius: 7px 0 0 7px;
        text-align: right;
        backdrop-filter: blur(1px);
    }

    .default-hero.image-hero .hero-caption h1 {
        font-size: 20px;
        line-height: 1.25;
    }

    .default-hero.image-hero .hero-caption p {
        font-size: 13px;
        line-height: 1.4;
    }

    .hero .slide span {
        font-size: 19px;
        line-height: 1.3;
    }

    .home-section,
    .page-section,
    .content-layout {
        padding-top: 25px;
        padding-bottom: 25px;
    }

    .section-title {
        gap: 10px;
    }

    .section-title h2 {
        font-size: 18px;
        padding: 7px 12px;
    }

    .post-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .post-card img {
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    .post-row {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 12px;
        padding: 10px;
    }

    .post-row img {
        width: 110px;
        height: 82px;
    }

    .post-row h2 {
        margin-top: 0;
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .search-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: none;
    }

    .search-form .btn,
    .search-form button {
        width: 100%;
    }

    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 680px;
    }

    .document-detail dl {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .document-detail dd {
        margin: 0 0 12px;
        overflow-wrap: anywhere;
    }

    .document-viewer {
        height: 65vh;
        min-height: 430px;
    }

    .content-layout,
    .contact-grid,
    .footer-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 15px;
    }

    .article-cover {
        width: 100%;
        height: auto;
    }

    .rich-content img,
    .rich-content iframe,
    .rich-content video {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 420px) {
    .hero,
    .default-hero.image-hero {
        height: 270px;
    }

    .site-name {
        font-size: 18px;
    }

    .slogan {
        display: none;
    }

    .default-hero.image-hero .hero-caption h1 {
        font-size: 17px;
    }

    .default-hero.image-hero .hero-caption p {
        font-size: 12px;
    }

    .post-row {
        grid-template-columns: 1fr;
    }

    .post-row img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}
/* Trang giới thiệu hiển thị toàn chiều ngang */
.introduction-full {
    width: min(1180px, calc(100% - 32px));
}

.introduction-full .article-content {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.introduction-full .article-content > h1 {
    margin-top: 0;
    margin-bottom: 22px;
    padding-bottom: 10px;
    color: #075e4d;
    border-bottom: 3px solid #e7b800;
}

@media (max-width: 800px) {
    .introduction-full {
        width: calc(100% - 24px);
    }

    .introduction-full .article-content > h1 {
        font-size: 26px;
    }
}
.functions-content > h2 {
    margin: 28px 0 12px;
    padding: 10px 15px;
    color: #fff;
    background: linear-gradient(90deg, #08785e, #13a07c);
    border-left: 5px solid #f0bd00;
    border-radius: 5px;
    font-size: 20px;
}

.functions-content > ul {
    margin: 0 0 20px;
    padding-left: 28px;
}

.functions-content > ul li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.function-note {
    margin-top: 28px;
    padding: 17px 20px;
    color: #18483d;
    background: #e8f7f2;
    border-left: 5px solid #e6b600;
    border-radius: 6px;
}

@media (max-width: 800px) {
    .functions-content > h2 {
        margin-top: 20px;
        padding: 9px 12px;
        font-size: 17px;
    }

    .functions-content > ul {
        padding-left: 22px;
    }

    .functions-content > ul li {
        line-height: 1.6;
    }

    .function-note {
        padding: 14px;
    }
}
/* Khung chữ trên banner */
.default-hero.image-hero .hero-caption {
    position: absolute;
    z-index: 2;
    top: 32px;
    right: 4%;
    bottom: auto;
    left: auto;

    display: flex;
    width: min(620px, 48%);
    min-height: 125px;
    padding: 20px 26px;

    color: #fff;
    background: rgba(0, 91, 73, .32);
    border: 1px solid rgba(255, 255, 255, .38);
    border-right: 6px solid #ffd044;
    border-left: 0;
    border-radius: 9px 0 0 9px;
    box-shadow: 0 9px 26px rgba(0, 50, 40, .15);

    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

/* Tên Trạm Y tế */
.default-hero.image-hero .hero-caption h1 {
    width: 100%;
    margin: 0 0 8px;

    color: #fff;
    font-size: clamp(24px, 2.15vw, 36px);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: .7px;

    text-align: center;
    text-wrap: balance;
    text-shadow: 0 2px 7px rgba(0, 35, 28, .75);
}

/* Khẩu hiệu */
.default-hero.image-hero .hero-caption p {
    width: 100%;
    margin: 0;

    color: #fff;
    font-size: clamp(14px, 1.15vw, 18px);
    font-weight: 500;
    line-height: 1.5;

    text-align: center;
    text-wrap: balance;
    text-shadow: 0 1px 5px rgba(0, 35, 28, .75);
}

/* Điện thoại */
@media (max-width: 800px) {
    .default-hero.image-hero .hero-caption {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;

        width: auto;
        min-height: 95px;
        padding: 13px 16px;

        background: rgba(0, 91, 73, .36);
        border-right-width: 4px;
    }

    .default-hero.image-hero .hero-caption h1 {
        margin-bottom: 5px;
        font-size: 20px;
        line-height: 1.25;
        letter-spacing: .3px;
    }

    .default-hero.image-hero .hero-caption p {
        font-size: 13px;
        line-height: 1.4;
    }
}

@media (max-width: 420px) {
    .default-hero.image-hero .hero-caption {
        right: 9px;
        bottom: 9px;
        left: 9px;
        min-height: 82px;
        padding: 11px 12px;
    }

    .default-hero.image-hero .hero-caption h1 {
        font-size: 17px;
    }

    .default-hero.image-hero .hero-caption p {
        font-size: 12px;
    }
}