/* studentaides — the small amount of CSS that inline styles can't do.
 *
 * The page templates carry their own inline styles (that's how the design
 * files are authored), so every override here has to be !important to win.
 * Classes are applied as hooks in the templates: sa-page, sa-split, sa-cols-2,
 * sa-cols-3, sa-sticky, sa-display, and so on.
 */

/* Long content that shouldn't drag the page sideways on a phone. */
.sa-scroll-x { overflow-x: auto; }

/* Native controls inherit nothing by default; make them match the design. */
.sa-input,
.sa-textarea,
.sa-select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: none;
  width: 100%;
  padding: 0;
  margin: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}
.sa-textarea { resize: none; }
.sa-resize { resize: vertical; }
.sa-select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #7c8a85 50%),
    linear-gradient(135deg, #7c8a85 50%, transparent 50%);
  background-position: right 10px center, right 5px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 24px;
}
.sa-input::placeholder,
.sa-textarea::placeholder { color: #a3aeaa; }

/* Focus ring that reads on both the white and the pale-green surfaces. */
.sa-focusable:focus-visible,
.sa-input:focus-visible,
.sa-textarea:focus-visible,
.sa-select:focus-visible {
  outline: 2px solid #2f5d50;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Anything clickable that isn't a link or a button. */
.sa-press { cursor: pointer; user-select: none; }
.sa-press:active { transform: translateY(1px); }

.sa-check { accent-color: #2f5d50; width: 17px; height: 17px; cursor: pointer; }

@media (max-width: 1100px) {
  .sa-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sa-split-wide { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 940px) {
  .sa-split,
  .sa-cols-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .sa-sticky { position: static !important; top: auto !important; }
  .sa-display { font-size: 40px !important; }
  .sa-display-sm { font-size: 30px !important; }
}

@media (max-width: 760px) {
  .sa-page { padding-left: 20px !important; padding-right: 20px !important; }
  .sa-cols-3 { grid-template-columns: minmax(0, 1fr) !important; }
  .sa-wrap { flex-wrap: wrap !important; }
  .sa-nav { gap: 16px !important; overflow-x: auto !important; }
  .sa-header { gap: 16px !important; flex-wrap: wrap !important; }
  .sa-display { font-size: 32px !important; }
  .sa-display-sm { font-size: 26px !important; }
  .sa-clock { font-size: 68px !important; }
  .sa-hide-sm { display: none !important; }
  /* A card row is: number, term, definition, delete. On a narrow screen the
     definition drops onto a second line under the term. */
  .sa-card-row { grid-template-columns: 26px minmax(0, 1fr) 28px !important; }
  .sa-card-row > *:nth-child(3) {
    grid-column: 2 !important;
    grid-row: 2 !important;
    border-left: 0 !important;
    padding-left: 0 !important;
    margin-top: 12px !important;
  }
  .sa-card-row > *:nth-child(4) { grid-column: 3 !important; grid-row: 1 !important; }
  .sa-rate { grid-template-columns: 1fr 1fr !important; }
  .sa-week { grid-template-columns: minmax(0, 1fr) !important; }
  .sa-pad-sm { padding: 28px 20px !important; }
}

@media (max-width: 520px) {
  .sa-stack-sm { flex-direction: column !important; align-items: stretch !important; }
  .sa-stack-sm > * { width: 100% !important; }
  .sa-display { font-size: 28px !important; }
}

@media print {
  .sa-no-print { display: none !important; }
}
