/* ================================================
   Brand News Detail - Notion Style
   ================================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: #ffffff;
    color: #37352f;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   Layout - Single Column (Notion Style)
   ================================================ */

.content-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0;
}

/* Blog Container - Centered Single Column */
.blog-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================================================
   Page Navigation
   ================================================ */

.page-nav {
    padding: 24px 0 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9b9a97;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
    padding: 6px 12px;
    margin-left: -12px;
    border-radius: 6px;
}

.back-link:hover {
    color: #37352f;
    background-color: rgba(55, 53, 47, 0.08);
}

.back-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ================================================
   Cover Image (Notion Style - Square)
   ================================================ */

.cover-image-container {
    /* blog-container 패딩을 무시하고 확장 */
    width: calc(100% + 48px);
    margin-left: -24px;
    aspect-ratio: 1 / 1;
    max-height: 400px;
    margin-bottom: 0;
    padding: 0;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f7f6f3 0%, #eae9e6 100%);
    position: relative;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: opacity 0.3s ease;
}

/* 이미지 로딩 애니메이션 */
.cover-image.loading {
    opacity: 0;
}

.cover-image.loaded {
    opacity: 1;
}

/* 커버 이미지가 있을 때 아이콘 오버랩 효과 */
.blog-container.has-cover-image .page-header {
    margin-top: -56px;
    position: relative;
    z-index: 2;
}

.blog-container.has-cover-image .page-icon {
    /* 이모지만 표시 (배경/그림자 없음) */
}

/* ================================================
   Page Header
   ================================================ */

.page-header {
    padding: 0 0 24px 0;
}

.page-icon {
    font-size: 78px;
    line-height: 1;
    margin-bottom: 16px;
    display: block;
}

.page-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #37352f;
    margin-bottom: 8px;
    word-break: keep-all;
}

.page-description {
    font-size: 16px;
    line-height: 1.6;
    color: #9b9a97;
    font-weight: 400;
    margin: 0;
}

/* Hide if empty */
.page-description:empty {
    display: none;
}

/* ================================================
   Page Properties (Notion Style)
   ================================================ */

.page-properties {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
    margin-bottom: 24px;
    border-top: 1px solid rgba(55, 53, 47, 0.09);
    border-bottom: 1px solid rgba(55, 53, 47, 0.09);
}

.property {
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
    min-height: 32px;
}

.property-icon {
    width: 24px;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 1;
}

.property-label {
    width: 100px;
    font-size: 14px;
    color: #9b9a97;
    flex-shrink: 0;
}

.property-value {
    flex: 1;
    font-size: 14px;
    color: #37352f;
}

/* Company Link Style */
.company-name-link {
    color: #37352f;
    text-decoration: none;
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.company-name-link:hover {
    background-color: rgba(55, 53, 47, 0.08);
}

/* Category Value */
.category-value {
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(227, 226, 224, 0.5);
    border-radius: 4px;
    font-size: 14px;
}

/* Tags in Properties */
.property-tags .property-value {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background-color: rgba(206, 205, 202, 0.5);
    color: #37352f;
    font-size: 14px;
    font-weight: 400;
    border-radius: 4px;
    border: none;
    transition: background-color 0.15s ease;
}

.tag:hover {
    background-color: rgba(206, 205, 202, 0.8);
}

/* ================================================
   Callout (Excerpt)
   ================================================ */

.page-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 16px 12px;
    background-color: rgba(241, 241, 239, 1);
    border-radius: 4px;
    margin-bottom: 32px;
}

.callout-icon {
    font-size: 20px;
    line-height: 1.4;
    flex-shrink: 0;
}

.callout-text {
    font-size: 16px;
    line-height: 1.6;
    color: #37352f;
    margin: 0;
}

/* ================================================
   Article Content (Notion Typography)
   ================================================ */

.page-content,
.article-content {
    width: 100%;
    margin: 0;
    padding: 0 0 48px 0;
    font-size: 16px;
    color: #37352f;
}

/* Paragraphs */
.article-content p {
    font-size: 16px;
    line-height: 1.8;
    color: #37352f;
    margin-bottom: 16px;
    word-break: keep-all;
}

/* Headings */
.article-content h1 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #37352f;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-top: 16px;
}

.article-content h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #37352f;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: none;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #37352f;
    margin-top: 32px;
    margin-bottom: 12px;
}

.article-content h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #37352f;
    margin-top: 24px;
    margin-bottom: 8px;
}

/* Bold & Italic */
.article-content strong {
    font-weight: 600;
    color: #37352f;
}

.article-content em {
    font-style: italic;
}

/* Links */
.article-content a {
    color: #37352f;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(55, 53, 47, 0.4);
    transition: text-decoration-color 0.15s ease;
}

.article-content a:hover {
    text-decoration-color: #37352f;
}

/* Lists */
.article-content ul,
.article-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article-content li {
    font-size: 16px;
    line-height: 1.8;
    color: #37352f;
    margin-bottom: 4px;
    padding-left: 4px;
}

.article-content li::marker {
    color: #37352f;
}

.article-content li strong {
    font-weight: 600;
}

/* Blockquote - Notion Style */
.article-content blockquote {
    margin: 24px 0;
    padding: 0 0 0 16px;
    border-left: 3px solid #37352f;
    background: transparent;
    border-radius: 0;
}

.article-content blockquote p {
    font-size: 16px;
    line-height: 1.8;
    color: #37352f;
    font-style: normal;
    margin: 0;
}

/* Code - Inline */
.article-content code {
    font-family: 'SFMono-Regular', Menlo, Consolas, 'PT Mono', 'Liberation Mono', Courier, monospace;
    font-size: 85%;
    background-color: rgba(135, 131, 120, 0.15);
    color: #eb5757;
    padding: 2px 5px;
    border-radius: 4px;
}

/* Code Blocks */
.article-content pre {
    background-color: #f7f6f3;
    border: none;
    border-radius: 4px;
    padding: 20px 24px;
    margin: 24px 0;
    overflow-x: auto;
}

.article-content pre code {
    font-family: 'SFMono-Regular', Menlo, Consolas, 'PT Mono', 'Liberation Mono', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #37352f;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* 코드 블록 내 링크 비활성화 */
.article-content pre a,
.article-content code a {
    pointer-events: none;
    cursor: text;
    color: inherit;
    text-decoration: none;
}

/* Images in Content */
.article-content img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 24px 0;
    display: block;
}

/* Horizontal Rule */
.article-content hr {
    border: none;
    border-top: 1px solid rgba(55, 53, 47, 0.09);
    margin: 32px 0;
}

/* Highlight/Mark (형광펜) - Tiptap Editor */
.article-content mark {
    background-color: #fef08a;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Task List (할 일 목록) - Tiptap Editor */
.article-content ul[data-type="taskList"] {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

.article-content ul[data-type="taskList"] li[data-type="taskItem"] {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    margin: 0;
}

.article-content ul[data-type="taskList"] li[data-type="taskItem"] label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.article-content ul[data-type="taskList"] li[data-type="taskItem"] input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 4px;
    flex-shrink: 0;
    accent-color: #2eaadc;
    cursor: pointer;
}

.article-content ul[data-type="taskList"] li[data-type="taskItem"][data-checked="true"] span {
    text-decoration: line-through;
    color: #9b9a97;
}

.article-content ul[data-type="taskList"] li[data-type="taskItem"] span {
    flex: 1;
    line-height: 1.6;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.article-content th,
.article-content td {
    border: 1px solid rgba(55, 53, 47, 0.09);
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
}

.article-content th {
    background-color: rgba(241, 241, 239, 1);
    font-weight: 600;
}

/* ================================================
   Read More Section
   ================================================ */

.read-more-section {
    padding: 48px 0;
    border-top: 1px solid rgba(55, 53, 47, 0.09);
}

.read-more-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #37352f;
}

/* List Style - Notion Style */
.read-more-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.read-more-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    padding: 12px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    border: none;
    background: transparent;
}

.read-more-card:hover {
    background: rgba(55, 53, 47, 0.04);
}

.read-more-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.read-more-content {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.read-more-card-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #37352f;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-card-excerpt {
    font-size: 13px;
    line-height: 1.4;
    color: #9b9a97;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-card-date {
    font-size: 12px;
    color: #b4b4b4;
}

/* ================================================
   Loading State
   ================================================ */

.loading-state {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.loading-state.active {
    display: flex;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(55, 53, 47, 0.1);
    border-top-color: #37352f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================================
   Responsive Design
   ================================================ */

/* Mobile */
@media (max-width: 768px) {
    .blog-container {
        padding: 0 16px;
    }

    /* 커버 이미지 조정 */
    .cover-image-container {
        width: calc(100% + 32px);
        margin-left: -16px;
        aspect-ratio: 1 / 1;
        max-height: 350px;
        border-radius: 0 0 10px 10px;
    }

    .blog-container.has-cover-image .page-header {
        margin-top: -44px;
    }

    .blog-container.has-cover-image .page-icon {
        /* 이모지만 표시 */
    }

    .page-icon {
        font-size: 60px;
    }

    .page-title {
        font-size: 32px;
    }

    .page-description {
        font-size: 15px;
    }

    .property {
        flex-wrap: wrap;
    }

    .property-label {
        width: 80px;
    }

    .article-content p {
        font-size: 15px;
    }

    .article-content h2 {
        font-size: 22px;
        margin-top: 32px;
    }

    .article-content h3 {
        font-size: 18px;
        margin-top: 24px;
    }

    .read-more-card {
        gap: 12px;
        padding: 10px 6px;
        margin: 0 -6px;
    }

    .read-more-image {
        width: 64px;
        height: 48px;
    }

    .read-more-section {
        padding: 32px 0;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    /* 커버 이미지 조정 */
    .cover-image-container {
        aspect-ratio: 1 / 1;
        max-height: 300px;
        border-radius: 0 0 8px 8px;
    }

    .blog-container.has-cover-image .page-header {
        margin-top: -36px;
    }

    .blog-container.has-cover-image .page-icon {
        /* 이모지만 표시 */
    }

    .page-icon {
        font-size: 48px;
    }

    .page-title {
        font-size: 28px;
    }

    .property {
        padding: 8px 0;
    }

    .property-icon {
        width: 20px;
    }

    .property-label {
        width: 70px;
        font-size: 13px;
    }

    .property-value {
        font-size: 13px;
    }
}
