/* =========================
   Andrés Ahumada Gómez — styles.css
   ========================= */

:root{
  --bg:#f7f8fa;
  --panel:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --accent:#9C1F14;
  --border:rgba(0,0,0,.08);
  --shadow: 0 8px 24px rgba(17,24,39,.08);

  --radius:14px;
  --max: 980px;
   
}

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

body{
  font-family: "CMU Serif", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body, h1, h2, h3, h4, h5, h6, p, a, li {
  /* font-family: "CMU Serif", Serif !important; */
  font-family: "JetBrains Mono", monospace;
  /*font-family: "Cascadia Code", monospace;*/
}
  /*font-style: italic !important;*/
  /*letter-spacing: 1px !important;
}*/

a{
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: break-word;
}

a, a:visited {
  color: var(--accent);
  /*color: inherit; */         
  text-decoration: none;   
}

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

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px;
  overflow-wrap: break-word;
}

/* Header */
.site-header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247,248,250,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 24px;
}

.brand{
  font-weight: 750;
  color: var(--text);
  letter-spacing: .2px;
}

.nav a{
  margin-left: 14px;
  color: var(--muted);
  font-weight: 600;
}
.nav a:hover,
.nav a.active{
  color: var(--text);
}

/* Separador visible solo en desktop */
.nav-sep{
  margin-left:10px;
  opacity:.6;
}

/* Nav en general */
.nav{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;   /* importante */
  text-align:right;
}

/* Grupo de idiomas */
.nav .lang{
  display: flex;
  gap: 10px;
}

/* Móvil: ocultar barra y mandar idiomas a nueva línea */
@media (max-width: 600px){
  .nav-sep{ display: none; }

  .nav .lang{
    flex-basis:100%;
    display:flex;
    justify-content:flex-end;   /* clave */
    gap:10px;
  }

}

/* Typography */
h1{
  font-size: clamp(30px, 4vw, 44px);
  margin: 8px 0 10px;
  line-height: 1.15;
}
h2{
  font-size: 22px;
  margin: 0 0 12px;
}
h3{
  font-size: 16px;
  margin: 0 0 10px;
}

.lead{
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 18px;
}

.accent{
  color: var(--accent);
  white-space: normal;
}
@media (max-width: 420px){
  h1 .accent{ white-space: normal; }
}

/* Hero */
.hero{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 32px;
  align-items: center;
  padding: 18px 0 8px;
}

.hero-content{ min-width: 0; 
             padding-right: 20px;
}

/* Contenedor de la imagen: controla tamaño y recorte */
.hero-media{
  justify-self: end;
  width: 100%;
  max-width: 420px;
  height: auto; /*min(460px, 60vh);   /* <- clave: evita que sea gigante */
  border-radius: 2px;
  overflow: hidden;
  object-fit: contain;
  line-height: 0;
}

.hero-photo{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000; 
  object-position: center;
  display: block;
}

/* Móvil */
@media (max-width: 820px){
  .hero{
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .hero-media{
    justify-self: center;
    max-width: 520px;
    height: 320px;
  }
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;

    background: none;
    border: none;
    padding: 0;
   
}

/* Botones */
.buttons a {
    display: inline-block;
    padding: 14px 30px;
    font-size: 18px;

    text-decoration: none;
    border: none;
    outline: none;

    color: white;
    background-color: #9C1F14;
    border-radius: 8px;
    transition: 0.3s;

   font-family: "JetBrains Mono", monospace;
   /*font-style: italic;*/
   letter-spacing: 1px;
}

/* Hover */
.buttons a:hover {
    background-color: #5a5d64;
}

/* Buttons */
.cta{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

.button{
  display:inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  border: 1px solid transparent;
}
.button:hover{ text-decoration:none; filter: brightness(.95); }

.button-ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.button-ghost:hover{ text-decoration:none; background: rgba(0,0,0,.03); }

@media (max-width: 600px){
  .buttons {
    flex-direction: column;
    align-items: center;
  }

  .buttons a {
    width: 100%;
    max-width: 320px;
    text-align: center;
  }
}

/* Links line */
.links{
  list-style:none;
  padding:0;
  margin: 14px 0 0;
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
}
.links a{ font-weight: 650; }

/* Sections */
.section{
  margin-top: 34px;
   gap: 2rem;
}

/* Grid + cards */
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

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

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow-wrap: break-word;
}
.card + .card {
  margin-top: 2rem;
}

.card ul{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.card p{ color: var(--muted); }

/* Tags (para projects.html si las usas) */
.tags span{
  display:inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
  color: var(--muted);
  font-size: .9rem;
}

/* Avatar (opcional) — BONUS: corregido height */
.avatar{
  width: 100%;
  height: 100vh;
  height: 100svh;
  border-radius: 0;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  justify-self: end;
}

@media (max-width: 820px){
  .avatar{ justify-self: start; width: 180px; height: 180px; }
}

/* Footer */
.footer{
  margin-top: 46px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 18px 0;
  font-size: 14px;
}

.full-width-image{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: block;

  height: auto;
  max-width: none;
  object-fit: cover;

  border-radius: 0;
  border: none;
  box-shadow: none;
}

@media (max-width: 820px){
  .full-width-image{ width: 100vw; }
}

/* Brand con logo */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
}

.sobre-mi-content {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.sobre-mi-texto {
  flex: 2;
}

.sobre-mi-imagen {
  flex: 1;
}

.sobre-mi-imagen img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .sobre-mi-content {
    flex-direction: column;
  }
}

.social-section {
  padding: 60px 20px;
  text-align: center;
}
.social-icons {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.social-icons img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}

.social-icons a {
  width: 55px;
  height: 55px;
  border-radius: 7px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.3s;
}

.social-icons a:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 20px rgba(247, 248, 250,0.25);
}

.social-icons svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* Colores oficiales */
.youtube { background: #f7f8fa; }
.linkedin { background: #f7f8fa; }
.instagram { background: #f7f8fa; }
.orcid { background: #f7f8fa; }
.scholar { background: #f7f8fa; }
.researchgate { background: #f7f8fa; }
.wordpress    { background: #f7f8fa; }
.cunef        { background: #f7f8fa; } 
.arxiv {background: #f7f8fa ;}

/* Layout general */
.docs-component {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
  margin: 20px 0;
}

/* Lista */
.docs-list {
  position: sticky;
  top: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.docs-title {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
}

.doc-item {
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  font-size: 14px;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.doc-item {
  color: #000000;          /* color normal del texto */
  -webkit-appearance: none; /* elimina estilo iOS */
  appearance: none;
}

.doc-item:focus,
.doc-item:active {
  color: #ffffff;          /* asegura color cuando se pulsa */
}


.doc-item:hover {
  background: #f3f4f6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.doc-item.is-active {
  background: #9C1F14;
  color: #ffffff;
  border-color: #9C1F14;
}

/* Visor */
.docs-viewer {
  min-width: 0;
}


/* Visor: por defecto SIN transforms */
.viewer-frame {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  overflow: hidden; /* ok en desktop */
}

.viewer-frame iframe {
  display: block;
  width: 100%;
  height: min(80vh, 900px);
  border: 0;
}

@media (max-width: 900px) {
  .docs-viewer {
    display: none;
  }
}

@media (max-width: 900px) {

  .docs-component {
    display: flex;
    justify-content: center;
  }

  .docs-list {
    width: 100%;
    max-width: 420px;  /* controla ancho */
  }

}

/* Correo / Oficina: desktop por defecto en 2 columnas */
main .section.contact-grid{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 1.25rem;
  align-items: start;
}

/* Móvil: 1 columna */
@media (max-width: 700px){
  main .section.contact-grid{
    grid-template-columns: 1fr !important;
  }
}

main .section.contact-grid .contact-item h2{
  margin: 0 0 .5rem 0;
}

main .section.contact-grid .contact-item p{
  margin: 0;
}

/* =========================
   Blog (mismo look & feel)
   ========================= */

.blog-layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

.blog-sidebar{
  position: sticky;
  top: 88px; /* ajusta si el header tapa */
}

.blog-links{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-link{
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}

.blog-link:hover{
  background: rgba(0,0,0,.04);
  text-decoration: none;
}

.blog-link.is-active{
  background: rgba(156,31,20,.10);
  color: var(--accent);
  font-weight: 700;
}

.blog-content{ min-width: 0; }

.blog-year{
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 14px;
}

.blog-post{
  padding: 10px 0 18px;
}

.blog-title{
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}

.blog-title:hover{
  text-decoration: underline;
}

.blog-meta{
  margin-top: 6px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.blog-excerpt{
  margin-top: 10px;
  color: var(--text);
  max-width: 75ch;
}

/* Móvil */
@media (max-width: 900px){
  .blog-layout{ grid-template-columns: 1fr; }
  .blog-sidebar{ position: static; top: auto; }
}

.viewer-frame--video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
}

.viewer-frame--video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: transparent;
   transform: scale(1.02);
}
