/* =============================================
   EtsyAI Tools — Base Stylesheet
   Mobile-first, no framework dependencies
   ============================================= */

:root {
  --color-primary: #2d6a4f;
  --color-accent: #d4a373;
  --color-bg: #fefae0;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #e0e0e0;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --max-width: 900px;
  --nav-height: 60px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 1.75rem; }
h3 { font-size: 1.15rem; color: var(--color-text); margin-top: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }

ul { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.4rem; }

/* Header / Nav */
header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover { background: var(--color-primary); color: white; }

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
  width: 100%;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--color-surface);
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border);
}

.hero h1 { font-size: 2.25rem; }

.tagline {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.cta-button {
  display: inline-block;
  background: var(--color-primary);
  color: white !important;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s;
  font-size: 1rem;
}

.cta-button:hover { background: #1e4d38; color: white !important; }

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.feature-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.feature-card h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.feature-card a { font-size: 0.9rem; font-weight: 600; }

/* Content block */
.content-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* Article pages */
article { max-width: 100%; }

article .lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  border-left: 4px solid var(--color-accent);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.prompt-box {
  background: #f4f1ea;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.prompt-box pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text);
}

code {
  background: #f4f1ea;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.88em;
}

/* Generator tool */
.generator-panel { scroll-margin-top: calc(var(--nav-height) + 1rem); }

.generator-form {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.generator-form label {
  font-weight: 700;
  color: var(--color-primary);
}

.field-hint {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.generator-form input,
.generator-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem;
  font: inherit;
  background: #fffdf8;
  color: var(--color-text);
}

.generator-form input:focus,
.generator-form textarea:focus {
  outline: 3px solid rgba(45, 106, 79, 0.16);
  border-color: var(--color-primary);
}

.generator-form button { justify-self: start; border: 0; cursor: pointer; }
.generator-form button:disabled { opacity: 0.7; cursor: wait; }

.form-status {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  min-height: 1.4rem;
  margin: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  background: #fffdf8;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 8px;
  padding: 1rem;
}

.result-card h3 { margin-top: 0; color: var(--color-primary); }
.result-card p { color: var(--color-text); }

.result-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.result-card-header h3 { margin-bottom: 0; }

.tag-result-card { border-left-color: var(--color-primary); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(45, 106, 79, 0.25);
  background: #f4f1ea;
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.86rem;
  line-height: 1.2;
}

.tag-example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

.copy-button {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
}

.copy-button:hover,
.copy-button:disabled {
  background: var(--color-primary);
  color: white;
}

.how-to-block ol { padding-left: 1.5rem; margin-bottom: 0; }
.how-to-block li { margin-bottom: 0.65rem; }

.faq-section details {
  border-top: 1px solid var(--color-border);
  padding: 0.85rem 0;
}

.faq-section details:last-child { border-bottom: 1px solid var(--color-border); }
.faq-section summary { cursor: pointer; font-weight: 700; color: var(--color-primary); }
.faq-section p { margin: 0.75rem 0 0; color: var(--color-text-muted); }

@media (min-width: 700px) {
  .result-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Sidebar */
.sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 2rem;
}

.sidebar h3 { margin-top: 0; font-size: 1rem; color: var(--color-primary); }
.sidebar ul { margin-bottom: 0; }
.sidebar li { margin-bottom: 0.5rem; }

@media (min-width: 768px) {
  article { float: left; width: 65%; }
  .sidebar { float: right; width: 28%; margin-top: 0; }
}

/* Footer */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

footer a { color: var(--color-text-muted); }

footer p {
  line-height: 1.8;
}

@media (max-width: 480px) {
  footer { font-size: 0.78rem; padding: 1rem 0.75rem; }
}

/* Responsive tweaks */
@media (max-width: 640px) {
  nav {
    height: auto;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    gap: 0;
  }

  .nav-brand { flex-shrink: 0; }


  .nav-links {
    gap: 0.35rem 0.6rem;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-links li { flex-shrink: 0; }

  .nav-links a {
    font-size: 0.82rem;
    padding: 0.25rem 0.4rem;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.65rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 2rem 1rem; }
  .nav-links a { font-size: 0.8rem; }
}

/* Clear floats */
main::after { content: ""; display: table; clear: both; }
