:root {
    --primary-background: #ffffff;
    --primary-text: #191f28;
    --secondary-background: #f8f9fa;
    --secondary-text: #4e5968;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-text: #ffffff;
    --border-color: #e5e8eb;
    --muted-text: #8b95a1;
    --card-background: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    font-weight: 400;
    line-height: 1.75;
    color: var(--primary-text);
    background-color: var(--primary-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-break: keep-all;
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    line-height: 1.35;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.15rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

h4 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 0.95rem;
}

p {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: inherit;
}

a,
a:hover,
a:focus {
    text-decoration: none;
    color: inherit;
}

a {
    transition: color 0.15s ease-in-out;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.65rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.15rem;
    }

    h4 {
        font-size: 1.05rem;
    }

    h5 {
        font-size: 0.95rem;
    }

    a,
    p,
    span,
    input,
    textarea {
        word-break: break-all;
    }
}

/* ===== header ===== */
.site-header {
    background-color: var(--primary-background);
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
    z-index: 1020
}

.site-logo-svg {
    width: 32px;
    height: 32px;
    color: var(--accent-color)
}

.brand-icon {
    width: 40px;
    height: 40px;
    background-color: var(--secondary-background);
    border-radius: 8px
}

.brand-title {
    font-size: 1.125rem;
    color: var(--primary-text);
    letter-spacing: -0.01em
}

.nav-link {
    color: var(--secondary-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color .2s ease;
    padding: 0.5rem 0
}

.nav-link:hover {
    color: var(--accent-color)
}

.header-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color)
}

.btn-cta {
    background-color: var(--accent-color);
    color: var(--accent-text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    transition: background-color .2s ease, transform .1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.btn-cta:hover {
    background-color: var(--accent-hover);
    color: var(--accent-text)
}

.navbar-toggler {
    background-color: var(--secondary-background);
    color: var(--primary-text);
    width: 44px;
    height: 44px;
    cursor: pointer
}

.menu-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-text)
}

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--primary-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease-in-out;
    z-index: 1000
}

.mobile-menu.open {
    max-height: 320px
}

.mobile-nav-link {
    color: var(--secondary-text);
    font-size: 1rem;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center
}

.mobile-nav-link:hover {
    background-color: var(--secondary-background);
    color: var(--accent-color)
}

.mobile-divider {
    height: 1px;
    background-color: var(--border-color);
    width: 100%
}

@media(max-width:767.98px) {
    .brand-title {
        font-size: 0.8rem;
        hyphens: auto;
        line-height: 1.2
    }
}

/* ===== hero_section ===== */
#hero.hero-section {
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-size: 2.25rem;
    line-height: 1.25;
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.125rem !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
}

.hero-tag-btn {
    background-color: var(--card-background);
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.hero-tag-btn:hover {
    background-color: var(--secondary-background);
    color: var(--primary-text);
    border-color: var(--muted-text);
}

.hero-tag-btn.active {
    background-color: var(--accent-color) !important;
    color: var(--accent-text) !important;
    border-color: var(--accent-color) !important;
}

/* ===== featured_article_section ===== */
#featured-article {
    background-color: var(--primary-background);
    color: var(--primary-text);
    hyphens: auto
}

#featured-article h1 {
    font-size: 2rem
}

#featured-article h3 {
    font-size: 1.35rem
}

#featured-article h4 {
    font-size: 1.1rem
}

@media(max-width:767.98px) {
    #featured-article h1 {
        font-size: 1.125rem;
        line-height: 1.2
    }

    #featured-article h3 {
        font-size: 0.875rem;
        line-height: 1.2
    }

    #featured-article h4 {
        font-size: 0.8rem;
        line-height: 1.2
    }
}

#featured-article .js-toggle-article-content:hover {
    background-color: var(--accent-hover) !important;
    color: var(--accent-text) !important
}

#featured-article .card {
    background-color: var(--card-background)
}

/* ===== latest_posts_section ===== */
#latest-posts {
    overflow: hidden;
    width: 100%;
}

#latest-posts .js-post-card {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#latest-posts .js-post-card:hover {
    border-color: var(--accent-color) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

#latest-posts .js-post-toggle:hover {
    background-color: var(--accent-hover) !important;
}

#latest-posts img {
    width: 100%;
    object-fit: cover;
}

@media (max-width: 767.98px) {
    #latest-posts h2 {
        font-size: 1rem !important;
        line-height: 1.25;
        hyphens: auto;
    }

    #latest-posts h3 {
        font-size: 0.875rem !important;
        line-height: 1.25;
        hyphens: auto;
    }

    #latest-posts h4 {
        font-size: 0.8125rem !important;
        line-height: 1.2;
    }

    #latest-posts p,
    #latest-posts li {
        font-size: 0.875rem !important;
    }
}

/* ===== popular_posts_section ===== */
#popular-posts {
    hyphens: auto;
}

#popular-posts .js-toggle-expand:hover {
    background-color: var(--accent-color) !important;
    color: var(--accent-text) !important;
    border-color: var(--accent-color) !important;
}

#popular-posts .js-toggle-expand:hover svg {
    color: var(--accent-text) !important;
}

@media (max-width: 767.98px) {
    #popular-posts h2 {
        font-size: 1rem !important;
        line-height: 1.25;
    }

    #popular-posts h3 {
        font-size: 0.875rem !important;
        line-height: 1.25;
    }

    #popular-posts .js-expand-content img {
        height: 200px !important;
    }
}

/* ===== categories_sidebar_section ===== */
#categories-sidebar {
    width: 100%;
    hyphens: auto;
}

#categories-sidebar .transition-transform {
    transition: transform 0.25s ease-in-out;
}

#categories-sidebar .card {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#categories-sidebar .card:hover {
    border-color: var(--accent-color) !important;
}

@media (max-width: 767.98px) {
    #categories-sidebar h2 {
        font-size: 1rem !important;
        line-height: 1.2;
    }

    #categories-sidebar .btn span.fw-semibold {
        font-size: 0.95rem !important;
    }
}

/* ===== about_author_section ===== */
#about-author {
    overflow: hidden;
}

#about-author .author-profile-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    transition: transform 0.3s ease;
}

#about-author .author-profile-img:hover {
    transform: scale(1.03);
}

@media (max-width: 767.98px) {
    #about-author h2 {
        font-size: 1rem;
        line-height: 1.2;
        hyphens: auto;
    }

    #about-author .h4 {
        font-size: 1rem;
    }

    #about-author p {
        font-size: 0.875rem;
    }

    #about-author .author-profile-img {
        max-width: 160px;
    }
}

/* ===== contact_form_section ===== */
#contact-form {
    overflow: hidden;
}

#contact-form input::placeholder,
#contact-form textarea::placeholder {
    color: var(--muted-text);
    opacity: 1;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.2);
    outline: 0;
}

#contact-form .btn:hover {
    background-color: var(--accent-hover) !important;
    color: var(--accent-text) !important;
}

@media (max-width: 767.98px) {
    #contact-form h2 {
        font-size: 1rem !important;
        line-height: 1.2;
        hyphens: auto;
    }

    #contact-form p {
        font-size: 0.875rem !important;
    }
}

/* ===== footer ===== */
#footer a:hover {
    color: var(--accent-color) !important;
}

#footer .js-tag-btn:hover {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
}

#footer .js-tag-btn.active {
    background-color: var(--accent-color) !important;
    color: var(--accent-text) !important;
    border-color: var(--accent-color) !important;
}

@media (max-width: 767.98px) {
    #footer h3 {
        font-size: 0.875rem !important;
        line-height: 1.2;
    }

    #footer h4 {
        font-size: 0.8125rem !important;
        line-height: 1.2;
    }
}
