/*
Theme Name: Mentys Log V2
Theme URI: https://mentys.web.id
Author: Yoga Esa Mahendra
Description: Clean Medium-style blog theme with Bootstrap 5 - Performance optimized
Version: 2.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mentys-log-v2
Tags: blog, clean, minimal, medium, bootstrap, responsive
*/

/* Bootstrap will be loaded via CDN in header with defer */

/* Custom CSS - Medium Style Clean Design */
:root {
    --primary: #1a1a1a;
    --secondary: #666;
    --border: #e5e5e5;
    --hover: #f0f0f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--primary);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

img[loading="lazy"] {
    min-height: 200px;
    background: #f5f5f5;
}

/* Prevent CLS (Cumulative Layout Shift) */
.hero-image,
.article-thumbnail,
.featured-image-medium img {
    background: #f5f5f5;
}

/* Header Customization */
.site-header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: var(--shadow);
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.site-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

/* Navigation Clean Pills */
.nav-pills .nav-link {
    color: var(--primary);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link.active {
    background: var(--hover);
    color: var(--primary);
}

/* Search Form */
.search-input {
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,26,26,0.1);
}

/* Hero Post */
.hero-post {
    margin-bottom: 3rem;
}

.hero-image {
    border-radius: 8px;
    overflow: hidden;
    height: 400px;
    margin-bottom: 1.5rem;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-image:hover img {
    transform: scale(1.02);
}

.post-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-title a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.post-title a:hover {
    color: var(--secondary);
}

.post-excerpt {
    font-size: 1.1rem;
    color: var(--secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--secondary);
}

.post-meta img {
    border-radius: 50%;
}

/* Article Cards */
.article-card {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.article-title a {
    color: var(--primary);
    text-decoration: none;
}

.article-title a:hover {
    color: var(--secondary);
}

.article-excerpt {
    color: var(--secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.article-thumbnail {
    border-radius: 4px;
    overflow: hidden;
    height: 100px;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Category Pills */
.category-pill {
    display: inline-block;
    background: var(--hover);
    color: var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.category-pill:hover {
    background: var(--primary);
    color: #fff;
}

/* Sidebar */
.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.sidebar-sticky {
    position: sticky;
    top: 80px;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: #fafafa;
}

.footer-links a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .hero-image {
        height: 300px;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
    
    .sidebar-sticky {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-image {
        height: 250px;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-excerpt {
        font-size: 1rem;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Prevent FOUT (Flash of Unstyled Text) */
.wf-loading body {
    opacity: 0;
}

.wf-active body,
.wf-inactive body {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

/* Critical rendering optimization */
.site-header,
.hero-post,
.article-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}

/* Will-change hints for animated elements */
.nav-link,
.btn,
.category-pill,
.tag-pill {
    will-change: transform, background-color;
}

/* GPU acceleration for smooth transitions */
.nav-link,
.article-card a,
.hero-post a {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize font loading */
@media (prefers-reduced-data: reduce) {
    * {
        font-family: system-ui, -apple-system, sans-serif !important;
    }
}

/* ================================
   MEDIUM-STYLE SINGLE POST
   ================================ */

/* Single Post Container - NO SIDEBAR */
.single-post-medium {
    background: #fff;
}

/* Entry Header - Centered, Large */
.entry-header-medium {
    padding: 60px 0 40px;
    max-width: 100%;
}

.entry-header-medium .col-lg-8 {
    max-width: 680px !important;
}

/* Title - Very Large (Medium Style) */
.entry-title-medium {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #1a1a1a;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .entry-title-medium {
        font-size: 32px;
    }
}

/* Subtitle (if exists) */
.entry-subtitle-medium {
    font-size: 24px;
    line-height: 1.5;
    color: #6b6b6b;
    margin-bottom: 32px;
    font-weight: 400;
}

/* Post Meta - Medium Style */
.post-meta-medium {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f2f2f2;
}

.author-avatar-medium img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.author-name-medium a {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
}

.author-name-medium a:hover {
    text-decoration: underline;
}

.post-date-medium {
    font-size: 14px;
    color: #6b6b6b;
}

/* Featured Image - FULL WIDTH, Very Large */
.featured-image-medium {
    width: 100%;
    max-width: 100%;
    margin: 0 0 48px;
    padding: 0;
}

.featured-image-medium img {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: cover;
    display: block;
}

/* Entry Content - Centered, Large Typography (MEDIUM STYLE) */
.entry-content-medium {
    padding: 0 0 48px;
}

.entry-content-medium .col-lg-8 {
    max-width: 680px !important;
}

.entry-content-medium p {
    font-size: 21px;
    line-height: 1.58;
    letter-spacing: -0.003em;
    color: #242424;
    margin-bottom: 32px;
    font-family: charter, Georgia, Cambria, "Times New Roman", Times, serif;
}

.entry-content-medium h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 56px;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.entry-content-medium h3 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 48px;
    margin-bottom: 12px;
}

.entry-content-medium a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.3);
    text-underline-offset: 2px;
}

.entry-content-medium a:hover {
    text-decoration-color: rgba(0, 0, 0, 0.8);
}

.entry-content-medium img {
    width: 100%;
    height: auto;
    margin: 32px 0;
    border-radius: 4px;
}

.entry-content-medium blockquote {
    border-left: 3px solid #1a1a1a;
    padding-left: 23px;
    margin-left: -26px;
    font-style: italic;
    font-size: 24px;
    line-height: 1.48;
    color: #292929;
}

.entry-content-medium code {
    background: #f7f7f7;
    padding: 3px 6px;
    border-radius: 3px;
    font-family: Menlo, Monaco, "Courier New", monospace;
    font-size: 16px;
}

.entry-content-medium pre {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 32px 0;
}

.entry-content-medium ul,
.entry-content-medium ol {
    font-size: 21px;
    line-height: 1.58;
    margin-bottom: 32px;
}

/* Entry Footer - Tags & Share */
.entry-footer-medium {
    padding: 48px 0;
}

.entry-footer-medium .col-lg-8 {
    max-width: 680px !important;
}

/* Tags - Medium Style (Gray Pills) */
.post-tags-medium {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-medium {
    display: inline-block;
    padding: 8px 16px;
    background: #f2f2f2;
    color: #6b6b6b;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s;
}

.tag-medium:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

/* Share Section - Medium Style (Claps, Comments, etc.) */
.share-medium {
    display: block;
}

.btn-clap-medium,
.btn-comment-medium,
.btn-bookmark-medium,
.btn-share-medium,
.btn-more-medium {
    background: none;
    border: none;
    color: #6b6b6b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.btn-clap-medium:hover,
.btn-comment-medium:hover,
.btn-bookmark-medium:hover,
.btn-share-medium:hover,
.btn-more-medium:hover {
    background: #f2f2f2;
    color: #1a1a1a;
}

.btn-clap-medium svg,
.btn-comment-medium svg,
.btn-bookmark-medium svg,
.btn-share-medium svg,
.btn-more-medium svg {
    width: 24px;
    height: 24px;
}

/* Author Card - Medium Style (Large Avatar) */
.author-card-medium {
    padding: 32px 0;
    border-top: 1px solid #f2f2f2;
    border-bottom: 1px solid #f2f2f2;
}

.author-avatar-large img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
}

.author-name-large {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.author-name-large a {
    color: #1a1a1a;
    text-decoration: none;
}

.author-name-large a:hover {
    text-decoration: underline;
}

.author-bio-medium {
    font-size: 16px;
    line-height: 1.5;
    color: #6b6b6b;
}

/* More From Author Section */
.more-from-author-medium {
    background: #fafafa;
}

.more-article-card .more-title a {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
}

.more-article-card .more-title a:hover {
    text-decoration: underline;
}

.more-excerpt {
    font-size: 14px;
    line-height: 1.5;
}

.more-meta {
    font-size: 13px;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .entry-header-medium {
        padding: 40px 0 24px;
    }
    
    .entry-content-medium p {
        font-size: 18px;
        line-height: 1.6;
    }
    
    .entry-content-medium h2 {
        font-size: 26px;
    }
    
    .entry-content-medium h3 {
        font-size: 22px;
    }
    
    .featured-image-medium img {
        max-height: 400px;
    }
}
