/*
Theme Name: Liew Zhivago Portfolio
Theme URI: https://liewzhivago.com/
Author: Liew Zhivago
Author URI: https://liewzhivago.com/
Description: Tema personalizado Noir. Idioma padrão: Inglês.
Version: 30.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, portfolio, dark, noir, multilingual, responsive, japanese
Text Domain: liew-zhivago
*/

:root {
    --color-midnight: #0F0B1A;
    --color-gold: #CBA135;
    --color-gold-hover: #e0b445;
    --color-off-white: #f5f5f5;
    --color-muted: #b0b0b0;
    --color-card: #1a1629;
    --font-display: 'Vollkorn', serif; 
    --font-body: 'Merriweather', serif;
    --font-ui: 'DM Sans', sans-serif;
    --font-jp: 'Noto Serif JP', serif;
}

/* Base Styles */
html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--color-midnight);
    color: var(--color-off-white);
    font-family: var(--font-body), serif; 
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* Header Background */
.header-bg {
    background-color: rgba(15, 11, 26, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Utility Classes */
.text-gold { color: var(--color-gold) !important; }
.text-off-white { color: var(--color-off-white) !important; }
.text-muted { color: var(--color-muted) !important; }
.bg-midnight { background-color: var(--color-midnight) !important; }
.bg-card { background-color: var(--color-card) !important; }
.bg-gold { background-color: var(--color-gold) !important; color: var(--color-midnight) !important; }

.font-display { font-family: var(--font-display) !important; }
.font-ui { font-family: var(--font-ui) !important; }
.font-body { font-family: var(--font-body) !important; }
.font-jp { font-family: var(--font-jp) !important; }

a { text-decoration: none; transition: color 0.3s ease; color: inherit; }
a:hover { color: var(--color-gold-hover); }

/* --- MENU PRINCIPAL (MODO OTIMIZADO) --- */
.nav-menu {
    display: flex;
    gap: 2px;
    height: auto;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap; 
    justify-content: center;
}

.nav-menu > li {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu > li > a {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 11px; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
    transition: all 0.3s ease;
    padding: 8px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    text-decoration: none;
    white-space: nowrap !important;
    border-radius: 4px;
}

.nav-menu > li:hover > a,
.nav-menu > li.current-menu-item > a {
    color: var(--color-gold) !important;
    background-color: rgba(203, 161, 53, 0.05);
}

/* --- MOBILE SPECIFIC MENU FIXES --- */
@media (max-width: 768px) {
    .nav-menu {
        gap: 5px;
    }
    .nav-menu > li > a {
        font-size: 10px;
        padding: 6px 8px;
        background-color: rgba(255,255,255,0.03);
    }
}

/* --- 3D BOOK FIXES --- */
.book-scene {
    overflow: visible !important; 
    padding: 60px !important;     
    margin: -20px auto 0;        
}

@media (max-width: 768px) {
    .book-scene {
        padding: 30px !important;
        margin: 0 auto;
    }
}

/* --- ADAPTATION IMAGE --- */
.adaptation-image-container {
    position: absolute;
    right: 5%; 
    top: 0;
    bottom: 0;
    width: 45%; 
    z-index: 1; 
    overflow: hidden;
    transform: skewX(-12deg); 
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform-origin: bottom right;
}

.adaptation-image {
    width: 150%; 
    height: 100%;
    margin-left: -25%; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: skewX(12deg); 
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.adaptation-image-container:hover .adaptation-image {
    transform: skewX(12deg) scale(1.05); 
}

/* --- READING ROOM --- */
.reading-card {
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.reading-card:hover h3 {
    color: var(--color-gold);
}

.prose-story p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 0.8;
    padding-right: 0.75rem;
    padding-top: 0.1rem;
    color: var(--color-gold);
    font-weight: 700;
}

/* Table Styles */
.event-row { transition: background-color 0.3s ease; }
.event-row:hover { background-color: rgba(203, 161, 53, 0.05); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.8s ease-out forwards; }

/* AdSense Container Logic */
.ad-auto-collapse:empty {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- LETTERBOXD / AFTER CREDITS STYLES --- */

/* Grid de Posters */
.poster-grid-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* Aspect Ratio Vertical (2:3) para Posters */
.aspect-poster {
    aspect-ratio: 2 / 3;
    position: relative;
    background-color: #151120;
}

.aspect-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.poster-grid-item:hover {
    border-color: var(--color-gold);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10;
}

.poster-grid-item:hover .aspect-poster img {
    opacity: 0.7;
}

/* Overlay de Nota (Hover) */
.poster-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(15, 11, 26, 0.8);
    text-align: center;
    padding: 10px;
}

.poster-grid-item:hover .poster-overlay {
    opacity: 1;
}

/* Estrelas de Rating */
.rating-stars {
    display: inline-flex;
    gap: 2px;
    color: var(--color-gold);
}
.rating-stars i {
    fill: currentColor;
}
.rating-stars i.empty {
    color: #444;
    fill: none;
}

/* Tabs de Categoria */
.cat-tab {
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}
.cat-tab:hover, .cat-tab.active {
    color: var(--color-gold);
    border-color: var(--color-gold);
}


/* --- NEW HOMEPAGE REVIEWS: LETTERBOXD GRID & ORBIT EFFECT --- */

.letterboxd-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 colunas */
    gap: 15px; /* Reduced gap for mobile */
    justify-content: center;
}

@media (min-width: 768px) {
    .letterboxd-grid {
        grid-template-columns: repeat(4, 1fr); /* Tablet: 4 colunas */
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .letterboxd-grid {
        grid-template-columns: repeat(5, 1fr); /* Desktop: 5 colunas */
    }
}

.letterboxd-card {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background-color: #151120;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover Scale (Desktop) */
@media (min-width: 1025px) {
    .letterboxd-card:hover {
        transform: scale(1.03);
        box-shadow: 0 10px 40px rgba(0,0,0,0.8);
        z-index: 10;
    }
}

/* Poster Image */
.letterboxd-poster {
    position: absolute;
    inset: 2px; /* Espaço para a borda animada */
    border-radius: 3px;
    overflow: hidden;
    background-color: #000;
    z-index: 2;
}

.letterboxd-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

/* Hover: Darken Image (Desktop) */
@media (min-width: 1025px) {
    .letterboxd-card:hover .letterboxd-poster img {
        opacity: 0.3;
    }
}

/* Animated Border Glow (Orbit Effect) */
.card-border-glow {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 80deg, var(--color-gold) 130deg, transparent 180deg);
    animation: rotate-border 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    transform-origin: center;
}

/* Show glow on Hover (Desktop) */
@media (min-width: 1025px) {
    .letterboxd-card:hover .card-border-glow {
        opacity: 1;
    }
}

@keyframes rotate-border {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Overlay Content (Rating & Text) */
.letterboxd-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    pointer-events: none; /* Deixa o clique passar para o card */
}

/* Show Overlay on Hover (Desktop) */
@media (min-width: 1025px) {
    .letterboxd-card:hover .letterboxd-overlay {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- MOBILE AUTOMATIC ANIMATIONS (LETTERBOXD) --- */
/* Esta seção substitui o hover por uma animação automática contínua em dispositivos móveis/tablets */

@keyframes autoShowOverlay {
    0%, 35% { opacity: 0; transform: translateY(10px); }
    45%, 85% { opacity: 1; transform: translateY(0); } /* Visível por um tempo */
    95%, 100% { opacity: 0; transform: translateY(10px); }
}

@keyframes autoDarken {
    0%, 35% { opacity: 1; }
    45%, 85% { opacity: 0.3; }
    95%, 100% { opacity: 1; }
}

@keyframes autoGlow {
    0%, 35% { opacity: 0; }
    45%, 85% { opacity: 1; }
    95%, 100% { opacity: 0; }
}

@media (max-width: 1024px) {
    /* Aplica as animações aos elementos internos */
    .letterboxd-card .letterboxd-overlay {
        animation: autoShowOverlay 6s infinite;
    }
    .letterboxd-card .card-border-glow {
        animation: autoGlow 6s infinite;
    }
    .letterboxd-card .letterboxd-poster img {
        animation: autoDarken 6s infinite;
    }

    /* Intercalar as animações (Pares vs Ímpares) para não piscar tudo junto */
    .letterboxd-card:nth-child(odd) .letterboxd-overlay,
    .letterboxd-card:nth-child(odd) .card-border-glow,
    .letterboxd-card:nth-child(odd) .letterboxd-poster img {
        animation-delay: 0s;
    }
    .letterboxd-card:nth-child(even) .letterboxd-overlay,
    .letterboxd-card:nth-child(even) .card-border-glow,
    .letterboxd-card:nth-child(even) .letterboxd-poster img {
        animation-delay: 3s;
    }
}

/* Updated Score Box Styles */
.review-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.score-text {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-gold);
    font-size: 24px;
    line-height: 1;
    margin-bottom: 5px;
}

.score-text span {
    font-size: 12px;
    opacity: 0.7;
    color: var(--color-off-white);
    font-family: var(--font-ui);
    margin-left: 2px;
}

.review-read-more {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-off-white);
    font-weight: bold;
    border-bottom: 1px solid var(--color-gold);
    padding-bottom: 2px;
}

/* 
   TRANSLATEPRESS STYLES & OVERRIDES 
   ========================================================================== */

/* 1. HIDE THE FLOATING SWITCHER (Bottom Right) */
.trp-language-switcher.trp-floating-switcher,
#trp-floater-ls,
.trp-floater-ls-popup {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
}

/* 2. CUSTOMIZE SHORTCODE DROPDOWN (Header) */
.liew-native-switcher .trp-language-switcher {
    width: auto !important;
    background: transparent !important;
    border: none !important;
}

/* Current Language Label (The "Button") */
.liew-native-switcher .trp-current-language-item__wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    padding: 5px 10px !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
}

.liew-native-switcher .trp-current-language-item__wrapper:hover {
    background-color: rgba(255,255,255,0.05) !important;
}

/* Text Style */
.liew-native-switcher .trp-language-item-name {
    color: var(--color-muted) !important;
    font-family: var(--font-ui) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 1px !important;
}

.liew-native-switcher .trp-current-language-item__wrapper:hover .trp-language-item-name {
    color: var(--color-gold) !important;
}

/* Dropdown Menu Container */
.liew-native-switcher .trp-switcher-dropdown-list {
    background-color: #151120 !important; /* Midnight dark */
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8) !important;
    padding: 5px 0 !important;
    margin-top: 10px !important;
    border-radius: 4px !important;
    min-width: 160px !important;
    z-index: 99999 !important;
}

/* Dropdown Items */
.liew-native-switcher .trp-switcher-dropdown-list .trp-language-item {
    display: flex !important;
    align-items: center !important;
    padding: 10px 15px !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.02) !important;
    transition: background 0.2s ease !important;
}

.liew-native-switcher .trp-switcher-dropdown-list .trp-language-item:last-child {
    border-bottom: none !important;
}

.liew-native-switcher .trp-switcher-dropdown-list .trp-language-item:hover {
    background-color: rgba(203, 161, 53, 0.1) !important; /* Gold tint */
}

.liew-native-switcher .trp-switcher-dropdown-list .trp-language-item:hover .trp-language-item-name {
    color: var(--color-gold) !important;
}

/* Flags */
.liew-native-switcher img.trp-flag-image {
    width: 18px !important;
    height: auto !important;
    margin-right: 8px !important;
    border-radius: 2px !important;
    opacity: 0.8 !important;
}

/* Arrow SVG */
.liew-native-switcher svg.trp-shortcode-arrow {
    width: 12px !important;
    height: 12px !important;
    margin-left: 2px !important;
}
.liew-native-switcher svg.trp-shortcode-arrow path {
    stroke: var(--color-muted) !important;
}
.liew-native-switcher .trp-current-language-item__wrapper:hover svg.trp-shortcode-arrow path {
    stroke: var(--color-gold) !important;
}

/* 
   TRANSLATEPRESS MODAL OVERRIDES
   ========================================================================== */

html body div#trp_ald_modal_container { background-color: rgba(15, 11, 26, 0.95) !important; backdrop-filter: blur(8px) !important; z-index: 9999999 !important; }
html body div#trp_ald_modal_popup { background-color: var(--color-card) !important; border: 1px solid var(--color-gold) !important; border-radius: 4px !important; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9) !important; padding: 30px !important; max-width: 90% !important; width: 450px !important; font-family: var(--font-ui) !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; position: fixed !important; margin: 0 !important; }
html body div#trp_ald_popup_text { color: var(--color-off-white) !important; font-size: 16px !important; font-weight: 500 !important; margin-bottom: 20px !important; text-align: center !important; line-height: 1.5 !important; background: transparent !important; }
html body .trp_ald_select_and_button { display: flex !important; flex-direction: column !important; gap: 15px !important; background: transparent !important; border: none !important; align-items: center !important; }
html body .trp_ald_ls_container { width: 100% !important; }
html body #trp_ald_popup_select_container { background-color: var(--color-midnight) !important; color: var(--color-gold) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important; border-radius: 2px !important; padding: 10px !important; width: 100% !important; font-family: var(--font-ui) !important; text-transform: uppercase !important; letter-spacing: 1px !important; font-size: 13px !important; cursor: pointer !important; text-align: left !important; }
html body .trp_ald_button { width: 100% !important; text-align: center !important; }
html body a#trp_ald_popup_change_language { display: inline-block !important; background-color: var(--color-gold) !important; color: var(--color-midnight) !important; font-weight: 800 !important; text-transform: uppercase !important; letter-spacing: 2px !important; padding: 14px 30px !important; text-align: center !important; border-radius: 2px !important; border: none !important; transition: all 0.3s ease !important; text-decoration: none !important; margin: 0 auto !important; font-size: 12px !important; width: 100% !important; box-sizing: border-box !important; box-shadow: 0 4px 15px rgba(203, 161, 53, 0.2) !important; }
html body a#trp_ald_popup_change_language:hover { background-color: var(--color-gold-hover) !important; transform: translateY(-2px) !important; box-shadow: 0 6px 20px rgba(203, 161, 53, 0.4) !important; }
html body a#trp_ald_x_button_and_textarea { display: flex !important; justify-content: center !important; align-items: center !important; margin-top: 20px !important; text-decoration: none !important; opacity: 0.6 !important; transition: opacity 0.3s !important; width: 100% !important; }
html body a#trp_ald_x_button_and_textarea:hover { opacity: 1 !important; }
html body span#trp_ald_x_button_textarea { color: var(--color-muted) !important; font-size: 11px !important; text-transform: uppercase !important; letter-spacing: 1px !important; font-family: var(--font-ui) !important; text-decoration: none !important; border-bottom: 1px solid transparent !important; }
html body a#trp_ald_x_button_and_textarea:hover span#trp_ald_x_button_textarea { color: var(--color-off-white) !important; border-bottom-color: var(--color-gold) !important; }
html body span#trp_ald_x_button { background-image: none !important; display: inline-block !important; margin-right: 8px !important; }
html body span#trp_ald_x_button::before { content: '✕' !important; color: var(--color-gold) !important; font-weight: bold !important; font-size: 14px !important; }
html body img.trp-flag-image { border: 1px solid rgba(255,255,255,0.2) !important; margin-right: 10px !important; vertical-align: middle !important; }