/*
Theme Name: GeneratePress Child - TC Notes
Description: Giao diện tĩnh lặng và tối giản dành cho TC Notes
Template: generatepress
Version: 1.0.0
*/

/* ==========================================================================
   1. CÁC BIẾN CỐT LÕI (ROOT VARIABLES)
   ========================================================================== */
:root {
    --tc-bg-color: #F4F1EA; 
    --tc-text-main: #2C2825; 
    --tc-text-muted: #777777; 
    --tc-border: #E8E5DF; 

    --tc-font-body: system-ui, -apple-system, sans-serif;
    --tc-font-mono: "Courier New", Courier, monospace;
}

/* ==========================================================================
   2. THIẾT LẬP NỀN TẢNG (BASE)
   ========================================================================== */
html {
    font-size: 100%; 
}

body {
    background-color: var(--tc-bg-color);
    color: var(--tc-text-main);
    font-family: var(--tc-font-mono); 
    font-size: 1rem; 
    line-height: 1.7; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

/* CHUẨN HÓA THẺ P THEO YÊU CẦU */
p {
    font-family: var(--tc-font-mono);
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.4;
    color: var(--tc-text-main);
    margin-bottom: 1.6em; 
}

a {
    color: var(--tc-text-main);
    text-decoration: none;
    border-bottom: 1px solid transparent; 
    transition: all 0.3s ease;
}

a:hover {
    border-bottom: 1px solid var(--tc-text-main); 
}
b, strong {
    font-weight: 700;
}
/* CHUẨN HÓA CÁC THẺ TIÊU ĐỀ */
h1, h3, h4, h5, h6 {
    font-family: var(--tc-font-mono);
    font-weight: 700; 
    color: var(--tc-text-main);
    line-height: 1.3;
    margin-top: 2.5em; 
    margin-bottom: 1em;
}

/* CHUẨN HÓA THẺ H2 THEO YÊU CẦU */
h2 {
    font-family: var(--tc-font-mono);
    font-size: 2.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--tc-text-main);
    line-height: 1.3;
    margin-top: 2.5em; 
    margin-bottom: 1.5rem;
}

h1 { font-size: 2.2rem; margin-top: 0; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.25rem; }

/* ==========================================================================
   3. CUSTOM HEADER & MENU (STATIC & STICKY)
   ========================================================================== */
.tc-custom-header {
    background-color: var(--tc-bg-color); 
    padding: 1.5rem 1.25rem; 
    border-bottom: 1px solid var(--tc-border);
    position: sticky; 
    top: 0;
    z-index: 1000; 
    transition: padding 0.3s ease, box-shadow 0.3s ease; 
}

.tc-custom-header.is-sticky {
    padding: 0.5rem 1.25rem; 
    background-color: rgba(244, 241, 234, 0.95); 
    backdrop-filter: blur(5px); 
}

.tc-header-inner {
    max-width: 75rem; 
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; 
}

.tc-logo a {
    display: block;
    line-height: 0; 
    border-bottom: none; 
}

.tc-logo-img-placeholder {
    max-width: 5.375rem; 
    height: auto;
    border-radius: 2px;
}

.tc-main-nav {
    display: flex;
    align-items: center;
    gap: 2rem; 
}

.tc-main-nav a {
    font-size: 1.4rem; 
    text-transform: lowercase; 
    border-bottom: none;
}

.tc-main-nav a:hover {
    opacity: 0.6; 
}

.tc-main-nav a.tc-nav-btn {
    padding: 0.4em 1em; 
    border: 1px solid var(--tc-text-main);
    border-radius: 2px;
}

.tc-main-nav a.tc-nav-btn:hover {
    background-color: var(--tc-text-main);
    color: var(--tc-bg-color); 
    opacity: 1;
}

.tc-menu-toggle-checkbox { display: none; }

.tc-menu-toggle-label {
    display: none; 
    flex-direction: column;
    justify-content: space-between;
    width: 1.75rem; 
    height: 1.25rem; 
    cursor: pointer;
    z-index: 100;
}

.tc-hamburger-line {
    display: block;
    width: 100%;
    height: 2px; 
    background-color: var(--tc-text-main);
    transition: all 0.3s ease;
}

@media (max-width: 64em) { 
    .tc-menu-toggle-label {
        display: flex; 
    }

    .tc-main-nav {
        position: absolute;
        top: 100%; 
        right: 0;
        background-color: var(--tc-bg-color);
        width: 100%;
        flex-direction: column;
        align-items: flex-end; 
        padding: 1.25rem 1.25rem 2rem 1.25rem;
        gap: 1.25rem; 
        border-bottom: 1px solid var(--tc-border);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); 
        
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.625rem); 
        transition: all 0.3s ease;
        z-index: 99;
    }

    .tc-menu-toggle-checkbox:checked ~ .tc-main-nav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .tc-menu-toggle-checkbox:checked + .tc-menu-toggle-label .line-1 {
        transform: translateY(9px) rotate(45deg);
    }
    .tc-menu-toggle-checkbox:checked + .tc-menu-toggle-label .line-2 {
        opacity: 0; 
    }
    .tc-menu-toggle-checkbox:checked + .tc-menu-toggle-label .line-3 {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* ==========================================================================
   4. CUSTOM FOOTER (SOCIAL LINKS)
   ========================================================================== */
.tc-custom-footer {
    background-color: var(--tc-bg-color); 
    padding: 6rem 1.25rem 4rem 1.25rem; 
    border-top: 1px solid var(--tc-border); 
}

.tc-footer-inner {
    max-width: 75rem;
    margin: 0 auto;
    text-align: center;
}

.tc-social-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
    gap: 2.5rem; 
}

.tc-social-nav a {
    font-size: 1.125rem; 
    color: var(--tc-text-muted); 
    text-transform: lowercase;
    border-bottom: none;
}

.tc-social-nav a:hover {
    color: var(--tc-text-main); 
}

@media (max-width: 48em) { 
    .tc-custom-footer {
        padding: 4rem 1.25rem 3rem 1.25rem;
    }
    .tc-social-nav {
        gap: 1.5rem; 
    }
}

/* ==========================================================================
   5. HOMEPAGE TEMPLATE
   ========================================================================== */
.tc-home-wrapper {
    max-width: 60rem; 
    margin: 0 auto;
    padding: 4rem 1.25rem;
}

/* Profile Header */
.tc-profile-header {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 5rem;
    padding: 3rem;
    background-color: #E8E5DF; 
    border-radius: 4px;
}
.tc-profile-avatar {
    width: 30%;
}
.tc-profile-avatar img {
    width: 9.375rem;
    border-radius: 50%; 
    border: 2px solid var(--tc-text-main);
    padding: 4px;
}

.tc-profile-info h1 {
    text-align: left;
    margin-bottom: 0.5rem;
}

.tc-tagline-text {
    font-family: var(--tc-font-mono);
    font-size: 1.425rem;
    margin-bottom: 0.5rem;
}

.tc-role {
    font-family: var(--tc-font-mono);
    font-style: italic;
    color: var(--tc-text-muted);
    font-size: 1.125rem;
}

/* Intro Quote */
.tc-intro-quote {
    font-family: var(--tc-font-body); /* Cho quote mảnh mai dễ đọc */
    font-style: italic;
    font-weight: 200;
    border-left: 2px solid var(--tc-text-main);
    padding-left: 1.5rem;
    margin: 3rem auto;
    max-width: 45rem;
    font-size: 1.125rem;
    line-height: 1.8;
}

.tc-intro-quote cite {
    font-family: var(--tc-font-mono); /* Tên tác giả giữ mono cho cứng cáp */
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: 700;
    color: var(--tc-text-muted);
}

/* Layout structural classes */
.tc-home-intro,
.tc-grid-heading {
    max-width: 60rem; 
    margin: 0 auto 5rem auto;
}

.tc-home-grid {
    margin-bottom: 6rem;
    border-top: 1px solid var(--tc-border);
    border-bottom: 1px solid var(--tc-border);
    padding: 0 0 4rem 0;
}

.tc-grid-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 3rem;
}

.tc-grid-item {
    text-align: center;
}

.tc-grid-item h3 {
    text-align: center;
    margin-top: 0;
}

.tc-featured-work {
    margin-bottom: 6rem;
}

.tc-featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 3rem;
}

.tc-featured-card {
    background-color: transparent;
    transition: all 0.3s ease;
}

.tc-featured-card h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.tc-featured-card:hover h4 {
    color: #444; 
}

/* Khung tranh Cafe Gallery */
.tc-item-image,
.tc-card-image {
    margin-bottom: 2rem;
    line-height: 0; 
    background-color: #FFFFFF; 
    padding: 0.75rem; 
    border: 1px solid #E2DFD9; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tc-item-image img,
.tc-card-image img {
    width: 100%;
    height: auto;
    border-radius: 0; 
    border: 1px solid #F0EEEA; 
}

.tc-grid-item:hover .tc-item-image,
.tc-featured-card:hover .tc-card-image {
    transform: translateY(-5px); 
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08); 
}

/* Recent Posts */
.tc-home-recent {
    margin-bottom: 3rem;
    max-width: 45rem; 
    margin-left: auto;
    margin-right: auto;
}

.tc-recent-list {
    list-style: none;
    padding: 0;
    margin: 0 0 3rem 0;
}

.tc-recent-list li {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px dashed var(--tc-border);
    padding-bottom: 0.5rem;
}

.tc-post-date {
    font-size: 0.9rem;
    color: var(--tc-text-muted);
    flex-shrink: 0; 
}

.tc-post-title:hover {
    opacity: 0.6;
}

.tc-read-more {
    text-align: right;
}

/* Responsive */
@media (max-width: 48em) { 
    .tc-profile-header {
        flex-direction: column; 
        text-align: center;
        gap: 2rem;
        padding: 2rem 1.25rem;
    }
    
    .tc-profile-info h1 {
        text-align: center;
    }

    .tc-grid-columns, 
    .tc-featured-grid {
        grid-template-columns: 1fr; 
        gap: 3rem;
    }
    
    .tc-grid-item h3 {
        text-align: center; 
    }

    .tc-recent-list li {
        flex-direction: column;
        gap: 0.25rem;
    }
    .tc-profile-avatar {
        width: 100%;
    }
}

/* ==========================================================================
   BỨC TRANH TRÍCH DẪN (QUOTE FRAME)
   ========================================================================== */
.tc-quote-frame {
    margin: 4rem auto;
    max-width: 50rem;
    background-color: #FFFFFF; 
    padding: 0.75rem; /* Viền Passepartout trắng giống khung cafe */
    border: 1px solid #E2DFD9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tc-quote-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08);
}

.tc-quote-image-wrap {
    position: relative;
    width: 100%;
    border: 1px solid #F0EEEA; /* Mép phân cách mỏng */
    background-color: #000000; /* Nền đen lót dưới cùng */
}

.tc-quote-image-wrap img {
    width: 100%;
    height: auto;
    min-height: 250px;
    object-fit: cover;
    display: block;
    opacity: 0.5; /* Làm mờ bức ảnh sóng biển để làm nổi bật chữ trắng */
}

.tc-quote-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 4rem;
    background: rgba(0, 0, 0, 0.3); /* Phủ thêm một lớp màu tối */
}

.tc-quote-overlay blockquote {
    font-family: var(--tc-font-body);
    font-size: 1.25rem;
    font-weight: 200;
    font-style: italic;
    color: #FFFFFF; /* Chữ màu trắng muốt */
    text-align: center;
    margin: 0;
    line-height: 1.7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); /* Đổ bóng chữ để dễ đọc trên nền ảnh */
}

.tc-quote-overlay cite {
    font-family: var(--tc-font-mono);
    display: block;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-style: normal;
    color: #E8E5DF; /* Chữ tên tác giả hơi ngả màu giấy cổ */
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 48em) {
    .tc-quote-overlay {
        padding: 1.5rem;
    }
    .tc-quote-overlay blockquote {
        font-size: 1rem;
        line-height: 1.3;
        padding: 5px;
    }
}

/* ==========================================================================
   GIAO DIỆN ĐỌC BÀI VIẾT - THÂN TRẦN (SINGLE POST) single.php
   ========================================================================== */

.tc-reading-room {
    max-width: 45rem; /* ~720px: Giới hạn hoàn hảo cho mắt đọc */
    margin: 0 auto;
    padding: 5rem 1.5rem;
}

.tc-article-header {
    text-align: left; /* Đưa mọi thứ về bên trái cho mộc mạc */
    margin-bottom: 3rem;
}

.tc-date {
    display: inline-block;
    font-family: var(--tc-font-mono), monospace; /* Font máy đánh chữ */
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
}

.tc-title {
    font-size: 2.5rem;
    line-height: 1.3;
    margin: 0;
    color: #222;
}

/* Ảnh đại diện nếu có */
.tc-featured-image {
    margin: 0 0 3rem 0;
}
.tc-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 4px; /* Bo góc cực nhẹ, không làm lố */
}

/* ĐỊNH DẠNG NỘI DUNG CHỮ & ẢNH TRONG BÀI */
.tc-content {
    font-size: 1.15rem; /* Chữ to, rõ ràng */
    line-height: 1.8;
    color: #333;
}

.tc-content p {
    margin-bottom: 1.5rem;
}

/* Hình ảnh chèn trong bài viết */
.tc-content figure, 
.tc-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    display: block;
}

/* Định dạng thẻ H2, H3 trong bài viết (SEO) */
.tc-content h2 {
    font-size: 1.75rem;
    margin: 3rem 0 1rem 0;
    color: #111;
}

.tc-content h3 {
    font-size: 1.35rem;
    margin: 2rem 0 1rem 0;
}

/* Định dạng Link SEO (đỏ bã trầu) mượt mà */
.tc-content a {
    color: #5f0808;
    text-decoration: none;
    border-bottom: 1px solid rgba(95, 8, 8, 0.4);
    transition: all 0.3s ease;
}

.tc-content a:hover {
    color: #3a0505;
    background-color: rgba(95, 8, 8, 0.03);
    border-bottom: 1px solid #5f0808;
}

/* Điều hướng cuối bài */
.tc-article-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.tc-post-navigation {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.tc-post-navigation a {
    color: #555;
    text-decoration: none;
    border-bottom: none; /* Bỏ gạch chân cho link điều hướng */
}

.tc-post-navigation a:hover {
    color: #000;
}

/* Sapo (Đoạn mở đầu in nghiêng, viền nhấn) */
.sapo-part p {
    font-style: italic;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 2px solid #2c2825;
    padding-left: 1rem;
    margin-bottom: 2.5rem;
}

/* Responsive cho Mobile */
@media (max-width: 768px) {
    .tc-reading-room {
        padding: 3rem 1.2rem;
    }
    .tc-title {
        font-size: 2rem;
    }
    .tc-post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ==========================================================================
   BỔ SUNG MỚI: KHUNG TRANH 3:2 & NÚT BẤM
   ========================================================================== */

/* 1. Khung tranh hiển thị hình ảnh tự động cắt 3:2 */
.tc-picture-frame {
    margin: 3rem 0;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #eee;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    text-align: center;
    clear: both; /* Đảm bảo không bị đè bởi ảnh float */
}

.tc-picture-frame img {
    display: block;
    margin: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.tc-picture-frame figcaption {
    font-family: var(--tc-font-mono), monospace;
    font-size: 0.85rem;
    color: var(--tc-text-muted);
    margin-top: 10px;
    font-style: normal;
}

/* 2. Class đẩy ảnh sang một bên, bo nhỏ 50% (Cho các chi tiết nhỏ đắt giá) */
@media (min-width: 48em) {
    .tc-picture-frame.tc-frame-right {
        width: 50%;
        float: right;
        margin: 0.5rem 0 1.5rem 2rem;
        clear: none;
    }
    .tc-picture-frame.tc-frame-left {
        width: 50%;
        float: left;
        margin: 0.5rem 2rem 1.5rem 0; /* Đổi margin để đẩy text ra xa mép phải của ảnh */
        clear: none;
    }
}

/* 3. Nút bấm tối giản trong bài viết */
.tc-content .tc-btn {
    display: inline-block;
    font-family: var(--tc-font-mono), monospace;
    font-size: 0.9rem;
    color: var(--tc-text-main);
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--tc-text-main);
    padding: 0.8rem 2rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
    background-color: transparent;
}

.tc-content .tc-btn:hover {
    background-color: var(--tc-text-main);
    color: var(--tc-bg-color);
}

/* ==========================================================================
   CÂU TRÍCH DẪN ĐẮT GIÁ TRONG BÀI VIẾT (PULL QUOTE) - BẢN EDITORIAL
   ========================================================================== */
.tc-content .tc-pull-quote {
    position: relative;
    font-style: italic;
    font-weight: 500;
    font-size: 1.45rem;
    text-align: center;
    margin: 4.5rem auto;
    padding: 2.5rem 1.5rem; /* Tạo không gian thở bên trong 2 đường kẻ */
    color: #5f0808;
    max-width: 85%;
    line-height: 1.6;
    border-top: 1px solid rgba(95, 8, 8, 0.15); /* Đường viền trên mờ tinh tế */
    border-bottom: 1px solid rgba(95, 8, 8, 0.15); /* Đường viền dưới mờ tinh tế */
}

/* Tạo dấu ngoặc kép khổng lồ, in chìm nghệ thuật */
.tc-content .tc-pull-quote::before {
    content: "\201C"; /* Mã CSS cho dấu ngoặc kép mở */
    display: block;
    font-family: Georgia, "Times New Roman", serif; /* Cố tình dùng font Serif để nét ngoặc kép được cong và sang trọng */
    font-size: 5rem;
    color: rgba(95, 8, 8, 0.15); /* Màu đỏ bã trầu nhưng làm mờ đi 85% để in chìm */
    line-height: 0;
    margin-top: -0.5rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   6. GIAO DIỆN TRANG SILO DÙNG CHUNG (TRAVEL, INSIGHT, WORK, BLOGS)
   ========================================================================== */
.tc-silo-container {
    max-width: 60rem; 
    margin: 0 auto;
    padding: 4rem 1.25rem 6rem 1.25rem;
}

/* Phần Header & Sapo giới thiệu */
.tc-silo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tc-silo-title {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.tc-silo-description {
    max-width: 48rem;
    margin: 0 auto;
    font-size: 1.15rem;
    color: var(--tc-text-muted);
}

.tc-silo-description p {
    margin-bottom: 1rem;
}

/* Đường kẻ phân cách */
.tc-silo-divider {
    border: 0;
    border-top: 1px dashed var(--tc-border);
    width: 30%;
    margin: 3rem auto 4rem auto;
}

/* Lưới bài viết (Grid 2 cột) */
.tc-silo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem 3rem;
}

.tc-silo-item {
    display: flex;
    flex-direction: column;
}

/* Hiệu ứng Khung tranh (Passepartout) */
.tc-silo-thumbnail {
    margin-bottom: 1.5rem;
    background-color: #FFFFFF; 
    padding: 0.75rem; 
    border: 1px solid #E2DFD9; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tc-silo-item:hover .tc-silo-thumbnail {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08); 
}

.tc-silo-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2; 
    object-fit: cover;
    border: 1px solid #F0EEEA; 
    display: block;
}

/* Phần Text thông tin bài viết */
.tc-silo-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Ép thẻ H2 trong Grid về căn trái */
.tc-silo-info .tc-silo-post-title {
    font-size: 1.45rem;
    text-align: left;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.tc-silo-info .tc-silo-post-title a {
    color: var(--tc-text-main);
    border-bottom: 2px solid transparent;
}

/* Hover mượt mà với màu đỏ bã trầu */
.tc-silo-info .tc-silo-post-title a:hover {
    color: #5f0808;
    border-bottom: 2px solid #5f0808;
}

.tc-silo-excerpt {
    font-size: 1.05rem;
    color: var(--tc-text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

.tc-silo-empty {
    text-align: center;
    font-style: italic;
    color: var(--tc-text-muted);
    grid-column: 1 / -1; /* Ép nó nằm giữa cả 2 cột nếu không có bài */
}

/* Responsive cho Mobile */
@media (max-width: 48em) {
    .tc-silo-grid {
        grid-template-columns: 1fr; 
        gap: 3rem;
    }
    .tc-silo-title {
        font-size: 2.2rem;
    }
    .tc-silo-container {
        padding-top: 2rem;
    }
}