/* =========================================
   1800s Pioneer / Deseret Alphabet Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Pioneer palette */
  --parchment:      #f4e8c1;
  --parchment-dark: #e8d5a3;
  --leather:        #8b6914;
  --leather-dark:   #6b4f10;
  --ink:            #2c1810;
  --ink-light:      #4a3728;
  --rust:           #a0522d;
  --dust:           #c4a265;
  --sage:           #7a8450;
  --sky:            #6b8cae;
  --cream:          #faf3e0;
  --border:         #b8a070;
  --shadow:         rgba(44, 24, 16, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Lora', 'Georgia', serif;
  background-color: var(--parchment);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(196, 162, 101, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 105, 20, 0.08) 0%, transparent 50%);
}

/* Header */
header {
  text-align: center;
  padding: 0.35rem 1rem 0.25rem;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(180deg, var(--cream) 0%, var(--parchment) 100%);
  flex-shrink: 0;
}

header h1 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.8rem;
  color: var(--leather-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
  text-shadow: 1px 1px 0 rgba(244, 232, 193, 0.8);
}

header .subtitle {
  font-size: 0.75rem;
  color: var(--rust);
  font-style: italic;
  letter-spacing: 0.04em;
}


/* Decorative rule */
.ornament {
  text-align: center;
  color: var(--dust);
  font-size: 1rem;
  letter-spacing: 0.5em;
  padding: 0.1rem 0;
  flex-shrink: 0;
}

/* Main output area — fills all space above the input */
.output-area {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 2rem;
  min-height: 0;
}

.output-section {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 1px 3px var(--shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.output-section h2 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rust);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--parchment-dark);
  padding-bottom: 0.25rem;
  flex-shrink: 0;
}

#deseret-output {
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--ink);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  flex: 1;
  overflow-y: auto;
}

/* Input area — pinned to bottom, resizable upward */
.input-area {
  flex-shrink: 0;
  border-top: 2px solid var(--border);
  background: linear-gradient(0deg, var(--cream) 0%, var(--parchment) 100%);
  display: flex;
  flex-direction: column;
}

/* Drag handle at the top of the input area */
.resize-handle {
  height: 12px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
}

.resize-handle::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}

.resize-handle:hover::after,
.resize-handle:active::after {
  background: var(--leather);
}

.input-wrap {
  padding: 0 2rem 1.25rem;
  flex: 1;
  display: flex;
  min-height: 0;
}

#input-text {
  width: 100%;
  height: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Lora', 'Georgia', serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--border);
  border-radius: 4px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
  box-shadow: inset 0 1px 4px var(--shadow);
}

#input-text:focus {
  border-color: var(--leather);
  box-shadow: inset 0 1px 4px var(--shadow), 0 0 0 2px rgba(139, 105, 20, 0.15);
}

#input-text::placeholder {
  color: var(--dust);
  font-style: italic;
}


/* Footer */
footer {
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.55rem;
  color: var(--dust);
  border-top: 1px solid var(--parchment-dark);
  flex-shrink: 0;
}

footer a {
  color: var(--rust);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Scrollbar styling */
.output-area::-webkit-scrollbar {
  width: 8px;
}

.output-area::-webkit-scrollbar-track {
  background: var(--parchment);
}

.output-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.output-area::-webkit-scrollbar-thumb:hover {
  background: var(--dust);
}

/* Responsive */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.3rem;
  }

  .output-area {
    padding: 1rem;
  }

  .input-area {
    padding: 0.75rem 1rem 1rem;
  }

  #deseret-output {
    font-size: 1.3rem;
  }

}
