/* * 새로운 '코딩티딩' 메인 스타일시트 (style.css)
 * v2 - 따뜻한 교육 테마 적용
 */

/* 1. 기본 설정 및 변수 (따뜻한 테마로 변경) */
:root {
    --color-primary: #4A90E2; /* 메인 컬러 (따뜻한 파란색) */
    --color-secondary: #F5A623; /* 강조 컬러 (따뜻한 주황색) */
    --color-dark: #2C3E50; /* 기본 텍스트 (어두운 슬레이트 블루) */
    --color-text: #34495E; /* 본문 텍스트 */
    --color-light-gray: #FAF8F0; /* 전체 배경 (부드러운 베이지) */
    --color-white: #ffffff;
    --shadow-light: 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 6px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* 2. 글로벌 리셋 & 폰트 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-light-gray); /* 따뜻한 배경색 적용 */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--color-primary); /* 메인 컬러 적용 */
    padding-bottom: 0.5rem;
    display: inline-block;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 3. 레이아웃 (컨테이너) */
.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
}

section {
    background: var(--color-white); /* 카드는 흰색 유지 (깔끔함) */
    margin: 2rem 0;
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 4. 헤더 */
#header {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 2rem 0;
    text-align: center;
}

#header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

#header .logo-img {
    width: 50px;
    height: 50px;
    background: var(--color-white);
    border-radius: 50%;
    padding: 5px;
}

#header h1 {
    color: var(--color-white);
    margin: 0;
    font-size: 2.2rem;
}
#header h1 a {
    color: inherit;
    text-decoration: none;
}
#header .subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* 5. 메인 콘텐츠 */
#main {
    padding: 2rem 0;
}

/* 6. 버튼 스타일 */
.button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid var(--color-text);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    text-align: center;
}

.button:hover {
    background: var(--color-light-gray);
    border-color: var(--color-dark);
    color: var(--color-dark);
}

.button.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.button.primary:hover {
    opacity: 0.85;
}

/* 7. 서비스 카드 그리드 (핵심) */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

.service-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.service-card .card-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.service-card .card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    font-size: 1.4rem;
    color: var(--color-dark); /* h3 색상 통일 */
}
/* 각 카드의 특정 색상 포인트 (선택 사항) */
.service-card:nth-of-type(1) h3 { color: #D9534F; } /* 스크래치 레드 */
.service-card:nth-of-type(2) h3 { color: #4A90E2; } /* AI Teading 블루 */
.service-card:nth-of-type(3) h3 { color: #5CB85C; } /* Arcade 그린 */


.service-card p {
    flex-grow: 1;
    font-size: 0.95rem;
}

.service-card .card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 8. About 섹션 */
.about-section {
    text-align: center;
}
.about-section p {
    max-width: 800px;
    font-size: 1.1rem;
}
.about-section .contact-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 9. 도서 홍보 섹션 */
.book-promo-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.book-promo-section .promo-image {
    flex: 1;
    max-width: 400px;
}
.book-promo-section .promo-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
}

.book-promo-section .promo-content {
    flex: 2;
}
.book-promo-section h2 {
    text-align: left;
    display: block;
    border-bottom: none;
    font-size: 1.8rem;
    color: var(--color-secondary); /* 강조색 적용 */
}
.book-promo-section .buy-links {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.book-promo-section .buy-links a {
    background: var(--color-light-gray);
    color: var(--color-dark);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.9rem;
}
.book-promo-section .buy-links a:hover {
    background: #e0e0e0;
}

/* 10. 푸터 */
#footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* 11. 모바일 반응형 */
@media (max-width: 768px) {
    h2 {
        font-size: 1.8rem;
    }

    .book-promo-section {
        flex-direction: column;
        text-align: center;
    }
    .book-promo-section h2 {
        text-align: center;
    }
    .book-promo-section .promo-content {
        flex: 1;
    }
    .book-promo-section .buy-links {
        justify-content: center;
    }
}

/* ==================================================
  12. 상세 페이지 스타일 (수정됨)
==================================================
*/

.detail-page {
    align-items: flex-start;
    text-align: left;
}

.detail-page h2,
.detail-page h3,
.detail-page h4 {
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
}

.detail-page h2 {
    font-size: 2.2rem;
    /* 색상은 아래 클래스별로 지정 */
}

.detail-page h3 {
    font-size: 1.6rem;
    color: var(--color-dark);
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-light-gray);
    padding-bottom: 0.5rem;
}

.detail-page h4 {
    font-size: 1.2rem;
    font-weight: 700;
}

.detail-page p {
    max-width: none; /* 요청대로 너비 제한 제거 */
}

.detail-header {
    width: 100%;
    margin-bottom: 2rem;
    /* 테두리 색상은 아래 클래스별로 지정 */
    padding-bottom: 1.5rem;
}

/* 스크래치 페이지 테마 (레드) */
.detail-page-scratch h2,
.service-card:nth-of-type(1) h3 {
    color: #D9534F;
}
.detail-page-scratch .detail-header {
    border-bottom: 3px solid #D9534F;
}

/* AI Teading 페이지 테마 (블루) */
.detail-page-ai h2,
.service-card:nth-of-type(2) h3 {
    color: #4A90E2;
}
.detail-page-ai .detail-header {
    border-bottom: 3px solid #4A90E2;
}

/* Arcade Teading 페이지 테마 (그린) */
.detail-page-arcade h2,
.service-card:nth-of-type(3) h3 {
    color: #5CB85C;
}
.detail-page-arcade .detail-header {
    border-bottom: 3px solid #5CB85C;
}

.detail-header .detail-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--color-text);
    margin: 0;
}

/* 유튜브 영상 (반응형) */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
    overflow: hidden;
    width: 100%; /* 너비 100% */
    background: #000;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 다운로드 리스트 (너비 제한 제거) */
.download-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    max-width: none; /* 요청대로 너비 제한 제거 */
}
.download-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-light-gray);
}
.download-list li:first-child {
    border-top: 1px solid var(--color-light-gray);
}
.download-list li strong {
    color: var(--color-dark);
    margin-right: 0.75rem;
    display: inline-block;
    min-width: 150px;
}
.download-list li a {
    font-weight: 500;
}

/* 업데이트 내역 (너비 제한 제거) */
.update-notes {
    background: var(--color-light-gray);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    max-width: none; /* 요청대로 너비 제한 제거 */
    margin: 1rem 0;
}
.update-notes small {
    line-height: 1.7;
    font-size: 0.95rem;
}

/* 상세 갤러리 */
.detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    width: 100%;
}
.detail-gallery a {
    display: block;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}
.detail-gallery a:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}
.detail-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}