/* ==========================================================================
   TƯỞNG NHỚ PLUGIN - FRONTEND STYLESHEET
   ========================================================================== */

:root {
    --tn-banner-bg: #FFF9E6;
    --tn-primary-color: #8B0000;
    --tn-today-border: #8B0000;
    --tn-title-color: #111111;
}

.tn-archive-wrapper,
.tn-single-wrapper {
    color: #333333;
    line-height: 1.6;
    box-sizing: border-box;
}

.tn-archive-wrapper *,
.tn-single-wrapper * {
    box-sizing: inherit;
}

.tn-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* ==========================================================================
   1. TOP BANNER: NGÀY GIỖ TRONG THÁNG
   ========================================================================== */

.tn-banner-block {
    background-color: var(--tn-banner-bg);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.tn-banner-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

/* Today / Highlighted Item Box */
.tn-highlight-item {
    margin-bottom: 22px;
}

.tn-highlight-link {
    display: inline-flex;
    align-items: center;
    background: #FFFFFF;
    border: 1.5px solid var(--tn-today-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tn-highlight-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.15);
}

.tn-highlight-badge {
    background-color: var(--tn-primary-color);
    color: #FFFFFF;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.tn-highlight-text {
    padding: 10px 20px;
    color: #111111;
    font-size: 16px;
}

.tn-highlight-text strong {
    color: var(--tn-title-color);
    font-weight: 700;
}

.tn-highlight-dates {
    margin-left: 6px;
    color: var(--tn-primary-color);
    font-weight: 600;
}

/* List of Other Anniversaries */
.tn-anniversary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tn-anniversary-row {
    display: flex;
    align-items: center;
    font-size: 15px;
    transition: opacity 0.2s ease;
}

.tn-anniversary-date {
    width: 140px;
    font-weight: 700;
    color: var(--tn-primary-color);
    flex-shrink: 0;
}

.tn-anniversary-name {
    color: #222222;
}

.tn-anniversary-name a {
    color: #222222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tn-anniversary-name a:hover {
    color: var(--tn-primary-color);
}

/* Past Anniversary Styling */
.tn-anniversary-row.status-past.is-muted {
    opacity: 0.55;
}

.tn-anniversary-row.status-past.is-line-through .tn-anniversary-name {
    text-decoration: line-through;
    color: #777;
}

.tn-past-tag {
    font-size: 11px;
    background: #e0e0e0;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: normal;
}

/* SVG Artwork Position */
.tn-banner-artwork {
    position: absolute;
    right: -20px;
    top: -20px;
    width: 220px;
    height: 220px;
    opacity: 0.8;
    pointer-events: none;
}

.tn-bg-svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   2. SEARCH & SORT BAR
   ========================================================================== */

.tn-search-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px 20px;
    flex-wrap: wrap;
}

.tn-search-box {
    position: relative !important;
    flex: 1 !important;
    min-width: 240px !important;
    max-width: 500px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.tn-search-icon {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #888888 !important;
    width: 18px !important;
    height: 18px !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
}

.tn-search-icon svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

#tn-search-input {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 20px 0 44px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 30px !important;
    font-size: 14px !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    line-height: 44px !important;
}

#tn-search-input:focus {
    border-color: var(--tn-primary-color) !important;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.1) !important;
}

.tn-sort-box {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    font-size: 14px;
    color: #666666;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.tn-sort-box label {
    display: inline-block !important;
    white-space: nowrap !important;
    margin: 0 !important;
    font-weight: 500;
    line-height: 1.5;
}

#tn-sort-select {
    display: inline-block !important;
    width: auto !important;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #FFFFFF;
    font-size: 14px;
    color: #333333;
    outline: none;
    cursor: pointer;
    white-space: nowrap !important;
}

/* ==========================================================================
   3. CARDS GRID (4 COLUMNS)
   ========================================================================== */

.tn-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.tn-card-item {
    background: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tn-card-item:hover {
    transform: translateY(-4px);
}

.tn-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tn-card-thumb-wrapper {
    width: 100%;
    aspect-ratio: 4 / 5;
    background-color: #f1f3f5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.tn-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tn-card-item:hover .tn-card-thumb {
    transform: scale(1.03);
}

.tn-card-body {
    padding: 14px 4px 8px;
    text-align: center;
}

.tn-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tn-title-color);
    margin: 0 0 4px 0;
    line-height: 1.35;
}

.tn-card-dates {
    font-size: 13px;
    font-weight: 600;
    color: var(--tn-primary-color);
}

.tn-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #777777;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ==========================================================================
   4. SINGLE DETAIL PAGE
   ========================================================================== */

.tn-single-wrapper {
    background-color: #FFFFFF;
}

.tn-single-hero {
    background: linear-gradient(135deg, #FFFDF0 0%, var(--tn-banner-bg) 100%);
    padding: 60px 20px 50px;
    position: relative;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.tn-single-hero-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 2;
    gap: 40px;
}

.tn-single-hero-text {
    flex: 1;
    padding-bottom: 20px;
}

.tn-single-title {
    font-size: 32px;
    font-weight: 800;
    color: #111111;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.tn-single-motto {
    font-style: italic;
    font-size: 16px;
    color: var(--tn-primary-color);
    font-weight: 600;
}

.tn-single-hero-portrait {
    width: 280px;
    flex-shrink: 0;
    margin-bottom: -90px; /* Overflows down into body section */
}

.tn-portrait-card {
    background: #FFFFFF;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.tn-portrait-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.tn-hero-sunray {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 150px;
    height: 150px;
    pointer-events: none;
    opacity: 0.6;
}

.tn-single-body {
    padding: 70px 20px 60px;
}

.tn-single-body-container {
    max-width: 800px;
    margin: 0 auto;
}

.tn-single-lifespan h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--tn-primary-color);
    margin: 0 0 25px 0;
}

.tn-single-entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333333;
}

.tn-single-entry-content ul {
    list-style: none;
    padding-left: 0;
}

.tn-single-entry-content li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.tn-single-entry-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--tn-primary-color);
    font-size: 20px;
    line-height: 1;
}

.tn-back-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
}

.tn-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #f8f9fa;
    color: #444444;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tn-btn-back svg {
    width: 16px;
    height: 16px;
    display: block;
}

.tn-btn-back:hover {
    background-color: var(--tn-primary-color);
    color: #FFFFFF;
}

/* ==========================================================================
   5. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
    .tn-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tn-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .tn-single-hero-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tn-single-hero-portrait {
        margin-bottom: -50px;
        width: 220px;
    }

    .tn-single-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .tn-grid-container {
        grid-template-columns: 1fr;
    }

    .tn-banner-block {
        padding: 20px;
    }

    .tn-highlight-link {
        flex-direction: column;
        align-items: flex-start;
    }

    .tn-anniversary-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   6. SOCIAL SHARE & RELATED POSTS
   ========================================================================== */

.tn-social-share {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 35px 0 30px 0 !important;
}

.tn-share-label {
    font-size: 15px !important;
    color: #666666 !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.tn-share-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background-color: #e9ecef !important;
    color: #555555 !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.tn-share-btn:hover {
    background-color: var(--tn-primary-color) !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.tn-share-btn svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tn-copy-toast {
    font-size: 13px !important;
    color: #155724 !important;
    background-color: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* Related Posts Block */
.tn-related-posts-block {
    margin-top: 45px;
    padding-top: 25px;
}

.tn-related-title {
    font-size: 22px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 25px 0;
}

.tn-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tn-related-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tn-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.tn-related-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tn-related-thumb-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #f1f3f5;
}

.tn-related-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tn-related-card:hover .tn-related-thumb {
    transform: scale(1.04);
}

.tn-related-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tn-related-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tn-related-card-excerpt {
    font-size: 13px;
    color: #777777;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 992px) {
    .tn-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .tn-related-grid {
        grid-template-columns: 1fr;
    }
}
