@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');

/* --- VARIABLES GLOBALES (MODO CLARO) --- */
:root {
  /* Paleta principal */
  --theme-bg: #ffffff;
  --theme-light-bg: #ffffff;
  --theme-text-primary: #000000;
  --theme-text-secondary: #666666;
  --theme-border-color: #cccccc;
  --theme-border-dark: #999999;
  --theme-accent: #143bff;
  --theme-link-color: #143bff;
  --theme-link-hover: #ffffff;
  --theme-windowbar-gradient-start: navy;
  --scroll-thumb: var(--theme-accent);
  --scroll-track: var(--theme-bg);

  /* Variables para el efecto 3D de las ventanas */
  --win-highlight: #ffffff;
  --win-shadow: #dfdfdf;
}

/* --- VARIABLES MODO OSCURO --- */
html.dark-mode {
  --theme-bg: #101010;
  --theme-light-bg: #101010;     
  --theme-text-primary: #e0e0e0;
  --theme-text-secondary: #a0a0a0;
  --theme-border-color: #58664e;
  --theme-border-dark: #1a1a1a;  
  --theme-accent: #b0c123;
  --theme-link-color: #b0c123;
  --theme-link-hover: #e0e0e0;
  --theme-windowbar-gradient-start: #0f9908;

  /* Efecto 3D ajustado para oscuro */
  --win-highlight: #606060;
  --win-shadow: #404040;

  --scroll-thumb: #b0c123;
  --scroll-track: #202020;
}


body.dark-mode img {
  opacity: 0.9;
}

* {
    
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    scrollbar-width: thin;
}

/* --- WINDOWS --- */

.right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-width: 250px;
}

.window-container{
    display:flex;
    flex-direction: row;
    align-items: flex-start;
    gap:15px;
}


.title-bar, .window, button, input, label, legend, li[role=tab], option, select, table, textarea, ul.tree-view {
    -webkit-font-smoothing: none;
    font-size: 11px;
}


.window {
    background: var(--theme-border-color);
    
    box-shadow: inset -1px -1px var(--theme-border-dark),
                inset 1px 1px var(--win-shadow),
                inset -1px -1px var(--theme-border-color),
                inset 2px 2px var(--win-highlight);
    padding: 2px;
    min-width: 210px;
}


.window-body {
    margin: 2px;
    padding: 10px;
    background-color: var(--theme-light-bg);
    color: var(--theme-text-primary);
}

.title-bar {
    align-items: center;
    background: linear-gradient(90deg, var(--theme-windowbar-gradient-start), var(--theme-accent));
    display: flex;
    justify-content: space-between;
    padding: 3px 2px 3px 8px;
}

.title-bar.inactive {
    background: linear-gradient(90deg, grey, #b5b5b5);
}

.title-bar-text {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0;
    margin-right: 24px;
}

.title-bar-controls {
    display: flex;
}

.title-bar-controls button {
    display: block;
    min-height: 14px;
    min-width: 16px;
    padding: 0;
}

.title-bar-controls button:active {
    padding: 0;
}

.title-bar-controls button:focus {
    outline: none;
}

.smallimage {
    width: 180px;
    height: 180px;
}

/* --- GLOBAL --- */

html {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background-color: var(--theme-bg);
  color: var(--theme-text-primary);
  letter-spacing: 0px;
  line-height: 1.5;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--theme-bg);
  color: var(--theme-text-primary);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Navigation */
nav {
  border-bottom: 0px solid var(--theme-border-color);
  background: var(--theme-light-bg);
  width: fit-content;
  margin: 0 auto;
}

nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  gap: 0;
}

nav li {
  margin: 0;
  border-right: 1px solid var(--theme-border-color);
}

nav li:last-child {
  border-right: none;
}

nav a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--theme-link-color);
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
  font-size: 0.9rem;
}

nav a:hover {
  background: linear-gradient(90deg, var(--theme-windowbar-gradient-start), var(--theme-link-color));
  color: var(--theme-link-hover);
  border-bottom-color: var(--theme-link-color);
  text-decoration: underline;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--theme-text-primary);
  font-weight: 700;
  letter-spacing: 0px;
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--theme-border-color);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.2rem;
  margin: 0.75rem 0 0.5rem 0;
  border-bottom: 1px solid var(--theme-border-color);
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1rem;
  margin: 0.5rem 0 0.25rem 0;
  font-weight: 700;
}

p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

time {
  display: block;
  padding-left: 0.5rem;
  color: var(--theme-text-secondary);
  font-size: 0.95rem;
}

time:hover {
  color: var(--theme-link-color);
}

a {
  color: var(--theme-link-color);
  text-decoration: underline;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--theme-accent);
  text-decoration: none;
}

/* Content sections */
article,
section {
  border: 1px solid var(--theme-border-color);
  background: var(--theme-light-bg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Container grid for layout */
.layout-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1000px) {
  .layout-container {
    grid-template-columns: 250px 1fr 250px;
  }
}

/* Portfolio grid - theme-style grid gallery */
.portfolio-thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1rem 0;
}

.portfolio-thumbnail {
  border: 1px solid var(--theme-border-color);
  background: var(--theme-light-bg);
  overflow: hidden;
  box-shadow: none;
  transition: all 0.1s;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.portfolio-thumbnail:hover {
  border: 3px solid var(--theme-accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.portfolio-thumbnail-image {
  width: 100%;
  height: 300px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border-bottom: 1px solid var(--theme-border-color);
  flex-shrink: 0;
}

.portfolio-thumbnail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-thumbnail-title {
  padding: 1rem 1rem 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--theme-text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}

.portfolio-thumbnail-description {
  padding: 0 1rem 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--theme-text-secondary);
  flex-grow: 1;
}

.portfolio-thumbnail-tags {
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.portfolio-thumbnail-tag {
  display: inline-block;
  padding: 2px 6px;
  background: transparent;
  color: var(--theme-link-color);
  font-size: 0.75rem;
  border: 1px solid var(--theme-border-color);
  font-weight: 400;
  text-decoration: none;
  transition: all 0.1s;
}

.portfolio-thumbnail-tag:hover {
  background: linear-gradient(90deg, rgb(16, 16, 193), var(--theme-link-color));
  color: var(--theme-link-hover);
  border-color: var(--theme-link-color);
  text-decoration: none;
}

.portfolio-thumbnail-link {
  display: none;
  padding: 0.75rem 1rem;
  margin: 0;
  background: transparent;
  color: var(--theme-link-color);
  text-decoration: underline;
  text-align: center;
  font-weight: 700;
  border-top: 1px solid var(--theme-border-color);
  transition: all 0.1s;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.portfolio-thumbnail-link:hover {
  background: var(--theme-link-color);
  color: var(--theme-link-hover);
}

.portfolio-thumbnail-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.portfolio-thumbnail-meta {
  padding: 0 1rem;
  color: var(--theme-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Buttons */
button,
.btn {
  padding: 0.4rem 0.8rem;
  background: var(--theme-border-color);
  border: 1px solid var(--theme-text-secondary);
  color: var(--theme-text-primary);
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  font-size: 0.85rem;
}

button:hover, .btn:hover {
  background-color: #f0f0f0;
  border-color: var(--theme-border-dark);
}

button:active, .btn:active {
  transform: translate(1px, 1px);
}

/* Code blocks */
code {
  background: #f5f5f5;
  padding: 2px 4px;
  border: 1px solid var(--theme-border-color);
  font-family: 'IBM Plex Mono', monospace;
  color: var(--theme-text-primary);
  font-size: 0.9rem;
}

pre {
  background: #f5f5f5;
  padding: 0.75rem;
  border: 1px solid var(--theme-border-color);
  overflow-x: auto;
  line-height: 1.4;
}

pre code {
  background: none;
  padding: 0;
  border: none;
}

/* Lists */
ul, ol {
  margin: 0.5rem 0;
  margin-left: 1.5rem;
  line-height: 1.6;
  list-style-type: "‣☽‎ ";
}

li {
  margin-bottom: 0.25rem;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--theme-accent);
  padding-left: 0.75rem;
  margin-left: 0;
  color: var(--theme-accent);
  font-style: italic;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0;
  gap: 1rem;
  border: 1px solid var(--theme-border-color);
  padding: 0.75rem;
  background: var(--theme-light-bg);
}

.pagination a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--theme-light-bg);
  border: 1px solid var(--theme-border-color);
  color: var(--theme-link-color);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.1s;
  font-size: 0.85rem;
}

.pagination a:hover {
  background: #f0f0f0;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.75rem 0;
  padding-left: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  background: transparent;
  color: var(--theme-link-color);
  border: 1px solid var(--theme-border-color);
  font-size: 0.8rem;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.1s;
  cursor: pointer;
}

.tag:hover {
  background: linear-gradient(90deg, rgb(16, 16, 193), var(--theme-link-color));
  color: var(--theme-link-hover);
  border-color: var(--theme-link-color);
  text-decoration: none;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background: var(--theme-border-color);
  margin: 1rem 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border: 0px solid var(--theme-border-color);
  display: block;
  margin: 0.75rem 0;
}

/* Article content padding */
article {
  padding: 1rem;
}

article > * {
  margin-left: 0;
  margin-right: 0;
}

section {
  padding: 1rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .right-column {
    width: 100%;
    min-width: 0;
    order: -1; 
  }
  
  .flex-container {
    flex-direction: column;
  }

  .window {
    width: 100%;
    min-width: 0;
  }

  .window-container {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  body {
    padding: 0;
  }

  main {
    padding: 1rem;
  }

  html {
    font-size: 12px;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1rem;
  }

  nav ol {
    flex-direction: row;
  }

  nav li {
    border-right: 1px solid var(--theme-border-color);
    border-bottom: 0px solid var(--theme-border-color);
  }

  nav li:last-child {
    border-bottom: none;
  }

  .portfolio-thumbnail-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .portfolio-thumbnail-image {
    height: 150px;
  }

  .portfolio-thumbnail-title {
    font-size: 1rem;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
  }

  .portfolio-thumbnail-description {
    padding: 0 0.75rem 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .portfolio-thumbnail-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }
}