/*
Theme Name: MUSK Health
Theme URI: https://musk.co.kr/
Author: MUSK
Description: Custom WordPress theme for MUSK health information site.
Version: 1.0.0
Text Domain: musk-health
*/

:root {
    --musk-bg: #f7faf8;
    --musk-surface: #ffffff;
    --musk-text: #1f2933;
    --musk-muted: #667085;
    --musk-line: #e6ece8;
    --musk-green: #2f7d5a;
    --musk-green-soft: #eaf5ef;
    --musk-blue: #4f6f8f;
    --musk-blue-soft: #edf3f8;
    --musk-radius: 18px;
    --musk-shadow: 0 8px 28px rgba(31, 41, 51, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--musk-bg);
    color: var(--musk-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.site-header {
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid var(--musk-line);
}

.site-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    min-height: 76px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.site-brand {
    flex: 0 0 auto;
}

.site-brand a {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--musk-green);
}

.site-navigation {
    flex: 1 1 auto;
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 26px;
}

.primary-menu li {
    margin: 0;
}

.primary-menu a {
    font-size: 15px;
    font-weight: 600;
    color: #344054;
}

.primary-menu a:hover {
    color: var(--musk-green);
}

.site-search {
    flex: 0 0 250px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-field {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--musk-line);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
}

.search-submit {
    border: 0;
    border-radius: 12px;
    background: var(--musk-green);
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
}

.site-content {
    min-height: 60vh;
}

.musk-home {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 24px 70px;
}

.home-hero {
    margin-bottom: 58px;
}

.home-hero article {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
    border: 1px solid var(--musk-line);
    border-radius: 26px;
    background: var(--musk-surface);
    box-shadow: var(--musk-shadow);
}

.home-hero img {
    width: 100%;
    height: 100%;
    min-height: 390px;
    object-fit: cover;
}

.hero-content {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content h1 {
    margin: 12px 0 18px;
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1.18;
    letter-spacing: -0.04em;
}

.hero-content p {
    margin: 0;
    color: var(--musk-muted);
    font-size: 18px;
}

.post-category {
    font-size: 14px;
    font-weight: 700;
    color: var(--musk-green);
}

.home-section {
    margin-top: 58px;
}

.section-heading {
    margin-bottom: 22px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -0.03em;
}

.section-heading > a {
    color: var(--musk-muted);
    font-size: 14px;
    font-weight: 600;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.post-card {
    overflow: hidden;
    border: 1px solid var(--musk-line);
    border-radius: var(--musk-radius);
    background: var(--musk-surface);
    box-shadow: var(--musk-shadow);
}

.post-card-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eef2ef;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.025);
}

.post-card-content {
    padding: 20px;
}

.post-card h3 {
    margin: 10px 0 10px;
    font-size: 20px;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.post-card p {
    margin: 0;
    color: var(--musk-muted);
    font-size: 15px;
    line-height: 1.65;
}

.post-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.health-badge {
    background: var(--musk-green-soft);
    color: var(--musk-green);
}

.supplement-badge {
    background: var(--musk-blue-soft);
    color: var(--musk-blue);
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--musk-line);
    background: #fff;
}

.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 42px 24px;
    color: var(--musk-muted);
    font-size: 14px;
}

.footer-about strong {
    display: block;
    margin-bottom: 8px;
    color: var(--musk-text);
    font-size: 20px;
}

.footer-disclaimer {
    max-width: 760px;
    margin-top: 20px;
}

.footer-links {
    margin-top: 18px;
}

.footer-links a {
    color: var(--musk-text);
    font-weight: 600;
}

.footer-copy {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--musk-line);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .site-header-inner {
        flex-wrap: wrap;
    }

    .site-navigation {
        order: 3;
        width: 100%;
    }

    .site-search {
        margin-left: auto;
    }

    .home-hero article {
        grid-template-columns: 1fr;
    }

    .home-hero img {
        min-height: 0;
        max-height: 430px;
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .site-header-inner {
        padding: 12px 18px;
        gap: 14px;
    }

    .site-brand a {
        font-size: 24px;
    }

    .site-search {
        flex: 1 1 100%;
        width: 100%;
    }

    .primary-menu {
        gap: 18px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 2px;
    }

    .primary-menu a {
        font-size: 14px;
    }

    .musk-home {
        padding: 22px 16px 50px;
    }

    .home-hero {
        margin-bottom: 42px;
    }

    .home-hero article {
        border-radius: 20px;
    }

    .hero-content {
        padding: 26px 22px 30px;
    }

    .hero-content h1 {
        font-size: 30px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .home-section {
        margin-top: 44px;
    }

    .section-heading h2 {
        font-size: 24px;
    }

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

    .post-card-content {
        padding: 18px;
    }

    .site-footer-inner {
        padding: 34px 18px;
    }
}

.single-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 44px 24px 80px;
}

.single-article {
    background: #fff;
    border: 1px solid var(--musk-line);
    border-radius: 22px;
    box-shadow: var(--musk-shadow);
    padding: 46px;
}

.single-header {
    margin-bottom: 28px;
}

.single-title {
    margin: 12px 0 14px;
    font-size: clamp(34px, 5vw, 50px);
    line-height: 1.24;
    letter-spacing: -0.04em;
}

.single-meta {
    color: var(--musk-muted);
    font-size: 14px;
}

.single-featured-image {
    margin: 0 0 34px;
    overflow: hidden;
    border-radius: 18px;
}

.single-featured-image img {
    width: 100%;
    height: auto;
}

.single-content {
    font-size: 18px;
    line-height: 1.85;
    color: #27323a;
}

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

.single-content p {
    margin: 0 0 1.55em;
}

.single-content h2 {
    margin: 2.2em 0 0.8em;
    font-size: 30px;
    line-height: 1.35;
    letter-spacing: -0.03em;
}

.single-content h3 {
    margin: 1.8em 0 0.7em;
    font-size: 24px;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.single-content ul,
.single-content ol {
    margin: 0 0 1.6em;
    padding-left: 1.5em;
}

.single-content li {
    margin-bottom: 0.55em;
}

.single-content blockquote {
    margin: 1.8em 0;
    padding: 18px 22px;
    border-left: 4px solid var(--musk-green);
    border-radius: 10px;
    background: var(--musk-green-soft);
}

.single-content table {
    width: 100%;
    margin: 1.8em 0;
    border-collapse: collapse;
    font-size: 16px;
}

.single-content th,
.single-content td {
    padding: 12px 14px;
    border: 1px solid var(--musk-line);
    text-align: left;
}

.single-content th {
    background: #f4f8f5;
    font-weight: 700;
}

.single-content img {
    margin: 1.8em auto;
    border-radius: 14px;
}

.single-content a {
    color: var(--musk-green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 640px) {
    .single-wrap {
        padding: 20px 14px 50px;
    }

    .single-article {
        padding: 24px 18px 30px;
        border-radius: 16px;
    }

    .single-title {
        font-size: 30px;
    }

    .single-content {
        font-size: 17px;
        line-height: 1.8;
    }

    .single-content h2 {
        font-size: 25px;
    }

    .single-content h3 {
        font-size: 21px;
    }

    .single-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.archive-header {
    margin-bottom: 30px;
    padding: 8px 0 4px;
}

.archive-header h1 {
    margin: 8px 0 10px;
    font-size: 38px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.archive-description {
    max-width: 760px;
    color: var(--musk-muted);
    font-size: 16px;
}

.archive-pagination {
    margin-top: 40px;
}

.archive-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.archive-pagination .page-numbers {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--musk-line);
    border-radius: 10px;
    background: #fff;
    color: var(--musk-text);
    font-size: 14px;
    font-weight: 600;
}

.archive-pagination .page-numbers.current {
    border-color: var(--musk-green);
    background: var(--musk-green);
    color: #fff;
}

.archive-pagination .page-numbers:hover {
    border-color: var(--musk-green);
    color: var(--musk-green);
}

@media (max-width: 640px) {
    .archive-header h1 {
        font-size: 30px;
    }

    .archive-pagination {
        margin-top: 30px;
    }
}

.related-posts {
    margin-top: 48px;
    padding-top: 34px;
    border-top: 1px solid var(--musk-line);
}

.related-posts .section-heading {
    margin-bottom: 20px;
}

.related-posts .section-heading h2 {
    font-size: 26px;
}

.related-posts .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-posts .post-card h3 {
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .related-posts .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .related-posts {
        margin-top: 36px;
        padding-top: 26px;
    }

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

    .related-posts .section-heading h2 {
        font-size: 23px;
    }
}

/* MUSK header logo */
.site-brand .site-logo-link {
    display: flex;
    align-items: center;
}

.site-brand .site-logo-image {
    display: block;
    width: auto;
    height: 42px;
    max-width: 230px;
    object-fit: contain;
}

@media (max-width: 640px) {
    .site-brand .site-logo-image {
        height: 36px;
        max-width: 190px;
    }
}

/* ===== Compact desktop layout tuning ===== */

@media (min-width: 981px) {
    .post-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }

    .post-card-content {
        padding: 18px;
    }

    .post-card h3 {
        font-size: 18px;
        line-height: 1.45;
    }

    .post-card p {
        font-size: 14px;
        line-height: 1.6;
    }

    .post-badge,
    .post-category {
        font-size: 12px;
    }

    .section-heading h2 {
        font-size: 28px;
    }

    .single-wrap {
        max-width: 900px;
    }

    .single-content {
        font-size: 17px;
        line-height: 1.8;
    }

    .single-content h2 {
        font-size: 26px;
    }

    .single-content h3 {
        font-size: 21px;
    }

    .related-posts .post-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ===== Archive page compact tuning ===== */

.archive-header {
    margin-bottom: 20px;
    padding: 0;
}

.archive-header h1 {
    margin: 4px 0 6px;
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.archive-description {
    max-width: 720px;
    font-size: 15px;
    line-height: 1.6;
}

.archive-header .post-category {
    font-size: 12px;
    margin-bottom: 2px;
}

.archive-header + .post-grid {
    margin-top: 18px;
}

@media (max-width: 640px) {
    .archive-header {
        margin-bottom: 16px;
    }

    .archive-header h1 {
        font-size: 26px;
    }

    .archive-description {
        font-size: 14px;
    }
}

/* Archive cards: match homepage card density */
.archive .post-card h2 {
    margin: 10px 0 10px;
    font-size: 18px;
    line-height: 1.45;
    letter-spacing: -0.02em;
}

@media (max-width: 640px) {
    .archive .post-card h2 {
        font-size: 18px;
        line-height: 1.45;
    }
}

/* ===== Header search compact style ===== */

.site-search {
    flex: 0 0 auto;
}

.site-search .search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-search .search-field {
    width: 180px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d7dce2;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    line-height: 40px;
}

.site-search .search-submit {
    width: 58px;
    height: 40px;
    padding: 0;
    border: 1px solid #d7dce2;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    line-height: 40px;
}

.site-search .search-submit:hover {
    border-color: var(--musk-green);
    color: var(--musk-green);
    background: #fff;
}

@media (max-width: 640px) {
    .site-search .search-field {
        width: 180px;
        max-width: calc(100vw - 100px);
    }
}
