/* ============================================
   MAPISAN.ES - Professional Design
   María Pilar Sánchez Sarasa
   ============================================ */

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

:root {
    --color-primary: #0A66C2;
    --color-primary-dark: #004182;
    --color-text: #000000DE;
    --color-text-secondary: #00000099;
    --color-text-muted: #666666;
    --color-bg: #F3F2F0;
    --color-white: #FFFFFF;
    --color-border: #00000024;
    --color-hover: #F3F2F0;
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    
    --shadow-sm: 0 0 0 1px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 0 0 1px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.12);
    
    --radius: 8px;
}

html {
    scroll-behavior: smooth;
    font-size: 14px;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: 24px; }
h2 { font-size: 20px; margin-bottom: 20px; }
h3 { font-size: 16px; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
}

/* ===== PROFILE HEADER ===== */
.profile-header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.header-background {
    height: 120px;
    background: linear-gradient(135deg, #0A66C2 0%, #004182 100%);
}

.profile-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.profile-main {
    position: relative;
    padding: 0 24px 20px;
    margin-top: -70px;
}

.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid var(--color-white);
    overflow: hidden;
    background: var(--color-bg);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-title {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.profile-location {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.profile-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--color-bg);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.contact-link:hover {
    background: #E8E6E3;
    text-decoration: none;
}

.contact-link svg {
    flex-shrink: 0;
}

/* ===== MAIN CONTENT LAYOUT - FULL WIDTH ===== */
.main-content {
    padding: 20px 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== SIDEBAR ===== */
.sidebar .card {
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.sidebar p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.skills-list,
.cert-list {
    list-style: none;
}

.skills-list li,
.cert-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
}

.skills-list li:last-child,
.cert-list li:last-child {
    border-bottom: none;
}

/* ===== EXPERIENCE SECTION - COMPACTA ===== */
.experience-section {
    margin-bottom: 20px;
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.experience-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.experience-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.exp-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exp-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.exp-company {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

.exp-date {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.exp-role {
    font-size: 14px;
    color: var(--color-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.exp-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* ===== REDES SOCIALES - GRID 2 COLS ===== */
.section-redes {
    margin-bottom: 20px;
}

.section-redes h2 {
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.section-subtitle {
    background: var(--color-white);
    padding: 0 20px 20px;
    font-size: 14px;
    color: var(--color-text-muted);
    box-shadow: var(--shadow-sm);
}

.redes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.red-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.red-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.red-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--color-bg);
    position: relative;
}

.red-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.red-fuente {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.red-content {
    padding: 16px;
}

.red-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.red-texto {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.red-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.red-link:hover {
    text-decoration: none;
    gap: 8px;
}

/* ===== PONENCIAS - CARDS HORIZONTALES ===== */
.ponencias-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ponencia-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.ponencia-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-primary);
}

.ponencia-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
}

.ponencia-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ponencia-content {
    flex: 1;
}

.ponencia-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.ponencia-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.ponencia-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ===== PUBLICACIONES - LISTA COMPACTA ===== */
.publicaciones-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publicacion-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    border-left: 3px solid var(--color-primary);
    background: var(--color-hover);
    border-radius: 4px;
    transition: all 0.2s;
}

.publicacion-item:hover {
    background: #E8E6E3;
}

.publicacion-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.publicacion-content {
    flex: 1;
}

.publicacion-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.publicacion-content p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin: 0;
}

.publicacion-tipo {
    display: inline-block;
    padding: 2px 8px;
    background: var(--color-primary);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--color-text-secondary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.project-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: all 0.2s;
}

.project-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-primary);
}

.project-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.project-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.project-content p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tag {
    padding: 4px 10px;
    background: var(--color-bg);
    border-radius: 12px;
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--color-white);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    box-shadow: var(--shadow-sm);
}

.footer-container {
    max-width: 100%;
    width: 100%;
}

.footer p {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .main-feed {
        order: 1;
    }
    
    .sidebar .card {
        position: static;
    }
    
    .redes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-layout {
        padding: 0 16px;
    }
    
    .profile-main {
        padding: 0 16px 20px;
    }
    
    .profile-photo {
        width: 120px;
        height: 120px;
        margin-top: -60px;
    }
    
    .profile-info h1 {
        font-size: 24px;
    }
    
    .profile-title {
        font-size: 14px;
    }
    
    .profile-contact {
        flex-direction: column;
    }
    
    .redes-grid {
        grid-template-columns: 1fr;
    }
    
    .ponencia-card {
        flex-direction: column;
    }
    
    .ponencia-image {
        width: 100%;
        height: 200px;
    }
    
    .project-item {
        flex-direction: column;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .header-background {
        height: 80px;
    }
    
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    .card {
        padding: 16px;
    }
    
    .red-image {
        height: 220px;
    }
}

/* ── SECCIÓN EMBEDS ─────────────────────────────────────── */
.section-subtitle { color: var(--color-text-secondary); font-size: 13px; margin-bottom: 20px; }

.embeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}
.embed-wrapper { width: 100%; display: flex; flex-direction: column; align-items: center; }
.embed-instagram .instagram-media { width: 100% !important; max-width: 100% !important; min-width: 0 !important; border-radius: var(--radius) !important; }
.embed-youtube iframe { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); background: #000; }
.embed-short { max-width: 340px; margin: 0 auto; }
.embed-short iframe { aspect-ratio: 9/16; }
.embed-twitter { width: 100%; max-width: 550px; margin: 0 auto; }
.embed-twitter .twitter-tweet { margin: 0 auto !important; }
.embed-tiktok { max-width: 340px; margin: 0 auto; }
.embed-tiktok iframe { width: 100%; min-height: 560px; border-radius: var(--radius); background: #000; }
.embed-desc { margin-top: 8px; font-size: 13px; color: var(--color-text-secondary); text-align: center; width: 100%; }
.embed-error { padding: 16px; background: #fff3f3; border: 1px solid #fcc; border-radius: var(--radius); color: #c00; font-size: 13px; width: 100%; text-align: center; }

/* ── TARJETAS LINKEDIN Y PRENSA ─────────────────────────── */
.tarjeta-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius); text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; width: 100%; box-sizing: border-box; }
.tarjeta-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tarjeta-linkedin { background: #fff; border: 1px solid #d0e8ff; border-left: 4px solid #0A66C2; }
.tarjeta-prensa   { background: #fff; border: 1px solid #e0e0e0; border-left: 4px solid #c0392b; }
.tarjeta-logo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.tarjeta-logo svg { width: 20px; height: 20px; flex-shrink: 0; }
.tarjeta-logo-linkedin { color: #0A66C2; }
.tarjeta-logo-prensa   { color: #c0392b; }
.tarjeta-fecha { margin-left: auto; font-weight: 400; color: var(--color-text-muted); font-size: 12px; }
.tarjeta-titulo { font-size: 15px; font-weight: 600; color: var(--color-text); line-height: 1.4; margin: 0; }
.tarjeta-desc { font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tarjeta-btn { font-size: 13px; font-weight: 600; margin-top: 4px; }
.tarjeta-linkedin .tarjeta-btn { color: #0A66C2; }
.tarjeta-prensa   .tarjeta-btn { color: #c0392b; }

/* ── EXPERIENCE EN SIDEBAR ──────────────────────────────── */
.sidebar .experience-section h4 { font-size: 13px; font-weight: 600; }
.sidebar .experience-item { gap: 10px; }
.sidebar .exp-icon { font-size: 16px; }

@media (max-width: 600px) { .embeds-grid { grid-template-columns: 1fr; } }
