/* ==========================================================================
   Tipografía y Layout idénticos a sebastiano.tronto.net
   ========================================================================== */

:root {
  --bg-color: #ffffff;
  --text-color: #111111;
  --link-color: #0f2899;
  --border-color: #cccccc;
  --code-bg: #eeeeee;
  --logo-bg: #000000;
  --logo-text: #ffffff;
}

[data-theme="dark"] {
  --bg-color: #000000; /* Negro puro */
  --text-color: #e4e4e7;
  --link-color: #58a6ff;
  --border-color: #27272a;
  --code-bg: #111111;
  --logo-bg: #ffffff;
  --logo-text: #000000;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #000000; /* Negro puro */
    --text-color: #e4e4e7;
    --link-color: #58a6ff;
    --border-color: #27272a;
    --code-bg: #111111;
    --logo-bg: #ffffff;
    --logo-text: #000000;
  }
}

/* Layout y Tipografía General (Exactos a Sebastiano) */
html {
  margin: 1em auto;
  max-width: 42em; /* Ancho idéntico al de Sebastiano */
  font-family: sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body {
  margin: auto 8px 20px 8px; /* Margen idéntico al de Sebastiano */
}

/* Enlaces */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Encabezados */
h1 {
  font-size: 1.9em;
  text-align: center;
  margin: 0.65em 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.5em;
  margin: 1em 0 0.5em 0;
}

p {
  margin: 0 0 1.25em 0;
}

/* Separadores */
hr.line {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 1.25em 0;
}

/* Header & Barra de Navegación */
header nav table {
  width: 100%;
  border-collapse: collapse;
}

td {
  vertical-align: middle;
}

.logo {
  text-align: left;
  font-weight: bold;
  font-size: 1.05em;
}

.logo a {
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}

.logo a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.links {
  text-align: right;
  font-weight: bold;
  font-size: 1.05em;
}

.links a {
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}

.links a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.15em;
  margin-left: 0.35em;
  vertical-align: middle;
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--link-color);
}

.theme-toggle-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .theme-toggle-btn svg {
  transform: rotate(180deg);
}

/* Botón Selector de Idioma */
.lang-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  cursor: pointer;
  padding: 1px 4px;
  margin-left: 0.35em;
  vertical-align: middle;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-toggle-btn:hover {
  color: var(--link-color);
  border-color: var(--link-color);
}

/* Reglas de Visualización Multilenguaje */
html:not([data-lang="en"]) .lang-en {
  display: none !important;
}

html[data-lang="en"] .lang-es {
  display: none !important;
}

/* Imagen Principal (Hero Photo) */
.main-photo-wrapper {
  margin: 0.5em 0 1.5em 0;
}

.main-photo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
}

/* Bloque de código si se utiliza */
pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  overflow-x: auto;
  font-family: monospace;
}

code {
  background-color: var(--code-bg);
  padding: 2px 4px;
  font-family: monospace;
  font-size: 0.9em;
}

/* Listas y Tablas de Contenido */
ul {
  margin: 0 0 1.25em 1.5em;
  padding: 0;
  line-height: 1.6;
}

li {
  margin-bottom: 0.35em;
}

.item-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
}

.item-table td {
  vertical-align: top;
  padding: 0.4em 0;
  line-height: 1.45;
}

.item-date {
  width: 8.5em;
  min-width: 8.5em;
  font-family: monospace;
  font-size: 0.95em;
  color: var(--text-color);
  opacity: 0.75;
}

.item-sub {
  font-size: 0.9em;
  opacity: 0.85;
  display: inline-block;
  margin-top: 0.15em;
  margin-bottom: 0.25em;
}

/* Foto en Sección CV */
.cv-photo-wrapper {
  text-align: center;
  margin: 0.4em 0 0.8em 0;
}

.cv-photo {
  width: 115px;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  display: inline-block;
}

/* Barra de Descarga de CV */
.cv-download-bar {
  text-align: center;
  margin: 0.6em 0 1.5em 0;
}

.download-link {
  font-weight: bold;
  font-size: 0.92em;
  padding: 5px 12px;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  display: inline-block;
  color: var(--link-color);
  text-decoration: none;
  background-color: var(--code-bg);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.download-link:hover {
  border-color: var(--link-color);
  text-decoration: underline;
}

/* Footer */
footer table {
  width: 100%;
  border-collapse: collapse;
}

.contact {
  text-align: left;
}

.contact-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  flex-wrap: wrap;
}

.contact a.email-link {
  font-weight: bold;
  color: var(--link-color);
}

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.social-icon {
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.social-icon:hover {
  opacity: 1;
  color: var(--link-color);
  text-decoration: none;
}

.social-icon svg {
  display: block;
}

.lastupdate {
  text-align: right;
  color: var(--text-color);
}

/* Estilos de Impresión */
@media print {
  html {
    max-width: 100%;
    margin: 0;
  }
  body {
    background: #fff;
    color: #000;
  }
  .theme-toggle-btn,
  .lang-toggle-btn {
    display: none;
  }
  hr.line {
    border-color: #000;
  }
}

/* Móviles */
@media (max-width: 540px) {
  .links {
    font-size: 0.92em;
  }
  h1 {
    font-size: 1.6em;
  }
}
