/* ═══════════════════════════════════════════════════════
   APUNTES DE CAMPANIA - STYLE.CSS
   Diseño Moleskine con scroll en texto
   ═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────
   RESET Y BASE
   ───────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #8B7355 0%, #6B5444 50%, #4A3C2F 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

/* Textura de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* ─────────────────────────────────────
   CONTENEDOR PRINCIPAL - MOLESKINE
   ───────────────────────────────────── */
.moleskine-container {
    max-width: 1400px;
    width: 100%;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    background: linear-gradient(145deg, #FBF8F3 0%, #F5F2ED 100%);
    border-radius: 20px;
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.4),
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 30px 50px 30px;
    overflow: hidden;
}

/* Líneas de cuaderno en el fondo */
.moleskine-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 29px,
        #E5DDD5 29px,
        #E5DDD5 30px
    );
    pointer-events: none;
    opacity: 0.4;
    border-radius: 20px;
}

/* ─────────────────────────────────────
   HEADER
   ───────────────────────────────────── */
.moleskine-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #D4C5B5;
    position: relative;
    z-index: 2;
}

.moleskine-header h1 {
    margin: 0;
    margin-bottom: 5px;
    line-height: 1.2;
}

.main-title {
    font-family: 'Caveat', cursive;
    font-size: 1.8em;
    font-weight: 700;
    color: #8B4513;
    letter-spacing: 0.5px;
}

.main-title::after {
    content: ' / ';
    color: #A0826D;
    font-weight: 400;
    margin: 0 4px;
}

.main-title-en {
    font-family: 'Caveat', cursive;
    font-size: 1.8em;
    font-weight: 600;
    color: #A0826D;
    letter-spacing: 0.5px;
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.65em;
    color: #8B7355;
    text-align: center;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
    margin-bottom: 6px;
}

.btn-comments {
    display: inline-block;
    padding: 4px 12px;
    background: transparent;
    border: 1.5px solid #8B4513;
    border-radius: 6px;
    color: #8B4513;
    text-decoration: none;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-comments:hover {
    background: #8B4513;
    color: #FBF8F3;
}

/* ─────────────────────────────────────
   INDICADOR DE PÁGINA
   ───────────────────────────────────── */
.page-indicator {
    position: absolute;
    top: 35px;
    right: 50px;
    font-family: 'Crimson Text', serif;
    font-size: 0.8em;
    color: #8B7355;
    font-weight: 600;
    background: rgba(212, 197, 181, 0.25);
    padding: 3px 10px;
    border-radius: 10px;
    z-index: 3;
}

/* ─────────────────────────────────────
   CONTENIDO DE LA PÁGINA
   ───────────────────────────────────── */
.page-content {
    flex: 1;
    position: relative;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    min-height: 0;
}

/* Scrollbar personalizado */
.page-content::-webkit-scrollbar {
    width: 8px;
}

.page-content::-webkit-scrollbar-track {
    background: rgba(212, 197, 181, 0.2);
    border-radius: 10px;
}

.page-content::-webkit-scrollbar-thumb {
    background: #A0826D;
    border-radius: 10px;
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: #8B7355;
}

.loading {
    text-align: center;
    color: #8B7355;
    font-style: italic;
    padding: 40px;
}

.error {
    text-align: center;
    color: #B8564A;
    padding: 40px;
}

.error h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.8em;
    margin-bottom: 10px;
}

/* ─────────────────────────────────────
   CONTENEDOR DE FOTO CON NAVEGACIÓN
   ───────────────────────────────────── */
.photo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0 auto;
    max-width: 1100px;
}

/* ─────────────────────────────────────
   FLECHAS DE NAVEGACIÓN
   ───────────────────────────────────── */
.nav-arrow {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: rgba(251, 248, 243, 0.9);
    border: 2px solid #8B4513;
    border-radius: 50%;
    color: #8B4513;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-arrow:hover:not(:disabled) {
    background: #8B4513;
    color: #FBF8F3;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    visibility: hidden;
}

.nav-arrow svg {
    width: 24px;
    height: 24px;
}

.nav-arrow-left {
    /* Flecha izquierda */
}

.nav-arrow-right {
    /* Flecha derecha */
}

/* ─────────────────────────────────────
   MARCO DE FOTO (TIPO POLAROID)
   ───────────────────────────────────── */
.photo-frame {
    background: white;
    padding: 15px;
    padding-bottom: 25px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 0 auto;
    max-width: 900px;
    width: fit-content;
    transform: rotate(-1.5deg);
}

.diary-photo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 45vh;
    object-fit: contain;
}

/* ─────────────────────────────────────
   ENTRADA DEL DIARIO
   ───────────────────────────────────── */
.diary-entry {
    position: relative;
}

.entry-header {
    margin-bottom: 15px;
}

.entry-title {
    font-family: 'Caveat', cursive;
    font-size: 1.9em;
    color: #8B4513;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.title-separator {
    margin: 0 6px;
    color: #A0826D;
    font-weight: 400;
}

.day-title {
    font-family: 'Caveat', cursive;
    font-size: 1.6em;
    color: #8B4513;
    font-weight: 600;
    margin-bottom: 5px;
}

.day-separator {
    margin: 0 8px;
    color: #A0826D;
    font-weight: 400;
}

.location {
    font-size: 1em;
    color: #6B5444;
    font-style: italic;
    margin-bottom: 10px;
    line-height: 1.4;
}

.location-separator {
    margin: 0 8px;
    color: #A0826D;
}

.divider {
    width: 60px;
    height: 2px;
    background: #D4C5B5;
    margin: 10px 0;
}

/* ─────────────────────────────────────
   COLUMNAS DE TEXTO BILINGÜE
   ───────────────────────────────────── */
.text-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 10px;
}

.text-block {
    position: relative;
}

.text-content {
    color: #3C3C3C;
    font-size: 1.2em;
    line-height: 1.7;
    text-align: justify;
    hyphens: auto;
}

.text-content p {
    margin-bottom: 0.8em;
}

/* ─────────────────────────────────────
   PÁGINA DE INTRODUCCIÓN
   ───────────────────────────────────── */
.intro-page {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.intro-content {
    text-align: center;
}

.intro-title {
    font-family: 'Caveat', cursive;
    font-size: 2.2em;
    color: #8B4513;
    font-weight: 600;
    margin-bottom: 10px;
}

.intro-subtitle {
    font-size: 1.3em;
    color: #A0826D;
    font-style: italic;
    margin-bottom: 20px;
}

/* ─────────────────────────────────────
   PÁGINA DE EPÍLOGO
   ───────────────────────────────────── */
.epilogo-page {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.epilogo-content {
    text-align: center;
}

.epilogo-title {
    font-family: 'Caveat', cursive;
    font-size: 2.2em;
    color: #8B4513;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ─────────────────────────────────────
   PÁGINA DE CRÉDITOS
   ───────────────────────────────────── */
.creditos-page {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-top: 20px;
}

.nav-arrows-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.creditos-title {
    font-family: 'Caveat', cursive;
    font-size: 2.2em;
    color: #8B4513;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.creditos-content {
    text-align: center;
}

.creditos-content .text-content {
    text-align: left;
}

.creditos-content .text-content p {
    margin-bottom: 0.8em;
}

.creditos-content .text-content a {
    color: #8B4513;
    text-decoration: none;
    font-weight: 600;
}

.creditos-content .text-content a:hover {
    text-decoration: underline;
}

.creditos-content .divider {
    margin: 0 auto 20px;
}

/* ─────────────────────────────────────
   RESPONSIVE - TABLET
   ───────────────────────────────────── */
@media (max-width: 1100px) {
    .moleskine-container {
        padding: 25px 35px 25px;
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
    }
    
    .text-columns {
        gap: 25px;
    }
    
    .page-content {
        gap: 12px;
    }
    
    .page-indicator {
        top: 30px;
        right: 35px;
    }
    
    .nav-arrow {
        width: 45px;
        height: 45px;
    }
    
    .photo-container {
        gap: 15px;
    }
    
    .diary-photo {
        max-height: 42vh;
    }
    
    .entry-title {
        font-size: 2.5em;
    }

	.day-title {
    	font-size: 2.2em;
	}

	.location {
    	font-size: 1.4em;
	}
	
	.text-columns {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .text-content {
        font-size: 1.7em;
        line-height: 1.8;
    }

	.subtitle {
    	font-size: 0.9em;
	}

	.btn-comments {
    	font-size: 1em;
    	padding: 6px 16px;
	}
}

@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }
    
    .moleskine-container {
        padding: 20px 18px 20px;
        height: calc(100vh - 30px);
        max-height: calc(100vh - 30px);
    }
    
    .moleskine-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .moleskine-header h1 {
        margin-bottom: 4px;
    }
    
    .main-title,
    .main-title-en {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 0.6em;
        margin-bottom: 5px;
    }
    
    .btn-comments {
        font-size: 0.7em;
        padding: 3px 10px;
    }
    
    .page-indicator {
        top: 25px;
        right: 18px;
        font-size: 0.75em;
        padding: 3px 8px;
    }
    
    .text-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .photo-container {
        gap: 10px;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
    }
    
    .nav-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .photo-frame {
        max-width: 100%;
        padding: 12px;
        padding-bottom: 15px;
    }
    
    .diary-photo {
        max-height: 40vh;
    }
    
    .day-title {
        font-size: 1.4em;
    }
    
    .entry-title {
        font-size: 1.6em;
        margin-bottom: 6px;
    }
    
    .location {
        font-size: 0.95em;
    }
    
    .text-content {
        font-size: 1.05em;
        line-height: 1.65;
    }
    
    .page-content {
        gap: 12px;
    }
        .creditos-title {
        font-size: 1.8em;
    }
    
    .nav-arrows-container {
        gap: 10px;
    }

}

/* ─────────────────────────────────────
   RESPONSIVE - MOBILE
   ───────────────────────────────────── */
@media (max-width: 480px) {
    body {
        padding: 10px 5px;
    }
    
    .moleskine-container {
        padding: 18px 12px 18px;
        border-radius: 15px;
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .moleskine-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .moleskine-header h1 {
        margin-bottom: 3px;
    }
    
    .main-title,
    .main-title-en {
        font-size: 1.3em;
    }
    
    .main-title::after {
        margin: 0 2px;
    }
    
    .subtitle {
        font-size: 0.55em;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }
    
    .btn-comments {
        padding: 3px 8px;
        font-size: 0.65em;
        border-width: 1px;
    }
    
    .page-indicator {
        top: 22px;
        right: 12px;
        font-size: 0.7em;
        padding: 2px 7px;
    }
    
    .photo-container {
        gap: 8px;
    }
    
    .nav-arrow {
        width: 36px;
        height: 36px;
        border-width: 1.5px;
    }
    
    .nav-arrow svg {
        width: 18px;
        height: 18px;
    }
    
    .photo-frame {
        padding: 10px;
        padding-bottom: 10px;
        transform: rotate(-1deg);
    }
    
    .diary-photo {
        max-height: 38vh;
    }
    
    .day-title {
        font-size: 1.3em;
    }
    
    .entry-title {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .location {
        font-size: 0.9em;
    }
    
    .text-columns {
    	grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .text-content {
        font-size: 1.05em;
        line-height: 1.6;
    }
    
    .intro-title,
    .epilogo-title {
        font-size: 1.6em;
    }
    
    .page-content {
        gap: 10px;
    }
        .creditos-title {
        font-size: 1.5em;
    }

}

/* Móviles en horizontal */
@media (max-height: 1100px) and (orientation: landscape) {
    .text-columns {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .text-content {
        font-size: 1.4em !important;
        line-height: 1.7;
    }
    
    .entry-title {
        font-size: 2.2em !important;
    }
    
    .day-title {
        font-size: 1.9em !important;
    }
    
    .location {
        font-size: 1.2em !important;
    }
    
    .subtitle {
        font-size: 0.85em !important;
    }
    
    .btn-comments {
        font-size: 0.95em !important;
    }
}
/* ─────────────────────────────────────
   UTILIDADES
   ───────────────────────────────────── */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

/* ─────────────────────────────────────
   LIGHTBOX PARA AMPLIAR FOTOS
   ───────────────────────────────────── */

/* Icono de lupa en la foto */
.zoom-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.zoom-icon svg {
    color: #8B4513;
}

/* Mostrar icono siempre en móvil */
@media (max-width: 1100px), (hover: none) {
    .zoom-icon {
        opacity: 1;
    }
}

/* Hover en foto */
.photo-frame {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-frame:hover {
    filter: brightness(1.05);
}

.photo-frame:hover .zoom-icon {
    opacity: 1;
}

/* Lightbox overlay */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #FBF8F3 0%, #F5F2ED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: calc(95vw - 80px);
    max-height: calc(95vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: white;
    padding: 15px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 30px;
    color: #8B4513;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    line-height: 1;
    padding: 0;
}

.lightbox-close:hover {
    background: white;
    transform: scale(1.1);
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-content img {
        max-width: calc(95vw - 50px);
        max-height: calc(95vh - 50px);
        padding: 10px;
    }
    
    .lightbox-close {
        width: 44px;
        height: 44px;
        font-size: 26px;
        top: 15px;
        right: 15px;
    }
    
    .zoom-icon {
        width: 32px;
        height: 32px;
    }
    
    .zoom-icon svg {
        width: 20px;
        height: 20px;
    }
}