@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  color-scheme: dark;
  font-size: 14px; /* compact base */
}

body {
  font-size: 0.9rem;
}

input,
select,
textarea,
button {
  font-size: 0.9rem;
  line-height: 1.1;
  padding: 0.25rem 0.45rem;
  min-height: unset;
}

table.striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.02);
}
table.striped tbody tr:nth-of-type(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.header-logo {
  height: 40px;
  width: auto;
  border-radius: 6px;
}

.header-welcome {
  font-size: 1.9rem;
  font-weight: 600;
}

.btn-astelles,
.btn-astelles.contrast,
a.btn-astelles[role="button"] {
  background-color: #ae2144 !important;
  border-color: #ae2144 !important;
  color: #fff !important;
}
.btn-astelles:where(:hover, :focus),
.btn-astelles.contrast:where(:hover, :focus),
a.btn-astelles[role="button"]:where(:hover, :focus) {
  background-color: #c63b5f !important;
  border-color: #c63b5f !important;
  color: #fff !important;
}

.current-lesson {
  background-color: #ae2144 !important;
  border-color: #ae2144 !important;
  color: #fff !important;
}

.kanji-table td {
  width: 20%;
}

.current-link {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.container nav a[role="button"] {
  background: #1b3a57;
  border-color: #1b3a57;
  color: #fff;
}
.container nav a[role="button"].current-link {
  background: #fff;
  border-color: #1b3a57;
  color: #1b3a57;
}

.target-dialogs-form {
  align-items: end;
  gap: 0.5rem;
}

.target-dialogs-actions {
  margin-top: 0.25rem;
}

/* Utility spacing/text helpers */
.mt-025 { margin-top: 0.25rem; }
.mt-05 { margin-top: 0.5rem; }
.mt-1 { margin-top: 1rem; }
.text-faded { color: #aab3c5; font-size: 0.9rem; }
.text-italic { font-style: italic; }
.text-center { text-align: center; }
.text-error { color: #ffb4b4; }
.no-underline { text-decoration: none; }
.no-margin { margin: 0; }
 
/* Alert card styling */
.alert-card {
  max-width: 480px;
  margin: 2rem auto;
}

/* Login page tweaks */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  max-width: 420px;
  margin: 2rem auto;
}

.full-height-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Printable layouts */
.printable-page {
  font-family: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
}

.print-card {
  padding: 1.5rem;
}

@media print {
  .printable-page header nav,
  .printable-page .no-print {
    display: none !important;
  }
  .print-card {
    box-shadow: none;
    border: none;
  }
}

table.striped td {
  vertical-align: middle;
}

/* Lessons layout */
.lessons-main {
  padding: 1.5rem 0;
}

.lessons-grid {
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lessons-subgrid {
  gap: 0.35rem;
  grid-template-columns: repeat(3, minmax(0,1fr));
}

/* Wordlists */
.wordlist-filters {
  align-items: end;
  gap: 0.5rem;
}

/* Dashboard search layout */
.dashboard-search {
  grid-template-columns: 125px 120px 1fr auto;
  align-items: end;
}
.dashboard-search .search-fields {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

/* Dashboard column stacks */
.dashboard-column {
  display: grid;
  gap: 1rem;
}

/* Blogs layout */
.blogs-center {
  justify-items: center;
}
.blogs-card {
  max-width: 900px;
  width: 100%;
}
.lesson-text {
  font-size: 1.3rem;
  line-height: 1.7;
}
.lesson-perzin {
  font-size: 1.1rem;
  line-height: 1.55;
}
.lesson-perzin .blog-para-text {
  flex: 1 1 auto;
}
.lesson-perzin header {
  margin-top: -8px;
}
.lesson-title {
  text-align: center;
  margin: 0.35rem 0 0.6rem;
}
.lesson-title .secondary {
  margin-left: 0.5rem;
  vertical-align: middle;
}
.lesson-select-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem 0 1rem;
}
.lesson-select-inline {
  display: inline-flex;
  vertical-align: middle;
}
.lesson-select {
  padding: 0.24rem 0.5rem;
  font-size: 1.05rem;
  min-width: 140px;
  width: min(100%, 760px);
  font-family: inherit;
}
.blog-para {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0 0 1rem;
}
.blog-para-image {
  width: 320px;
  height: auto;
  border-radius: 6px;
  flex: 0 0 auto;
}
.blog-para-text {
  margin: 0;
}
.lesson-perzin .blog-para {
  flex-direction: row-reverse;
}

/* Part selector */
.part-select {
  padding: 0.15rem 1.4rem 0.15rem 0.5rem;
  min-height: auto;
  position: relative;
  top: 7px;
  font-size: 1.1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
}
@media (max-width: 720px) {
  .blog-para {
    flex-direction: column;
  }
  .blog-para-image {
    width: 100%;
    max-width: 320px;
  }
}

/* Welcome page */
.welcome-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 3rem 2.5rem;
  background: url("/pics/matsuri.jpg") center/cover no-repeat;
  border: 1px solid rgba(10, 12, 18, 0.4);
  box-shadow: 0 24px 60px rgba(10, 12, 18, 0.35);
  color: #f8f5ef;
}
.welcome-hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(120deg, rgba(8, 12, 18, 0.55), rgba(8, 12, 18, 0.15) 45%, rgba(8, 12, 18, 0.55));
}
.welcome-hero h1 {
  font-family: \"DM Serif Display\", \"Garamond\", \"Georgia\", serif;
  font-size: clamp(2.4rem, 3vw, 3.2rem);
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}
.welcome-hero__content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}
.welcome-hero__eyebrow {
  font-family: \"Space Grotesk\", \"Futura\", \"Trebuchet MS\", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
  color: #f7d38a;
}
.welcome-hero__lead {
  font-family: \"Space Grotesk\", \"Futura\", \"Trebuchet MS\", sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.welcome-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.welcome-hero__button,
.welcome-hero__ghost {
  font-family: \"Space Grotesk\", \"Futura\", \"Trebuchet MS\", sans-serif;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
}
.welcome-hero__button {
  background: #f7d38a;
  color: #1a1a1a;
  box-shadow: 0 10px 20px rgba(247, 211, 138, 0.25);
}
.welcome-hero__ghost {
  border: 1px solid rgba(248, 245, 239, 0.65);
  color: #f8f5ef;
}
.welcome-hero__ribbon {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: grid;
  gap: 0.35rem;
  font-family: \"Space Grotesk\", \"Futura\", \"Trebuchet MS\", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  background: rgba(10, 12, 18, 0.65);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(248, 245, 239, 0.18);
  color: #f8f5ef;
}
.welcome-hero__backdrop::before,
.welcome-hero__backdrop::after {
  content: \"\";
  position: absolute;
  border-radius: 999px;
  opacity: 0.45;
  filter: blur(0px);
  animation: floatGlow 8s ease-in-out infinite;
}
.welcome-hero__backdrop::before {
  width: 240px;
  height: 240px;
  background: rgba(231, 187, 121, 0.35);
  top: -60px;
  left: -40px;
}
.welcome-hero__backdrop::after {
  width: 180px;
  height: 180px;
  background: rgba(120, 176, 214, 0.35);
  bottom: -40px;
  right: 80px;
  animation-delay: -3s;
}
@keyframes floatGlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(12px); }
}
@media (max-width: 720px) {
  .welcome-hero {
    padding: 2rem 1.5rem;
  }
  .welcome-hero__ribbon {
    position: static;
    margin-top: 1.5rem;
    width: fit-content;
  }
}

/* Verb tables */
.verb-ending {
  color: #f39c12;
  font-weight: 700;
}

/* Legacy lesson content smoothing */
.legacy-content .legacy-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.legacy-content .legacy-body th,
.legacy-content .legacy-body td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem;
  vertical-align: top;
}
.legacy-content .legacy-body img {
  max-width: 100%;
  height: auto;
}
.legacy-content .legacy-body ul {
  padding-left: 1.25rem;
}
.legacy-content .legacy-body p {
  margin: 0.35rem 0;
}
