:root {
  --bg-color: #22201d;
  --text-color: #f8f8f2;
  --card-bg: #2f2d29;
  --border-color: #44413e;
  --accent-color: #ffd93b;
  --accent-hover: #e6c930;
  --theme-color: #ffd93b;
}

u {
  text-decoration: none;
  border-bottom: 2px solid var(--accent-color);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'VT323', sans-serif;
  color: var(--accent-color);
}

html.dark {
  --bg-color: #22201d;
  --text-color: #f8f8f2;
  --theme-color: #ffd93b;
  --accent-color: #ffd93b;
}

html.light {
  --bg-color: #f8f8f2;
  --text-color: #22201d;
  --card-bg: #ede9dd;
  --theme-color: #561d82;
  --accent-color: #d4af37;
}

body {
  font-family: 'VT323', sans-serif;
  margin: 0 auto;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-icon {
  height: 10vh;
  min-height: 4rem;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.content-wrapper {
  padding-left: 1.0rem;
  padding-right: 1.0rem;
  /* max-width: 1500px; */
  min-width: 80vw;
  margin: 0 auto;
  box-sizing: border-box;
}

header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  /* flex-wrap: nowrap; */
  justify-content: space-between;
  align-items: center;
}

nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

nav a {
  /* margin-right: 1rem; */
  font-size: 1.5rem;
  white-space: nowrap;
  font-family: 'VT323', sans-serif;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

nav a.active {
  font-family: 'VT323', sans-serif;
  color: var(--accent-color);
  /* font-weight: bold; */
  border-bottom: 2px solid var(--accent-color);
}

nav a:hover{
  font-family: 'VT323', sans-serif;
  color: var(--accent-color);
}

.translator {
  display: flex;
  gap: 3rem;
  margin: 2rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.input-box, .output-box {
  flex: 1 1 30%;;
  min-width: 20rem;
  max-width: 50%; 
  height: 70vh;
}

.input-box, .output-box h2{
  justify-content: center;
  align-items: center;
}

.translator textarea {
  width: 100%;
  padding: 1rem;
  font-family: inherit;
  font-size: 2rem;
  border-radius: .5rem;
  background: var(--card-bg);
  color: var(--header-bg);
  border: 1px solid var(--accent-color);
  resize: none;
  box-sizing: border-box;
  height: 80%;
}

/* Responsive: if screen is too small, stack them */
@media (max-width: 730px) {
  .input-box, .output-box {
    height: 30vh;
  }
}

.api-status {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle {
  display: none;
}

.toggle-switch {
  width: 50px;
  height: 24px;
  background: var(--theme-color);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch::after {
  content: "";
  width: 20px;
  height: 20px;
  background: #f8f8f2;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left 0.3s;
}

#theme-toggle:checked + .toggle-switch::after {
  left: 28px;
}

.grammar-page {
  max-width: 1200px;
  margin: 0 auto;
}

.grammar-section {
  margin-bottom: 3rem;
}

.grammar-section h2 {
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.section-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.section-columns .column {
  flex: 1;
  min-width: 300px;
  padding-bottom: 1rem;
}

.section-columns .column + .column {
  border-left: 2px solid var(--border-color);
  padding-left: 2rem;
}

.section-columns .column h3 {
  margin-top: 1rem;
  color: var(--accent-color);
}

.section-columns .column p {
  margin: 0.5rem 0;
}

@media (max-width: 768px) {
  .section-columns {
    flex-direction: column;
  }
}

.pixel-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'VT323', monospace, sans-serif;
}

.pixel-table th, .pixel-table td {
  border: 2px solid var(--text-color);
  padding: 0.6rem 1rem;
  text-align: center;
  background: --card-bg;
}

.pixel-table thead {
  background: var(--accent-color);
  color: #22201d;
  border: 2px solid var(--accent-color);
}

.pixel-table thead th, .pixel-table thead td{
  border: 2px solid var(--accent-color);
}

ul {
  list-style-type: none;
  padding-left: 0;
}
ul li::before {
  content: "■ ";
  color: var(--accent-color);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.calendartile {
  height: 14vw;
  object-fit: cover;
  position: relative;
  display: inline-block;   
}

.calendartile img{
  display: block;
  max-width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.calendar-day {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #22201d;
  font-size: 2em;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
}

.calendar-saint {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%);
  color: #32312f;
  font-size: 1em;
  max-width: 50%;
  font-weight: bold;
  pointer-events: none;
  text-align: center;
  line-height: 1.0;
}

.calendar-real {
  position: absolute;
  top: 85%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9c8741;
  font-size: 1.5em;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
}

.calendar-date {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #32312f;
  font-size: 4em;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
}