/* Last synced SEP 30, 2025, 0847 HOURS pst REMOVED SITE-WIDE BACKGROUND COLORS */

/* ===== Baseline site styles ===== */
/* overlay_pill.css — no page-wide overrides */

:root {
  /* --background-muted-crimson removed */
  --text-light: #ffffff;
  --accent-color: #800020; /* maroon for buttons & accents */
}

* {
  box-sizing: border-box;
  background-color: inherit; /* keep surfaces inherited */
  color: inherit;            /* keep text color inherited */
  font-family: sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* no background or color here — inherit from global style.css */
}


.awen-container {
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.awen-title {
  font-size: 2.5em;
  margin-bottom: 0.2em;
  text-align: center;
}

.awen-subtitle {
  font-size: 1.2em;
  max-width: 600px;
  text-align: center;
  margin-bottom: 0.75em; /* tighter */
}

.poem-form {
  width: 100%;
  max-width: 600px;
  margin-bottom: 0.75em; /* tighter */
}

.poem-input {
  width: 100%;
  height: 160px;
  padding: 10px;
  font-size: 1em;
  background-color: #fff;
  color: #000;
  border: 2px solid var(--accent-color, #800020);
  border-radius: 8px;
  margin-bottom: 1em;
  resize: vertical;
}

.poem-button {
  background-color: var(--accent-color, #800020);
  color: var(--text-light, #ffffff);
  border: none;
  padding: 10px 20px;
  font-size: 1em;
  border-radius: 6px;
  cursor: pointer;
}

.clear-button {
  display: block;
  margin-top: 8px;
  margin-left: 0;
}

.auth-buttons {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}
.auth-buttons .poem-button {
  padding: 10px 20px;
}

.poem-header {
  font-size: 1.5em;
  margin-top: 0.1em; /* raise header closer to buttons */
  margin-bottom: 0.4em;
  text-align: center;
}

.poem-output {
  background-color: #fff;
  color: #000;
  padding: 10px;
  padding-top: 24px; /* lower poem text on desktop/tablet */
  border-radius: 8px;
  max-width: 800px;
  margin: auto;
  position: relative;
}

.poem-output pre {
  white-space: pre-wrap;
  margin-top: 0;
  outline: none;
}

.poem-output .action-icon {
  position: absolute;
  top: 4px; /* keeps icons tight to top */
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.poem-output .action-icon:hover { opacity: 1; }
.poem-output .action-icon .copy-svg { width: 16px; height: 16px; display: block; }
.poem-output .action-icon .action-label { font-size: 12px; color: #000; }

.divider {
  margin: 1em 0;
  border: none;
  height: 1px;
  background-color: #ccc;
}

#poem-text {
  margin: 0;
  padding: 0;
}

/* --------------------------------------- */
/* Mobile overrides (≤600px)               */
/* --------------------------------------- */
@media (max-width: 600px) {
  /* Slightly lowered poem text under the toolbar */
  .poem-output {
    padding-top: 13px; /* gentler drop */
    display: grid;
    grid-template-columns: 1fr auto auto;  /* text + two buttons on right */
    grid-auto-rows: auto;
    align-items: start;
  }

  /* Place both buttons in the first row, right side, no overlap */
  .poem-output .action-icon {
    position: static;         /* override absolute so they flow */
    padding: 8px 10px;        /* finger-friendly tap target */
    border-radius: 10px;
    grid-row: 1;              /* keep both in the top row */
  }

  /* Ensure the poem text starts on the next row, full width */
  #poem-text {
    grid-column: 1 / -1;
  }
}

/* ===== Accordion (consolidated) =====
   Awen accordions with maroon header, white panel */
.awen-acc {
  width: 400px;      /* matches width_px=400 */
  min-width: 400px;
  max-width: 400px;
  margin: 0;
}

.awen-acc__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: var(--accent-color, #800020);   /* maroon header */
  color: var(--text-light, #ffffff);          /* white text */
  border: 2px solid var(--accent-color, #800020);
  border-radius: 8px;
  cursor: pointer;
}

.awen-acc__label { font-weight: 600; }

/* chevron inherits header color (white) */
.awen-acc__chev, .awen-acc__chev::before { color: inherit; }
.awen-acc__chev::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.2s ease;
}
.awen-acc__bar[aria-expanded="true"] .awen-acc__chev::before { transform: rotate(90deg); }

.awen-acc__panel {
  width: 100%;
  padding: 10px;
  background: #ffffff;   /* readable content area */
  color: #000000;
  border: 1px solid var(--accent-color, #800020);
  border-radius: 8px;
  margin-top: 6px;
}

/* Respect the native hidden attribute */
.awen-acc__panel[hidden] { display: none !important; }

/* Last synced Aug 14, 2025, 13:06 hours PST — Mobile: hide accordions at ≤600px */
@media (max-width: 600px) {
  .awen-acc { display: none !important; }
}

/* ===================================================================== */
/* Input glow pulse while busy (twice per phase, soft outer glow)        */
/* ===================================================================== */

:root {
  /* Match JS phase gap (T=1180ms); pulse is half that → 2 pulses per phase */
  --awen-phase-gap: 1180ms;
  --awen-pulse-duration: calc(var(--awen-phase-gap) / 2);
}

/* Gentle outer glow; no layout shift; starts/stops via .is-busy class */
.poem-input.is-busy {
  animation: awenInputGlow var(--awen-pulse-duration) ease-in-out infinite;
}

@keyframes awenInputGlow {
  0%   { box-shadow: 0 0 2px 0 rgba(128, 0, 32, 0.20); }
  50%  { box-shadow: 0 0 20px 4px rgba(128, 0, 32, 0.60); }
  100% { box-shadow: 0 0 2px 0 rgba(128, 0, 32, 0.20); }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .poem-input.is-busy { animation: none !important; }
}

/* ===================================================================== */
/* Veil overlay positioning + visibility                                 */
/* ===================================================================== */

.awen-overlay { position: relative; }

.awen-status-veil {
  position: absolute;
  inset: 8px;                         /* sits inside the wrapper */
  display: none;                      /* hidden until .is-visible */
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.55);    /* soft dark glass (mobile default) */
  color: #fff;
  border-radius: 8px;
  pointer-events: none;               /* don’t block typing/clicks */
  opacity: 0;                         /* fade control */
  transition: opacity 0.2s ease;
  z-index: 2;                         /* above the textarea */
}

.awen-status-veil.is-visible { display: flex; opacity: 1; }
.awen-status-veil.is-fading  { opacity: 0.2; }

/* Desktop-only: lighten the veil (keep mobile at 0.55) */
@media (min-width: 601px) {
  .awen-status-veil { background: rgba(0, 0, 0, 0.38) !important; }
}

.awen-status-veil .awen-status-caret {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  animation: awenCaretBlink 1s ease-in-out infinite;
}

.awen-status-veil { inset: 8px 8px 26px 8px !important; } /* top right bottom left */





@keyframes awenCaretBlink {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

/* ===================================================================== */
/* Phone landscape protection: hide accordions on short viewports        */
/* ===================================================================== */

/* Hide accordions on short (landscape phone) viewports */
@media (orientation: landscape) and (max-height: 480px) {
  .awen-acc { display: none !important; }
}
