/*
 Theme Name:   GeneratePress Child - 낙서장의 득템일지
 Theme URI:    https://nakso.blog
 Description:  낙서장의 득템일지 블로그 커스텀 자식 테마
 Author:       낙서장
 Author URI:   https://nakso.blog
 Template:     generatepress
 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:  generatepress-child
*/

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --color-primary: #E8725C;
    --color-primary-dark: #C95A46;
    --color-secondary-bg: #FDF5ED;
    --color-accent: #5AADA8;
    --color-text: #2D2D2D;
    --color-text-secondary: #6B6B6B;
    --color-card-bg: #FFFFFF;
    --color-border: #E8E0D8;
    --color-cat-daily: #F5A623;
    --color-cat-tech: #4A90D9;
    --color-cat-food: #E85C4A;
    --color-cat-picks: #5CB85C;
    --font-main: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --max-width: 1200px;
    --section-gap: 60px;
}

/* ========================================
   Global Overrides
   ======================================== */
body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: #FAFAF8;
}

body.nakso-front .site-content {
    padding: 0;
}

body.nakso-front .inside-article {
    padding: 0;
    margin: 0;
}

body.nakso-front .entry-content {
    padding: 0;
    margin: 0;
}

body.nakso-front .content-area {
    width: 100%;
    max-width: 100%;
}

body.nakso-front #primary {
    width: 100%;
    max-width: 100%;
}

body.nakso-front .site-main {
    margin: 0;
}

/* Hide sidebar on front page */
body.nakso-front #right-sidebar,
body.nakso-front #left-sidebar {
    display: none;
}

/* ========================================
   Header Refinements
   ======================================== */
.main-navigation .main-nav ul li a {
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-navigation .main-nav ul li a:hover {
    color: var(--color-primary);
}

.site-title a {
    color: var(--color-primary-dark);
    font-weight: 700;
}

/* ========================================
   Hero Section
   ======================================== */
.nakso-hero {
    background-color: var(--color-secondary-bg);
    padding: 48px 20px 40px;
    border-bottom: 1px solid var(--color-border);
}

.nakso-hero__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
}

.nakso-hero__text {
    flex: 1;
    min-width: 0;
}

.nakso-hero__title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 12px 0;
    line-height: 1.3;
    position: relative;
}

.nakso-hero__title::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
    margin-top: 16px;
}

.nakso-hero__subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    margin: 20px 0 0 0;
    line-height: 1.6;
    font-weight: 400;
}

.nakso-hero__desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 12px 0 0 0;
    line-height: 1.7;
}

.nakso-hero__image {
    flex-shrink: 0;
    width: 340px;
}

.nakso-hero__image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Section Common
   ======================================== */
.nakso-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--section-gap) 20px;
}

.nakso-section__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 32px 0;
    position: relative;
    padding-bottom: 12px;
}

.nakso-section__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.nakso-section__more {
    text-align: center;
    margin-top: 32px;
}

/* ========================================
   Buttons
   ======================================== */
.nakso-btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nakso-btn--primary {
    background: var(--color-primary);
    color: #fff;
    border: 2px solid var(--color-primary);
}

.nakso-btn--primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
}

.nakso-btn--outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.nakso-btn--outline:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ========================================
   Category Navigation Cards
   ======================================== */
.nakso-cat-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.nakso-cat-nav__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: var(--color-text);
    border-top: 4px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nakso-cat-nav__card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    color: var(--color-text);
    text-decoration: none;
}

.nakso-cat-nav__card--daily { border-top-color: var(--color-cat-daily); }
.nakso-cat-nav__card--tech { border-top-color: var(--color-cat-tech); }
.nakso-cat-nav__card--food { border-top-color: var(--color-cat-food); }
.nakso-cat-nav__card--picks { border-top-color: var(--color-cat-picks); }

.nakso-cat-nav__icon {
    font-size: 2rem;
    margin-bottom: 8px;
    line-height: 1;
}

.nakso-cat-nav__name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.nakso-cat-nav__count {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* ========================================
   Latest Posts Grid
   ======================================== */
.nakso-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.nakso-post-card {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nakso-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.nakso-post-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nakso-post-card__link:hover {
    text-decoration: none;
    color: inherit;
}

.nakso-post-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.nakso-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nakso-post-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary);
}

.nakso-post-card__badge--daily { background: var(--color-cat-daily); }
.nakso-post-card__badge--tech { background: var(--color-cat-tech); }
.nakso-post-card__badge--food { background: var(--color-cat-food); }
.nakso-post-card__badge--picks { background: var(--color-cat-picks); }
/* Korean category name badges */
.nakso-post-card__badge--\uc77c\uc0c1 { background: var(--color-cat-daily); }
.nakso-post-card__badge--IT\uacf5\ubd80 { background: var(--color-cat-tech); }
.nakso-post-card__badge--\ub9db\uc9d1 { background: var(--color-cat-food); }
.nakso-post-card__badge--\ucd94\ucc9c\ud15c { background: var(--color-cat-picks); }

.nakso-post-card__content {
    padding: 20px;
}

.nakso-post-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-text);
}

.nakso-post-card__excerpt {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nakso-post-card__meta {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* ========================================
   No Thumbnail Fallback
   ======================================== */
.nakso-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, #F0A090 100%);
}

.nakso-no-thumb--daily,
.nakso-no-thumb--\uc77c\uc0c1 {
    background: linear-gradient(135deg, #F5A623 0%, #F7C76B 100%);
}

.nakso-no-thumb--tech,
.nakso-no-thumb--IT\uacf5\ubd80 {
    background: linear-gradient(135deg, #4A90D9 0%, #7BB3E8 100%);
}

.nakso-no-thumb--food,
.nakso-no-thumb--\ub9db\uc9d1 {
    background: linear-gradient(135deg, #E85C4A 0%, #F08C7E 100%);
}

.nakso-no-thumb--picks,
.nakso-no-thumb--\ucd94\ucc9c\ud15c {
    background: linear-gradient(135deg, #5CB85C 0%, #8DD88D 100%);
}

/* ========================================
   Category Sections (Horizontal Scroll)
   ======================================== */
.nakso-cat-section {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    padding: 40px 20px;
    margin: 0 auto;
    max-width: var(--max-width);
}

.nakso-cat-section + .nakso-cat-section {
    margin-top: 24px;
}

.nakso-cat-section .nakso-section__title::after {
    background: var(--color-primary);
}

.nakso-cat-section--food .nakso-section__title::after {
    background: var(--color-cat-food);
}

.nakso-cat-section--picks .nakso-section__title::after {
    background: var(--color-cat-picks);
}

.nakso-cat-section--tech .nakso-section__title::after {
    background: var(--color-cat-tech);
}

.nakso-cat-section__scroll {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.nakso-mini-card {
    background: #FAFAF8;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nakso-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.nakso-mini-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nakso-mini-card a:hover {
    text-decoration: none;
    color: inherit;
}

.nakso-mini-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.nakso-mini-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nakso-mini-card__title {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 12px 12px 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-text);
}

.nakso-mini-card__date {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    display: block;
    margin: 0 12px 12px;
}

/* ========================================
   Tech/IT List Section
   ======================================== */
.nakso-tech-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nakso-tech-list__item {
    border-bottom: 1px solid var(--color-border);
}

.nakso-tech-list__item:last-child {
    border-bottom: none;
}

.nakso-tech-list__item a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 16px 0;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.nakso-tech-list__item a:hover {
    color: var(--color-cat-tech);
    text-decoration: none;
}

.nakso-tech-list__title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.nakso-tech-list__date {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.nakso-tech-list__tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nakso-tag {
    font-size: 0.72rem;
    color: var(--color-cat-tech);
    background: rgba(74, 144, 217, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ========================================
   Sidebar Search Widget Fix
   ======================================== */
.widget_search .wp-block-search__input {
    height: 40px;
    padding: 8px 12px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.widget_search .wp-block-search__inside-wrapper {
    display: flex;
    align-items: stretch;
}

.widget_search .wp-block-search__button {
    height: 40px;
    padding: 8px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ========================================
   Blog Listing Page (/blog/, archive, category)
   ======================================== */

/* Full-width blog content area */
.blog .site-content .content-area,
.archive .site-content .content-area,
.search .site-content .content-area {
    width: 100%;
    max-width: 100%;
}

/* Hide sidebar on blog/archive pages */
.blog #right-sidebar,
.archive #right-sidebar,
.search #right-sidebar {
    display: none;
}

/* Blog post cards in listing */
.blog .inside-article,
.archive .inside-article {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.blog .inside-article:hover,
.archive .inside-article:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Featured image in listing */
.blog .post-image,
.archive .post-image {
    margin-bottom: 0;
}

.blog .post-image img,
.archive .post-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* Post content area in listing */
.blog .entry-header,
.archive .entry-header {
    padding: 24px 28px 0;
}

.blog .entry-summary,
.archive .entry-summary {
    padding: 0 28px;
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.blog .entry-meta,
.archive .entry-meta {
    padding: 0 28px;
    font-size: 0.82rem;
}

/* Post title in listing */
.blog .entry-title,
.archive .entry-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.blog .entry-title a,
.archive .entry-title a {
    color: var(--color-text);
    text-decoration: none;
}

.blog .entry-title a:hover,
.archive .entry-title a:hover {
    color: var(--color-primary);
}

/* Category/tag meta styling */
.blog .cat-links a,
.archive .cat-links a,
.single .cat-links a {
    display: inline-block;
    padding: 2px 10px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 4px;
}

.blog .cat-links a:hover,
.archive .cat-links a:hover,
.single .cat-links a:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

/* Tag links styling */
.blog .tags-links a,
.archive .tags-links a,
.single .tags-links a {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(90, 173, 168, 0.1);
    color: var(--color-accent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    margin: 2px 2px;
}

.blog .tags-links a:hover,
.archive .tags-links a:hover,
.single .tags-links a:hover {
    background: rgba(90, 173, 168, 0.2);
    color: var(--color-accent);
}

/* Footer meta (read more, comments) */
.blog .entry-meta .byline,
.archive .entry-meta .byline {
    display: none;
}

/* Archive/category page header */
.page-header {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 32px 28px;
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    position: relative;
    padding-bottom: 12px;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* ========================================
   Single Post Page
   ======================================== */

/* Full-width single post */
.single .site-content .content-area {
    width: 100%;
    max-width: 100%;
}

/* Hide sidebar on single post */
.single #right-sidebar {
    display: none;
}

/* Single post container */
.single .inside-article {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* Featured image - full width within card */
.single .post-image {
    margin-bottom: 0;
}

.single .post-image img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

/* Single post header */
.single .entry-header {
    padding: 32px 40px 16px;
}

.single .entry-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--color-text);
    margin-bottom: 16px;
}

/* Meta info */
.single .entry-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0;
}

/* Single post content */
.single .entry-content {
    padding: 32px 40px;
    font-size: 1rem;
    line-height: 1.85;
    color: var(--color-text);
}

.single .entry-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text);
}

.single .entry-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--color-text);
}

.single .entry-content p {
    margin-bottom: 20px;
}

.single .entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.single .entry-content a:hover {
    color: var(--color-primary-dark);
}

/* Code blocks */
.single .entry-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 24px 0;
}

.single .entry-content code {
    background: rgba(232, 114, 92, 0.1);
    color: var(--color-primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.single .entry-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Blockquotes */
.single .entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    background: var(--color-secondary-bg);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: normal;
}

.single .entry-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Lists */
.single .entry-content ul,
.single .entry-content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.single .entry-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* Post footer (tags area) */
.single footer.entry-meta {
    padding: 24px 40px;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
}

/* Comments area */
.single .comments-area {
    max-width: 800px;
    margin: 24px auto 0;
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 32px 40px;
}

/* Post navigation */
.single .post-navigation {
    max-width: 800px;
    margin: 24px auto;
}

/* ========================================
   Footer Overrides
   ======================================== */
.site-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* ========================================
   Responsive: Tablet (768px+)
   ======================================== */
@media (min-width: 768px) {
    .nakso-cat-nav {
        grid-template-columns: repeat(4, 1fr);
    }

    .nakso-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nakso-cat-section__scroll {
        grid-template-columns: repeat(4, 1fr);
    }

    .nakso-cat-section {
        padding: 40px 32px;
    }
}

/* ========================================
   Responsive: Desktop (1024px+)
   ======================================== */
@media (min-width: 1024px) {
    .nakso-hero {
        padding: 64px 20px 56px;
    }

    .nakso-hero__inner {
        gap: 64px;
    }

    .nakso-hero__title {
        font-size: 2.4rem;
    }

    .nakso-hero__subtitle {
        font-size: 1.2rem;
    }

    .nakso-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .nakso-section {
        padding: var(--section-gap) 40px;
    }
}

/* ========================================
   Responsive: Mobile (<768px)
   ======================================== */
@media (max-width: 767px) {
    :root {
        --section-gap: 40px;
    }

    .nakso-hero {
        padding: 32px 20px;
    }

    .nakso-hero__inner {
        flex-direction: column-reverse;
        gap: 24px;
        text-align: center;
    }

    .nakso-hero__image {
        width: 200px;
        margin: 0 auto;
    }

    .nakso-hero__title {
        font-size: 1.6rem;
    }

    .nakso-hero__title::after {
        margin: 16px auto 0;
    }

    .nakso-hero__subtitle {
        font-size: 0.95rem;
    }

    .nakso-section__title {
        font-size: 1.3rem;
    }

    .nakso-tech-list__item a {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .nakso-tech-list__title {
        min-width: unset;
    }

    /* Blog/Single mobile */
    .single .entry-header {
        padding: 24px 20px 12px;
    }

    .single .entry-title {
        font-size: 1.35rem;
    }

    .single .entry-content {
        padding: 24px 20px;
    }

    .single .entry-content h2 {
        font-size: 1.2rem;
    }

    .single footer.entry-meta {
        padding: 20px;
    }

    .single .comments-area {
        padding: 24px 20px;
    }

    .blog .post-image img,
    .archive .post-image img {
        height: 200px;
    }

    .blog .entry-header,
    .archive .entry-header {
        padding: 20px 20px 0;
    }

    .blog .entry-summary,
    .archive .entry-summary {
        padding: 0 20px;
    }

    .blog .entry-meta,
    .archive .entry-meta {
        padding: 0 20px;
    }

    .page-header {
        padding: 24px 20px;
    }
}
