/*
Theme Name: generatepress-cafe24
Theme URI: https://generatepress.com
Template: generatepress
Author: Tom Usborne
Author URI: https://tomusborne.com
Description: GeneratePress Child Theme - Apple Style Redesign for CindyJun Soft (Dark Header + Light Content)
*/

/* ==================== GOOGLE FONTS IMPORT ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* ==================== ROOT VARIABLES & DESIGN TOKENS ==================== */
:root {
    --nav-bg: rgba(22, 22, 23, 0.8);
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-text: #f5f5f7;
    --bg-main: #fbfbfd;
    --bg-card: #ffffff;
    --bg-card-secondary: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --font-main: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ==================== GLOBAL BASE RESET & TYPOGRAPHY ==================== */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body, html {
    font-family: var(--font-main);
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

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

/* ==================== GENERATEPRESS WRAPPER FIXES ==================== */
body.home #page,
body.home #content,
body.home .site-content,
body.front-page #page,
body.front-page #content,
body.front-page .site-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: var(--bg-main) !important;
    box-shadow: none !important;
}

/* ==================== OFFICIAL LOGO STYLING ==================== */
.site-logo img,
.custom-logo,
.site-logo-img,
.header-image {
    height: 36px;
    width: auto;
    max-height: 42px;
    object-fit: contain;
    vertical-align: middle;
    transition: var(--transition-smooth);
}

.site-logo img:hover,
.site-logo-img:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

/* ==================== APPLE SLEEK DARK NAV & STICKY HEADER ==================== */
.global-nav,
.site-header,
#site-navigation,
.main-navigation {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: var(--nav-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--nav-border) !important;
    transition: var(--transition-smooth);
    box-shadow: none !important;
}

.nav-container,
.inside-navigation,
.inside-header {
    max-width: 1024px !important;
    margin: 0 auto !important;
    height: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 22px !important;
}

.nav-logo,
.main-title a,
.site-branding a {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: var(--nav-text) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Apple Sleek Dark Menu Links */
.nav-menu,
.main-nav > ul,
.main-navigation .main-nav > ul {
    display: flex !important;
    align-items: center !important;
    gap: 28px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.nav-menu a,
.main-nav > ul > li > a,
.main-navigation .main-nav > ul > li > a {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--nav-text) !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
    line-height: normal !important;
}

.nav-menu a:hover,
.main-nav > ul > li > a:hover,
.main-navigation .main-nav > ul > li:hover > a,
.main-navigation .main-nav > ul > li.current-menu-item > a {
    opacity: 1 !important;
    background: transparent !important;
    color: #ffffff !important;
}

/* Hamburger toggle — hidden on desktop, revealed in the mobile media query */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 1.5px;
    margin: 0 auto;
    background: var(--nav-text);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.2s ease;
}

/* Bars collapse into an X while the panel is open */
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ==================== APPLE LIGHT CONTENT SECTIONS ==================== */
/* Hero Section 1 (Light White Tone) */
.hero-dark,
.hero-light-main {
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    text-align: center;
    padding: 90px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.hero-eyebrow {
    font-size: 17px;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 24px;
}

.cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.btn-primary,
.button.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 980px;
    transition: var(--transition-smooth);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary:hover,
.button.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: scale(1.02);
}

.btn-secondary,
.button.btn-secondary {
    color: var(--accent-blue) !important;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-smooth);
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover,
.button.btn-secondary:hover {
    text-decoration: underline;
}

/* Apple Light Visual Card */
.hero-visual-card {
    width: 100%;
    max-width: 900px;
    height: 380px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.hero-visual-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,113,227,0.06) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.card-badge {
    background: #f5f5f7;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px 14px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Hero Section 2 (Light Gray Tone) */
.hero-light {
    background-color: var(--bg-card-secondary) !important;
    color: var(--text-primary) !important;
    text-align: center;
    padding: 90px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hero-light .hero-title {
    background: linear-gradient(180deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-light .hero-subtitle {
    color: var(--text-secondary);
}

/* Hero Compact (Identity hero on the front page — 65vh was too tall) */
.hero-dark.hero-compact {
    min-height: auto;
    padding: 96px 20px 56px;
}

/* Garage Intro (reading-column prose section) */
.garage-intro {
    background-color: var(--bg-main);
    padding: 24px 20px 72px;
    width: 100%;
}

.garage-intro-inner {
    max-width: 720px;
    margin: 0 auto;
}

.garage-intro p {
    font-size: 19px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.garage-intro p:first-child {
    font-size: 21px;
    color: var(--text-primary);
}

/* Section Heading (used above the tile grid) */
.section-heading {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 32px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

/* ==================== TILE GRID SECTION (LIGHT TONE) ==================== */
.tile-grid-section {
    padding: 24px 16px;
    background-color: var(--bg-main) !important;
    width: 100%;
}

.tile-grid-section .grid-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tile-card {
    border-radius: 28px;
    padding: 50px 30px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.tile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.tile-card.dark,
.tile-card.gray {
    background-color: #f5f5f7;
    color: var(--text-primary);
}

.tile-card.light,
.tile-card.white {
    background-color: #ffffff;
    color: var(--text-primary);
}

.tile-title {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tile-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: 16px;
}

.tile-icon-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    background: rgba(0, 113, 227, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    font-size: 48px;
}

/* Garage Projects card variant — icon leads, text follows */
.tile-quote {
    font-size: 17px;
    font-style: italic;
    color: var(--accent-blue);
    max-width: 360px;
    margin: 0 auto 16px;
}

.tile-card .tile-icon-wrapper:first-child {
    margin-top: 0;
    margin-bottom: 28px;
}

.cta-group.cta-inline {
    justify-content: center;
    margin-bottom: 0;
}

/* Keep the fixed header from covering the #garage-projects anchor target */
#garage-projects {
    scroll-margin-top: 72px;
}

/* ==================== APPLE LIGHT FOOTER ==================== */
.footer-apple,
.site-footer {
    background-color: #f5f5f7 !important;
    color: #6e6e73 !important;
    font-size: 12px;
    padding: 40px 20px 60px;
    border-top: 1px solid #d2d2d7 !important;
    width: 100%;
}

.footer-content {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid #d2d2d7;
}

.footer-copy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* GeneratePress renders .site-info as its own white box, wider than the
   reading column, which reads as a stray panel inside the grey footer band.
   Flatten it and align it to the same column as the content. */
.site-info {
    background-color: transparent;
    border: 0;
    padding: 0;
}

.site-info .inside-site-info {
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.site-info a {
    color: var(--text-secondary);
}

.site-info a:hover {
    color: var(--accent-blue);
}

/* ==================== POSTS & ARCHIVES (READING VIEW) ==================== */
/* These templates come from the GeneratePress parent; the child only restyles
   them. This stylesheet is enqueued after GP's main.min.css, so equal-specificity
   rules win and !important is unnecessary. */

/* Reading column. The container is ~1200px wide, far too wide for prose. */
body.single-post .content-area,
body.page .content-area,
body.blog .content-area,
body.archive .content-area,
body.search .content-area {
    width: 100%;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

/* Content boxes adopt the card language of .tile-card / .hero-visual-card */
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.separate-containers .paging-navigation {
    background-color: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    padding: 40px;
}

.separate-containers .site-main > article {
    margin-bottom: 20px;
}

/* ---- Titles ---- */
.entry-header .entry-title,
.page-header .page-title {
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.25;
    margin: 0 0 10px;
}

body.single-post .entry-header .entry-title {
    font-size: 40px;
    font-weight: 700;
}

.page-header .page-title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 0;
}

/* Archive/search items render an h2 title that links to the post */
body.blog .entry-header .entry-title,
body.archive .entry-header .entry-title,
body.search .entry-header .entry-title {
    font-size: 26px;
    font-weight: 600;
}

.entry-title a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.entry-title a:hover {
    color: var(--accent-blue);
}

/* ---- Meta: date, author, categories ---- */
.entry-meta {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.entry-meta a {
    color: var(--text-secondary);
}

.entry-meta a:hover {
    color: var(--accent-blue);
}

footer.entry-meta {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---- Body copy ---- */
.entry-content {
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.75;
    margin-top: 28px;
}

.entry-summary {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    margin-top: 16px;
}

.entry-content > * + * {
    margin-top: 1.4em;
}

.entry-content h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-top: 1.8em;
}

.entry-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 1.6em;
}

.entry-content a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--accent-blue-hover);
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.4em;
}

.entry-content li + li {
    margin-top: 0.5em;
}

.entry-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--accent-blue);
    color: var(--text-secondary);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

.entry-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--bg-card-secondary);
    padding: 2px 6px;
    border-radius: 6px;
}

.entry-content pre {
    background: var(--text-primary);
    color: var(--nav-text);
    padding: 20px 24px;
    border-radius: 16px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.read-more {
    display: inline-block;
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 500;
}

.page-header {
    margin-bottom: 20px;
}

/* ---- Previous/next post links ---- */
.post-navigation {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

.post-navigation a {
    color: var(--accent-blue);
}

.post-navigation a:hover {
    color: var(--accent-blue-hover);
}

/* ---- Pagination ---- */
.paging-navigation .page-numbers {
    display: inline-block;
    min-width: 36px;
    padding: 6px 10px;
    margin: 0 3px;
    border-radius: 980px;
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.paging-navigation .page-numbers:hover {
    background: var(--bg-card-secondary);
}

.paging-navigation .page-numbers.current {
    background: var(--accent-blue);
    color: #ffffff;
}

/* ---- Comments ---- */
.comments-area {
    margin-top: 20px;
}

.comments-title,
.comment-reply-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-card-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.comment-form .form-submit input[type="submit"] {
    background-color: var(--accent-blue);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border: 0;
    border-radius: 980px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.comment-form .form-submit input[type="submit"]:hover {
    background-color: var(--accent-blue-hover);
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    /* Collapsed by default; the toggle adds .is-open to reveal the panel */
    .nav-menu,
    .main-navigation .main-nav > ul {
        display: none !important;
    }

    /* Menu becomes a full-width panel dropping out of the sticky header.
       Absolute positioning takes it out of the flex row, leaving
       logo (left) and hamburger (right) in the bar. */
    .nav-menu {
        position: absolute;
        top: 54px;
        left: 0;
        right: 0;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 4px 22px 16px !important;
        /* Solid, not translucent: backdrop-filter is inert here because the
           parent .global-nav already establishes a backdrop root, so page
           content would bleed through the menu text unblurred. */
        background: #161617 !important;
        border-bottom: 1px solid var(--nav-border);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
        max-height: calc(100vh - 54px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* Visibility must not depend on an animation finishing: a throttled or
       skipped entry animation would leave the panel stuck at opacity 0. */
    .nav-menu.is-open {
        display: flex !important;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--nav-border);
    }

    .nav-menu li:last-child {
        border-bottom: 0;
    }

    /* Full-width tap targets instead of the desktop inline links */
    .nav-menu a {
        display: block !important;
        font-size: 16px !important;
        padding: 15px 2px !important;
        opacity: 0.9 !important;
    }

    .hero-title {
        font-size: 38px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .tile-grid-section .grid-container {
        grid-template-columns: 1fr;
    }

    .tile-title {
        font-size: 28px;
    }

    .tile-sub {
        font-size: 15px;
    }

    .tile-card {
        min-height: 380px;
        padding: 40px 20px;
    }

    .garage-intro p {
        font-size: 17px;
    }

    .garage-intro p:first-child {
        font-size: 18px;
    }

    .section-title {
        font-size: 24px;
    }

    .tile-quote {
        font-size: 15px;
    }

    .hero-visual-card {
        height: 280px;
    }

    /* Reading view. GeneratePress zeroes the container padding here, so the
       cards would sit flush against both screen edges. */
    body.single-post .content-area,
    body.page .content-area,
    body.blog .content-area,
    body.archive .content-area,
    body.search .content-area {
        padding-left: 14px;
        padding-right: 14px;
    }

    .separate-containers .inside-article,
    .separate-containers .comments-area,
    .separate-containers .page-header,
    .separate-containers .paging-navigation {
        padding: 24px 20px;
        border-radius: 18px;
    }

    body.single-post .entry-header .entry-title {
        font-size: 30px;
    }

    body.blog .entry-header .entry-title,
    body.archive .entry-header .entry-title,
    body.search .entry-header .entry-title {
        font-size: 22px;
    }

    .page-header .page-title {
        font-size: 24px;
    }

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

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

    .entry-content h3 {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-toggle-bar {
        transition: none;
    }
}
