/*
Theme Name: Flex Blog
Theme URI: https://demo-01.studioplanc.com
Author: Studio Planc
Author URI: https://studioplanc.com
Description: A clean, minimal blog theme inspired by flex.team/blog design.
Version: 1.0.0
Text Domain: flex-blog
*/

/* ============================================
   0. CSS RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    color: rgb(60, 70, 81);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: rgb(44, 51, 58);
}

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

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: rgb(44, 51, 58);
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================
   1. HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(252, 252, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {}

.header-inner {
    max-width: 1408px;
    margin: 0 auto;
    padding: 0 32px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 20px;
    font-weight: 600;
    color: rgb(44, 51, 58);
    letter-spacing: -0.3px;
}

.site-logo span {
    font-weight: 400;
    color: rgb(141, 150, 161);
    margin-left: 6px;
}

.main-nav {
    display: flex;
    align-items: center;
}

/* 1차 메뉴 리스트 */
.main-nav .nav-list {
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
}

/* 1차 메뉴 li — 드롭다운 기준점 */
.main-nav .nav-list>li {
    position: relative;
}

/* 1차 링크 */
.main-nav .nav-list>li>a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 500;
    color: rgb(44, 51, 58);
    transition: opacity 0.15s ease;
    position: relative;
    white-space: nowrap;
}

/* ::after 언더라인 제거 */
.main-nav a::after {
    display: none;
}

.main-nav .nav-list>li>a:hover {
    opacity: 0.6;
    color: rgb(44, 51, 58);
}

/* has-children 화살표 */
.main-nav .nav-list>li.menu-item-has-children>a::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%232c333a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    order: 1;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.main-nav .nav-list>li.menu-item-has-children:hover>a::before {
    transform: rotate(180deg);
}

/* ---- 드롭다운 서브메뉴 ---- */
.main-nav .nav-list>li>.sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 180px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 200;
    pointer-events: none;
}

.main-nav .nav-list>li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* 서브메뉴 링크 */
.main-nav .nav-list>li>.sub-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 400;
    color: rgb(44, 51, 58);
    transition: background 0.12s ease;
    white-space: nowrap;
}

.main-nav .nav-list>li>.sub-menu li a:hover {
    background: rgba(0, 0, 0, 0.04);
    opacity: 1;
}

/* 서브메뉴 화살표 커넥터 (hover gap 방지) */
.main-nav .nav-list>li.menu-item-has-children::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
}



/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgb(44, 51, 58);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* ============================================
   2. CONTAINER
   ============================================ */
.container {
    max-width: 1408px;
    margin: 0 auto;
    padding: 0 32px;
}

.container--narrow {
    max-width: 664px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   3. BLOG HERO / PAGE TITLE
   ============================================ */
.page-hero {
    padding: 60px 0 40px;
}

.page-hero__title {
    font-size: 32px;
    font-weight: 700;
    color: rgb(44, 51, 58);
    letter-spacing: -0.5px;
}

.page-hero__desc {
    font-size: 16px;
    color: rgb(141, 150, 161);
    margin-top: 8px;
}

/* ============================================
   4. CATEGORY FILTERS
   ============================================ */
/* ============================================
   4a. ARCHIVE HEADER
   ============================================ */
.archive-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 36px 0 28px;
}

.archive-header__title {
    font-size: 22px;
    font-weight: 700;
    color: rgb(44, 51, 58);
    white-space: nowrap;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.archive-header__line {
    display: block;
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
}

.category-filters {

    display: flex;
    align-items: center;
    gap: 8px;
    padding: 28px 0 28px;
    flex-wrap: wrap;
}

.category-filters a {
    font-size: 14px;
    font-weight: 500;
    color: rgb(141, 150, 161);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-filters a:hover,
.category-filters a.active {
    color: rgb(44, 51, 58);
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

/* ============================================
   5. POST GRID
   ============================================ */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
    padding: 0 0 80px;
}

/* ============================================
   6. POST CARD
   ============================================ */
.post-card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    border: none;
    overflow: visible;
    transition: none;
    padding: 8px;
}

.post-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 1);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 0;
}

.post-card:hover::before {
    opacity: 0.03;
    transform: scale(1);
}

.post-card>* {
    position: relative;
    z-index: 1;
}

.post-card__thumb {
    position: relative;
    padding-bottom: 60.24%;
    /* 5:3 */
    overflow: hidden;
    background: #e8e8e8;
    border-radius: 12px;
}

.post-card__thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.post-card__body {
    padding: 12px 0 16px;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.post-card__category {
    font-size: 12px;
    font-weight: 500;
}

/* Category accent colors */
.cat-team-story {
    color: rgb(240, 71, 133);
}

.cat-session {
    color: rgb(207, 120, 0);
}

.cat-news {
    color: rgb(0, 122, 230);
}

.cat-tips {
    color: rgb(143, 64, 222);
}

.cat-design {
    color: rgb(0, 166, 118);
}

.cat-default {
    color: rgb(0, 122, 230);
}

.post-card__date {
    font-size: 12px;
    color: rgb(141, 150, 161);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0;
}

/* 카테고리 뒤 세로 라인 구분자 */
.post-card__category+.post-card__date::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 10px;
    background: rgba(141, 150, 161, 0.5);
    margin: 0 8px;
    flex-shrink: 0;
    align-self: center;
}

.post-card__title {
    font-size: 26px;
    font-weight: 700;
    color: rgb(44, 51, 58);
    line-height: 1.4;
    margin-bottom: 5px;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__excerpt {
    font-size: 16px;
    color: rgb(141, 150, 161);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

/* ============================================
   7. SINGLE POST
   ============================================ */
.single-header {
    padding: 60px 0 32px;
    text-align: center;
}

.single-header__category {
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.single-header__title {
    font-size: 40px;
    font-weight: 700;
    color: rgb(44, 51, 58);
    line-height: 1.3;
    letter-spacing: -0.8px;
    max-width: 800px;
    margin: 0 auto 20px;
}

.single-header__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    color: rgb(141, 150, 161);
}

.single-header__author {
    font-weight: 500;
    color: rgb(60, 70, 81);
}

.single-header__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgb(141, 150, 161);
}

/* Featured Image */
.single-featured {
    margin: 0 auto 48px;
    max-width: 960px;
    border-radius: 12px;
    overflow: hidden;
}

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

/* Post Content */
.single-content {
    font-size: 18px;
    line-height: 1.7;
    color: rgb(60, 70, 81);
    padding-bottom: 80px;
}

.single-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 48px 0 16px;
    letter-spacing: -0.3px;
}

.single-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 40px 0 12px;
}

.single-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 8px;
}

.single-content p {
    margin-bottom: 24px;
}

.single-content ul,
.single-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.single-content ul {
    list-style: disc;
}

.single-content ol {
    list-style: decimal;
}

.single-content li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.single-content blockquote {
    border-left: 3px solid rgb(44, 51, 58);
    padding: 16px 24px;
    margin: 32px 0;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgb(60, 70, 81);
}

.single-content img {
    border-radius: 8px;
    margin: 32px 0;
}

.single-content a {
    color: rgb(0, 122, 230);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 122, 230, 0.3);
    transition: text-decoration-color 0.2s ease;
}

.single-content a:hover {
    text-decoration-color: rgb(0, 122, 230);
    color: rgb(0, 122, 230);
}

.single-content pre {
    background: rgb(44, 51, 58);
    color: #f8f8f8;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 32px 0;
    font-size: 14px;
    line-height: 1.6;
}

.single-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.single-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.single-content figure {
    margin: 32px 0;
}

.single-content figcaption {
    font-size: 14px;
    color: rgb(141, 150, 161);
    text-align: center;
    margin-top: 12px;
}

/* ============================================
   8. SHARE BUTTONS
   ============================================ */
.share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    margin-top: 48px;
}

.share-bar__label {
    font-size: 14px;
    font-weight: 500;
    color: rgb(141, 150, 161);
    margin-right: 4px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: rgb(60, 70, 81);
    font-size: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.share-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
}

/* ============================================
   9. POST NAVIGATION
   ============================================ */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 48px 0 80px;
}

.post-nav__item {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.post-nav__item:hover {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.01);
}

.post-nav__label {
    font-size: 12px;
    font-weight: 500;
    color: rgb(141, 150, 161);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.post-nav__title {
    font-size: 16px;
    font-weight: 600;
    color: rgb(44, 51, 58);
    line-height: 1.4;
}

.post-nav__item--next {
    text-align: right;
}

/* ============================================
   10. PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0 80px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgb(60, 70, 81);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
}

.pagination .current {
    background: rgb(44, 51, 58);
    color: #fff;
    border-color: rgb(44, 51, 58);
}

/* ============================================
   11. FOOTER
   ============================================ */
.site-footer {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 40px 0;
}

.footer-inner {
    max-width: 1408px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 14px;
    color: rgb(141, 150, 161);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 14px;
    color: rgb(141, 150, 161);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: rgb(44, 51, 58);
}

/* ============================================
   12. PAGE TEMPLATE
   ============================================ */
.page-content {
    padding: 60px 0 80px;
}

.page-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 24px;
}

.page-content p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 24px;
}

/* ============================================
   13. 404 PAGE
   ============================================ */
.error-404 {
    text-align: center;
    padding: 120px 0;
}

.error-404 h1 {
    font-size: 120px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.06);
    line-height: 1;
    margin-bottom: 16px;
}

.error-404 p {
    font-size: 18px;
    color: rgb(141, 150, 161);
    margin-bottom: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    background: rgb(44, 51, 58);
    color: #fff;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: rgb(30, 35, 40);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   14. RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 20px;
    }

    .single-header__title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 20px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(252, 252, 252, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 16px 20px;
        gap: 4px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        padding: 12px 0;
        width: 100%;
    }

    .main-nav a::after {
        display: none;
    }

    .container {
        padding: 0 20px;
    }

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

    .page-hero {
        padding: 40px 0 24px;
    }

    .page-hero__title {
        font-size: 26px;
    }

    .single-header {
        padding: 40px 0 24px;
    }

    .single-header__title {
        font-size: 28px;
    }

    .single-content {
        font-size: 16px;
    }

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

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

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

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .category-filters {
        gap: 6px;
    }

    .category-filters a {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* ============================================
   15. ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.post-card:nth-child(1) {
    animation-delay: 0.05s;
}

.post-card:nth-child(2) {
    animation-delay: 0.1s;
}

.post-card:nth-child(3) {
    animation-delay: 0.15s;
}

.post-card:nth-child(4) {
    animation-delay: 0.2s;
}

.post-card:nth-child(5) {
    animation-delay: 0.25s;
}

.post-card:nth-child(6) {
    animation-delay: 0.3s;
}

.post-card:nth-child(7) {
    animation-delay: 0.35s;
}

.post-card:nth-child(8) {
    animation-delay: 0.4s;
}

.post-card:nth-child(9) {
    animation-delay: 0.45s;
}

/* Smooth scroll for all transitions */
.single-content {
    animation: fadeInUp 0.6s ease forwards;
}

/* ============================================
   16. SCREEN READER TEXT
   ============================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}