/* =====================================================================
   Joon Blog theme layer — Apple 다크 모드 문법
   기존 common/style/responsive.css 위에 마지막으로 로드되어 비주얼만 덮어쓴다.
   원칙: 순수 검정 배경, 채움색 카드(테두리 최소), 크고 단단한 제목, 넉넉한 여백,
        필(pill) 버튼, 글래스 헤더, 색은 절제(앰버는 포인트에만).
   ===================================================================== */
:root {
    --bg: #000000;
    --bg-2: #0d0d0f;
    --fill: #1c1c1e;
    --fill-2: #2c2c2e;
    --fill-3: #3a3a3c;
    --sep: rgba(84, 84, 88, 0.55);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;
    --accent: #ffae00;
    --accent-ink: #1a1200;
    --link: #2997ff;
    --radius: 18px;
    --radius-sm: 12px;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

/* hidden 속성이 display:flex 클래스에 밀리지 않도록 */
[hidden] {
    display: none !important;
}

/* ---------- base ---------- */
html {
    background: var(--bg);
}

body {
    background: var(--bg);
    color: var(--text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

::selection {
    background: rgba(255, 174, 0, 0.35);
}

* {
    scrollbar-color: var(--fill-3) transparent;
}

a {
    transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

h1, h2, h3, .h1, .h2, .h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

.highlight {
    color: var(--accent);
}

/* ---------- header (glass) ---------- */
.header {
    height: 56px;
    padding: 0 28px;
    background: rgba(0, 0, 0, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

main {
    margin-top: 56px;
}

.main_logo {
    width: auto;
    min-width: 140px;
    font-size: 1.05rem;
}

.main_logo span {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.main_logo .home_icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

.nav_list {
    gap: 2px;
}

.nav_list a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 0.86rem;
    font-weight: 500;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav_list a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.search_area {
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s, box-shadow 0.2s;
}

.search_area:focus-within {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.search_area > input {
    font-size: 0.9rem;
}

.search_area > input::placeholder {
    color: var(--text-3);
}

/* ---------- 검색 팝업 ---------- */
.popup::before {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.popup_wrapper {
    margin-top: 80px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(28, 28, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.popup_wrapper .search_area {
    max-width: none;
    background: rgba(255, 255, 255, 0.1);
}

.recommend_area h6,
.recent_search_area h6 {
    color: var(--text-3);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.recommend_area > ul > li {
    flex: 0 0 auto;
    padding: 5px 12px;
    background: var(--fill-2);
    color: var(--text);
    font-weight: 500;
}

.recent_search_area ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent_search_area li a {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text-2);
}

.recent_search_area li a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

/* ---------- 인트로 ---------- */
.intro {
    padding: 64px 0 56px;
    border-bottom: 1px solid var(--sep);
    border-radius: 0;
}

.intro .left {
    gap: 32px;
}

.intro .profile {
    max-width: 104px;
    max-height: 104px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.intro .intro_desc .h1 {
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.intro_tagline {
    margin-top: 8px;
    font-size: 1.15rem;
    color: var(--text-2);
}

.intro .social_group a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--fill);
    background-size: 18px;
    transition: transform 0.25s var(--ease), background-color 0.25s;
}

.intro .social_group a:hover {
    background-color: var(--fill-2);
    transform: scale(1.06);
}

.intro.sm {
    padding: 4px 0;
    border-bottom: 0;
}

.intro.sm .left .profile {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* ---------- 섹션 제목 ---------- */
.section {
    padding: 44px 0;
}

.section_title {
    margin-bottom: 24px;
}

h2.section_title {
    justify-content: flex-start;
    gap: 8px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section_title > h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2.section_title .icon_36 {
    width: 22px;
    height: 22px;
    margin-top: 3px;
    opacity: 0.5;
    transition: transform 0.25s var(--ease), opacity 0.25s;
}

a:hover > h2.section_title .icon_36 {
    transform: translateX(3px);
    opacity: 1;
}

/* ---------- 카드 ---------- */
.main_post {
    gap: 20px;
}

.main_post a {
    flex: 0 0 calc((100% - 40px) / 3);
}

.article {
    gap: 12px;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    transition: transform 0.4s var(--ease);
}

.article:hover {
    transform: translateY(-3px);
}

.article_img {
    border-radius: 16px;
    background: #0d0d0f;
}

.article_img img {
    object-fit: cover;
    transition: scale 0.7s var(--ease);
}

.article:hover .article_img img {
    scale: 1.04;
}

.article .article_desc {
    gap: 6px;
    padding: 4px 2px 8px;
}

.article .article_desc .h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.08rem;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.article_meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-3);
}

.article_meta .views {
    margin-left: auto;
}

/* 썸네일이 없는 글: 제목을 담은 타이틀 카드 (이미지 자리) */
.title_card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 20px 8%;
    background: radial-gradient(70% 70% at 50% 40%, #242427 0%, #0e0e10 65%, #000 100%);
    color: var(--text);
    text-align: center;
}

.title_card_brand {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-3);
}

.title_card_title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.03em;
    word-break: keep-all;
}

/* 타이틀 카드가 제목을 이미 보여주므로 카드 아래 제목은 숨기고 메타만 남긴다 */
.article.no_thumb .article_desc .h2 {
    display: none;
}

.head_post .left .title_card {
    height: 100%;
    aspect-ratio: 16 / 10 !important;
}

.head_post .left .title_card_title {
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    -webkit-line-clamp: 4;
}

.head_post .left .article.no_thumb .article_desc {
    padding-top: 40px;
}

.trending .thumb_placeholder {
    display: block;
    background: var(--fill) url('/images/opengraph/favicon.png') center / 28px no-repeat;
}

/* 인기 글 히어로 카드: 이미지 위에 제목 */
.head_post {
    gap: 20px;
}

.head_post .right {
    gap: 20px;
}

.head_post .left .article {
    position: relative;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
}

.head_post .left .article_img {
    height: 100%;
    border-radius: 0;
}

.head_post .left .article_img img {
    aspect-ratio: 16 / 10 !important;
}

.head_post .left .article_desc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 72px 28px 26px;
    gap: 8px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0.9) 100%);
}

.head_post .left .article_desc::before {
    content: attr(data-label);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.head_post .left .article_desc .h2 {
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.head_post .left .article_meta {
    color: var(--text-2);
}

/* ---------- Trending 랭킹 리스트 ---------- */
.trending {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 48px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trending li {
    border-bottom: 1px solid var(--sep);
}

.trending li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    color: var(--text);
    transition: opacity 0.2s;
}

.trending li a:hover {
    opacity: 0.75;
}

.trending .rank {
    flex: none;
    width: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-3);
    letter-spacing: -0.02em;
}

.trending .thumb {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--fill);
}

.trending .text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.trending .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.trending .meta {
    font-size: 0.8rem;
    color: var(--text-3);
}

/* ---------- 목록/검색 ---------- */
.sort {
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--fill);
}

.sort > a {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-2);
    transition: background 0.2s, color 0.2s;
}

.sort > a:hover {
    color: var(--text);
}

.sort > a.on {
    background: var(--fill-3);
    color: var(--text);
}

.result_count {
    margin-top: -8px;
}

.pagination li {
    width: 36px;
    height: 36px;
    margin: 0 3px;
    border-radius: 50%;
    color: var(--text-2);
}

.pagination li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pagination li:hover {
    background: var(--fill-2);
}

.pagination li.active {
    background: var(--text);
    color: #000;
    font-weight: 600;
}

/* ---------- 버튼 / 입력 ---------- */
.button {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--text);
    color: #000;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}

.button:hover {
    background: #ffffff;
}

.button:active {
    transform: scale(0.98);
}

.button.gray_800 {
    background: var(--fill-2);
    color: var(--text);
    border: 0;
}

.button.gray_800:hover {
    background: var(--fill-3);
}

.button.my_gray {
    background: var(--text);
    color: #000;
}

.button.my_gray:hover {
    background: #fff;
}

.input_black,
.hashtag_maker .input_group input {
    background: var(--fill);
    border: 0;
    border-radius: var(--radius-sm);
    transition: box-shadow 0.2s, background 0.2s;
}

.input_black::placeholder {
    color: var(--text-3);
}

.input_black:focus,
.hashtag_maker .input_group input:focus {
    background: var(--fill-2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

/* ---------- 글 페이지 ---------- */
.view_wrapper {
    gap: 40px;
    justify-content: center;
}

.view_wrapper .contents {
    flex: 0 1 780px;
    max-width: 780px;
    min-width: 0;
}

.post_tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 2px;
    padding: 0;
    list-style: none;
}

.post_tags .hashtag,
.hashtag_area .hashtag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--fill-2);
    font-size: 0.86rem;
    transition: background 0.2s;
}

.post_tags .hashtag:hover,
.hashtag_area .hashtag:hover {
    background: var(--fill-3);
}

.post_tags .hashtag::before,
.hashtag_area .hashtag::before {
    color: var(--text-3);
}

.post_type {
    color: var(--text-3);
}

.view_title {
    gap: 20px;
    margin-top: 16px;
}

.view_title .title {
    font-size: clamp(2rem, 4.2vw, 2.9rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.view_title .banner {
    background: var(--fill);
    color: var(--text-2);
    font-size: 0.9rem;
}

.view_content {
    margin-top: 32px;
    gap: 32px;
}

.view_content > img.image_fit {
    border-radius: var(--radius) !important;
}

.ql-editor-view {
    font-size: 1.06rem;
    line-height: 1.8;
    color: #e8e8ed;
    letter-spacing: -0.005em;
}

.ql-editor-view h1,
.ql-editor-view h2,
.ql-editor-view h3,
.ql-editor-view h4 {
    margin: 2em 0 0.7em;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.ql-editor-view h1 {
    font-size: 1.9rem;
}

.ql-editor-view h2 {
    font-size: 1.55rem;
}

.ql-editor-view h3 {
    font-size: 1.25rem;
}

.ql-editor-view p {
    margin-bottom: 1.1em;
}

.ql-editor-view a {
    color: var(--link);
    text-decoration: none;
}

.ql-editor-view a:hover {
    text-decoration: underline;
}

.ql-editor-view blockquote {
    margin: 1.5em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--fill-3);
    color: var(--text-2);
    font-size: 1.15rem;
    font-weight: 500;
    font-style: normal;
}

.ql-editor-view pre.ql-syntax,
.ql-editor-view .ql-code-block-container,
.view_content .ql-code-block-container {
    margin: 1.5em 0;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--fill) !important;
    font-size: 0.9rem;
    line-height: 1.65;
}

.ql-editor-view img {
    border-radius: 14px;
}

.ql-editor-view ul,
.ql-editor-view ol {
    margin-bottom: 1.1em;
}

.ql-editor-view li {
    margin: 0.3em 0;
}

.share_group {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--sep);
}

.post_nav {
    padding-top: 0;
    border-top: 0;
}

.post_nav a {
    background: var(--fill);
    border: 0;
    transition: background 0.2s, transform 0.3s var(--ease);
}

.post_nav a:hover {
    background: var(--fill-2);
    transform: translateY(-2px);
}

.back_to_list a {
    color: var(--text-2);
}

/* ---------- 댓글 ---------- */
.comments {
    border-top: 1px solid var(--sep);
}

.comment {
    background: var(--fill);
    border: 0;
}

.comment.owner {
    border: 0;
    background: linear-gradient(180deg, rgba(255, 174, 0, 0.07), var(--fill) 70%);
}

.comment_notice.ok {
    background: rgba(48, 209, 88, 0.14);
    color: #30d158;
}

.comment_notice.error {
    background: rgba(255, 69, 58, 0.14);
    color: #ff453a;
}

.comment_form textarea.input_black {
    min-height: 110px;
}

/* ---------- 작성/수정 ---------- */
.file_wrapper,
.ql-toolbar,
.ql-container {
    border-color: var(--fill-3) !important;
}

.ql-toolbar {
    background: var(--fill);
}

.write_title input.title {
    font-weight: 700;
    letter-spacing: -0.035em;
}

.hashtag_area .hashtag {
    cursor: pointer;
}

/* ---------- 로그인 / 404 ---------- */
.login_group {
    padding: 44px 32px;
    border-radius: 24px;
    background: var(--fill);
}

.login_group h1 {
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.not_found_box::before {
    content: '404';
    font-size: clamp(5rem, 15vw, 8rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
    color: var(--fill-3);
}

.not_found_box h1 {
    font-weight: 700;
    letter-spacing: -0.03em;
}

.not_found_box h6 {
    color: var(--text-2);
}

/* ---------- 푸터 ---------- */
.footer {
    margin-top: 56px;
    border-top: 1px solid var(--sep);
    background: var(--bg);
}

.footer .top,
.footer .bottom {
    width: 100%;
    max-width: 1188px;
    margin: 0 auto;
}

.footer .top {
    padding: 40px 24px 28px;
}

.footer .bottom {
    padding: 16px 24px 40px;
    border-top: 1px solid var(--sep);
    color: var(--text-3);
}

.footer .main_logo {
    font-size: 1rem;
}

.footer h5 {
    color: var(--text-3);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer h6 {
    color: var(--text-2);
    font-size: 0.9rem;
}

.footer .bottom .h5 {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

.footer .policies a {
    color: var(--text-3);
    font-size: 0.8rem;
}

.footer .policies a:hover {
    color: var(--text);
}

.footer .social_group a {
    opacity: 0.6;
}

.footer .social_group a:hover {
    opacity: 1;
}

/* ---------- 빈 상태 ---------- */
.empty_state {
    border-radius: var(--radius);
    background: var(--fill);
}

/* ---------- 반응형 ---------- */
@media screen and (max-width: 768px) {
    .main_post a {
        flex: 0 0 calc((100% - 20px) / 2);
    }
}

@media screen and (max-width: 567px) {
    .header {
        height: 56px;
        padding: 12px 20px;
    }

    .header.on {
        height: 300px;
    }

    main {
        margin-top: 56px;
    }

    .nav_list a {
        display: block;
        padding: 10px 12px;
        font-size: 1rem;
    }

    .intro {
        padding: 40px 0 32px;
    }

    .main_post a {
        flex: 1 0 100%;
    }

    .head_post .left .article_desc {
        padding: 56px 18px 18px;
    }

    .trending {
        grid-template-columns: 1fr;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
