/*
Theme Name: elee.my Blog Theme
Version: 3.1
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap');

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

/* 게시글 본문 내부는 글로벌 리셋에서 제외 - 작성자 HTML 우선 */
.entry-content *:not(style) {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    color: #333333;
    line-height: 1.6;
}

/* ===== HEADER ===== */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

.site-logo a {
    font-size: 2rem;
    font-weight: 800;
    color: #FF8C00;
    text-decoration: none;
}

.site-logo span {
    color: #1f2937;
}

/* ===== NAVIGATION ===== */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.3s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: #FF8C00;
}

/* ===== CONTAINER ===== */
.site-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

/* ===== POSTS ===== */
.posts-list {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    border-left: 4px solid #FF8C00;
    padding-left: 1rem;
}

.post-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.post-thumbnail {
    width: 200px;
    min-height: 120px;
    max-height: 180px;
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: #111827;
    text-decoration: none;
}

.post-title a:hover {
    color: #FF8C00;
}

.post-excerpt {
    font-family: 'Inter', sans-serif;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    font-family: 'Inter', sans-serif;
    color: #FF8C00;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.875rem;
}

.post-date {
    font-family: 'Inter', sans-serif;
    color: #9ca3af;
}

.post-meta {
    font-family: 'Inter', sans-serif;
}

.post-category {
    font-family: 'Inter', sans-serif;
    color: #FF8C00;
    font-weight: 700;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #FF8C00;
}

.profile-widget {
    text-align: center;
    border-top: 4px solid #FF8C00;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid #FF8C00;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.5rem;
}

.social-links a {
    color: #4b5563;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: #FF8C00;
    background-color: #fff7ed;
}

.portfolio-widget {
    background: #f9fafb;
    border: 2px solid #FF8C00;
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.portfolio-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(255, 140, 0, 0.2);
    background-color: #fff7ed;
}

.portfolio-icon {
    font-size: 3rem;
    color: #FF8C00;
    margin-bottom: 1rem;
}

/* ===== SINGLE POST ===== */
.single-post {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.entry-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

/* entry-content 기본 스타일: 인라인 스타일이 있으면 인라인이 우선됨 */
.entry-content img {
    border-radius: 0;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
.site-footer {
    background-color: #1f2937;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    text-align: center;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 968px) {
    .site-content {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    .main-navigation {
        display: none;
    }
    
    .post-card {
        flex-direction: column;
    }
    
    .post-thumbnail {
        width: 100%;
        height: auto;
        max-height: 300px;
        background-color: #f3f4f6;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .post-thumbnail img {
        width: 100%;
        height: auto;
        display: block;
    }
    
    .sidebar {
        position: static;
    }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 640px) {
    /* 전체 오버플로우 방지 */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    body {
        font-size: 14px;
    }
    
    /* 헤더 - 10px 패딩으로 통일 */
    .site-header {
        padding: 0;
    }
    
    .header-container {
        padding: 0.75rem 10px !important;
        max-width: 100%;
        margin: 0;
    }
    
    .site-logo a {
        font-size: 1.25rem;
    }
    
    /* 콘텐츠 영역 - 10px 패딩으로 통일 */
    .site-content {
        padding: 0 10px !important;
        margin: 10px auto;
        max-width: 100%;
    }
    
    /* 게시글 - 10px 패딩으로 통일 */
    .single-post {
        padding: 10px !important;
        margin: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 목록 - 10px 패딩으로 통일 */
    .posts-list {
        padding: 10px !important;
    }
    
    /* 제목 */
    .entry-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        padding: 0;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    /* 본문 */
    .entry-content {
        font-size: 0.9375rem;
        line-height: 1.7;
        padding: 0;
        max-width: 100%;
    }
    
    /* 이미지 - 인라인 스타일이 없는 이미지만 화면 전체 너비로 */
    .entry-content img:not([style]) {
        max-width: calc(100% + 20px);
        width: calc(100% + 20px);
        height: auto;
        display: block;
        margin: 1.5rem -10px;
        border-radius: 0;
    }
    
    .post-title {
        font-size: 1.125rem;
    }
    
    /* 본문 내 Font Awesome 아이콘 크기 제한 (모바일) - 인라인 스타일 없는 경우만 */
    .entry-content i.fa-solid:not([style]),
    .entry-content i.fa-regular:not([style]),
    .entry-content i.fa-brands:not([style]),
    .entry-content i[class*="fa-"]:not([style]) {
        font-size: clamp(0.875rem, 4vw, 1.5rem);
        display: inline-block;
        max-width: 100%;
    }
}

/* ===== CUSTOM HTML CONTENT (테마 CSS 무효화) ===== */
/* 커스텀 HTML 콘텐츠는 테마 스타일을 받지 않음 */
.entry-content .custom-html-content,
.entry-content .custom-html-content * {
    all: revert;
}

.entry-content .custom-html-content {
    font-size: initial;
    line-height: initial;
    color: initial;
}

.entry-content .custom-html-content img {
    border-radius: initial;
    margin: initial;
    max-width: initial;
    width: initial;
    height: initial;
    display: initial;
}

.entry-content .custom-html-content h1,
.entry-content .custom-html-content h2,
.entry-content .custom-html-content h3,
.entry-content .custom-html-content h4,
.entry-content .custom-html-content h5,
.entry-content .custom-html-content h6 {
    font-size: initial;
    font-weight: initial;
    margin-top: initial;
    margin-bottom: initial;
}

.entry-content .custom-html-content p {
    margin: initial;
    padding: initial;
}

/* 또는 완전히 격리된 스타일 */
.entry-content .isolated-content,
.entry-content .isolated-content * {
    all: initial !important;
}

.entry-content .isolated-content {
    display: block !important;
}

.entry-content .isolated-content div {
    display: block !important;
}

.entry-content .isolated-content p {
    display: block !important;
}

.entry-content .isolated-content span {
    display: inline !important;
}

/* ===== MOBILE FIX: 큰 이미지와 아이콘 제한 ===== */
@media (max-width: 768px) {
    /* 게시글 내 인라인 스타일이 없는 이미지만 크기 제한 */
    .entry-content img:not([style]),
    .custom-html-content img:not([style]),
    .isolated-content img:not([style]) {
        max-width: 100%;
        width: 100%;
        height: auto;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* SVG 크기 제한 - 인라인 스타일 없는 경우만 */
    .entry-content svg:not([style]),
    .custom-html-content svg:not([style]) {
        max-width: 100%;
        height: auto;
    }
    
    /* Font Awesome 아이콘 크기 자동 조정 - 인라인 스타일 없는 경우만 */
    .entry-content i[class*="fa-"]:not([style]),
    .entry-content .fa:not([style]),
    .entry-content .fas:not([style]),
    .entry-content .far:not([style]),
    .entry-content .fab:not([style]) {
        max-width: 100%;
        font-size: inherit;
    }
    
    /* 큰 아이콘 클래스 제한 - 인라인 스타일 없는 경우만 */
    .entry-content .fa-10x:not([style]),
    .entry-content .fa-9x:not([style]),
    .entry-content .fa-8x:not([style]),
    .entry-content .fa-7x:not([style]),
    .entry-content .fa-6x:not([style]),
    .entry-content .fa-5x:not([style]),
    .entry-content .fa-4x:not([style]),
    .entry-content .fa-3x:not([style]) {
        font-size: 2rem;
    }
    
    .entry-content .fa-2x:not([style]) {
        font-size: 1.5rem;
    }
    
    /* 인라인 스타일로 지정된 아이콘은 작성자 의도를 존중 - 제거 */
    
    /* 넘치는 콘텐츠 숨김 - entry-content 자체만 */
    .entry-content,
    .custom-html-content {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    /* 고정 너비 요소 제한 - 제거: 인라인 style의 width를 존중 */
    
    /* Flexbox 콘텐츠 줄바꿈 - 제거: 인라인 flex 설정 존중 */
    
    /* 큰 패딩/마진 제한 - 제거: 인라인 padding 존중 */
}

/* ===== 이미지가 화면을 넘어가지 않도록 ===== */
.entry-content img {
    max-width: 100%;
    height: auto;
}

/* ===== 큰 요소 자동 축소 ===== */
@media (max-width: 640px) {
    /* 인라인 스타일이 없는 요소만 max-width 제한 */
    .entry-content *:not([style]) {
        max-width: 100%;
    }
    
    /* 인라인 스타일이 없는 제목만 폰트 크기 제한 */
    .entry-content h1:not([style]) { font-size: 1.75rem; }
    .entry-content h2:not([style]) { font-size: 1.5rem; }
    .entry-content h3:not([style]) { font-size: 1.25rem; }
}
