/*
 Theme Name:   GeneratePress Velog
 Template:     generatepress
 Description:  Velog style child theme for GeneratePress
 Author:       Bitnami User
 Version:      1.0.0
*/

/* Velog Style Customizations */

/* General Body and Background */
body {
    background-color: #f8f9fa; /* Light grey background like Velog */
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Nanum Gothic", "Noto Sans KR", "Noto Sans CJK KR", arial, 돋움, Dotum, Tahoma, Geneva, sans-serif;
}

/* Header Styles */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.inside-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1728px;
    margin: 0 auto;
}

/* Navigation */
.main-navigation {
    background: transparent;
}

.main-navigation .main-nav ul li a {
    color: #212529;
    font-weight: 500;
    font-size: 1.1rem;
}

.main-navigation .main-nav ul li:hover > a, 
.main-navigation .main-nav ul li.current-menu-item > a {
    color: #12b886; /* Velog Green */
    background: transparent;
}

/* Post Grid Layout (Velog Card Style) */
.generate-columns-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 2rem 0;
    justify-content: flex-start; /* Align left */
}

/* Update: Larger Cards (2 Columns) */
.blog .type-post, .archive .type-post {
    background: #ffffff;
    border-radius: 8px; /* Softer rounded corners */
    box-shadow: 0 4px 16px 0 rgba(0,0,0,0.04);
    transition: transform 0.25s ease-in, box-shadow 0.25s ease-in;
    margin-bottom: 30px; /* More spacing between rows */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Change from 33.33% to 50% minus gap */
    width: calc(50% - 20px);
    box-sizing: border-box;
    border: 1px solid #f1f3f5; /* Subtle border for definition */
}

@media (max-width: 1024px) {
    .blog .type-post, .archive .type-post {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .blog .type-post, .archive .type-post {
        width: 100%; /* 1 Column on mobile */
    }
}

.blog .type-post:hover, .archive .type-post:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px 0 rgba(0,0,0,0.08);
}

.inside-article {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; /* For absolute positioning inside if needed */
}

/* Image on top with specific aspect ratio */
.post-image {
    margin: 0 !important;
    position: relative;
    width: 100%;
    padding-top: 52%; /* 16:9 Aspect Ratio roughly, or 52% usually looks good for cards */
    overflow: hidden;
}

/* Default image logic is handled in functions.php, but let's ensure styling is correct */
.post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    background-color: #f1f3f5; /* Placeholder color */
}

/* Add default image placeholder if no image exists (handled by PHP) */
.post-image.no-image::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="%23adb5bd" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

/* Content Area */
.entry-header {
    padding: 1rem 1rem 0 1rem;
    margin-top: 0;
}

.entry-title {
    font-size: 1.15rem; /* Balanced title size */
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    word-break: keep-all; /* Korean word break */
}

.entry-title a {
    color: #212529;
    text-decoration: none;
}

.entry-summary {
    padding: 0 1rem;
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.8rem; /* Fixed height for summary to align cards roughly */
}

/* Meta / Footer of Card */
.entry-meta {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f1f3f5;
    font-size: 0.75rem;
    color: #868e96;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* Tags should be hidden in card preview to keep it clean */
.tags-links {
    display: none !important; 
}


.read-more {
    display: none;
}

/* Sidebar Adjustments for Velog Style */
@media (min-width: 769px) {
    .left-sidebar .site-content .content-area {
        width: calc(100% - 280px); /* 250px sidebar + 30px gap */
        margin-left: auto;
    }
    .left-sidebar .site-content .widget-area {
        width: 250px;
        position: sticky;
        top: 80px;
        align-self: flex-start;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
    .left-sidebar .site-content .widget-area::-webkit-scrollbar {
        width: 4px;
    }
    .left-sidebar .site-content .widget-area::-webkit-scrollbar-thumb {
        background-color: #dee2e6;
        border-radius: 2px;
    }
}

.widget {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
}

.velog-tag-list-widget .widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid #212529;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.velog-tag-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.velog-tag-list li {
    margin-bottom: 0.5rem;
}

.velog-tag-list li a {
    text-decoration: none;
    color: #495057;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.velog-tag-list li.current-cat a,
.velog-tag-list li a:hover {
    color: #12b886;
    font-weight: 600;
}

.velog-tag-list .count {
    font-size: 0.85rem;
    color: #868e96;
    margin-left: 0.5rem;
}

/* Velog Profile Section Styles */
.velog-profile-container {
    max-width: 1728px;
    margin: 3rem auto 2rem auto;
    padding: 0 2rem;
}

.velog-profile-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.velog-profile-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.velog-profile-img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.velog-profile-img-placeholder {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: #495057;
}

.velog-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #212529;
    line-height: 1.2;
}

.velog-bio {
    font-size: 1.1rem;
    color: #495057;
    margin: 0;
    line-height: 1.5;
}

.velog-nav-tabs {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    border-bottom: 1px solid #dee2e6; /* Line across? Velog actually floats the underline */
    position: relative;
}

.velog-tab {
    font-size: 1.25rem;
    font-weight: 600;
    color: #868e96;
    text-decoration: none;
    padding-bottom: 1rem;
    position: relative;
    transition: color 0.2s;
}

.velog-tab:hover {
    color: #212529;
}

.velog-tab.active {
    color: #12b886; /* Velog Green */
}

.velog-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px; /* Overlap border */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #12b886;
}

@media (max-width: 768px) {
    .velog-profile-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    .velog-profile-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .velog-profile-img, .velog-profile-img-placeholder {
        width: 80px;
        height: 80px;
    }
    .velog-name {
        font-size: 1.25rem;
    }
    .velog-bio {
        font-size: 1rem;
    }
}

/* Velog Tags Page Styles */
.velog-tags-page .velog-section-title {
    text-align: center;
    border-bottom: none;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.velog-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.velog-tags-cloud li a {
    display: block;
    padding: 0.5rem 1.25rem;
    background: #f8f9fa;
    border-radius: 2rem;
    text-decoration: none;
    color: #495057;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.velog-tags-cloud li a:hover {
    background: #f1f3f5;
    color: #12b886;
    transform: translateY(-2px);
    border-color: #12b886;
}

.velog-tags-cloud .cat-count {
    color: #adb5bd;
    font-size: 0.9em;
    margin-left: 0.3rem;
}

/* Dark Mode for Tags Page */
body.dark-mode .velog-tags-cloud li a {
    background: #252525;
    color: #acacac;
}

body.dark-mode .velog-tags-cloud li a:hover {
    background: #383838;
    color: #96f2d7;
    border-color: #96f2d7;
}

/* Header Right Items */
.velog-header-items {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
}

.velog-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #212529;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.velog-icon-btn:hover {
    background-color: #f1f3f5;
    color: #12b886; /* Velog Green */
}

.velog-new-post-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #212529;
    border-radius: 2rem;
    text-decoration: none;
    color: #212529;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.velog-new-post-btn:hover {
    background-color: #212529;
    color: #ffffff;
}

/* Search Overlay */
.velog-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.velog-search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.velog-search-box {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #868e96;
    padding: 1rem;
}

.velog-search-input {
    width: 100%;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    outline: none;
}

.velog-search-close {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #495057;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #ececec;
}

body.dark-mode .site-header,
body.dark-mode .generate-columns,
body.dark-mode .inside-article,
body.dark-mode .sidebar .widget,
body.dark-mode .blog .type-post,
body.dark-mode .archive .type-post,
body.dark-mode .velog-category-grid li a {
    background-color: #1e1e1e;
    color: #ececec;
    border-color: #333;
}

body.dark-mode .entry-title a,
body.dark-mode .main-navigation .main-nav ul li a,
body.dark-mode .velog-name,
body.dark-mode .velog-tab,
body.dark-mode .velog-icon-btn,
body.dark-mode .velog-new-post-btn {
    color: #ececec;
}

body.dark-mode .velog-bio,
body.dark-mode .entry-summary,
body.dark-mode .velog-tag-list li a,
body.dark-mode .cat-count {
    color: #acacac;
}

body.dark-mode .velog-new-post-btn {
    border-color: #ececec;
}
body.dark-mode .velog-new-post-btn:hover {
    background-color: #ececec;
    color: #121212;
}

body.dark-mode .entry-meta,
body.dark-mode .velog-nav-tabs {
    border-color: #333;
}

body.dark-mode .tags-links a {
    background-color: #252525;
    color: #96f2d7;
}

body.dark-mode .velog-search-overlay {
    background-color: rgba(18, 18, 18, 0.95);
}
body.dark-mode .velog-search-input {
    color: #ececec;
}

/* Hide Main Navigation Menu */
.main-navigation {
    display: none !important;
}

/* Ensure menu bar items (search, dark mode) are still visible and positioned correctly */
/* Since they are usually inside the nav, we might need to adjust their container or ensure they are hooked elsewhere */
/* GeneratePress hooks "generate_menu_bar_items" usually inside navigation, but we are hiding .main-navigation */
/* However, we hooked "generate_menu_bar_items" which outputs <div class="menu-bar-items">. */
/* If .main-navigation is hidden, check if .menu-bar-items is inside it. */

/* In GeneratePress, .menu-bar-items is inside .inside-navigation. */
/* So hiding .main-navigation hides everything. */

/* We need to hide the MENU itself (.main-nav) but keep the container if we want the items. */
/* Or, we can just hide the UL */

.main-navigation .main-nav > ul {
    display: none !important;
}

/* Also hide the toggle button on mobile since there is no menu */
.menu-toggle {
    display: none !important;
}

/* Make sure the container is still visible for our custom items */
.main-navigation, .inside-navigation {
    display: block !important;
}

/* Remove background and padding that might look weird empty */
.main-navigation {
    background: transparent;
}

/* Profile Section Center Alignment */
.velog-profile-wrapper {
    justify-content: center;
    text-align: center;
    flex-direction: column; /* Stack image and text for center alignment */
}

.velog-profile-left {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.velog-profile-text {
    max-width: 600px; /* Limit width for better reading */
}

/* Nav Tabs Center Alignment */
.velog-nav-tabs {
    justify-content: center;
}
