/* styles.css
   Modern, minimal responsive UI using system fonts only (keeps CSP happy).
   High-contrast, accessible sizes, and simple utility classes.
*/

/* Layout / base */
:root{
  --bg: #f7f8fb;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #0b63d6;
  --accent-contrast: #ffffff;
  --border: #e6e9ef;
  --danger: #c53030;
  --radius: 10px;
  --max-width: 980px;
  --container-padding: 20px;
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color-scheme: light;
}

* { box-sizing: border-box; }
html,body { height:100%; margin:0; background:var(--bg); color:#0f172a; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
img { max-width:100%; height:auto; display:block; }

/* Center the app */
.wrapper {
  width:100%;
  max-width: var(--max-width);
  margin: 28px auto;
  padding: var(--container-padding);
}

/* Header */
header.site-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
header.site-header h1 { margin:0; font-size:20px; letter-spacing:-0.2px; }
header.site-header p { margin:0; color:var(--muted); font-size:13px; }

/* Controls row */
.controls {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:16px;
}

.field {
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:180px;
}

label.small { font-size:12px; color:var(--muted); }

/* Selects and inputs */
select, textarea, button {
  font-family: inherit;
  font-size:15px;
  border-radius:8px;
  border:1px solid var(--border);
  padding:10px 12px;
  background:linear-gradient(180deg, #fff, #fbfdff);
  color: #0f172a;
  outline: none;
}

select:focus, textarea:focus, button:focus {
  box-shadow: 0 0 0 4px rgba(11,99,214,0.12);
  border-color: var(--accent);
}

/* ---------- Top layout + responsive senators grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* Top area: two-column grid of senator cards */
.senators-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 700px) {
  .senators-top {
    grid-template-columns: 1fr;
  }
}

/* Senator card (single authoritative definition) */
.senator-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #f1f3f7;
  background: #fff;
}

/* (optional photo slot - harmless if you don't add photos yet) */
.senator-photo {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  flex: 0 0 84px;
  object-fit: cover;
  background: linear-gradient(180deg,#f5f7fb,#eef3ff);
  display: block;
}

/* Text area inside card */
.senator-info { flex: 1 1 auto; min-width:0; }
.senator-title { margin:0; font-weight:700; font-size:15px; }
.senator-meta { color:var(--muted); font-size:13px; margin-top:6px; }

/* Buttons area */
.senator-actions { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }

/* --------- Script row (full width, below senators) ---------- */
.script-row {
  margin-top: 18px;
  display: block;
}

.script-box {
  display:flex;
  flex-direction:column;
  gap:8px;
}

textarea#scriptBox {
  resize: vertical;
  min-height: 480px;   /* generous reading area */
  width: 100%;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Mobile tweaks */
@media (max-width: 700px) {
  .senator-photo { width: 72px; height:72px; flex:0 0 72px; }
  textarea#scriptBox { min-height: 360px; font-size:15px; }
}


/* Copy status */
.status {
  color: #0f5132;
  font-size:13px;
}

/* Small helpers */
.small-muted { font-size:13px; color:var(--muted); }
.hr { height:1px; background:transparent; margin:12px 0; }

/* Responsive */
@media (max-width:980px) {
  .grid { grid-template-columns: 1fr; }
  .wrapper { padding:14px; }
  .field { min-width:120px; }
}

/* Focus-visible for accessibility */
:focus-visible { outline: 3px solid rgba(11,99,214,0.18); outline-offset:2px; }

/* Active senator card highlight */
[data-active="true"] {
  border: 1px solid rgba(11,99,214,0.16) !important;
  box-shadow: 0 8px 20px rgba(11,99,214,0.06);
}
