/*--------------------------------------------------------------
# Citation Generator page
--------------------------------------------------------------*/
.citation-section { padding: 60px 0; }

/* ── Option rows (style / source type / output mode) ─────────────────────── */
.cite-options {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eef0f2;
}
.cite-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.cite-row-label {
  font-size: 12px;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  min-width: 92px;
}

/* Source-type picker — five labeled icon buttons */
.cite-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
}
.cite-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: transparent;
  border: 1.5px solid #d0dae8;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cite-type-btn i {
  font-size: 22px;
  color: #6c757d;
  transition: color 0.15s;
}
.cite-type-btn:hover {
  border-color: #0563bb;
  color: #0563bb;
  background: #e8f0fb;
}
.cite-type-btn:hover i { color: #0563bb; }
.cite-type-btn.active {
  border-color: #0563bb;
  background: #0563bb;
  color: #fff;
}
.cite-type-btn.active i { color: #fff; }

/* Re-use the ethanol pill toggle (.result-unit-toggle / .unit-tab) but let it
   sit inline in the row, not be the only thing in a centered block. */
.cite-row .result-unit-toggle { margin-bottom: 0; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.cite-form .calc-grid {
  margin-bottom: 6px;
}
.calc-field.is-invalid .input-unit-wrap {
  border-color: #dc3545;
}
.calc-field.is-invalid .input-unit-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}
.field-help {
  font-size: 12px;
  color: #adb5bd;
  margin-top: 2px;
}
.field-required-mark {
  color: #dc3545;
  margin-left: 3px;
}

/* Reuse the .upload-actions centering trick from cloud.css for the action
   row, since .search-button + .reset-button have baked-in margins from the
   ethanol page. */
.cite-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.cite-actions .search-button,
.cite-actions .reset-button {
  margin: 0;
}

/* ── Output card ─────────────────────────────────────────────────────────── */
.cite-output-card {
  margin-top: 24px;
}
.cite-output-body {
  padding: 22px 28px 26px;
}
.cite-output-meta {
  font-size: 12px;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.cite-output {
  font-family: "Open Sans", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #45505b;
  background: #f8fafd;
  border: 1px solid #e4eaf1;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
  /* Hanging indent — Chicago/MLA/APA/Harvard all use this for bibliographies */
  padding-left: 36px;
  text-indent: -20px;
  word-break: break-word;
}
.cite-output em { font-style: italic; }
.cite-output.is-intext {
  text-indent: 0;
  padding-left: 20px;
  font-size: 16px;
  text-align: center;
}

.cite-copy-btn.copied {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

/* ── Autofill button (sits inside .input-unit-wrap on URL fields) ─────────── */
.cite-autofill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 15px;
  background: #e8f0fb;
  color: #0563bb;
  border: none;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.cite-autofill-btn:hover:not(:disabled) {
  background: #0563bb;
  color: #fff;
}
.cite-autofill-btn:disabled { opacity: 0.7; cursor: progress; }
.cite-autofill-btn i { font-size: 15px; }
.cite-autofill-btn .bx-spin { animation: cite-spin 0.8s linear infinite; }
@keyframes cite-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cite-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .cite-row-label { min-width: 0; }
  .cite-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cite-type-btn { padding: 9px 6px; font-size: 11px; }
  .cite-type-btn i { font-size: 20px; }
  /* The full-width pill toggles (style + output mode) need to stretch on
     mobile so the labels don't get clipped. */
  .cite-row .result-unit-toggle {
    display: flex;
    width: 100%;
  }
  .cite-row .result-unit-toggle .unit-tab {
    flex: 1;
    padding: 7px 6px;
    text-align: center;
  }
  .cite-output {
    padding-left: 24px;
    text-indent: -14px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .cite-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Below ~480px, four tabs in a single row become too cramped — wrap to a
     2 × 2 grid using the same blue-pill aesthetic. */
  .cite-row .result-unit-toggle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-radius: 12px;
  }
  .cite-row .result-unit-toggle .unit-tab {
    border-radius: 0;
    padding: 8px 6px;
    font-size: 12px;
  }
}
