/* Moderno y limpio */
:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --light: #e9e9e9;
    --gray: #888;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.7;
}

.container, .section-header, .admin-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER --- */
header {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
    position: relative;
    top: 0;
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
}

nav a {
    color: #ddd;
    margin-left: 1.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

nav a:hover {
    color: #00aaff;
}

/* --- HERO --- */
.hero {
    text-align: center;
    padding: 30px 20px 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* --- PASSION GRID --- */
.passions-grid {
    display: grid;
    gap: 25px;
    padding: 0 20px;
    box-sizing: border-box;
}

.passion-card {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    background: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    padding: 30px 20px;
    color: #1a1a2e;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 220px;
}

.passion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.passion-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #5f27cd;
}

.passion-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.passion-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    /* Evita truncamiento */
    white-space: normal;
    overflow: visible;
}

/* Colores por pasión */
.passion-card.photography    { border-top: 6px solid #ff6b6b; }
.passion-card.poetry        { border-top: 6px solid #ff9ff3; }
.passion-card.programming   { border-top: 6px solid #54a0ff; }
.passion-card.cybersecurity { border-top: 6px solid #5f27cd; }
.passion-card.radioaficion  { border-top: 6px solid #ff8c00; }

/* --- DISEÑO PARA PC/TABLET --- */
@media (min-width: 769px) {
    .passions-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        margin: 60px auto;
        padding: 0;
    }

    .passion-card {
        max-width: 350px;
    }

    /* Contenedor para las dos tarjetas inferiores */
    .bottom-cards-wrapper {
        grid-column: 2 / 4;
        justify-self: center;
        display: flex;
        gap: 25px;
    }

    .bottom-cards-wrapper .passion-card {
        max-width: 350px;
        margin: 0;
    }
}

/* --- DISEÑO PARA MÓVIL --- */
@media (max-width: 768px) {
    .passions-grid {
        grid-template-columns: 1fr;
        margin-top: 40px;
    }

    .passion-card,
    .bottom-cards-wrapper .passion-card {
        max-width: 400px;
        width: 100%;
        margin: 0 auto;
    }

    .bottom-cards-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
}

/* --- RECENT WORK --- */
.recent-work {
    padding: 40px 0;
}

.recent-work h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 2rem;
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.photo-preview {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.photo-preview:hover {
    transform: scale(1.03);
}

.photo-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.photo-info {
    padding: 15px;
    background: white;
}

.photo-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--primary);
}

.photo-info p {
    font-size: 0.9rem;
    color: var(--gray);
}

/* --- BOTONES --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    background: #0c2a4d;
    transform: translateY(-2px);
}

.text-center {
    text-align: center;
    margin: 30px 0;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--primary);
    color: #aaa;
    margin-top: 60px;
}

/* --- MENÚ RESPONSIVO --- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateZ(0);
    isolation: isolate;
}

.nav-brand a {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-menu a {
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: #ddd;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 10px 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 10px 20px;
    }

    .nav-toggle {
        display: flex;
    }
}

/* --- GENERAL: EVITAR TRUNCAMIENTO --- */
.passion-card h3,
.passion-card p {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* --- POESÍA: LISTA DE POEMAS --- */
.poems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.poem-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-left: 6px solid #ccc; /* Se sobrescribe con style="" */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.poem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.poem-card h3 {
    color: #1a1a2e;
    margin-bottom: 5px;
    font-size: 1.3rem;
    font-weight: 600;
}

.poem-title-link {
    color: #1a1a2e;
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.poem-title-link:hover {
    color: #dd77aa;
    text-decoration: underline;
}

.poem-preview {
    font-family: 'Georgia', serif;
    line-height: 1.7;
    color: #555;
    font-size: 1.05rem;
    white-space: pre-line;
    margin: 15px 0;
    min-height: 80px;
}

.read-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.95rem;
    color: #0088ff;
    text-decoration: none;
    opacity: 0.8;
    font-weight: 500;
}

.read-more:hover {
    color: #0055aa;
    text-decoration: underline;
    opacity: 1;
}

.poem-date {
    display: block;
    text-align: right;
    margin-top: 15px;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
    padding-right: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
    font-size: 1.1rem;
}

/* --- DETALLE DEL POEMA --- */
.poem-detail {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.poem-article {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    line-height: 1.8;
    max-width: 95%;
    margin: 0 auto;
    position: relative;
}

.poem-header {
    text-align: center;
    margin-bottom: 20px;
}

.poem-header h1 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.4rem;
    color: rgb(204, 252, 211);
    margin: 0;
    letter-spacing: -0.5px;
}

.poem-body {
    font-family: 'Georgia', serif;
    font-size: 1.4rem;
    color: #2c3e50;
    line-height: 1.5;
    text-align: center;
    white-space: pre-line;
    max-width: 700px;
    margin: 20px auto;
    padding: 0 10px;
}

.poem-body br {
    margin: 0;
    padding: 0;
}

.poem-nav {
    text-align: center;
    margin: 40px 0 20px;
}

/* --- FONDO PARA POEMAS DEDICADOS --- */
.poem-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    opacity: 0.4;
    filter: brightness(0.95) blur(6px);
    transition: opacity 0.6s ease;
}

/* --- RESPONSIVE: POEMAS --- */
@media (max-width: 768px) {
    .poem-article {
        padding: 15px 10px;
        margin: 20px auto;
    }

    .poem-header h1 {
        font-size: 1.8rem;
    }

    .poem-body, .´poem-date {
        font-size: 1.2rem;
        line-height: 1.5;
    }
}

/* --- RESPONSIVE: POEMAS --- */
@media (max-width: 414px) {
    .poem-article {
        padding: 15px 10px;
        margin: 20px auto;
    }

    .poem-header h1 {
        font-size: 1.4rem;
    }

    .poem-body {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .poem-date {
        font-size: 0.5rem;
        line-height: 1;
    }
}

/* --- GALERÍA DE FOTOGRAFÍA --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.photo-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: white;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.photo-caption {
    margin-top: 12px;
    padding: 0 5px;
}

.photo-caption h4 {
    font-size: 1.15rem;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.photo-caption p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

/* --- MODAL DE FOTO (pantalla completa) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    text-align: center;
    overflow: hidden;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    margin-top: 5vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    object-fit: contain;
    animation: fadeInZoom 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.modal-caption {
    color: #ddd;
    font-size: 1.1rem;
    margin-top: 15px;
    font-family: 'Georgia', serif;
    padding: 0 20px;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.close-btn:hover {
    color: #bbb;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

@keyframes fadeInZoom {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- PÁGINA "SOBRE MÍ" --- */
.about-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    font-family: 'Segoe UI', sans-serif;
}

.about-header {
    text-align: center;
    margin-bottom: 60px;
    color: #1a1a2e;
}

.about-header h1 {
    font-size: 2.0rem;
    margin-bottom: 15px;
    color: #fcfcfd;
}

.about-header p {
    font-size: 1.1rem;
    color: #858484;
    max-width: 850px;
    margin: 0 auto;
}

/* Sección con foto a la izquierda */
.about-section {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 80px;
    line-height: 1.7;
}

/* Texto */
.about-text {
    flex: 1;
    max-width: 600px;
}

.about-text h2 {
    font-size: 1.6rem;
    color: #1a1a2e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-text p {
    color: #333;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Imagen */
.about-image {
    flex: 1;
    max-width: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.about-image img {
    width: 100%;
    height: 300px;
    object-fit: cover; /* Recorta la imagen para llenar el espacio */
    display: block;
    transition: transform 0.4s ease;
    border-radius: 12px;
}

.about-image img:hover {
    transform: scale(1.05);
}

/* Foto a la derecha */
.right-image {
    flex-direction: row-reverse;
}

/* Responsive: una columna en móviles */
@media (max-width: 768px) {
    .about-section {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .right-image {
        flex-direction: column;
    }

    .about-image,
    .about-text {
        max-width: 100%;
    }

    .about-image {
        order: -1; /* Mantiene la imagen arriba en móvil */
    }
}