/* ==== RESET Y BODY ==== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}


/* ==== IMAGEN DE PRESENTACIÓN ==== */
.img-presentacion-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.img-presentacion-container img {
  width: 500px;
  height: 500px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.img-presentacion-container .presentacion-textos {
  flex: 1;
}

/* ==== HEADER ==== */
header {
  background-image: url('https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 4rem 1rem;
  text-align: left;
  font-size: 1.5rem;
  position: relative;
  overflow: hidden;
  background-attachment: fixed;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

header>* {
  position: relative;
  z-index: 1;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  header {
    background-attachment: scroll;
    padding: 3rem 1rem;
  }
}

/* ==== NAV ==== */
nav {
  margin-top: 1rem;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 0 1rem;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav a:hover,
nav a:focus {
  color: #ffcc00;
  outline: none;
  text-decoration: none;
}

/* ==== BOTÓN TEMA ==== */
#theme-toggle {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  background-color: #ffffff33;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#theme-toggle:hover,
#theme-toggle:focus {
  background-color: #ffffff55;
  outline: none;
}

/* ==== MAIN ==== */
main {
  padding: 2rem 1rem;
}

section {
  margin-bottom: 3rem;
}

section h2 {
  color: #007bff;
  margin-bottom: 0.5rem;
  text-align: left;
  font-size: 2rem;
  font-weight: bold;
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.5rem;
  margin-top: 0;
}

section p {
  text-align: justify;
  font-size: 1.3rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

#contacto p {
  text-align: center;
  font-size: 1.2rem;
  margin-top: 1rem;
  margin-bottom: 0.2rem;

}

.redes-sociales span {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}


/* === BLOG TARJETAS Y DETALLE === */
.blog-tarjeta {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  margin-bottom: 1.2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-tarjeta h3 {
  margin: 0;
  color: #007bff;
  font-size: 1.25rem;
}

.blog-fecha {
  font-size: 0.95rem;
  color: #888;
}

.ver-mas,
#volver-blog {
  align-self: flex-start;
  background-color: #007bff;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.ver-mas:hover,
#volver-blog:hover {
  background-color: #0056b3;
}

/* Igualar tamaño y fuente de texto en blog */
#blog p,
#blog ul,
#blog li {
  font-size: 1.3rem;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: inherit;
  text-align: justify;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

#blog ul {
  margin-left: 1.5rem;
}

#blog h3,
#blog h4 {
  font-family: 'Segoe UI', sans-serif;
}

/* === FIN BLOG === */




/* ==== FOOTER ==== */
footer {
  background-color: #ddd;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #555;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==== MODO OSCURO ==== */
body.modo-oscuro {
  background-color: #1c1c1c;
  color: #eee;
}

body.modo-oscuro header {
  background-color: #111;
}

body.modo-oscuro nav a {
  color: #eee;
}

body.modo-oscuro nav a:hover,
body.modo-oscuro nav a:focus {
  color: #ffcc00;
  outline: none;
}

body.modo-oscuro #theme-toggle {
  background-color: #ffffff11;
  color: #eee;
}

body.modo-oscuro section h2 {
  color: #f4f7f8;
}

body.modo-oscuro footer {
  background-color: #333;
  color: #ccc;
}

.github-logo-oscuro {
  display: none;
}

body.modo-oscuro .github-logo-claro {
  display: none;
}

body.modo-oscuro .github-logo-oscuro {
  display: inline;
}

/* ==== REDES SOCIALES ==== */
.redes-sociales {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

.redes-sociales img {
  width: 36px;
  height: 36px;
  transition: transform 0.2s;
  vertical-align: middle;
}

.redes-sociales a:hover img,
.redes-sociales a:focus img {
  transform: scale(1.15);
  outline: none;
}

/* ==== PROYECTOS ==== */
#contenedor-proyectos {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding: 1rem 0;
  max-width: 1000px;
  margin: 0 auto;
}

.tarjeta-proyecto {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta-proyecto:hover,
.tarjeta-proyecto:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tarjeta-proyecto img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.tarjeta-proyecto .contenido {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tarjeta-proyecto h3 {
  margin: 0 0 0.5rem 0;
  color: #007bff;
  font-size: 1.25rem;
}

.tarjeta-proyecto p {
  flex-grow: 1;
  color: #555;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.tarjeta-proyecto a {
  align-self: flex-start;
  background-color: #007bff;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta-proyecto a:hover,
.tarjeta-proyecto a:focus {
  background-color: #0056b3;
  box-shadow: 0 0 8px #007bff;
  outline: none;
}

/* ==== MODO OSCURO TARJETAS ==== */
body.modo-oscuro .tarjeta-proyecto {
  background-color: #2c2c2c;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

body.modo-oscuro .tarjeta-proyecto h3 {
  color: #00c3ff;
}

body.modo-oscuro .tarjeta-proyecto p {
  color: #ccc;
}

body.modo-oscuro .tarjeta-proyecto a {
  background-color: #00aaff;
}

body.modo-oscuro .tarjeta-proyecto a:hover,
body.modo-oscuro .tarjeta-proyecto a:focus {
  background-color: #0088cc;
  box-shadow: 0 0 8px #00aaff;
}

/* ==== RESPONSIVE ==== */

/* Imagen y texto presentación */
@media (max-width: 900px) {
  .img-presentacion-container img {
    width: 220px;
    height: 220px;
  }

  section p {
    font-size: 1.1rem;
  }
}

/* Móvil */
@media (max-width: 600px) {
  .img-presentacion-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .img-presentacion-container img {
    width: 140px;
    height: 140px;
  }

  .img-presentacion-container .presentacion-textos {
    text-align: center;
  }

  .presentacion-textos p {
    font-size: 1rem;
    text-align: justify;
  }

  .blog-tarjeta {
    padding: 0.7rem;
    max-width: 98vw;
    font-size: 1rem;
  }

  .blog-tarjeta h3 {
    font-size: 1.1rem;
  }

  .blog-fecha {
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
  }

  #blog p,
  #blog ul,
  #blog li {
    font-size: 1rem;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
  }

  #blog-detalle {
    padding: 0.7rem;
  }

  .blog-tarjeta {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  #blog-detalle {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 0.5rem;
  }
}