/*
  Base styles shared by every site. Colors and fonts come from the site's theme
  (/theme/tokens.css); a theme's own stylesheet loads after this file and may override it.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: clip;
}

a {
  color: var(--color-link);
}

/* Visible keyboard focus on every interactive element (WCAG 2.2 AA 2.4.7, 2.4.11). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

img,
video,
iframe,
table {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-on-primary);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
.site-main,
.site-footer {
  padding: 1rem;
}

.site-main,
.site-header .inner,
.site-footer .inner {
  max-width: 64rem;
  margin: 0 auto;
}

.site-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.site-name a {
  color: inherit;
  text-decoration: none;
}

.site-logo {
  display: block;
  max-height: 4rem;
  width: auto;
}

.site-hero {
  margin: 0 0 1.5rem;
}

.site-hero img {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* Classic: name and navigation share one bar, and stack on narrow screens. */
.layout-classic .site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Centered: name or logo centered above the navigation. */
.layout-centered .site-header .inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.layout-centered .site-nav ul {
  justify-content: center;
}

.visually-hidden:not(:focus):not(:active) {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Account navigation */
.account-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-nav form {
  margin: 0;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--color-link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Forms */
form {
  margin-block: 1.5rem;
}

.field {
  margin-block-end: 1.25rem;
  max-width: 32rem;
}

.field label {
  display: block;
  font-weight: 700;
}

.field .hint {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.field input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  font: inherit;
  color: var(--color-text);
  background: var(--color-background);
  border: 2px solid var(--color-text);
  border-radius: 4px;
}

.field-error input {
  border-color: var(--color-error);
}

.error-message {
  margin: 0.25rem 0;
  color: var(--color-error);
  font-weight: 700;
}

button {
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--color-on-primary);
  background: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
}

button.secondary {
  color: var(--color-primary);
  background: var(--color-background);
}

.error-summary {
  border: 3px solid var(--color-error);
  padding: 1rem;
  margin-block: 1rem 1.5rem;
}

.error-summary h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.notice {
  border-left: 6px solid var(--color-primary);
  padding: 0.5rem 1rem;
  margin-block: 1rem;
}

/* Shown on every page of an IntelliArch support session, so it is never mistaken for the board. */
.support-banner {
  border-bottom: 4px solid var(--color-primary);
  padding-block: 0.5rem;
}

.support-banner .inner {
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.support-banner p {
  margin: 0;
}

.details dt {
  font-weight: 700;
}

.details dd {
  margin: 0 0 0.75rem;
}

/* Two-step sign-in */
.qr-code {
  display: block;
  margin-block: 0.5rem;
  background: #ffffff;
  padding: 8px;
}

.manual-key,
.recovery-codes code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.recovery-codes {
  columns: 2 12rem;
}

/* Board pages */
.data-table {
  border-collapse: collapse;
  width: 100%;
  margin-block: 1rem 2rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #c8c8c8;
  vertical-align: top;
}

fieldset.field {
  border: 0;
  padding: 0;
}

fieldset.field legend {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0.25rem;
}

.checkbox input,
.radio input {
  width: 1.25rem;
  height: 1.25rem;
}

form button + button {
  margin-left: 0.5rem;
}

/* Documents */
.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 1rem;
}

.search-form .field {
  flex: 1 1 14rem;
}

.field select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  font: inherit;
  color: var(--color-text);
  background: var(--color-background);
  border: 2px solid var(--color-text);
  border-radius: 4px;
}

.search-form button {
  margin-bottom: 1.25rem;
}

.document-list {
  padding-left: 1.25rem;
}

.category-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-nav a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  color: var(--color-text);
  text-decoration: none;
}

.category-nav a:hover {
  text-decoration: underline;
}

.category-nav a[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
}

.category-nav .count {
  font-weight: 400;
}

/* Request messages */
.message-thread {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.message-thread .message {
  margin-block: 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-primary);
  background: var(--color-background);
}

.message-thread .from-owner {
  border-left-style: dashed;
}

.message-thread .meta {
  margin: 0 0 0.25rem;
}

.message-body {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.message-files {
  margin: 0.5rem 0 0;
}

.tag {
  display: inline-block;
  padding: 0 0.5rem;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  font-size: 0.875rem;
}

.document-list li {
  margin-block: 0.5rem;
}

.document-list .meta {
  display: block;
  font-size: 0.95rem;
}

/* Notices */
.notice-list {
  list-style: none;
  padding: 0;
}

.notice-list li {
  border-bottom: 1px solid #c8c8c8;
  padding-block: 0.75rem;
}

.notice-list h2 {
  margin: 0;
  font-size: 1.25rem;
}

.meta {
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

.summary {
  font-weight: 700;
}

.preview {
  border: 2px dashed var(--color-primary);
  padding: 1rem;
  margin-block: 1rem;
}

.field textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  font: inherit;
  color: var(--color-text);
  background: var(--color-background);
  border: 2px solid var(--color-text);
  border-radius: 4px;
}

/* Calendar */
.view-nav ul,
.home-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.view-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: none;
}

.month-nav {
  display: flex;
  gap: 1.5rem;
}

.event-list {
  padding-left: 1.25rem;
}

.event-list li {
  margin-block: 0.5rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

.field-row .field {
  flex: 1 1 12rem;
}

.next-event {
  border-left: 6px solid var(--color-primary);
  padding: 0.25rem 1rem;
  margin-block: 1.5rem;
}

/* Site pages */
.payment-link {
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin-block: 1.5rem;
}

.payment-link a {
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.site-credit {
  font-size: 0.875rem;
}

.preserve-lines {
  white-space: pre-line;
}

.message-post {
  border-top: 1px solid #d0d0d0;
  padding: 0.75rem 0;
}

.message-meta {
  margin-bottom: 0.25rem;
}

/*
  Modern layout. Every color comes from the theme's tokens; the surfaces below derive from them,
  and a theme's stylesheet may set --surface, --border and --muted to tune them.
*/
.layout-modern {
  --surface: #ffffff;
  --border: color-mix(in srgb, var(--color-text) 12%, var(--color-background));
  --muted: color-mix(in srgb, var(--color-text) 78%, var(--color-background));
  --radius: 16px;
}

.layout-modern .site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}

.layout-modern .site-main,
.layout-modern .site-header .inner,
.layout-modern .site-footer .inner {
  max-width: 74rem;
}

.layout-modern .site-main {
  padding: 2rem 1.5rem 4rem;
}

.layout-modern .site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.layout-modern .site-name a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.layout-modern .site-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 1.1rem;
  font-weight: 800;
}

.layout-modern .site-name-text {
  font-size: 1.15rem;
  font-weight: 800;
}

.layout-modern .site-nav ul {
  gap: 0.25rem;
}

.layout-modern .site-nav a,
.layout-modern .account-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
}

.layout-modern .site-nav a:hover,
.layout-modern .account-nav a:hover {
  background: color-mix(in srgb, var(--color-text) 6%, var(--surface));
}

.layout-modern .account-nav a[href="/account/sign-in"] {
  background: var(--color-primary);
  color: #ffffff;
}

.layout-modern .site-footer {
  background: var(--color-primary);
  color: #ffffff;
  padding: 2.5rem 1.5rem;
  margin-top: 0;
}

.layout-modern .site-footer a {
  color: #ffffff;
}

/* Buttons used on the modern home page. */
.button-accent,
.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.button-accent {
  background: var(--color-on-primary);
  color: var(--color-primary);
}

.button-outline {
  border: 1px solid currentColor;
  color: #ffffff;
}

/* Welcome: the panel sits over the entrance photo, or stands alone without one. */
.home-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 28rem;
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-primary);
}

.home-hero-plain {
  min-height: 0;
}

.home-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero-panel {
  position: relative;
  margin: 2rem;
  max-width: 36rem;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #ffffff;
}

.home-hero-plain .home-hero-panel {
  margin: 0;
  max-width: 44rem;
}

.home-hero-panel h1 {
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}

.home-hero-panel p {
  font-size: 1.05rem;
}

.home-hero-panel a:not([class]) {
  color: #ffffff;
}

.home-eyebrow {
  margin: 0;
  color: var(--color-on-primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

/* Quick-link cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.home-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--color-text);
  text-decoration: none;
}

.home-card:hover {
  border-color: var(--color-link);
}

.home-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-link) 12%, var(--surface));
  color: var(--color-link);
}

.home-card-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.home-card-text {
  color: var(--muted);
}

/* Notices beside the calendar, dues and contact. */
.home-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.home-notices {
  flex: 999 1 32rem;
  min-width: 0;
}

.home-side {
  flex: 1 1 20rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-panel {
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.home-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.home-panel > p:last-child {
  margin-bottom: 0;
}

.home-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-panel-dark {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.home-panel-dark a,
.home-panel-dark .meta {
  color: #ffffff;
}

.home-panel-dark h2.home-eyebrow {
  font-size: 0.8rem;
}

.home-event-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

.home-notice-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.home-notice-list li {
  display: flex;
  gap: 1.1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.home-date {
  flex: 0 0 4rem;
  height: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--color-background);
  line-height: 1.1;
}

.home-date span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.home-date strong {
  font-size: 1.4rem;
}

.home-notice-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.home-notice-text a {
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.05rem;
}

.home-notice-summary {
  color: var(--muted);
}

@media (max-width: 40rem) {
  /* Phones: the name and account links on one row, the menu as one row that scrolls sideways. */
  .layout-modern .site-header {
    padding: 0.5rem 1rem;
  }

  .layout-modern .site-header .inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .layout-modern .account-nav {
    order: 2;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .layout-modern .site-nav {
    order: 3;
    grid-column: 1 / -1;
    overflow-x: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .layout-modern .site-nav ul {
    flex-wrap: nowrap;
  }

  .layout-modern .site-nav a {
    white-space: nowrap;
  }

  .layout-modern .site-main {
    padding: 1rem 1rem 3rem;
  }

  .home-hero {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .home-hero-image {
    position: static;
    height: 13rem;
  }

  .home-hero-panel {
    margin: 0;
    border-radius: 0;
  }

  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .home-card {
    padding: 1rem;
  }

  .home-card-text {
    display: none;
  }
}

/* Letters print on their own: no site header, menus or footer. */
@media print {
    .site-header,
    .site-footer,
    .skip-link,
    .no-print {
        display: none !important;
    }

    .site-main {
        margin: 0;
        padding: 0;
    }
}
