/* === Responsive Overrides (added by assistant) === */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; }
img, video, canvas, svg { max-width: 100%; height: auto; }

/* Constrain page width but keep full-width on small screens */
.wrapper, .container, #content, #main, #page, #stacks_out, .stacks_out, .stacks_in {
  max-width: min(72rem, 100%);
}

/* Generic grid/flex helpers */
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.row > [class*="col"] { flex: 1 1 16rem; min-width: 12rem; }

/* RapidWeaver Stacks columns (floats) -> stack on mobile */
.s3_column, .s2_column, .s1_column { min-width: 0; }
@media (max-width: 900px) {
  .s3_column, .s2_column, .s1_column,
  .threeCol, .twoCol, .oneCol,
  .threeColStack .s3_column, .twoColStack .s2_column, .oneColStack .s1_column {
    float: none !important;
    width: 100% !important;
    display: block !important;
    clear: both !important;
  }
}

/* Navigation: allow wrapping and touch targets */
#navcontainer ul, nav ul { display: flex; flex-wrap: wrap; gap: .5rem; }
#navcontainer a, nav a { padding: .5rem .75rem; display: block; }

/* Make embeds fluid */
.responsive-embed, .video, .embed {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
}
.responsive-embed iframe, .video iframe, .embed iframe,
.responsive-embed object, .video object, .embed object,
.responsive-embed embed, .video embed, .embed embed {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* Tables: scroll on small screens */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; }

/* Avoid hard-coded widths on small screens */
@media (max-width: 780px) {
  [style*="width:"] { max-width: 100% !important; width: 100% !important; }
  [class*="width-"], .fixed-width, .sidebar { max-width: 100% !important; width: 100% !important; }
}

/* Headings and spacing scale */
:root {
  --space-1: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
  --space-2: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --step-0: clamp(1rem, 0.95rem + 0.5vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.1rem + 1vw, 1.5rem);
}
h1 { font-size: var(--step-1); }
main, #content, #main { padding-inline: var(--space-1); }

/* Images inside headers/logo */
#logo img { height: auto !important; max-width: 100% !important; }

/* Footer tidy on wrap */
footer { display: block; padding: var(--space-1); }


@media (max-width: 600px) {
  table { display: block; overflow-x: auto; white-space: nowrap; }
  thead { display: table-header-group; }
}
