/*
TRABAJO OPTATIVO DE CSS
Joan Moral Lopez
mailto: jml123@alu.ua.es
*/

/* ===== ESTILOS BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== CONTENEDOR PRINCIPAL (ID del HTML) ===== */
#contenedor {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER (Adaptado a #intro del HTML) ===== */
#intro {
    background: linear-gradient(to right, #0055a4, #003366);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 2rem;
    border-radius: 0 0 8px 8px;
}

#titulo {
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
}

#titulo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    border-bottom: none;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
}

#titulo h1 span {
    display: block;
}

#titulo h2 {
    font-size: 1.2rem;
    color: #ffcc00;
    font-weight: normal;
    margin-top: 0.25rem;
    border-left: none;
    padding-left: 0;
}

#titulo h2 span {
    display: block;
}

/* ===== RESUMEN ===== */
#resumen {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    margin: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #ffcc00;
}

#resumen p {
    margin-bottom: 1rem;
    color: #f0f0f0;
}

#resumen ul.ul1 {
    margin: 1rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
    color: #f0f0f0;
}

#resumen li {
    margin-bottom: 0.5rem;
}

/* ===== COMENTARIO ===== */
#comentario {
    background: #e8f4fd;
    border-left: 4px solid #0055a4;
    padding: 1.5rem;
    margin: 1.5rem;
    border-radius: 0 6px 6px 0;
}

#comentario p {
    margin-bottom: 1rem;
    color: #333;
}

/* ===== ENLACES INTERNOS ===== */
#enlacesintra {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

#enlacesintra h3.intra {
    color: #0055a4;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

#enlacesintra ul.ul1 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding-left: 0;
}

#enlacesintra li {
    margin-bottom: 0;
}

#enlacesintra a {
    display: inline-block;
    background: #0055a4;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

#enlacesintra a:hover {
    background: #003366;
    text-decoration: none;
}

/* ===== APARTADOS PRINCIPALES ===== */
#apartados {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
    padding: 2.5rem;
    border: 1px solid #e9ecef;
}

#apartados > div {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

#apartados > div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ===== ENCABEZADOS DE APARTADOS ===== */
#apartados h3 {
    color: #0055a4;
    border-bottom: 2px solid #ffcc00;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#apartados h3 span {
    display: block;
}

/* ===== OBJETIVOS ===== */
#objetivos p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ===== CONTENIDOS ===== */
#contenidos ul.ul1,
#contenidos ul.ul2 {
    margin: 1rem 0 1.5rem 1.5rem;
    padding-left: 1rem;
}

#contenidos ul.ul1 li,
#contenidos ul.ul2 li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

#contenidos ul.ul1 > li {
    font-weight: 600;
    color: #003366;
}

#contenidos ul.ul1 ul {
    margin: 0.5rem 0 0.5rem 1.5rem;
    font-weight: normal;
    color: #555;
}

#contenidos ul.ul1 ul li {
    font-weight: normal;
}

/* ===== PROFESORES ===== */
#profesores dl {
    margin: 1rem 0;
}

#profesores dt {
    font-weight: 600;
    color: #0055a4;
    margin-top: 1rem;
}

#profesores dt:first-child {
    margin-top: 0;
}

#profesores dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: #555;
}

/* ===== BIBLIOGRAF?A ===== */
#bibliografia dl {
    margin: 1rem 0;
}

#bibliografia dt {
    font-weight: 600;
    color: #003366;
    margin-top: 1rem;
    font-size: 1.1rem;
}

#bibliografia dt:first-child {
    margin-top: 0;
}

#bibliografia dd {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0055a4;
}

#bibliografia span.autores {
    font-weight: 600;
    color: #0055a4;
    display: block;
}

#bibliografia span.editorial {
    display: block;
    color: #666;
    font-style: italic;
    margin: 0.25rem 0;
}

#bibliografia span.isbn {
    display: block;
    color: #888;
    font-size: 0.9rem;
}

/* ===== ENLACES (DISE?OS, HIST?RICO, RECURSOS) ===== */
#enlaces {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}

#lselecciona,
#lhistorico,
#lrecursos {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#enlaces h3 {
    color: #0055a4;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

#enlaces ul {
    list-style: none;
    padding-left: 0;
}

#enlaces li {
    margin-bottom: 0.75rem;
    padding-left: 0;
}

#enlaces a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.25rem 0;
}

#enlaces a:hover {
    color: #003366;
    text-decoration: underline;
}

/* ===== ENLACES VERSIONES ===== */
#enlacesversiones {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 2rem 0;
}

#enlacesversiones h3.versiones {
    color: #0055a4;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

#enlacesversiones ul.ul1 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding-left: 0;
}

#enlacesversiones li {
    margin-bottom: 0;
}

#enlacesversiones a {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

#enlacesversiones a:hover {
    background: #545b62;
    text-decoration: none;
}

/* ===== DIVS EXTRAS (Para im?genes) ===== */
#extraDiv1,
#extraDiv2,
#extraDiv3,
#extraDiv4,
#extraDiv5,
#extraDiv6 {
    display: none; /* Ocultos por defecto, se pueden mostrar con CSS espec?fico */
}

/* ===== ENLACES GENERALES ===== */
a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #003366;
    text-decoration: underline;
}

/* ===== LISTAS GENERALES ===== */
ul, ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ===== ACCESIBILIDAD WCAG 2.2 ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ffcc00;
    color: #000;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* Mejoras de contraste */
.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

/* ===== RESPONSIVE DESIGN ===== */

/* M?viles (640px o menos) */
@media (max-width: 640px) {
    #contenedor {
        padding: 0 15px;
    }
    
    #intro {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    #titulo {
        padding: 0 1rem;
    }
    
    #titulo h1 {
        font-size: 1.5rem;
    }
    
    #titulo h2 {
        font-size: 1rem;
    }
    
    #resumen,
    #comentario {
        margin: 1rem;
        padding: 1rem;
    }
    
    #enlacesintra ul.ul1 {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #apartados {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    #enlaces {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #enlacesversiones ul.ul1 {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    #contenedor {
        max-width: 95%;
    }
    
    #apartados {
        padding: 2rem;
    }
    
    #enlaces {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Tablets grandes (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    #contenedor {
        max-width: 90%;
    }
}

/* Desktop (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    #contenedor {
        max-width: 1100px;
    }
}

/* Pantallas grandes (1441px - 1920px) */
@media (min-width: 1441px) and (max-width: 1920px) {
    #contenedor {
        max-width: 1400px;
    }
    
    body {
        font-size: 1.05rem;
    }
}

/* 4K (1921px+) */
@media (min-width: 1921px) {
    #contenedor {
        max-width: 1600px;
    }
    
    body {
        font-size: 1.1rem;
    }
}


/* prueba final: á é í ó ú ñ */

