/*
Theme Name: Rodols Game & IT
Theme URI: https://rodols.net
Author: Dosik
Description: 게임과 IT 매거진을 위한 속도 최적화 앱 스타일 테마.
Version: 1.1.0
*/

:root {
    --bg-color: #0F0F0F;
    --text-color: #FFFFFF;
    --category-bg: #272727;
    --primary-color: #3EA6FF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-color); color: var(--text-color); font-family: 'Pretendard', -apple-system, sans-serif; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px 40px 20px; }

/* 헤더 & 검색창 */
.top-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; margin-bottom: 15px; }
.site-title { font-size: 1.6rem; font-weight: 900; }
.header-search form { display: flex; align-items: center; background: var(--category-bg); border-radius: 20px; padding: 6px 14px; transition: background 0.3s; }
.header-search form:focus-within { background: #333; box-shadow: 0 0 0 1px #555; }
.search-input { background: transparent; border: none; color: #fff; width: 120px; font-size: 0.9rem; outline: none; transition: width 0.3s; }
.search-input:focus { width: 180px; }
.search-submit { background: none; border: none; color: #aaa; cursor: pointer; margin-left: 5px; }

/* 카테고리 네비게이션 */
.category-nav { margin-bottom: 30px; overflow-x: auto; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.category-list { 
    display: flex; 
    gap: 10px; 
    flex-wrap: nowrap; /* 모바일에서 카테고리 2줄로 깨지는 현상 방지 */
}
.category-list li a { display: inline-block; background: var(--category-bg); padding: 8px 18px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; color: #E0E0E0; transition: all 0.2s; }
.category-list li.current-cat a { background: #FFFFFF; color: #121212; }

/* 촘촘한 썸네일 그리드 */
.dense-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #222;
    transition: transform 0.2s, box-shadow 0.2s;
}
.grid-item:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); z-index: 2; }

.thumb-wrapper { width: 100%; height: 100%; }
.item-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.grid-item:hover .item-thumb { transform: scale(1.08); }

/* 썸네일 하단 텍스트 */
.item-info {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    padding: 20px 10px 12px 10px;
    text-align: center;
    box-sizing: border-box; /* 패딩으로 인해 박스 크기가 틀어지는 것 방지 */
}
.item-title { 
    display: block; /* 텍스트 속성을 블록으로 고정 */
    font-size: 0.9rem; 
    font-weight: 700; 
    line-height: 1.2;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); 
}

@media (min-width: 1024px) {
    .dense-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
    .item-title { font-size: 1rem; }
}

/* 페이지네이션 (페이징 처리 버튼 디자인) */
.pagination { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    margin-top: 40px; 
    margin-bottom: 20px;
}
.pagination a, .pagination span { 
    display: inline-block; 
    padding: 8px 14px; 
    background: #222; 
    color: #fff; 
    border-radius: 8px; 
    font-weight: bold; 
    font-size: 0.9rem;
    transition: background 0.2s; 
}
.pagination a:hover { 
    background: #444; 
}
.pagination span.current { 
    background: #FFFFFF; 
    color: #000; 
}