﻿:root {
  --bg: #d6c085;
  --panel: #e0d0a3;
  --panel-line: #ad965a;
  --card: #c8c5bc;
  --card-line: #b0aca1;
  --paper: #f5efe0;
  --text: #2f2c26;
  --muted: #5b564b;
  --link: #506656;
  --active: #f6bb34;
  --nav-bg: #f0d795;
  --white: #ffffff;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Comfortaa", "Trebuchet MS", sans-serif;
  line-height: 1.5;
  padding: 1.4rem 0;
}

a {
  color: var(--link);
}

.site-wrap {
  width: min(930px, calc(100% - 1.2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 2px solid #e5e5e5;
  margin-bottom: 0.35rem;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 120px;
  max-width: 35vw;
  height: auto;
  flex: 0 0 auto;
}

.brand-copy {
  display: grid;
  gap: 0.2rem;
}

.brand-title {
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
}

.menu-toggle {
  display: none;
  border: 1px solid #b9ac83;
  background: #f3e7c4;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  color: #3f3a2f;
  font-weight: 700;
  font-family: inherit;
}

.main-nav {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.83rem;
  font-weight: 700;
}

.nav-link {
  text-decoration: none;
  color: var(--link);
  padding: 0.48rem 0.64rem;
  border-radius: 6px;
}

.nav-link:hover {
  background: #ead8a9;
}

.nav-link.is-active {
  background: var(--active);
  color: #fff;
}

.hero-image {
  margin-bottom: 0.35rem;
}

.hero-image img {
  display: block;
  width: 100%;
  height: auto;
}

.grammar-nav {
  display: flex;
  overflow-x: auto;
  gap: 0.22rem;
  background: var(--nav-bg);
  border: 1px solid #ddc88d;
  padding: 0.35rem 0.2rem;
  margin-bottom: 0.45rem;
}

.topic-link {
  white-space: nowrap;
  text-decoration: none;
  color: #3c3c3c;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.43rem 0.54rem;
  border-radius: 4px;
}

.topic-link:hover {
  background: #ecd6a3;
}

.topic-link.is-active {
  background: var(--active);
  color: #fff;
}

.main-content {
  min-height: 300px;
}

.alert {
  border-radius: var(--radius);
  padding: 0.62rem 0.72rem;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.alert--success {
  background: #dbefcf;
  border: 1px solid #9fca8b;
  color: #234722;
}

.alert--error {
  background: #f7d6d6;
  border: 1px solid #d7a2a2;
  color: #6b1d1d;
}

.content-panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 0.6rem;
  margin-bottom: 0.6rem;
}

.two-column {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0.8rem;
}

.card {
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 0.72rem;
}

.card-search {
  background: var(--card);
}

.card-content {
  background: var(--paper);
}

.card h2 {
  margin: 0;
  font-size: 1.02rem;
}

.muted {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: "Open Sans", Arial, sans-serif;
}

.stack-form {
  display: grid;
  gap: 0.56rem;
  margin-top: 0.75rem;
}

.stack-form label {
  font-size: 0.85rem;
  font-weight: 700;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  border: 1px solid #bdb7a8;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.95rem;
  padding: 0.52rem;
}

.stack-form button {
  border: 1px solid #968d76;
  background: #f3efe5;
  color: #333;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.52rem 0.65rem;
  cursor: pointer;
  justify-self: start;
}

.stack-form button:hover {
  background: #e9dfcb;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.9rem;
}

.inline-check input[type="checkbox"] {
  margin: 0;
}

.logout-form {
  margin-top: 0.9rem;
}

.btn-secondary {
  border: 1px solid #8d8271;
  background: #e4d9bf;
  color: #433d33;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.42rem 0.6rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #d8c9a7;
}

.notice {
  margin-top: 0.8rem;
  border: 1px solid #dfbd82;
  background: #f8e5c0;
  border-radius: 4px;
  padding: 0.5rem;
  font-family: "Open Sans", Arial, sans-serif;
}

.result-term {
  margin-top: 0.9rem;
  margin-bottom: 0.3rem;
  font-family: "Open Sans", Arial, sans-serif;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "Open Sans", Arial, sans-serif;
}

.result-list li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.55rem;
  border-top: 1px solid #dbd2bf;
  padding: 0.48rem 0;
}

.term {
  font-weight: 700;
}

.intro-content {
  border-bottom: 1px solid #c9bea8;
  margin-bottom: 0.68rem;
  padding-bottom: 0.68rem;
}

.legacy-content {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.95rem;
}

.legacy-content p,
.legacy-content li {
  line-height: 1.55;
}

.legacy-content p[align="JUSTIFY"] {
  text-align: justify;
}

.legacy-content p[align="LEFT"] {
  text-align: left;
}

.legacy-content table {
  width: 100%;
  border-collapse: collapse;
}

.legacy-content td,
.legacy-content th {
  border: 1px solid #b9ab89;
  padding: 0.42rem;
  vertical-align: top;
}

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

.table-scroller {
  overflow-x: auto;
}

.punctuation-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.punctuation-link {
  text-decoration: none;
  border: 1px solid #c7aa5c;
  color: #333;
  background: #efe0ba;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.33rem 0.52rem;
}

.punctuation-link.is-active {
  background: var(--active);
  color: #fff;
  border-color: #d99d23;
}

.inline-errors {
  margin-top: 0.7rem;
  margin-bottom: 0.5rem;
  border: 1px solid #d39f9f;
  background: #f6dcdc;
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
}

.inline-errors p {
  margin: 0.14rem 0;
  color: #6b1d1d;
  font-family: "Open Sans", Arial, sans-serif;
}

.admin-layout {
  align-items: start;
}

.admin-block + .admin-block {
  margin-top: 1rem;
}

.admin-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.96rem;
}

.picker-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.admin-editor-form {
  margin-top: 0.5rem;
}

.admin-textarea {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
}

.ui-editor-grid {
  display: grid;
  gap: 0.55rem;
}

.ui-field {
  display: grid;
  gap: 0.28rem;
}

.ui-field label {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.82rem;
  color: #4b463d;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.89rem;
}

.admin-table th,
.admin-table td {
  border: 1px solid #b8ab8a;
  padding: 0.34rem 0.42rem;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #eadbb8;
}

.inline-form {
  display: inline-block;
  margin-left: 0.4rem;
}

.link-button {
  background: transparent;
  border: none;
  color: var(--link);
  text-decoration: underline;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 0;
}

.link-button:hover {
  color: #334537;
}

.fb-icon {
  width: 17px;
  height: 17px;
  vertical-align: text-bottom;
  margin-right: 0.16rem;
}

.site-footer {
  border-top: 2px solid #e5e5e5;
  color: #676259;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0;
  font-size: 0.85rem;
}

.footer-fb-link {
  text-decoration: none;
}

.admin-link {
  margin: 0 0.3rem 0 0.5rem;
  font-size: 0.82rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.has-motion .card {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.has-motion .card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .two-column {
    grid-template-columns: 1fr;
  }

  .result-list li {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding-top: 0.8rem;
  }

  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    display: none;
    border-top: 1px solid #d1c29f;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
  }

  .main-nav.is-open {
    display: flex;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}
