/* ============================================================
   MAESTRÍAS - CSS
   Estilos para template-maestrias.php (Fiel al Figma)
   Version: 1.1.1
   ============================================================ */

/* ========================================
   SECCIÓN INTRO (Texto + Imagen)
   ======================================== */

.og-maestrias-intro {
    padding: 0;
    background: #f5f5f5;
}

/* Layout horizontal (Grid) - Mantener para compatibilidad */
.og-maestrias-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
    align-items: stretch;
}

/* Layout vertical (nuevo) */
.og-maestrias-intro-vertical {
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.og-maestrias-intro .og-maestrias-intro-image {
    width: 100%;
    max-height: 650px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.og-maestrias-intro .og-maestrias-intro-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 650px;
}

.og-maestrias-intro .og-maestrias-intro-text {
    padding: 60px 80px;
    text-align: center;
    background: #f5f5f5;
}

.og-maestrias-intro .og-maestrias-intro-text h2 {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.og-maestrias-intro .og-maestrias-intro-text p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.og-maestrias-intro .og-maestrias-intro-buttons {
    justify-content: center;
}

.og-maestrias-intro-text {
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f5f5f5;
    position: relative;
}
/* Botones centrados en una fila */
.og-buttons-centered {
    justify-content: center;
}

/* Carrusel container para educación continua */
.og-maestrias-carousel {
    width: 100%;
    position: relative;
}

.og-maestrias-carousel .og-carousel-slide {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.og-maestrias-carousel .og-carousel-slide.active {
    display: block;
}

.og-maestrias-intro-text h2 {
    font-size: 18px;
    font-weight: 400;
    color: #003d71;
    line-height: 1.6;
    margin-bottom: 20px;
}

.og-maestrias-intro-text p {
    font-size: 1.25rem;
    color: #666666;
    line-height: 1.8;
    margin-bottom: 30px;
}

/* Indicadores para el carrusel de maestrías/educación */
.og-maestrias-carousel .og-carousel-indicators {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: flex-start;
}

.og-maestrias-carousel .og-indicator {
    width: 14px;
    height: 14px;
    background: rgba(0, 61, 113, 0.3);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.og-maestrias-carousel .og-indicator:hover {
    background: rgba(0, 61, 113, 0.5);
    transform: scale(1.1);
}

.og-maestrias-carousel .og-indicator.active {
    background: #003d71;
    width: 16px;
    height: 16px;
}

.og-maestrias-intro-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.og-btn-maestrias-primary {
    padding: 14px 32px;
    background: #003d71;
    color: #ffffff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-block;
}

.og-btn-maestrias-primary:hover {
    background: #002852;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 61, 113, 0.3);
}

.og-btn-maestrias-secondary {
    padding: 14px 32px;
    background: transparent;
    color: #003d71;
    border: 2px solid #003d71;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-block;
}

.og-btn-maestrias-secondary:hover {
    background: #003d71;
    color: #ffffff;
    transform: translateY(-2px);
}

.og-maestrias-intro-image {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.og-maestrias-intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   SEPARADOR AZUL
   ======================================== */

.og-maestrias-separator {
    min-height: 80px;
    background: #0593f3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.og-separator-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    line-height: 1.3;
}

/* ========================================
   GRID DE MAESTRÍAS (4 Cards)
   ======================================== */

.og-maestrias-grid {
    padding: 0;
    background: #003d71;
}

.og-maestrias-grid .og-container {
    max-width: 1400px;
}

.og-maestrias-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    justify-content: center;
}

/* Centrar cuando hay solo 2 cards (para Acuerdo 286 y Programas España) */
.og-maestrias-list-centered {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
}

/* Centrar cuando hay 3 cards (para Educación Continua) */
.og-maestrias-list:has(.og-maestria-card:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 0 auto;
}

/* Centrar cuando hay 2 cards (automático sin clase especial) */
.og-maestrias-list:has(.og-maestria-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
}

/* Cards de Maestría */
.og-maestria-card {
    background: #ffffff;
    padding: 100px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.og-maestria-card:hover {
    background: #f8f9fa;
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.og-maestria-card h3 {
    font-size: 28px;
    font-weight: 700;
    color: #003d71;
    margin-bottom: 40px;
    line-height: 1.3;
}

.og-btn-maestria-card {
    padding: 12px 40px;
    background: #0593f3;
    color: #ffffff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-block;
}

.og-btn-maestria-card:hover {
    background: #0079d7;
    transform: scale(1.05);
}

/* ========================================
   RESPONSIVE - MAESTRÍAS LISTADO
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .og-maestrias-intro {
        padding-top: 70px;
    }
    
    .og-maestrias-intro-grid {
        grid-template-columns: 1fr;
    }

    .og-maestrias-intro-text {
        padding: 50px 40px;
    }

    .og-maestrias-intro-image {
        min-height: 400px;
    }
    
    /* Layout vertical en tablet */
    .og-maestrias-intro-vertical {
        padding: 0 15px;
    }
    
    .og-maestrias-intro-vertical .og-maestrias-intro-image {
        max-height: 450px;
        border-radius: 10px;
    }
    
    .og-maestrias-intro-vertical .og-maestrias-intro-image img {
        max-height: 450px;
    }
    
    .og-maestrias-intro-vertical .og-maestrias-intro-text {
        padding: 50px 40px;
    }

    .og-maestrias-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    /* Mantener 3 columnas en tablet si hay exactamente 3 cards */
    .og-maestrias-list:has(.og-maestria-card:nth-child(3):last-child) {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
    }
    
    .og-maestrias-list-centered {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }
    
    .og-maestrias-hero h1,
    .og-maestria-hero h1 {
        font-size: 2.8rem;
        padding: 0 20px;
    }
}

/* Móvil */
@media (max-width: 768px) {
    .og-maestrias-intro {
        padding-top: 60px;
    }
    
    .og-maestrias-hero h1,
    .og-maestria-hero h1 {
        font-size: 2rem;
        padding: 0 15px;
    }
    
    .og-maestrias-intro-text {
        padding: 40px 20px;
    }
    
    /* Layout vertical en móvil */
    .og-maestrias-intro-vertical {
        padding: 0 10px;
    }
    
    .og-maestrias-intro-vertical .og-maestrias-intro-image {
        max-height: 350px;
        border-radius: 8px;
    }
    
    .og-maestrias-intro-vertical .og-maestrias-intro-image img {
        max-height: 350px;
    }
    
    .og-maestrias-intro-vertical .og-maestrias-intro-text {
        padding: 40px 20px;
    }
    
    .og-maestrias-list,
    .og-maestrias-list:has(.og-maestria-card:nth-child(3):last-child),
    .og-maestrias-list:has(.og-maestria-card:nth-child(2):last-child) {
        grid-template-columns: 1fr;
    }

    .og-maestrias-intro-text h2 {
        font-size: 16px;
    }

    .og-maestrias-intro-text p {
        font-size: 14px;
    }

    .og-maestrias-intro-buttons {
        flex-direction: column;
    }

    .og-btn-maestrias-primary,
    .og-btn-maestrias-secondary {
        width: 100%;
        text-align: center;
    }

    .og-maestrias-separator {
        height: 50px;
    }

    .og-maestrias-list {
        grid-template-columns: 1fr;
    }
    
    .og-maestrias-list-centered {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .og-maestria-card {
        padding: 60px 30px;
        min-height: 300px;
    }

    .og-maestria-card h3 {
        font-size: 24px;
        margin-bottom: 30px;
    }
}

/* ============================================================
   PÁGINAS DE DETALLE DE MAESTRÍA (mantener estilos existentes)
   ============================================================ */

/* ============================================================
   PÁGINAS DE DETALLE DE MAESTRÍA
   ============================================================ */

/* Hero individual */
.og-maestria-hero {
    background: linear-gradient(135deg, #1a365d 0%, #2563eb 100%);
    color: white;
    padding: 100px 0 60px;
    text-align: center;
}

.og-maestria-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.og-maestria-subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Contenido con sidebar */
.og-maestria-content {
    padding: 60px 0;
}

.og-maestria-content .og-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

/* Main content */
.og-maestria-main {
    background: white;
    padding: 2rem;
    border-radius: 12px;
}

.og-maestria-intro h2 {
    font-size: 2rem;
    color: #1a365d;
    margin-bottom: 1rem;
}

.og-maestria-intro p {
    font-size: 1.125rem;
    color: #475569;
    line-height: 1.8;
}

.og-maestria-benefits {
    margin-top: 3rem;
}

.og-maestria-benefits h3 {
    font-size: 1.75rem;
    color: #1a365d;
    margin-bottom: 1rem;
}

.og-maestria-benefits ul {
    list-style: none;
    padding: 0;
}

.og-maestria-benefits ul li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    color: #475569;
}

.og-maestria-benefits ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
}

.og-maestria-info {
    margin-top: 3rem;
}

.og-maestria-info h3 {
    font-size: 1.75rem;
    color: #1a365d;
    margin-bottom: 1.5rem;
}

.og-maestria-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.og-info-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.og-info-item strong {
    display: block;
    color: #1a365d;
    margin-bottom: 0.5rem;
}

.og-info-item span {
    color: #475569;
}

/* ============================================
   CONVOCATORIA VIGENTE
   ============================================ */
.og-convocatoria-vigente {
    background: #0593f3;
    padding: 60px 0;
}

.og-convocatoria-title {
    font-size: 28px;
    font-weight: 700;
    text-align: left;
    color: #003366;
    margin-bottom: 10px;
}

.og-convocatoria-subtitle {
    text-align: left;
    font-size: 15px;
    color: #003366;
    margin-bottom: 30px;
    font-weight: 400;
}

.og-convocatoria-table-wrapper {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.og-convocatoria-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.og-convocatoria-table thead {
    background: white;
    border-bottom: 2px solid #333;
}

.og-convocatoria-table thead th {
    color: #333;
    padding: 12px 15px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
}

.og-convocatoria-table tbody tr {
    border-bottom: 1px solid #ddd;
}

.og-convocatoria-table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    color: #333;
    text-align: center;
}

.og-convocatoria-table tbody tr:last-child {
    border-bottom: none;
}

/* CTA de formulario */
.og-maestria-cta {
    margin-top: 3rem;
    background: #eff6ff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.og-maestria-cta h3 {
    font-size: 1.75rem;
    color: #1a365d;
    margin-bottom: 0.5rem;
}

.og-maestria-cta p {
    color: #475569;
    margin-bottom: 1.5rem;
}

/* Sidebar */
.og-maestria-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.og-sidebar-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.og-sidebar-card h4 {
    font-size: 1.25rem;
    color: #1a365d;
    margin-bottom: 0.75rem;
}

.og-sidebar-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ========================================
   SECCIÓN CONTACTO (Con Formulario)
   ======================================== */

.og-maestrias-contacto {
    padding: 80px 0;
    background: #ffffff;
}

.og-maestrias-contacto-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}

/* Columna Izquierda: Info + Logo */
.og-maestrias-contacto-info {
    padding: 40px 30px;
    background: #f8fafc;
    border-radius: 8px;
}

.og-maestrias-contacto-info h2 {
    font-size: 32px;
    font-weight: 700;
    color: #003d71;
    margin-bottom: 30px;
}

.og-contacto-info-item {
    margin-bottom: 20px;
}

.og-contacto-info-item p {
    font-size: 15px;
    color: #333333;
    line-height: 1.8;
    margin-bottom: 5px;
}

.og-contacto-info-item a {
    color: #0593f3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.og-contacto-info-item a:hover {
    color: #003d71;
    text-decoration: underline;
}

.og-contacto-buho {
    margin-top: 40px;
    text-align: center;
}

.og-contacto-buho img {
    max-width: 150px;
    height: auto;
    opacity: 1;
}

/* Columna Derecha: Formulario */
.og-maestrias-contacto-form {
    background: #f8fafc;
    padding: 40px;
    border-radius: 8px;
}

/* Estilos del formulario HTML / CF7 */
.og-form-maestrias,
.og-maestrias-contacto-form .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.og-form-group,
.og-maestrias-contacto-form .wpcf7-form-control-wrap {
    width: 100%;
}

.og-form-group input[type="text"],
.og-form-group input[type="email"],
.og-form-group input[type="tel"],
.og-form-group select,
.og-form-group textarea,
.og-maestrias-contacto-form input[type="text"],
.og-maestrias-contacto-form input[type="email"],
.og-maestrias-contacto-form input[type="tel"],
.og-maestrias-contacto-form select,
.og-maestrias-contacto-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Lexend', sans-serif;
    background: #ffffff;
    color: #333333;
    transition: all 0.3s ease;
}

.og-form-group input:focus,
.og-form-group select:focus,
.og-form-group textarea:focus,
.og-maestrias-contacto-form input:focus,
.og-maestrias-contacto-form select:focus,
.og-maestrias-contacto-form textarea:focus {
    outline: none;
    border-color: #0593f3;
    box-shadow: 0 0 0 3px rgba(5, 147, 243, 0.1);
}

.og-form-group textarea,
.og-maestrias-contacto-form textarea {
    resize: vertical;
    min-height: 100px;
}

.og-form-group select,
.og-maestrias-contacto-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Checkbox personalizado */
.og-form-checkbox,
.og-maestrias-contacto-form .wpcf7-list-item {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
}

.og-form-checkbox label,
.og-maestrias-contacto-form .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.og-form-checkbox input[type="checkbox"],
.og-maestrias-contacto-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    cursor: pointer;
}

/* Botón Enviar */
.og-btn-form-submit,
.og-maestrias-contacto-form input[type="submit"],
.og-maestrias-contacto-form button[type="submit"] {
    padding: 14px 40px;
    background: #0593f3;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    font-family: 'Lexend', sans-serif;
}

.og-btn-form-submit:hover,
.og-maestrias-contacto-form input[type="submit"]:hover,
.og-maestrias-contacto-form button[type="submit"]:hover {
    background: #0079d7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 147, 243, 0.3);
}

/* Nota temporal */
.og-form-note {
    margin-top: 20px;
    padding: 15px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    font-size: 14px;
    color: #92400e;
    border-radius: 4px;
}

/* Mensajes CF7 */
.og-maestrias-contacto-form .wpcf7-response-output {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
}

.og-maestrias-contacto-form .wpcf7-mail-sent-ok {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.og-maestrias-contacto-form .wpcf7-validation-errors {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* ========================================
   RESPONSIVE - SECCIÓN CONTACTO
   ======================================== */

@media (max-width: 1024px) {
    .og-maestrias-contacto-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }

    .og-maestrias-contacto-info {
        max-width: 100%;
    }
    
    .og-maestrias-contacto-form {
        padding: 30px 25px;
    }
}

@media (max-width: 768px) {
    .og-maestrias-contacto {
        padding: 60px 0;
    }
    
    .og-maestrias-contacto-grid {
        gap: 30px;
        padding: 0 15px;
    }
    
    .og-maestrias-contacto-info,
    .og-maestrias-contacto-form {
        padding: 25px 20px;
    }
    
    .og-maestrias-contacto-form input[type="text"],
    .og-maestrias-contacto-form input[type="email"],
    .og-maestrias-contacto-form input[type="tel"],
    .og-maestrias-contacto-form select,
    .og-maestrias-contacto-form textarea {
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* ============================================================
   VIDEO TESTIMONIOS
   ============================================================ */

.og-maestrias-video {
    background: #ffffff;
    padding: 80px 0;
    text-align: center;
}

.og-maestrias-video h2 {
    font-size: 32px;
    color: #003b72;
    font-weight: 700;
    margin-bottom: 40px;
    text-transform: none;
}

.og-maestrias-video .og-video-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 (9/16 = 0.5625) */
    height: 0;
    overflow: hidden;
}

.og-maestrias-video .og-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: #000000;
    outline: none;
}

.og-maestrias-video .og-video-player:focus {
    outline: 3px solid #0593f3;
    outline-offset: 4px;
}

/* ============================================================
   RESPONSIVE - VIDEO TESTIMONIOS
   ============================================================ */

@media (max-width: 768px) {
    .og-maestrias-video {
        padding: 50px 0;
    }

    .og-maestrias-video h2 {
        font-size: 24px;
        margin-bottom: 25px;
        padding: 0 20px;
    }

    .og-maestrias-video .og-video-wrapper {
        padding: 0 10px;
        padding-bottom: 56.25%; /* Mantener aspect ratio 16:9 en móvil */
    }

    .og-maestrias-video .og-video-player {
        border-radius: 8px;
    }

    /* Carrusel responsive en educación continua */
    .og-maestrias-intro-text {
        padding: 40px 30px;
    }

    .og-maestrias-intro-text h2 {
        font-size: 16px;
    }

    .og-maestrias-intro-text p {
        font-size: 15px;
    }

    .og-maestrias-carousel .og-carousel-indicators {
        justify-content: center;
        margin-top: 20px;
    }

    .og-maestrias-intro-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .og-btn-maestrias-primary,
    .og-btn-maestrias-secondary {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .og-maestrias-contacto {
        padding: 60px 0;
    }

    .og-maestrias-contacto-info,
    .og-maestrias-contacto-form {
        padding: 30px 20px;
    }

    .og-maestrias-contacto-info h2 {
        font-size: 24px;
    }

    .og-contacto-buho img {
        max-width: 120px;
    }

    /* Separador responsive */
    .og-maestrias-separator {
        min-height: 60px;
        padding: 15px 20px;
    }

    .og-separator-title {
        font-size: 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .og-maestrias-hero h1 {
        font-size: 2rem;
    }

    .og-maestria-hero h1 {
        font-size: 2rem;
    }

    .og-maestria-content .og-container {
        grid-template-columns: 1fr;
    }

    .og-maestria-info-grid {
        grid-template-columns: 1fr;
    }
}
