/* GH.STUDIO Portfolio - Minimalist Modern Design */

/* ========== SHORTCODE WRAPPER (for WordPress integration) ========== */
.ghstudio-flipbook-wrapper {
    width: 100%;
    min-height: 750px;
    padding: 80px 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef3 100%);
}

/* Reduce white space from Gutenverse parent containers - ONLY on portfolio page */
body.page .guten-column-wrapper .ghstudio-flipbook-wrapper {
    margin-top: -70px !important;
    margin-bottom: -330px !important;
}

/* Override flipbook positioning when inside wrapper */
.ghstudio-flipbook-wrapper .ghstudio-flipbook {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto;
}

/* Override page indicator when inside wrapper */
.ghstudio-flipbook-wrapper .page-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

/* ========== LEGACY: STANDALONE PAGE TEMPLATE ========== */
.ghstudio-portfolio-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef3 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Remove all fancy cursor effects */
.ghstudio-portfolio-body,
.ghstudio-portfolio-body a,
.ghstudio-portfolio-body button,
.ghstudio-portfolio-body .page-turn-hint {
    cursor: default;
}

.ghstudio-portfolio-body a:hover,
.ghstudio-portfolio-body button:hover,
.ghstudio-portfolio-body .page-turn-hint:hover {
    cursor: pointer;
}

/* Flipbook Container - Clean & Centered */
.ghstudio-flipbook {
    width: 460px;
    height: 650px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    perspective: 1500px;
    z-index: 1;
}

/* Spine Line - Minimal Shadow */
.letter-page.active::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 15;
    pointer-events: none;
}

/* Individual Pages - Clean Shadow */
.ghstudio-page {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: visible;
    transform-origin: center center;
    transform-style: preserve-3d;
    transition: all 0.6s ease-in-out;
    backface-visibility: hidden;
}

/* Cover Page - Minimal Design */
.cover-page {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    z-index: 2;
    position: relative;
    transform: rotateY(0deg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* Hide all cover pages except page-1 by default */
.cover-page:not(#page-1):not(.active) {
    opacity: 0;
    visibility: hidden;
    width: 460px;
    left: 0;
}

/* Cover Page Flipped - 3D Rotation */
.cover-page.flipped {
    transform: rotateY(-180deg);
    pointer-events: none;
}

/* Minimal border - single line */
.cover-page::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    border-radius: 2px;
}

/* Remove all decorative ornaments */
.corner-ornament,
.cover-page::after {
    display: none;
}

/* Cover Background Container */
.cover-background {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Background Logo - subtle */
.background-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    opacity: 0.08;
    z-index: 2;
}

.background-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Cover Content - Logo chính */
.cover-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-logo {
    max-width: 350px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Website URL - Bottom right */
.website-url {
    position: absolute;
    bottom: 60px;
    right: 60px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 300;
}

/* Page Turn Hint Button - Minimal */
.page-turn-hint {
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-left: none;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.page-turn-hint span {
    color: rgba(0, 0, 0, 0.4);
    font-size: 28px;
    font-weight: 300;
    transition: all 0.3s ease;
}

.page-turn-hint:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-50%) translateX(3px);
}

.page-turn-hint:hover span {
    color: rgba(0, 0, 0, 0.7);
}

.page-turn-prev {
    right: auto;
    left: -25px;
    border-right: none;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px 0 0 4px;
}

.page-turn-prev:hover {
    transform: translateY(-50%) translateX(-3px);
}

/* Letter Page - Clean White */
.letter-page {
    background: #ffffff;
    transition: all 0.6s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 460px;
    left: 0;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
}

.letter-page.active {
    width: 920px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    visibility: visible;
    z-index: 3;
}

.cover-page.active {
    width: 460px !important;
    height: 650px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    transform-origin: center center !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10 !important;
}

.cover-page.flipped {
    transform: rotateY(-180deg);
    opacity: 0;
}

.letter-page .page-content {
    display: flex;
    height: 100%;
    position: relative;
}

/* Center spine line - subtle */
.letter-page .page-content::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(-50%);
    z-index: 1;
}

/* Left column - Dark Minimal */
.letter-left {
    width: 50%;
    padding: 60px 40px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    position: relative;
    overflow: hidden;
}

/* Remove ornamental frame */
.letter-left::before,
.letter-left::after {
    display: none;
}

.design-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-style: normal;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 400;
}

.ornament-top, .ornament-bottom {
    width: 120px;
    height: 1px;
    position: relative;
    background: rgba(255, 255, 255, 0.2);
}

/* Remove ornament symbols */
.ornament-top::before,
.ornament-bottom::before {
    display: none;
}

/* Right column - Clean White */
.letter-right {
    width: 50%;
    padding: 50px 45px;
    background: #ffffff;
    overflow-y: auto;
    position: relative;
}

/* Remove paper texture */
.letter-right::before {
    display: none;
}

.letter-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.letter-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.underline-gold {
    width: 80px;
    height: 2px;
    background: #2c3e50;
    margin: 0 auto;
    position: relative;
}

/* Remove decorative symbols */
.underline-gold::before,
.underline-gold::after {
    display: none;
}

.letter-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.8;
    text-align: justify;
    position: relative;
    z-index: 1;
}

.greeting {
    font-style: italic;
    margin-bottom: 25px;
    color: #7f8c8d;
    font-size: 16px;
    font-weight: 300;
}

.letter-body p {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 15px;
    text-indent: 30px;
}

.letter-body p:first-of-type {
    text-indent: 0;
}

.letter-body strong {
    color: #2c3e50;
    font-weight: 600;
}

.signature {
    margin-top: 40px;
    text-align: right;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 25px;
}

.signature p {
    margin-bottom: 10px;
    font-style: italic;
    color: #7f8c8d;
    font-size: 15px;
}

.signature strong {
    color: #2c3e50;
    font-size: 17px;
    letter-spacing: 1px;
}

/* Page Indicator - Minimal */
.page-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Projects Gallery - Clean Grid */
.projects-gallery {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    padding: 0;
}

/* First image - LARGE (spans 2 rows) */
.project-item.project-large {
    grid-row: span 2;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Other 3 images - NORMAL */
.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Hover Effects - Subtle */
.project-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-item:hover img {
    transform: scale(1.05);
}

/* Remove golden border glow */
.project-item::before {
    display: none;
}

/* Table of Contents - Clean Design */
.toc-container {
    padding: 40px 0;
}

.toc-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin: 0 0 40px 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

.toc-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: #2c3e50;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
}

.toc-item:hover {
    padding-left: 8px;
    background: rgba(0, 0, 0, 0.02);
}

.toc-label {
    font-size: 15px;
    font-weight: 400;
    color: #2c3e50;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.toc-item:hover .toc-label {
    color: #34495e;
    font-weight: 500;
}

.toc-dots {
    flex-grow: 1;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.15) 40%, transparent 40%);
    background-size: 6px 1px;
    background-repeat: repeat-x;
    margin: 0 12px;
}

.toc-number {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.toc-item:hover .toc-number {
    color: #34495e;
}

/* Remove hero pen writing animation elements */
.hero-pen-container,
#inkCanvas,
.hero-pen-svg,
#heroTextPath,
#writingPath,
.hero-pen-realistic,
#heroPen {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .ghstudio-flipbook {
        width: 90vw;
        height: 70vh;
    }
    
    .main-logo {
        max-width: 250px;
    }
    
    .website-url {
        bottom: 30px;
        right: 30px;
        font-size: 11px;
    }
    
    .letter-right {
        padding: 40px 30px;
    }
    
    .toc-title {
        font-size: 22px;
        letter-spacing: 1px;
    }
    
    .toc-label {
        font-size: 14px;
    }
    
    .toc-number {
        font-size: 15px;
    }
}


/* === FIX: Back cover align center like front cover (DYNAMIC) === */
.back-cover {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    position: absolute !important;
    width: 460px !important;
    height: 650px !important;
    z-index: 10 !important;
}

/* Đảm bảo ảnh trong back cover luôn căn full */
.back-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === FIX: BACK COVER FINAL === */
.back-cover {
    /* Giữ vị trí giữa giống front cover */
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  
    /* Giữ đúng kích thước và loại bỏ nền */
    width: 460px !important;
    height: 650px !important;
    background: none !important;
    box-shadow: none !important;
  
    /* Giữ thứ tự trên cùng */
    z-index: 10 !important;
  }
  
  /* Ảnh trang bìa sau hiển thị rõ nét, không bị blend */
  .back-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  
    /* Xóa toàn bộ hiệu ứng làm mờ / pha trộn */
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
  
    /* Giữ trong luồng layout (ko tuyệt đối) */
    position: relative !important;
  }
    
  /* GH.STUDIO Portfolio - MOBILE 2 PAGES DISPLAY FIX */

/* Copy đè lên CSS cũ hoặc thêm vào cuối file */

/* ========================================== */
/* MOBILE OVERRIDE - FORCE 2 PAGES DISPLAY */
/* ========================================== */

@media (max-width: 768px) {
    /* Reset mọi thứ về 2 trang */
    .ghstudio-flipbook-wrapper {
        min-height: 100vh;
        padding: 20px 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Container chính */
    .ghstudio-flipbook {
        width: 100%;
        max-width: none;
        height: auto;
        position: relative;
        transform: none;
    }
    
    /* QUAN TRỌNG: Letter page phải đủ rộng cho 2 trang */
    .letter-page.active {
        width: 760px !important; /* 2 x 380px */
        height: 540px !important;
        max-width: none !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        margin: 0 auto !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Page content PHẢI là flex row */
    .letter-page.active .page-content {
        display: flex !important;
        flex-direction: row !important;
        width: 760px !important;
        height: 540px !important;
        position: relative !important;
    }
    
    /* Trang TRÁI - với gallery */
    .letter-left {
        width: 380px !important;
        min-width: 380px !important;
        flex: 0 0 380px !important;
        height: 540px !important;
        padding: 30px 25px !important;
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important;
        position: relative !important;
        overflow: visible !important;
    }
    
    /* Trang PHẢI - với text */
    .letter-right {
        width: 380px !important;
        min-width: 380px !important;
        flex: 0 0 380px !important;
        height: 540px !important;
        padding: 30px 25px !important;
        background: #ffffff !important;
        position: relative !important;
        overflow-y: auto !important;
    }
    
    /* Đường kẻ giữa 2 trang */
    .letter-page .page-content::before {
        content: '';
        position: absolute;
        left: 380px; /* Vị trí chính xác giữa 2 trang */
        top: 0;
        bottom: 0;
        width: 1px;
        background: rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    /* Gallery projects */
    .projects-gallery {
        width: calc(100% - 20px) !important;
        height: auto !important;
        min-height: 260px !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, 100px) !important;
        gap: 8px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .project-item {
        width: 100% !important;
        height: 100px !important;
        position: relative !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    }
    
    .project-item.project-large {
        grid-row: span 2 !important;
        height: 208px !important;
    }
    
    .project-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Text elements */
    .design-text {
        display: block !important;
        color: rgba(255, 255, 255, 0.6) !important;
        font-size: 9px !important;
    }
    
    .ornament-top,
    .ornament-bottom {
        width: 80px !important;
        height: 1px !important;
        background: rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Cover pages - 1 trang */
    .cover-page,
    .cover-page.active {
        width: 380px !important;
        height: 540px !important;
    }
    
    .back-cover {
        width: 380px !important;
        height: 540px !important;
    }
}

/* iPhone 14 Pro - 393px */
@media (max-width: 393px) {
    /* 2 trang cho iPhone */
    .letter-page.active {
        width: 700px !important; /* Nhỏ hơn 1 chút cho iPhone */
        height: 500px !important;
    }
    
    .letter-page.active .page-content {
        width: 700px !important;
        height: 500px !important;
    }
    
    /* Mỗi trang 350px */
    .letter-left,
    .letter-right {
        width: 350px !important;
        min-width: 350px !important;
        flex: 0 0 350px !important;
        height: 500px !important;
        padding: 25px 20px !important;
    }
    
    /* Đường kẻ giữa */
    .letter-page .page-content::before {
        left: 350px;
    }
    
    /* Gallery nhỏ hơn */
    .projects-gallery {
        min-height: 240px !important;
        grid-template-rows: repeat(2, 90px) !important;
        gap: 6px !important;
    }
    
    .project-item {
        height: 90px !important;
    }
    
    .project-item.project-large {
        height: 186px !important;
    }
    
    /* Text adjustments */
    .letter-header h1 {
        font-size: 18px !important;
    }
    
    .letter-body p {
        font-size: 11px !important;
        line-height: 1.5 !important;
    }
    
    /* Cover & back cover */
    .cover-page,
    .cover-page.active,
    .back-cover {
        width: 350px !important;
        height: 500px !important;
    }
}

/* FORCE hiển thị mọi thứ */
@media (max-width: 768px) {
    .letter-page.active,
    .letter-page.active .page-content,
    .letter-left,
    .letter-right,
    .projects-gallery,
    .project-item {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Không cho flex wrap */
    .letter-page.active .page-content {
        flex-wrap: nowrap !important;
    }
}

/* Hide navigation */
@media (max-width: 768px) {
    .page-turn-hint,
    .page-turn-prev {
        display: none !important;
    }
}

/* Debug - nếu cần test */
/* 
@media (max-width: 768px) {
    .letter-left {
        border: 2px solid red !important;
    }
    .letter-right {
        border: 2px solid blue !important;
    }
}
*/

  