/* style.css (Final Version) */

/* Font Settings */
@font-face {
    font-family: 'Pretendard';
    src: url('../fonts/Pretendard-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Pretendard';
    src: url('../fonts/Pretendard-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* General Body and Layout */
body {
    font-family: 'Pretendard', sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    display: flex;
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh;
    margin: 0;
}
.container {
    margin-top: 40px;
    margin-bottom: 40px;
    width: 90%; 
}

/* Header */
.site-header {
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 20px;
    font-weight: 800;
    color: #333;
    text-decoration: none;
}
.main-nav a {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.main-nav a:hover {
    background-color: #f1f3f5;
}

/* Roulette Page Styles */
.container:not(.content-page) {
    background-color: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 600px;
}
h1 { color: #212529; margin-bottom: 8px; }
p { color: #868e96; margin-bottom: 25px; }
.category-buttons {
    margin: 25px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    min-height: 80px;
}
.category-btn { padding: 10px 18px; font-size: 16px; font-weight: 600; color: #495057; background-color: #f1f3f5; border: 1px solid #dee2e6; border-radius: 20px; cursor: pointer; transition: all 0.2s ease-in-out; }
.category-btn:hover { background-color: #e9ecef; transform: translateY(-2px); }
.category-btn.selected { background-color: #007bff; color: white; border-color: #007bff; box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3); }
#submit-btn { width: 100%; padding: 15px 0; font-size: 18px; font-weight: bold; color: white; background-color: #28a745; border: none; border-radius: 10px; cursor: pointer; margin-top: 20px; transition: background-color 0.3s; }
#submit-btn:hover { background-color: #218838; }
#result {
    margin-top: 30px;
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    min-height: 120px;
}
#menu-name {
    font-size: 20px;
    color: #495057;
    line-height: 1.5;
    transition: opacity 0.5s;
}
.menu-highlight { display: inline-block; margin-top: 8px; font-size: 32px; color: #ff6b6b; font-weight: 800; }

/* Footer */
.footer-nav {
    text-align: center;
    padding-bottom: 20px;
    font-size: 14px;
    color: #adb5bd;
    width: 100%;
}
.footer-nav a { color: #868e96; text-decoration: none; margin: 0 10px; }
.footer-nav a:hover { text-decoration: underline; }
.footer-nav p { margin-top: 10px; font-size: 12px; }

/* Content & Blog Pages */
.content-page {
    text-align: left;
    max-width: 1100px; 
}
.post-content-page .container.content-page {
    max-width: 800px;
}
.content-page h1 { text-align: center; margin-bottom: 30px; }
.content-page h3 { margin-top: 25px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.content-page p { line-height: 1.8; }
.home-btn { display: block; width: 200px; margin: 40px auto 0; padding: 12px 20px; text-align: center; background-color: #6c757d; color: white; text-decoration: none; border-radius: 8px; transition: background-color 0.3s; }
.home-btn:hover { background-color: #5a6268; }

/* Blog List Page */
.post-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
}
.post-card {
    display: flex;
    flex-direction: column; 
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    overflow: hidden; 
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.post-card .post-image-wrapper {
    width: 100%;
    padding-top: 100%; 
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa; 
}
.post-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.3s;
}
.post-card:hover img {
    transform: scale(1.05); 
}
.post-card .post-content-wrapper {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}
.post-card h2 {
    font-size: 16px;
    line-height: 1.5;
    color: #212529;
    height: 72px; 
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.post-card .post-meta {
    font-size: 12px;
    color: #868e96;
    margin-top: auto; 
    padding-top: 10px;
}

/* Individual Blog Post Styles */
.post-content {
    margin-top: 30px;
}
.post-meta {
    font-size: 14px;
    color: #868e96;
    margin-bottom: 15px;
}
.post-featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 30px 0; 
    border-radius: 12px; 
    overflow: hidden; 
    background-color: #f1f3f5;
}
.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ★★★          본문 이미지 스타일 (최종 버전)          ★★★ */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
.post-inline-image {
    width: 100%;
    max-width: 200px; /* 여기서 최대 너비를 200px로 제어 */
    margin: 40px auto; 
    text-align: center;
}
.post-inline-image img {
    width: 100%; /* 부모(.post-inline-image)의 너비에 맞춤 */
    height: auto; /* 가로 비율에 맞춰 세로 자동 조절 */
    aspect-ratio: 1 / 1; /* 이미지를 1:1 정사각형 비율로 강제 */
    object-fit: cover; /* 1:1 비율에 맞게 이미지가 잘리더라도 꽉 채움 */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .post-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .post-list {
        grid-template-columns: 1fr;
    }
    .logo { font-size: 18px; }
    .main-nav a { font-size: 15px; }
    .container:not(.content-page) { padding: 25px 20px; }
    .post-card h2 {
        font-size: 18px;
        height: auto;
        -webkit-line-clamp: 2;
    }
}