/*
Theme Name: Vitala
Theme URI: https://huydev.local/vitala/
Author: HuyDev
Author URI: https://huydev.local/
Description: A clean, modern health & wellness magazine theme. Featured hero, article card grid, popular posts sidebar, and a trustworthy teal + navy palette. No page builder, no framework.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vitala
Tags: news, magazine, health, two-column, custom-menu, featured-images, editor-style, translation-ready
*/

/* ---------------------------------------------------------------
   Tokens
--------------------------------------------------------------- */
:root{
    --brand: #12a594;          /* teal */
    --brand-ink: #0c7a6e;
    --brand-soft: #e2f5f1;
    --navy: #0f2a43;           /* headings */
    --ink: #23303c;
    --soft: #566472;
    --muted: #8a97a3;
    --line: #e7edf1;
    --bg: #ffffff;
    --bg-soft: #f4f8f9;
    --coral: #ef6c4d;          /* warm accent */

    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --display: "Sora", "Inter", sans-serif;

    --container: 1220px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15,42,67,.04), 0 8px 24px rgba(15,42,67,.06);
    --shadow-hover: 0 6px 14px rgba(15,42,67,.08), 0 18px 40px rgba(15,42,67,.10);
}

/* ---------------------------------------------------------------
   Base
--------------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body{
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; height: auto; display: block; }
a{ color: var(--brand-ink); text-decoration: none; }
a:hover{ color: var(--brand); }
h1, h2, h3, h4{ font-family: var(--display); color: var(--navy); line-height: 1.2; font-weight: 700; margin: 0; }
ul{ margin: 0; padding: 0; list-style: none; }
button{ font-family: inherit; }

.container{ width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.screen-reader-text{ position: absolute; left: -9999px; }
.skip-link{ position: absolute; left: -9999px; }
.skip-link:focus{ left: 16px; top: 16px; background: var(--navy); color: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 200; }

.section-head{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--navy);
}
.section-head h2{ font-size: 1.4rem; letter-spacing: -0.01em; }
.section-head .see-all{ font-size: .82rem; font-weight: 600; color: var(--brand-ink); }

.chip{
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #fff;
    background: var(--brand);
    padding: 4px 10px;
    border-radius: 999px;
}
.chip-outline{ color: var(--brand-ink); background: var(--brand-soft); }

.meta{
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    color: var(--muted);
}
.meta .dot{ width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* ---------------------------------------------------------------
   Header
--------------------------------------------------------------- */
.site-header{ border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 100; }
.header-bar{ display: flex; align-items: center; gap: 1.5rem; height: 74px; }
.brand{ display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--navy); }
.brand:hover{ color: var(--navy); }
.brand .brand-mark{
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: var(--brand); color: #fff;
    border-radius: 9px;
    font-size: 1.05rem;
}
.brand .brand-name b{ color: var(--brand); font-weight: 700; }

.primary-nav{ margin-left: auto; }
.primary-nav > ul{ display: flex; align-items: center; gap: 1.6rem; }
.primary-nav a{ font-size: .9rem; font-weight: 600; color: var(--ink); }
.primary-nav a:hover,
.primary-nav .current-menu-item > a{ color: var(--brand); }
.primary-nav li{ position: relative; }
.primary-nav ul ul{
    position: absolute; top: 100%; left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
}
.primary-nav li:hover > ul{ display: block; }
.primary-nav ul ul a{ display: block; padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.primary-nav ul ul a:hover{ background: var(--bg-soft); }

.header-actions{ display: flex; align-items: center; gap: .5rem; }
.icon-btn{
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 10px;
    color: var(--navy);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.icon-btn:hover{ background: var(--brand-soft); color: var(--brand-ink); }
.icon-btn svg{ width: 18px; height: 18px; }
.nav-toggle{ display: none; }

/* Search drop */
.search-drop{
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
    display: none;
}
.search-drop.open{ display: block; }
.search-drop .container{ padding-block: 16px; }

/* ---------------------------------------------------------------
   Hero (featured)
--------------------------------------------------------------- */
.home-hero{ padding-block: 30px 12px; }
.hero-grid{
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 24px;
}
.hero-lead{
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 440px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: var(--navy);
}
.hero-lead img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-lead::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,42,67,0) 30%, rgba(15,42,67,.85) 100%); }
.hero-lead .hero-body{ position: relative; z-index: 2; padding: 28px; }
.hero-lead h2{ color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 12px 0 8px; }
.hero-lead h2 a{ color: #fff; }
.hero-lead h2 a:hover{ color: var(--brand-soft); }
.hero-lead .meta{ color: rgba(255,255,255,.8); }
.hero-lead .meta .dot{ background: rgba(255,255,255,.6); }

.hero-side{ display: grid; grid-template-rows: 1fr 1fr; gap: 24px; }
.hero-mini{
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 208px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: var(--navy);
}
.hero-mini img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-mini::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,42,67,0) 35%, rgba(15,42,67,.82) 100%); }
.hero-mini .hero-body{ position: relative; z-index: 2; padding: 18px; }
.hero-mini h3{ color: #fff; font-size: 1.05rem; margin-top: 8px; }
.hero-mini h3 a{ color: #fff; }
.hero-mini h3 a:hover{ color: var(--brand-soft); }

/* ---------------------------------------------------------------
   Body layout
--------------------------------------------------------------- */
.home-body{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 44px;
    padding-block: 40px 60px;
}
.main-col{ min-width: 0; }

/* ---------------------------------------------------------------
   Article cards
--------------------------------------------------------------- */
.card-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.card{ display: flex; flex-direction: column; }
.card-media{
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-soft);
    margin-bottom: 14px;
}
.card-media img{ width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card-media:hover img{ transform: scale(1.05); }
.card .chip{ align-self: flex-start; margin-bottom: 10px; }
.card-title{ font-size: 1.15rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.card-title a{ color: var(--navy); }
.card-title a:hover{ color: var(--brand); }
.card-excerpt{ color: var(--soft); font-size: .92rem; margin-bottom: 12px; }
.card .meta{ margin-top: auto; }

/* List style row (archive / search) */
.post-rows{ display: grid; gap: 26px; }
.post-row{
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 22px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}
.post-rows > .post-row:last-child{ border-bottom: none; padding-bottom: 0; }
.post-row .card-media{ aspect-ratio: 4/3; margin-bottom: 0; }
.post-row .card-title{ font-size: 1.3rem; }

/* ---------------------------------------------------------------
   Sidebar
--------------------------------------------------------------- */
.sidebar{ display: grid; gap: 34px; align-content: start; position: sticky; top: 92px; }
.widget{ min-width: 0; }
.widget-title{
    font-family: var(--display);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand);
}

/* Popular */
.pop-list{ display: grid; gap: 16px; }
.pop-item{ display: flex; gap: 14px; align-items: flex-start; }
.pop-rank{
    flex: none;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand);
    width: 26px;
    line-height: 1.3;
}
.pop-thumb{ flex: none; width: 74px; height: 60px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); }
.pop-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.pop-body{ min-width: 0; }
.pop-title{ font-size: .92rem; font-weight: 600; line-height: 1.35; }
.pop-title a{ color: var(--navy); }
.pop-title a:hover{ color: var(--brand); }
.pop-meta{ font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* Categories */
.cat-list li + li{ border-top: 1px solid var(--line); }
.cat-list a{
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 0;
    font-size: .92rem; font-weight: 500; color: var(--ink);
}
.cat-list a:hover{ color: var(--brand); }
.cat-list .cat-count{ font-size: .72rem; color: var(--muted); background: var(--bg-soft); border-radius: 999px; padding: 2px 9px; }

/* Newsletter / callout */
.callout{
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-ink) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 24px;
}
.callout h3{ color: #fff; font-size: 1.1rem; margin-bottom: 6px; }
.callout p{ font-size: .85rem; color: rgba(255,255,255,.85); margin: 0 0 14px; }
.callout input[type="email"]{
    width: 100%; border: none; border-radius: 8px;
    padding: 11px 12px; font-family: inherit; font-size: .9rem;
    margin-bottom: 10px;
}
.callout button{
    width: 100%; border: none; border-radius: 8px;
    background: var(--navy); color: #fff; font-weight: 600;
    padding: 11px 12px; cursor: pointer;
}
.callout button:hover{ background: #0a1f33; }

/* Health tip box */
.tipbox{
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--coral);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
}
.tipbox .chip{ background: var(--coral); }
.tipbox p{ margin: 10px 0 0; font-size: .9rem; color: var(--soft); }

/* ---------------------------------------------------------------
   Pagination
--------------------------------------------------------------- */
.pagination{ display: flex; justify-content: center; gap: 6px; padding-top: 40px; }
.pagination .page-numbers{
    min-width: 42px; padding: 9px 12px; text-align: center;
    border: 1px solid var(--line); border-radius: 9px;
    font-size: .9rem; font-weight: 600; color: var(--ink);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover{ background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------------------------------------------------------
   Single
--------------------------------------------------------------- */
.single-wrap{ padding-block: 36px 60px; }
.single-grid{ display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 44px; }
.article-head{ max-width: 760px; margin: 0 auto 26px; text-align: center; }
.article-head .chip{ margin-bottom: 14px; }
.article-title{ font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
.article-head .meta{ justify-content: center; margin-top: 16px; }
.article-hero{ border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; }

.article-body{ font-size: 1.06rem; line-height: 1.8; color: var(--ink); }
.article-body > * + *{ margin-top: 1.3rem; }
.article-body p{ margin: 0; }
.article-body h2{ font-size: 1.6rem; margin-top: 2.2rem; }
.article-body h3{ font-size: 1.3rem; margin-top: 1.8rem; }
.article-body a{ text-decoration: underline; text-underline-offset: 3px; }
.article-body img, .article-body figure{ border-radius: var(--radius); margin-block: 1.8rem; }
.article-body ul, .article-body ol{ padding-left: 1.3rem; }
.article-body ul li{ list-style: disc; }
.article-body ol li{ list-style: decimal; }
.article-body li + li{ margin-top: .5rem; }
.article-body blockquote{
    margin: 1.8rem 0; padding: 4px 0 4px 20px;
    border-left: 3px solid var(--brand);
    font-family: var(--display); font-size: 1.25rem; color: var(--navy);
}
.article-body pre{ background: var(--navy); color: #eaf6f4; border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; font-size: .9rem; }
.article-body code{ background: var(--bg-soft); padding: .12em .4em; border-radius: 5px; font-size: .9em; }

.medical-note{
    display: flex; gap: 12px;
    background: var(--brand-soft);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-top: 2rem;
    font-size: .88rem; color: var(--brand-ink);
}
.medical-note svg{ flex: none; width: 22px; height: 22px; }

.article-tags{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2rem; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.article-tags a{ font-size: .78rem; color: var(--soft); background: var(--bg-soft); padding: 6px 12px; border-radius: 999px; }
.article-tags a:hover{ background: var(--brand); color: #fff; }

.author-card{ display: flex; gap: 16px; background: var(--bg-soft); border-radius: var(--radius); padding: 20px; margin-top: 2rem; }
.author-card img{ width: 60px; height: 60px; border-radius: 50%; flex: none; }
.author-card .author-name{ font-family: var(--display); font-weight: 700; color: var(--navy); }
.author-card .author-bio{ font-size: .9rem; color: var(--soft); margin-top: 4px; }

.post-nav{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 2rem; }
.post-nav a{
    display: block; padding: 16px 18px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .2s, box-shadow .2s;
}
.post-nav a:hover{ border-color: var(--brand); box-shadow: var(--shadow); }
.post-nav .nav-label{ font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.post-nav .nav-title{ display: block; margin-top: 4px; font-family: var(--display); font-weight: 600; color: var(--navy); }
.post-nav .next{ text-align: right; }

/* ---------------------------------------------------------------
   Comments
--------------------------------------------------------------- */
.comments-area{ margin-top: 40px; }
.comments-title{ font-size: 1.4rem; margin-bottom: 20px; }
.comment-list{ display: grid; gap: 4px; margin-bottom: 32px; }
.comment-list ul.children{ margin-left: 28px; padding-left: 18px; border-left: 1px solid var(--line); }
.comment-body{ padding: 16px 0; }
.comment-meta{ display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comment-meta img{ width: 42px; height: 42px; border-radius: 50%; }
.comment-meta .fn{ font-weight: 700; font-style: normal; color: var(--navy); font-size: .92rem; }
.comment-meta .comment-date{ font-size: .74rem; color: var(--muted); }
.comment-content{ color: var(--soft); font-size: .95rem; }
.comment .reply a{ font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.comment-respond{ background: var(--bg-soft); border-radius: var(--radius); padding: 26px; }
.comment-reply-title{ font-size: 1.25rem; margin-bottom: 6px; }
.comment-notes, .logged-in-as{ font-size: .85rem; color: var(--muted); margin: 0 0 16px; }
.comment-form p{ margin: 0 0 14px; }
.comment-form label{ display: block; font-size: .8rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
    width: 100%; font-family: inherit; font-size: .95rem;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    padding: 11px 13px; color: var(--ink);
}
.comment-form input:focus, .comment-form textarea:focus{ outline: none; border-color: var(--brand); }
.comment-form textarea{ min-height: 130px; resize: vertical; }
.comment-form .form-submit{ margin: 0; }
.comment-form .submit{
    background: var(--brand); color: #fff; border: none;
    border-radius: 8px; padding: 12px 26px; font-weight: 600; cursor: pointer;
}
.comment-form .submit:hover{ background: var(--brand-ink); }

/* ---------------------------------------------------------------
   Archive head / states
--------------------------------------------------------------- */
.page-head{ padding-block: 40px 6px; }
.page-head .chip{ margin-bottom: 12px; }
.page-head h1{ font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page-head p{ color: var(--soft); margin: 10px 0 0; max-width: 640px; }

.state-empty{ text-align: center; padding-block: 80px; }
.state-empty h1{ font-size: clamp(3rem, 12vw, 6rem); color: var(--brand); }
.state-empty p{ color: var(--soft); margin: 10px 0 22px; }
.btn{
    display: inline-block; background: var(--brand); color: #fff;
    padding: 12px 24px; border-radius: 9px; font-weight: 600;
}
.btn:hover{ background: var(--brand-ink); color: #fff; }

/* Page (static) */
.page-single{ max-width: 820px; margin-inline: auto; padding-block: 40px 60px; }

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */
.site-footer{ background: var(--navy); color: #b9c6d1; margin-top: 20px; }
.footer-top{ display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; padding-block: 50px; }
.footer-brand .brand{ color: #fff; margin-bottom: 12px; }
.footer-brand .brand .brand-name b{ color: var(--brand); }
.footer-brand p{ font-size: .9rem; color: #93a3b1; }
.footer-col h4{ color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer-col li{ margin-bottom: 9px; }
.footer-col a{ color: #b9c6d1; font-size: .88rem; }
.footer-col a:hover{ color: var(--brand); }
.footer-social{ display: flex; gap: 10px; margin-top: 14px; }
.footer-social a{ width: 38px; height: 38px; display: grid; place-items: center; background: rgba(255,255,255,.08); border-radius: 9px; color: #fff; }
.footer-social a:hover{ background: var(--brand); }
.footer-social svg{ width: 17px; height: 17px; }
.footer-bottom{ border-top: 1px solid rgba(255,255,255,.1); padding-block: 20px; font-size: .82rem; color: #7f909e; text-align: center; }

/* Back to top */
.to-top{
    position: fixed; right: 20px; bottom: 20px;
    width: 46px; height: 46px; display: none;
    place-items: center; background: var(--brand); color: #fff;
    border: none; border-radius: 11px; cursor: pointer; z-index: 90;
    box-shadow: var(--shadow-hover);
}
.to-top.show{ display: grid; }
.to-top:hover{ background: var(--brand-ink); }

/* Search form */
.search-form{ display: flex; gap: 8px; }
.search-form input[type="search"]{
    flex: 1; font-family: inherit; font-size: .95rem;
    border: 1px solid var(--line); border-radius: 9px; background: #fff;
    padding: 11px 14px;
}
.search-form input[type="search"]:focus{ outline: none; border-color: var(--brand); }
.search-form button{ background: var(--brand); color: #fff; border: none; border-radius: 9px; padding: 0 18px; font-weight: 600; cursor: pointer; }
.search-form button:hover{ background: var(--brand-ink); }

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 1024px){
    .home-body, .single-grid{ grid-template-columns: 1fr; gap: 44px; }
    .sidebar{ position: static; grid-template-columns: 1fr 1fr; display: grid; }
    .sidebar .callout{ grid-column: 1 / -1; }
}
@media (max-width: 860px){
    .hero-grid{ grid-template-columns: 1fr; }
    .hero-side{ grid-template-rows: none; grid-template-columns: 1fr 1fr; }
    .post-row{ grid-template-columns: 200px 1fr; }
}
@media (max-width: 680px){
    .nav-toggle{ display: grid; }
    .primary-nav{
        position: fixed; inset: 0 0 0 auto; width: min(80vw, 320px);
        background: #fff; border-left: 1px solid var(--line);
        transform: translateX(100%); transition: transform .28s ease;
        padding: 84px 24px 24px; z-index: 150; overflow-y: auto;
    }
    .primary-nav.open{ transform: translateX(0); }
    .primary-nav > ul{ flex-direction: column; align-items: flex-start; gap: 4px; }
    .primary-nav > ul > li{ width: 100%; border-bottom: 1px solid var(--line); }
    .primary-nav a{ display: block; padding: 12px 0; }
    .primary-nav ul ul{ position: static; border: none; box-shadow: none; padding: 0 0 8px 14px; display: block; }
    .card-grid{ grid-template-columns: 1fr; }
    .sidebar{ grid-template-columns: 1fr; }
    .hero-side{ grid-template-columns: 1fr; }
    .post-row{ grid-template-columns: 1fr; }
    .post-row .card-media{ aspect-ratio: 16/9; }
    .post-nav{ grid-template-columns: 1fr; }
    .post-nav .next{ text-align: left; }
    .footer-top{ grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 440px){
    .footer-top{ grid-template-columns: 1fr; }
}
