:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --border-color: #e0e0e0;
  --subtle-color: #999999;
  --header-bg: #ffffff;
  --menu-bg: #ffffff;
  --quote-bg: #f9f9f9;
  --story-bg: #fffbe6;
  --story-final-bg: #f5f5f5;
}

body.dark {
  --bg-color: #1a1a1a;
  --text-color: #d4d4d4;
  --border-color: #333333;
  --subtle-color: #777777;
  --header-bg: #1a1a1a;
  --menu-bg: #242424;
  --quote-bg: #242424;
  --story-bg: #2a2510;
  --story-final-bg: #222222;
}

/* ========================================
   Estilos generales
   ======================================== */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

html.dark {
  background-color: #1a1a1a;
}

/* ========================================
   Estilos de la estructura del layout
   ======================================== */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
}

/* ========================================
   Estilos de la cabecera (header)
   ======================================== */
.main-header {
  height: 100px;
  background-color: var(--header-bg);
  transition: background-color 0.3s ease;
}

.header-with-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.header-with-button h1 {
  margin: 0;
}

.header-with-button .button {
  margin-left: 0;
}

/* ========================================
   Estilos de la navegación (menú)
   ======================================== */
.menu {
  margin: 20px 0;
  position: relative;
}

.menu-label {
  font-size: 2.5rem;
}

.menu .menu-label {
  font-size: 1.4rem !important;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.menu-toggle .hamburger {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background-color: var(--text-color);
  transition: background-color 0.3s ease;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .menu-list {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    background-color: var(--menu-bg);
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition:
      transform 0.5s ease-in-out,
      background-color 0.3s ease;
  }

  .menu-list.show {
    transform: translateX(0) !important;
  }

  .menu-list .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-color);
    display: none;
  }
}

@media (min-width: 769px) {
  .menu-toggle,
  .menu-list .close-btn {
    display: none !important;
  }
}

.menu-list a {
  font-size: 21px;
  padding: 10px 20px;
  display: block;
  text-align: left;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.menu-list {
  padding-top: 50px;
}

.menu-list a.active {
  color: #2112f3;
}

.menu-list.show ~ .menu-toggle .hamburger {
  display: none;
}

.menu-toggle.open .hamburger:nth-child(1) {
  transform: rotate(45deg);
  position: absolute;
  top: 0px;
}

.menu-toggle.open .hamburger:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open .hamburger:nth-child(3) {
  transform: rotate(-45deg);
  position: absolute;
  top: -1px;
}

/* ========================================
   Estilos de los párrafos
   ======================================== */
p {
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-color) !important;
}

/* ========================================
   Contenedor principal (container)
   ======================================== */
.container {
  max-width: 1300px !important;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   Estilos de la lista de artículos
   ======================================== */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.5s ease-in-out forwards;
  animation-delay: calc(0.1s * var(--i));
  transition: border-color 0.3s ease;
}

.article-list li:last-child {
  border-bottom: none;
}

.article-list a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.article-list a:hover {
  color: #007bff;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Estilos de la lista de proyectos
   ======================================== */
.projects-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.project-item {
  margin-bottom: 2rem;
  padding: 15px;
}

.title-project {
  font-size: 1.4rem;
  color: var(--text-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.title-project:hover {
  color: #0077cc;
  transform: translateX(5px);
}

.icon-project {
  font-size: 1.4rem;
}

.description-project {
  font-size: 1.1rem;
  margin-left: 20px;
  color: var(--subtle-color) !important;
  font-style: italic;
  transition: color 0.3s ease;
}

.project-item:hover .description-project {
  color: var(--text-color) !important;
}

.social-link {
  text-decoration: none;
  transition: text-decoration 0.3s ease;
}

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

.underline-on-hover:hover {
  text-decoration: underline;
}

/* Fechas de artículos */
.has-text-grey {
  font-size: 0.9rem;
  color: var(--subtle-color);
}

footer {
  width: 100%;
  text-align: center;
  padding: 20px 0;
  color: var(--subtle-color);
  background-color: var(--bg-color);
  transition:
    color 0.3s ease,
    background-color 0.3s ease;
}

.highlighted-quote {
  background: var(--quote-bg);
  border-left: 4px solid #007bff;
  padding: 15px;
  font-style: italic;
  color: var(--text-color);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.personal-story {
  background: var(--story-bg);
  border-left: 4px solid #f4c542;
  padding: 15px;
  font-style: normal;
  color: var(--text-color);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.highlighted-link {
  text-decoration: underline;
  font-weight: bold;
  color: #0275d8;
}

.lista-ajustada {
  font-size: 1.25rem !important;
  line-height: 1.5;
  margin-top: 0.5em;
  padding-left: 1.5em;
  list-style-type: disc !important;
  list-style-position: outside !important;
}

.lista-ajustada li {
  font-size: inherit !important;
  display: list-item !important;
}

.personal-story-final {
  background-color: var(--story-final-bg);
  border-left: 5px solid #0077b6;
  padding: 15px;
  font-style: italic;
  margin: 20px 0;
  transition: background-color 0.3s ease;
}

/* ========================================
   Botón dark mode
   ======================================== */
.dark-mode-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  font-size: 1.3rem;
  padding: 8px 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  z-index: 9999;
  transition:
    opacity 0.2s ease,
    background-color 0.3s ease;
  line-height: 1;
}

.dark-mode-btn:hover {
  opacity: 0.7;
}

/* ========================================
   Dark mode - overrides generales
   ======================================== */
body.dark,
body.dark .container,
body.dark .layout,
body.dark .columns,
body.dark .column,
body.dark main,
body.dark .content,
body.dark section,
body.dark .hero,
body.dark .box,
body.dark .card,
body.dark .notification {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

body.dark blockquote {
  background-color: #242424;
  border-left-color: #555;
  color: var(--text-color);
}

body.dark .title,
body.dark .subtitle,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4 {
  color: var(--text-color) !important;
}

body.dark hr {
  background-color: var(--border-color);
  border-color: var(--border-color);
}

body.dark strong,
body.dark b {
  color: #ffffff !important;
}

body.dark .has-text-grey {
  color: var(--subtle-color) !important;
}

body.dark
  .tag:not(.is-primary):not(.is-link):not(.is-info):not(.is-success):not(
    .is-warning
  ):not(.is-danger) {
  background-color: #333333 !important;
  color: var(--text-color) !important;
}
