/* === HEADER BANNER — Premium with blurred bg + atmospheric effects === */
.site-banner {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a14 25%, #2d0a0a 50%, #1a0a14 75%, #0a0a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Background image layer — blurred */
.site-banner .banner-bg {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    filter: blur(4px);
    transform: scale(1.05);
    transition: opacity 0.6s ease;
}

/* Atmospheric overlay — gradient vignette */
.site-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(212, 160, 23, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 50%, rgba(139, 26, 26, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 26, 26, 0.15) 0%, transparent 50%);
    z-index: 1;
}

/* Floating mist particles */
.site-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 15% 30%, rgba(255, 215, 0, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 70%, rgba(255, 215, 0, 0.3) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 20%, rgba(255, 215, 0, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 80%, rgba(255, 215, 0, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 40%, rgba(255, 215, 0, 0.35) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 25% 55%, rgba(255, 215, 0, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 85%, rgba(255, 215, 0, 0.25) 0%, transparent 100%);
    z-index: 1;
    animation: bannerParticles 8s ease-in-out infinite alternate;
}

@keyframes bannerParticles {
    0% {
        opacity: 0.4;
        transform: translateY(0);
    }

    100% {
        opacity: 0.8;
        transform: translateY(-6px);
    }
}

/* Decorative gold borders */
.site-banner .banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px 40px;
}

.site-banner .banner-content::before,
.site-banner .banner-content::after {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, #D4A017, #FFD700, #D4A017, transparent);
}

.site-banner .banner-content::before {
    margin-bottom: 14px;
}

.site-banner .banner-content::after {
    margin-top: 14px;
}

/* Title — golden glow */
.site-banner h1 {
    font-family: 'Cormorant Garamond', 'Ma Shan Zheng', serif;
    font-size: 1.8rem;
    color: #FFD700;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

/* Subtitle — shimmer */
.site-banner .banner-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin-top: 8px;
    letter-spacing: 2px;
    font-weight: 300;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 215, 0, 0.9) 45%,
            rgba(255, 255, 255, 0.8) 55%,
            rgba(255, 255, 255, 0.6) 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: subtitleShimmer 4s ease-in-out infinite;
}

@keyframes subtitleShimmer {

    0%,
    100% {
        background-position: -100% 0;
    }

    50% {
        background-position: 200% 0;
    }
}

/* === NAVBAR (đỏ, sticky) === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 300;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-link {
    display: block;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--accent);
    background: rgba(0, 0, 0, 0.1);
}

.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-actions a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    padding: 8px;
    transition: color var(--duration);
}

.nav-actions a:hover {
    color: var(--accent);
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 60px 0 20px;
        transition: right 0.3s var(--ease);
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-menu .nav-link {
        padding: 14px 24px;
        border-bottom: none;
        position: relative;
        z-index: 1;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
    }

    .nav-overlay.open {
        display: block;
    }
}

/* === TICKER/NOTICE BAR === */
.ticker-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
}

.ticker-bar .container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ticker-label {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    white-space: nowrap;
}

.ticker-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Layout: 1 large left (spans 2 rows) | 2×2 grid of 4 cards right */
.fg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    margin-bottom: var(--gap);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Large card = left column, spans both rows */
.fg-card-large {
    grid-column: 1;
    grid-row: 1 / 3;
}

/* Right side: 2×2 sub-grid */
.fg-right {
    grid-column: 2;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
}

/* ALL cards — shared base */
.fg-card {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: #1a1a2e;
}

.fg-card-large {
    min-height: 400px;
}

/* Image fills entire card */
.fg-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.fg-card:hover img {
    transform: scale(1.05);
}

/* Placeholder when no image */
.fg-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f0e8 url('../images/placeholder-dao.svg') center/cover no-repeat;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    color: rgba(139, 26, 26, 0.25);
}

.fg-card-large .fg-placeholder {
    min-height: 400px;
    font-size: 5rem;
}

/* Category tag — top-left corner */
.fg-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    z-index: 3;
    line-height: 1.3;
}

/* Info overlay — bottom gradient with title + meta */
.fg-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    z-index: 2;
}

.fg-card-large .fg-info {
    padding: 20px 22px;
}

.fg-info h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fg-card-large .fg-info h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.fg-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.fg-card-large .fg-meta {
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .fg-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .fg-card-large {
        grid-column: 1;
        grid-row: 1;
        min-height: 280px;
    }

    .fg-right {
        grid-column: 1;
        grid-row: 2;
    }

    .fg-card-small {
        min-height: 160px;
    }

    .fg-info {
        padding: 14px 16px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    }

    .fg-info h3 {
        font-size: 0.9rem;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    }

    .fg-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .fg-right {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 180px);
    }
}

/* === SEARCH OVERLAY === */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    width: 100%;
    max-width: 640px;
    padding: 0 20px;
    transform: translateY(-20px);
    transition: transform 0.35s ease;
}

.search-overlay.active .search-overlay-inner {
    transform: translateY(0);
}

.search-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.search-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

/* Search input box */
.search-box {
    position: relative;
    margin-bottom: 24px;
}

.search-box-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--accent-warm);
    background: var(--bg-white);
}

/* === BÁT QUÁI LOADING SPINNER === */
.bagua-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
}

.bagua-loader.active {
    display: flex;
}

.bagua-svg {
    width: 100px;
    height: 100px;
    animation: baguaSpin 3s linear infinite;
}

@keyframes baguaSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Trigrams counter-rotate to stay readable */
.bagua-trigrams {
    animation: baguaCounterSpin 3s linear infinite;
    transform-origin: 100px 100px;
}

@keyframes baguaCounterSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

/* Pulsing glow on the SVG */
.bagua-svg circle:first-child {
    animation: baguaGlow 2s ease-in-out infinite alternate;
}

@keyframes baguaGlow {
    from {
        stroke: rgba(212, 160, 23, 0.2);
    }

    to {
        stroke: rgba(212, 160, 23, 0.6);
    }
}

.bagua-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 12px;
    letter-spacing: 1px;
}

/* === SEARCH RESULTS === */
.search-results {
    max-height: 55vh;
    overflow-y: auto;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    margin-bottom: 4px;
}

.search-result-item:hover {
    background: var(--bg-light);
    color: var(--text);
}

.search-result-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-thumb i {
    font-size: 1.2rem;
    color: var(--accent-warm);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-info .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-result-type {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(212, 160, 23, 0.15);
    color: var(--accent-warm);
    white-space: nowrap;
}

.search-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.search-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    color: rgba(212, 160, 23, 0.3);
}

.search-hint {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}


.news-section {
    padding: 20px;
}

.news-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Large article card in news section */
.news-card-large {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-card-large .card-img {
    position: relative;
    height: 260px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
}

.news-card-large .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img .placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F1EA url('../images/placeholder-dao.svg') center/cover no-repeat;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4rem;
    color: rgba(139, 26, 26, 0.25);
}

.news-card-large h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.4;
    transition: color var(--duration);
}

.news-card-large:hover h3 {
    color: var(--primary-dark);
}

.news-card-large .excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
}

/* Small list items */
.news-list {
    list-style: none;
}

.news-list-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dotted var(--border);
    text-decoration: none;
    color: inherit;
}

.news-list-item:last-child {
    border-bottom: none;
}

.news-list-item .thumb {
    flex-shrink: 0;
    width: 72px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #eee;
}

.news-list-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-list-item .thumb .placeholder-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F1EA url('../images/placeholder-dao.svg') center/cover no-repeat;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4rem;
    color: rgba(139, 26, 26, 0.45);
}

.news-list-item .item-body h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 2px;
    transition: color var(--duration);
}

.news-list-item:hover .item-body h4 {
    color: var(--primary);
}

.news-list-item .meta {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .news-main-grid {
        grid-template-columns: 1fr;
    }
}

/* === ARTICLE CARD (standard) === */
.article-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-card .card-img {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.article-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--ease);
}

.article-card:hover .card-img img {
    transform: scale(1.03);
}

.article-card .card-body {
    padding: 14px 16px;
}

.article-card .card-body h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.4;
    color: var(--ink);
}

.article-card .card-body .excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.article-card .card-body .meta {
    margin-top: 8px;
}

/* Cards grid */
.cards-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.cards-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .cards-grid-3 {
        grid-template-columns: 1fr;
    }

    .cards-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* === DEITY/MANTRA CARD (catalog) === */
.deity-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.deity-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.deity-card .card-img {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #F4F1EA url('../images/placeholder-dao.svg') center/cover no-repeat;
}

.deity-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s var(--ease);
}

.deity-card:hover .card-img img {
    transform: scale(1.05);
}

.deity-card .card-img .deity-char {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4.5rem;
    color: rgba(139, 26, 26, 0.25);
}

.deity-card .card-body {
    padding: 14px 16px;
}

.deity-card .card-body h3 {
    font-size: 1rem;
    color: var(--primary-darker);
    margin-bottom: 2px;
}

.deity-card .card-body .chinese {
    font-family: 'Ma Shan Zheng', cursive;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.deity-card .card-body .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* === SIDEBAR === */

.sidebar-box {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--gap);
    overflow: hidden;
}

.sidebar-box .sidebar-header {
    padding: 0 16px;
    padding-top: 16px;
}

.sidebar-box .sidebar-body {
    padding: 16px;
}

/* Social buttons (Facebook, YouTube, Zalo, TikTok) */
.social-links {
    list-style: none;
}

.social-links li {
    margin-bottom: 8px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity var(--duration);
}

.social-link:hover {
    opacity: 0.9;
    color: #fff;
}

.social-link .social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
}

.social-link .social-label {
    flex: 1;
}

.social-link .social-label small {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.8;
}

.social-link .social-action {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.social-facebook {
    background: #1877F2;
}

.social-youtube {
    background: #FF0000;
}

.social-zalo {
    background: #0068FF;
}

.social-tiktok {
    background: #000000;
}
.social-link:not(.social-facebook):not(.social-youtube):not(.social-zalo):not(.social-tiktok) {
    background: black;
}

/* Sidebar category links */
.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    border-bottom: 1px dotted var(--border);
}

.sidebar-links li:last-child {
    border-bottom: none;
}



.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.sidebar-links a:hover {
    color: var(--primary);
}

.sidebar-links .link-arrow {
    color: var(--primary);
    font-size: 0.7rem;
}

/* Sidebar reference banners */
.ref-banners {
    list-style: none;
}

.ref-banners li {
    margin-bottom: 8px;
}

.ref-banners a {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ref-banners img {
    width: 100%;
    transition: opacity var(--duration);
}

.ref-banners a:hover img {
    opacity: 0.8;
}

/* === DETAIL PAGE === */
.detail-page {
    padding: 24px 0;
}

.detail-header {
    margin-bottom: 24px;
}

.detail-header h1 {
    color: var(--primary-darker);
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.detail-header .chinese-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.3rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.detail-header .rank-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.detail-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    max-width: 350px;
}

.detail-image img {
    width: 100%;
}

.detail-image .detail-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F1EA url('../images/placeholder-dao.svg') center/cover no-repeat;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 5rem;
    color: rgba(139, 26, 26, 0.25);
}

.detail-domain {
    padding: 12px 16px;
    background: #fff5f5;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.detail-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-attributes .attr {
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.detail-content {
    line-height: 1.8;
    font-size: 1rem;
}

.detail-content h2 {
    color: var(--primary-darker);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.detail-content h3 {
    color: var(--primary-darker);
    margin: 20px 0 10px;
    font-size: 1.15rem;
}

.detail-content h4 {
    color: var(--ink);
    margin: 16px 0 8px;
    font-size: 1.05rem;
}

.detail-content p {
    margin-bottom: 16px;
}

/* CKEditor alignment support */
.detail-content [style*="text-align:center"],
.detail-content [style*="text-align: center"] {
    text-align: center;
}

.detail-content [style*="text-align:right"],
.detail-content [style*="text-align: right"] {
    text-align: right;
}

.detail-content [style*="text-align:justify"],
.detail-content [style*="text-align: justify"] {
    text-align: justify;
}

/* CKEditor font family/size — inline styles are respected by default */

/* CKEditor font-size classes (used by Super Build) */
.detail-content .text-tiny {
    font-size: 0.7em;
}

.detail-content .text-small {
    font-size: 0.85em;
}

.detail-content .text-big {
    font-size: 1.4em;
}

.detail-content .text-huge {
    font-size: 1.8em;
}

.text-content .text-tiny {
    font-size: 0.7em;
}

.text-content .text-small {
    font-size: 0.85em;
}

.text-content .text-big {
    font-size: 1.4em;
}

.text-content .text-huge {
    font-size: 1.8em;
}

/* CKEditor table support */
.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.detail-content table td,
.detail-content table th {
    border: 1px solid var(--border);
    padding: 8px 12px;
    vertical-align: top;
}

.detail-content table th {
    background: var(--bg-light, #f5f5f5);
    font-weight: 700;
}

/* CKEditor blockquote */
.detail-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 16px 0;
    background: rgba(139, 26, 26, 0.04);
    font-style: italic;
    color: var(--text-secondary);
}

/* CKEditor horizontal line */
.detail-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 24px 0;
}

/* CKEditor marker/highlight */
.detail-content mark,
.detail-content .marker-yellow {
    background: #fdfd77;
}

.detail-content .marker-green {
    background: #62f962;
}

.detail-content .marker-pink {
    background: #fc7999;
}

.detail-content .marker-blue {
    background: #72ccfd;
}

.detail-content .pen-red {
    color: #e71313;
    background: transparent;
}

.detail-content .pen-green {
    color: #128a00;
    background: transparent;
}

/* CKEditor image */
.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 4px);
}

.detail-content figure {
    margin: 16px 0;
}

.detail-content figure.image {
    text-align: center;
}

.detail-content figure.image-style-side {
    float: right;
    max-width: 50%;
    margin: 0 0 16px 16px;
}

.detail-content figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
}

/* CKEditor list indent support */
.detail-content ol,
.detail-content ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.detail-content li {
    margin-bottom: 4px;
}

/* CKEditor code block */
.detail-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: var(--radius-sm, 4px);
    overflow-x: auto;
    margin: 16px 0;
    font-size: 0.9rem;
}

.detail-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.detail-content pre code {
    background: none;
    padding: 0;
}

/* Ensure text-content (mantra blocks) also supports CKEditor styles */
.text-content [style*="text-align:center"],
.text-content [style*="text-align: center"] {
    text-align: center;
}

.text-content table {
    width: 100%;
    border-collapse: collapse;
}

.text-content table td,
.text-content table th {
    border: 1px solid var(--border);
    padding: 8px 12px;
}

.text-content img {
    max-width: 100%;
    height: auto;
}

/* Mantra text blocks */
.mantra-block {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.mantra-block h3 {
    color: var(--primary-darker);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-warm);
    display: inline-block;
}

.mantra-block .text-content {
    font-size: 1.05rem;
    line-height: 2;
}

.mantra-block.original .text-content {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    line-height: 2.2;
    color: var(--ink);
}

/* === PAGE HERO (smaller, for inner pages) === */
.page-hero {
    padding: 32px 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--gap);
}

.page-hero h1 {
    font-size: 1.5rem;
    color: var(--primary-darker);
}

.page-hero p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === FOOTER (blue, 3 columns) === */
.footer {
    background: var(--footer-bg);
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.footer-brand .footer-logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.footer-brand .footer-logo-text {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4rem;
    color: #FFD700;
}

.footer p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.footer h4 {
    color: #FFD700;
    font-size: 1rem;
    margin-bottom: 14px;
    font-weight: 700;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a,
.footer-links span {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    transition: color var(--duration);
}

.footer-links a:hover {
    color: #FFD700;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.footer-contact .contact-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    margin-top: 2px;
}

.footer-bottom {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 960px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* === RELATED SECTION === */
.related-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* === SCROLL TO TOP === */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: var(--footer-bg);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
    z-index: 50;
    box-shadow: var(--shadow-md);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary);
}