/* styles.css - Tema claro/oscuro, responsive y accesible */
/* Variables y reset compartidos en /assets/base.css */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgb(0 0 0 / 6%);
  background: var(--card);
}

.site-header h1 {
  margin: 0;
  font-size: 1.1rem;
}

.controls button {
  margin-left: 0.5rem;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
}

.container {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 1rem;
}

.converter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (width <= 1000px) {
  .converter {
    grid-template-columns: 1fr 280px;
  }
}

@media (width <= 800px) {
  .converter {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 0.75rem;
  }
}

/* right column image card */
.hero {
  display: block;
}

.hero img {
  max-width: 100%;
  height: auto;
}

.right-col .hero {
  background: var(--card);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgb(2 6 23 / 12%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.right-col .hero img {
  width: 100%;
  height: auto;
  max-width: 320px;
  border-radius: 8px;
  border: 1px solid rgb(0 0 0 / 4%);
}

.result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: linear-gradient(90deg, rgb(34 197 94 / 3%), transparent);
  box-shadow: 0 6px 18px rgb(2 6 23 / 3%);
}

.right-col .result {
  margin-top: 0;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgb(0 0 0 / 2%), transparent);
}

.conv-form {
  background: var(--card);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 0 rgb(0 0 0 / 3%);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.conv-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgb(2 6 23 / 6%);
}

.conv-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

  .references {
    background: var(--card);
    padding: 1rem;
    border-radius: 8px;
  }

.left-col .conv-form {
  background: var(--card);
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgb(2 6 23 / 6%);
}

.conv-form select,
.conv-form input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgb(0 0 0 / 8%);
  border-radius: 6px;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
}

.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.col {
  flex: 1;
}

.swap-col {
  display: flex;
  align-items: center;
}

#swap-btn {
  height: 40px;
  width: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  border: 0;
}

.actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.actions button {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgb(0 0 0 / 6%);
  background: var(--card);
  cursor: pointer;
}

.result-value {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text);
}

.explanation {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
  display: block;
}

.history {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.history ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.history li {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgb(0 0 0 / 2%);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.ingredient-row {
  margin-top: 0.5rem;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* small tweaks */
.site-footer {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

.copy-success {
  color: green;
}

/* Hero image and UI polish */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}



/* Place columns on wide screens */
@media (width >= 801px) {
  .left-col {
    grid-column: 1;
  }
}

@media (width <= 800px) {
  .converter {
    grid-template-columns: 1fr;
  }

  .converter .hero {
    display: none;
  }

  .converter .hero img {
    display: none;
  }
}

/* Accessible focus for keyboard users */
:focus:not(:focus-visible) {
  outline: none;
}
