/*
Theme Name: Vital Notes
Description: Health news theme with a lead band for the newest story and a dated story log.
Version: 1.1.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vitalnotes
Tags: blog, news, custom-menu, featured-images
*/
:root{
    --th-navy: #12305a;
    --th-navy-deep: #0c2346;
    --th-ink: #1a2230;
    --th-slate: #586273;
    --th-mist: #f3f6fa;
    --th-surface: #ffffff;
    --th-line: #d8dfe9;
    --th-mint: #8fe3c0;
    --th-link: #0f5bb5;
    --th-on-dark: #e9eef6;
    --th-font-title: "Literata", Georgia, "Times New Roman", serif;
    --th-font-text: "Public Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --th-radius: 6px;
    --th-container: 1180px;
    --th-narrow: 680px;
    --th-media: 960px;
    --th-gap: clamp(16px, 3vw, 32px);
}
@media screen{
    /*
    * BASE.
    */
    *,
    *::before,
    *::after{ box-sizing: border-box; }
    html{ -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
    body{
        margin: 0px;
        background: var(--th-mist);
        color: var(--th-ink);
        font-family: var(--th-font-text);
        font-size: 17px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
    }
    img{ max-width: 100%; height: auto; display: block; }
    a{ color: var(--th-link); text-underline-offset: 3px; }
    a:hover{ color: var(--th-navy); }
    :focus-visible{ outline: 3px solid var(--th-link); outline-offset: 2px; border-radius: 2px; }
    .tf{ font-family: var(--th-font-title); font-optical-sizing: auto; }
    .container{ width: min(100% - 32px, var(--th-container)); margin-inline: auto; }
    .container-narrow{ width: min(100% - 32px, var(--th-narrow)); }
    .container-media{ width: min(100% - 32px, var(--th-media)); }
    .thumb-cover{ display: block; overflow: hidden; border-radius: var(--th-radius); background: var(--th-line); }
    .thumb-cover img{ width: 100%; height: 100%; object-fit: cover; }
    .screen-reader-text{
        position: absolute !important;
        width: 1px;
        height: 1px;
        padding: 0px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0px, 0px, 0px, 0px);
        white-space: nowrap;
        border: 0px;
    }
    .skip-link{
        position: absolute;
        left: 16px;
        top: -60px;
        z-index: 100;
        padding: 10px 16px;
        background: var(--th-surface);
        color: var(--th-navy);
        font-weight: 600;
        border-radius: var(--th-radius);
    }
    .skip-link:focus{ top: 12px; }
    .btn{
        display: inline-block;
        padding: 12px 22px;
        border: 0px;
        border-radius: var(--th-radius);
        background: var(--th-navy);
        color: #ffffff;
        font: 600 16px/1.2 var(--th-font-text);
        text-decoration: none;
        cursor: pointer;
    }
    .btn:hover{ background: var(--th-navy-deep); color: #ffffff; }

    /*
    * HEADER.
    */
    .site-header{ position: sticky; top: 0px; z-index: 50; background: var(--th-navy); color: var(--th-on-dark); transition: transform 0.25s ease; }
    .admin-bar .site-header{ top: 32px; }
    .header-inner{ display: flex; align-items: center; gap: 24px; min-height: 68px; }
    .header-brand{ flex: 0 0 auto; }
    .header-brand-name{ color: #ffffff; font-size: 25px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
    .header-brand-name:hover{ color: var(--th-mint); }
    .header-brand .custom-logo{ max-height: 44px; width: auto; }
    .header-toggle{ display: none; }
    .header-nav{ display: flex; align-items: center; gap: 20px; margin-left: auto; }
    .header-nav .menu{ display: flex; gap: 4px; margin: 0px; padding: 0px; list-style: none; }
    .header-nav .menu a{ display: block; padding: 8px 12px; color: var(--th-on-dark); font-weight: 500; text-decoration: none; border-radius: var(--th-radius); }
    .header-nav .menu a:hover,
    .header-nav .menu .current-menu-item > a{ color: #ffffff; background: rgba(255, 255, 255, 0.1); }
    .header-nav .menu .current-menu-item > a{ box-shadow: inset 0px -2px 0px var(--th-mint); }
    .header-nav .sub-menu{ display: none; }

    /*
    * SEARCH FORM.
    */
    .search-form{ display: flex; align-items: stretch; width: 100%; max-width: 260px; }
    .search-form-field{
        flex: 1 1 auto;
        min-width: 0px;
        padding: 9px 12px;
        border: 1px solid transparent;
        border-radius: var(--th-radius) 0px 0px var(--th-radius);
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        font: 400 15px/1.3 var(--th-font-text);
    }
    .search-form-field::placeholder{ color: rgba(233, 238, 246, 0.75); }
    .search-form-field:focus{ outline: none; border-color: var(--th-mint); background: rgba(255, 255, 255, 0.18); }
    .search-form-submit{
        flex: 0 0 auto;
        padding: 0px 12px;
        border: 0px;
        border-radius: 0px var(--th-radius) var(--th-radius) 0px;
        background: var(--th-mint);
        color: var(--th-navy-deep);
        cursor: pointer;
    }
    .search-form-submit:hover{ background: #ffffff; }
    .page-head-search .search-form,
    .empty-search .search-form{ max-width: 460px; }
    .page-head-search .search-form-field,
    .empty-search .search-form-field{ background: var(--th-surface); border-color: var(--th-line); color: var(--th-ink); }
    .page-head-search .search-form-field::placeholder,
    .empty-search .search-form-field::placeholder{ color: var(--th-slate); }
    .page-head-search .search-form-submit,
    .empty-search .search-form-submit{ background: var(--th-navy); color: #ffffff; }

    /*
    * BLOCK LEAD.
    */
    .block-lead{ background: var(--th-navy); color: var(--th-on-dark); padding: 40px 0px 56px; }
    .lead-head{ max-width: 720px; margin-bottom: 28px; }
    .lead-head-title{ margin: 0px; color: #ffffff; font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
    .lead-head-text{ margin: 8px 0px 0px; color: var(--th-on-dark); font-size: 18px; }
    .lead-story{
        display: grid;
        grid-template-columns: minmax(0px, 5fr) minmax(0px, 6fr);
        gap: var(--th-gap);
        align-items: center;
        padding-top: 28px;
        border-top: 3px solid var(--th-mint);
    }
    .lead-story-date{ display: block; color: var(--th-mint); font-size: 15px; font-weight: 600; }
    .lead-story-title{ margin: 10px 0px 14px; font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; line-height: 1.2; }
    .lead-story-title a{ color: #ffffff; text-decoration: none; }
    .lead-story-title a:hover{ text-decoration: underline; text-decoration-color: var(--th-mint); text-decoration-thickness: 2px; }
    .lead-story-excerpt{
        display: -webkit-box;
        margin: 0px 0px 22px;
        overflow: hidden;
        color: var(--th-on-dark);
        font-size: 18px;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
    .lead-story-more{
        display: inline-block;
        padding: 11px 20px;
        border-radius: var(--th-radius);
        background: var(--th-mint);
        color: var(--th-navy-deep);
        font-weight: 600;
        text-decoration: none;
    }
    .lead-story-more:hover{ background: #ffffff; color: var(--th-navy-deep); }
    .lead-story-thumb{ aspect-ratio: 3 / 2; background: var(--th-navy-deep); }
    .block-lead :focus-visible{ outline-color: var(--th-mint); }

    /*
    * PAGE HEAD.
    */
    .block-page-head{ padding: 44px 0px 8px; }
    .page-head-title{ margin: 0px; font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; line-height: 1.2; color: var(--th-navy); }
    .page-head-text{ margin: 8px 0px 0px; color: var(--th-slate); font-size: 17px; }
    .page-head-text p{ margin: 0px; }
    .page-head-search{ margin-top: 18px; }

    /*
    * BLOCK LOG.
    */
    .block-log{ padding: 40px 0px 64px; }
    .block-log-title{ margin: 0px 0px 20px; font-size: 26px; font-weight: 700; color: var(--th-navy); }
    .log-list{ display: grid; gap: 14px; }
    .log-item{
        position: relative;
        display: grid;
        grid-template-columns: 84px minmax(0px, 1fr) 220px;
        gap: 24px;
        align-items: start;
        padding: 22px 24px;
        background: var(--th-surface);
        border-radius: var(--th-radius);
        transition: box-shadow 0.2s ease;
    }
    .log-item:hover{ box-shadow: inset 4px 0px 0px var(--th-navy); }
    .log-item:has(.log-item-title a:focus-visible){ outline: 3px solid var(--th-link); outline-offset: 2px; }
    .log-item-title a::after{ content: ""; position: absolute; inset: 0px; z-index: 1; border-radius: var(--th-radius); }
    .log-item-title a:focus-visible{ outline: none; }
    .log-item-date{ display: flex; flex-direction: column; padding-top: 2px; color: var(--th-navy); line-height: 1.1; }
    .log-item-day{ font-family: var(--th-font-title); font-size: 36px; font-weight: 700; }
    .log-item-month{ margin-top: 4px; color: var(--th-slate); font-size: 14px; }
    .log-item-title{ margin: 0px 0px 8px; font-size: 22px; font-weight: 700; line-height: 1.3; }
    .log-item-title a{ color: var(--th-ink); text-decoration: none; }
    .log-item:hover .log-item-title a{ color: var(--th-link); text-decoration: underline; }
    .log-item-excerpt{
        display: -webkit-box;
        margin: 0px;
        overflow: hidden;
        color: #3b4555;
        font-size: 16px;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    .log-item-read{ margin: 10px 0px 0px; color: var(--th-slate); font-size: 14px; }
    .log-item-read-date{ display: none; }
    .log-item-thumb{ aspect-ratio: 4 / 3; }

    /*
    * PAGINATION.
    */
    .block-pagination{ margin-top: 32px; }
    .block-pagination ul{ display: flex; flex-wrap: wrap; gap: 8px; margin: 0px; padding: 0px; list-style: none; }
    .block-pagination a,
    .block-pagination span{
        display: block;
        min-width: 44px;
        padding: 10px 14px;
        border-radius: var(--th-radius);
        background: var(--th-surface);
        color: var(--th-navy);
        font-weight: 600;
        text-align: center;
        text-decoration: none;
    }
    .block-pagination a:hover{ background: var(--th-navy); color: #ffffff; }
    .block-pagination .current{ background: var(--th-navy); color: #ffffff; }
    .block-pagination .dots{ background: transparent; }

    /*
    * SINGLE.
    */
    .block-single{ background: var(--th-surface); padding-bottom: 56px; }
    .single-head{ padding: 48px 0px 28px; }
    .single-title{ margin: 0px; color: var(--th-navy); font-size: clamp(30px, 4.4vw, 46px); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
    .single-meta{ margin: 16px 0px 0px; color: var(--th-slate); font-size: 16px; }
    .single-media{ margin: 0px 0px 36px; }
    /* Natural ratio: most covers are 3:2 and some are portrait, so cropping would cut them. */
    .single-media img{ width: auto; max-width: 100%; max-height: min(78vh, 640px); margin-inline: auto; border-radius: var(--th-radius); }
    .single-content{ font-size: 19px; line-height: 1.75; overflow-wrap: break-word; }
    .single-content > *:first-child{ margin-top: 0px; }
    .single-content p,
    .single-content ul,
    .single-content ol,
    .single-content figure,
    .single-content blockquote,
    .single-content table{ margin: 0px 0px 1.3em; }
    .single-content h2,
    .single-content h3,
    .single-content h4{ margin: 1.8em 0px 0.6em; font-family: var(--th-font-title); color: var(--th-navy); line-height: 1.3; }
    .single-content h2{ font-size: 28px; }
    .single-content h3{ font-size: 23px; }
    .single-content h4{ font-size: 20px; }
    .single-content li + li{ margin-top: 0.4em; }
    .single-content blockquote{ padding: 4px 0px 4px 22px; border-left: 4px solid var(--th-navy); font-family: var(--th-font-title); font-size: 21px; color: var(--th-ink); }
    .single-content figcaption,
    .single-content .wp-element-caption{ margin-top: 8px; color: var(--th-slate); font-size: 15px; line-height: 1.5; }
    .single-content img{ border-radius: var(--th-radius); }
    .single-content .alignwide{ width: min(100vw - 32px, var(--th-media)); margin-inline: calc((min(100vw - 32px, var(--th-media)) - 100%) / -2); max-width: none; }
    .single-content iframe{ max-width: 100%; }
    .single-content table{ width: 100%; border-collapse: collapse; font-size: 16px; }
    .single-content th,
    .single-content td{ padding: 10px 12px; border: 1px solid var(--th-line); text-align: left; vertical-align: top; }
    .single-content th{ background: var(--th-mist); }
    .table-scroll{ overflow-x: auto; margin-bottom: 1.3em; }
    .table-scroll table{ margin-bottom: 0px; }
    .single-pages{ margin: 24px 0px; font-weight: 600; }
    .single-filed{ margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--th-line); color: var(--th-slate); font-size: 15px; }
    .single-filed-label{ margin-right: 6px; }
    .single-filed a{ font-weight: 600; }
    .single-note{ margin: 24px 0px 0px; padding: 16px 20px; border-left: 4px solid var(--th-mint); background: var(--th-mist); color: #3b4555; font-size: 15px; line-height: 1.55; border-radius: 0px var(--th-radius) var(--th-radius) 0px; }
    .block-related{ padding-top: 48px; }

    /*
    * ADS (AD INSERTER WRAPPERS).
    */
    .code-block:has(.adsbygoogle){ padding: 12px 0px; }
    .code-block:has(.adsbygoogle)::before{
        content: "Advertisement";
        display: block;
        margin-bottom: 6px;
        color: var(--th-slate);
        font-size: 12px;
        line-height: 1.2;
        text-align: center;
    }
    /* Reserve room for responsive units so the text does not jump when the ad loads; collapse if unfilled. */
    .code-block:has(.adsbygoogle[data-ad-format="auto"]){ min-height: 300px; }
    .code-block:has(.adsbygoogle[data-ad-status="unfilled"]){ min-height: 0px; padding: 0px; }
    .code-block:has(.adsbygoogle[data-ad-status="unfilled"])::before{ display: none; }

    /*
    * COMMENTS.
    */
    .block-discussion{ background: var(--th-surface); padding: 8px 0px 56px; }
    .block-comments{ margin-top: 40px; }
    .comments-title,
    .comments-reply-title{ margin: 0px 0px 18px; color: var(--th-navy); font-size: 24px; }
    .comments-list,
    .comments-list .children{ margin: 0px; padding: 0px; list-style: none; }
    .comments-list .children{ margin-left: 28px; }
    .comment-item-body{ padding: 16px 0px; border-bottom: 1px solid var(--th-line); }
    .comment-item-meta{ display: flex; align-items: center; gap: 10px; font-size: 15px; }
    .comment-item-meta img{ border-radius: 50%; }
    .comment-item-author{ font-weight: 600; }
    .comment-item-date{ color: var(--th-slate); }
    .comment-item-content{ margin-top: 8px; font-size: 16px; }
    .comment-item-awaiting{ color: var(--th-slate); font-size: 14px; }
    .comment-item-reply a{ font-size: 14px; font-weight: 600; }
    .comment-respond{ margin-top: 32px; }
    .comment-form label{ display: block; margin-bottom: 6px; font-weight: 600; font-size: 15px; }
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea{
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--th-line);
        border-radius: var(--th-radius);
        background: var(--th-surface);
        font: 400 16px/1.5 var(--th-font-text);
        color: var(--th-ink);
    }
    .comment-form input:focus,
    .comment-form textarea:focus{ outline: none; border-color: var(--th-link); box-shadow: 0px 0px 0px 3px rgba(15, 91, 181, 0.2); }
    .comment-form .comment-form-cookies-consent label{ display: inline; font-weight: 400; }

    /*
    * EMPTY STATE.
    */
    .block-empty{ padding: 72px 0px 88px; }
    .empty-title{ margin: 0px 0px 12px; color: var(--th-navy); font-size: clamp(28px, 4vw, 40px); }
    .empty-text{ margin: 0px 0px 24px; color: var(--th-slate); font-size: 18px; }
    .empty-search{ margin-bottom: 24px; }

    /*
    * FOOTER.
    */
    .site-footer{ background: var(--th-navy-deep); color: var(--th-on-dark); padding: 44px 0px 36px; }
    .footer-inner{ display: grid; grid-template-columns: minmax(0px, 1fr) auto; gap: 20px 40px; align-items: start; }
    .footer-about-name{ margin: 0px 0px 6px; color: #ffffff; font-size: 22px; font-weight: 700; }
    .footer-about-text{ margin: 0px; max-width: 520px; font-size: 15px; }
    .footer-nav .menu{ display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0px; padding: 0px; list-style: none; }
    .footer-nav a{ color: var(--th-on-dark); font-size: 15px; }
    .footer-nav a:hover{ color: var(--th-mint); }
    .footer-copyright{ grid-column: 1 / -1; margin: 12px 0px 0px; padding-top: 18px; border-top: 1px solid rgba(233, 238, 246, 0.18); color: rgba(233, 238, 246, 0.8); font-size: 14px; }
    .site-footer :focus-visible{ outline-color: var(--th-mint); }

    /*
    * TO TOP.
    */
    .to-top{
        position: fixed;
        right: 18px;
        bottom: 18px;
        z-index: 40;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 0px;
        border-radius: 50%;
        background: var(--th-navy);
        color: #ffffff;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    }
    .to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0px); }
    .to-top:hover{ background: var(--th-link); }
}

@media screen and (prefers-reduced-motion: reduce){
    html{ scroll-behavior: auto; }
    .to-top,
    .site-header,
    .log-item{ transition: none; }
}
