/* Campus Activity Hub — components (lists, cards, forms, hero, tiles) */
:root {
  --cah-primary: #1267b5;
  --cah-primary-dark: #0e4e8a;
  --cah-primary-light: #d0e2f3;
  --cah-primary-lighter: #eef5fb;
  --cah-text: #323130;
  --cah-text-2: #605e5c;
  --cah-border: #edebe9;
  --cah-border-strong: #8a8886;
  --cah-bg-hover: #f3f2f1;
  --cah-bg-soft: #faf9f8;
  --cah-danger: #a4262c;
  --cah-radius: 4px;
}

.cah-webpart { margin: 0 0 32px; }
.cah-wp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cah-wp-title { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; color: var(--cah-text); }
.cah-cmds { display: flex; gap: 8px; }
.cah-empty { color: var(--cah-text-2); background: var(--cah-bg-soft); border: 1px dashed var(--cah-border); padding: 16px; border-radius: var(--cah-radius); margin: 0; }
.cah-muted { color: var(--cah-text-2); }
.cah-crumbs { font-size: 13px; color: var(--cah-text-2); margin: 0 0 8px; }
.cah-crumbs a { color: var(--cah-text-2); }
.cah-page-h1 { font-size: 28px; font-weight: 600; margin: 0 0 20px; line-height: 1.25; }
.cah-see-all { margin: 12px 0 0; display: flex; align-items: center; gap: 12px; }
.cah-filter-note { font-size: 14px; margin: 0 0 12px; }
.cah-count { font-size: 13px; color: var(--cah-text-2); background: var(--cah-bg-soft); padding: 8px 12px; margin: 0; border-top: 1px solid var(--cah-border); }

/* buttons */
.cah-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 16px; border: 1px solid var(--cah-border-strong); border-radius: 2px; background: #fff; color: var(--cah-text); font: 600 14px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.cah-btn:hover { background: var(--cah-bg-hover); color: var(--cah-text); }
.cah-btn:focus-visible { outline: 2px solid var(--cah-text); outline-offset: 1px; }
.cah-btn-primary { background: var(--cah-primary); border-color: var(--cah-primary); color: #fff; }
.cah-btn-primary:hover { background: var(--cah-primary-dark); border-color: var(--cah-primary-dark); color: #fff; }
.cah-btn-danger { color: var(--cah-danger); border-color: var(--cah-danger); }
.cah-btn-danger:hover { background: #fde7e9; color: var(--cah-danger); }
.cah-btn-sm { min-height: 28px; padding: 0 12px; font-size: 13px; }
.cah-btn-xs { min-height: 24px; padding: 0 8px; font-size: 12px; }
.cah-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.cah-inline-form { display: inline; margin: 0; }

/* pills & chips */
.cah-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.cah-chip { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; line-height: 18px; background: var(--cah-bg-hover); color: var(--cah-text); }
.cah-full { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 10px; background: #fde7d9; color: #8a3707; font-size: 12px; font-weight: 600; }

/* view switcher */
.cah-views { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.cah-view-pill { padding: 4px 12px; border: 1px solid var(--cah-border-strong); border-radius: 16px; font-size: 13px; color: var(--cah-text); text-decoration: none; background: #fff; }
.cah-view-pill:hover { background: var(--cah-bg-hover); color: var(--cah-text); }
.cah-view-pill.is-active { background: var(--cah-primary-light); border-color: var(--cah-primary); color: var(--cah-primary-dark); font-weight: 600; }

/* tables */
.cah-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cah-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.cah-table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--cah-text-2); padding: 10px 12px; border-bottom: 1px solid var(--cah-border); white-space: nowrap; }
.cah-table td { padding: 10px 12px; border-bottom: 1px solid var(--cah-border); vertical-align: top; }
.cah-table tbody tr:hover { background: var(--cah-bg-hover); }
.cah-table img { width: 64px; height: 36px; object-fit: cover; border-radius: 2px; }
.cah-title-link { font-weight: 600; color: var(--cah-primary); text-decoration: none; }
.cah-title-link:hover { text-decoration: underline; }
.cah-actions { white-space: nowrap; text-align: right; }
.cah-actions .cah-inline-form + .cah-inline-form { margin-left: 4px; }
td.cah-missing::after { content: "Required info"; display: inline-block; font-size: 12px; color: #7a5a00; background: #fff4ce; padding: 0 6px; border-radius: 2px; }
.cah-table-headonly { margin-bottom: 0; }
.cah-groups .cah-table { table-layout: fixed; }
.cah-groups .cah-table th, .cah-groups .cah-table td { overflow-wrap: anywhere; white-space: normal; }
.cah-groups.is-collapsed > .cah-table-wrap:first-child { display: none; }
.cah-subgroup .cah-table { width: calc(100% + 20px); margin-left: -20px; }
.cah-groups .cah-table-wrap + .cah-group { border-top: 0; }
.cah-group { border-bottom: 1px solid var(--cah-border); }
.cah-group > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 6px; }
.cah-group > summary::-webkit-details-marker { display: none; }
.cah-group > summary::before { content: "›"; display: inline-block; width: 12px; transition: transform .15s; font-size: 18px; line-height: 1; color: var(--cah-text-2); }
.cah-group[open] > summary::before { transform: rotate(90deg); }
.cah-group > summary:hover { background: var(--cah-bg-hover); }
.cah-subgroup { margin-left: 20px; border-bottom: 0; }
.cah-group-count { font-weight: 400; color: var(--cah-text-2); }
.cah-group .cah-table td { border-bottom-color: var(--cah-bg-hover); }

/* cards */
.cah-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cah-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--cah-border); border-radius: var(--cah-radius); overflow: hidden; color: var(--cah-text); text-decoration: none; box-shadow: 0 1.6px 3.6px rgba(0,0,0,.08), 0 .3px .9px rgba(0,0,0,.06); transition: box-shadow .15s, transform .15s; }
.cah-card:hover, .cah-card:focus-visible { box-shadow: 0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.1); color: var(--cah-text); transform: translateY(-1px); }
.cah-card-img { aspect-ratio: 16 / 10; background: var(--cah-bg-hover); overflow: hidden; }
.cah-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cah-card-noimg { width: 100%; height: 100%; background: linear-gradient(135deg, var(--cah-primary-light), var(--cah-primary-lighter)); }
.cah-card-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.cah-card-field { display: grid; }
.cah-card-label { font-size: 12px; color: var(--cah-text-2); }
.cah-card-value { font-size: 14px; }
.cah-card-title { font-size: 16px; font-weight: 600; }

/* hero (layout: one large tile + four tiles) */
.cah-hero { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; height: clamp(320px, 38vw, 470px); margin: 0 0 24px; }
.cah-hero-tile { position: relative; overflow: hidden; display: block; color: #fff; text-decoration: none; background: #222; }
.cah-hero-1 { grid-row: 1 / span 2; }
.cah-hero-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.cah-hero-tile:hover img { transform: scale(1.03); }
.cah-hero-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,0) 100%); }
.cah-hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 16px 20px; display: grid; gap: 6px; }
.cah-hero-title { font-size: 20px; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cah-hero-1 .cah-hero-title { font-size: 32px; }
.cah-hero-1 .cah-hero-text { padding: 28px 32px; }
.cah-hero-cta { font-size: 15px; font-weight: 600; }
.cah-hero-tile:hover, .cah-hero-tile:focus-visible { color: #fff; }
.cah-hero-tile:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* explore tiles & quick links */
.cah-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.cah-tile { display: grid; gap: 8px; text-decoration: none; color: var(--cah-text); font-weight: 600; font-size: 14px; }
.cah-tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--cah-radius); display: block; transition: filter .15s; }
.cah-tile:hover img { filter: brightness(.9); }
.cah-tile:hover { color: var(--cah-primary); }
.cah-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cah-quick-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--cah-border); border-radius: var(--cah-radius); text-decoration: none; color: var(--cah-text); font-weight: 600; font-size: 14px; background: #fff; }
.cah-quick-tile img { width: 56px; height: 56px; border-radius: var(--cah-radius); object-fit: cover; }
.cah-quick-tile:hover { background: var(--cah-bg-hover); color: var(--cah-text); }

/* forms */
.cah-form { max-width: 720px; }
.cah-field { margin: 0 0 18px; }
.cah-label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.cah-req { color: var(--cah-danger); }
.cah-form input[type=text], .cah-form input[type=url], .cah-form input[type=number], .cah-form input[type=date], .cah-form input[type=datetime-local], .cah-form select, .cah-form textarea {
  width: 100%; max-width: 100%; box-sizing: border-box; min-height: 36px; padding: 6px 10px; border: 1px solid var(--cah-border-strong); border-radius: 2px; font: inherit; font-size: 14px; color: var(--cah-text); background: #fff;
}
.cah-form textarea { min-height: 96px; resize: vertical; }
.cah-form input:focus, .cah-form select:focus, .cah-form textarea:focus { outline: 2px solid var(--cah-primary); outline-offset: -1px; border-color: var(--cah-primary); }
.cah-form .cah-url-desc { margin-top: 6px; }
.cah-desc { font-size: 12px; color: var(--cah-text-2); margin: 4px 0 0; }
.cah-error { font-size: 12px; color: var(--cah-danger); margin: 4px 0 0; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea, .has-error .cah-radios { border-color: var(--cah-danger) !important; }
.cah-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.cah-check input { width: 18px; height: 18px; margin: 0; }
.cah-radios { border: 1px solid var(--cah-border-strong); border-radius: 2px; padding: 10px 12px; margin: 0; }
.cah-ro-value { padding: 6px 0; font-size: 14px; }
.cah-readonly { padding-bottom: 12px; border-bottom: 1px solid var(--cah-border); }
.cah-img-current { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cah-img-current img { width: 160px; height: 90px; object-fit: cover; border-radius: 2px; }
.cah-form-actions { display: flex; gap: 8px; padding-top: 8px; }
.cah-msg { padding: 10px 14px; border-radius: 2px; margin: 0 0 16px; font-size: 14px; }
.cah-msg-ok { background: #dff6dd; color: #0b5a08; }
.cah-msg-err { background: #fde7e9; color: var(--cah-danger); font-weight: 600; }
.cah-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 12px; background: var(--cah-bg-soft); border: 1px solid var(--cah-border); border-radius: var(--cah-radius); font-size: 14px; }
.cah-signin { padding: 20px; background: var(--cah-bg-soft); border: 1px solid var(--cah-border); border-radius: var(--cah-radius); }

/* display form */
.cah-activity { max-width: 860px; }
.cah-activity-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--cah-radius); display: block; margin: 0 0 16px; }
.cah-activity-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.cah-activity h2 { font-size: 20px; margin: 24px 0 8px; }
.cah-facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cah-facts li { background: var(--cah-bg-soft); border: 1px solid var(--cah-border); border-radius: var(--cah-radius); padding: 10px 12px; font-size: 14px; display: grid; gap: 2px; }
.cah-facts strong { font-size: 12px; font-weight: 400; color: var(--cah-text-2); }
.cah-dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0; margin: 0; font-size: 14px; max-width: 860px; }
.cah-dl dt { font-weight: 600; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--cah-border); color: var(--cah-text-2); }
.cah-dl dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--cah-border); }
.cah-allfields, .cah-history { margin: 16px 0; max-width: 860px; }
.cah-allfields > summary, .cah-history > summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--cah-primary); }
.cah-stamp { font-size: 13px; }

/* calendar */
.cah-cal-nav { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.cah-cal-nav h3 { margin: 0 8px; font-size: 18px; min-width: 150px; text-align: center; }
.cah-cal-grid { border: 1px solid var(--cah-border); border-radius: var(--cah-radius); overflow: hidden; }
.cah-cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cah-cal-head div { font-size: 12px; font-weight: 600; color: var(--cah-text-2); padding: 8px; background: var(--cah-bg-soft); border-bottom: 1px solid var(--cah-border); }
.cah-cal-day { min-height: 104px; padding: 6px; border-right: 1px solid var(--cah-border); border-bottom: 1px solid var(--cah-border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cah-cal-row .cah-cal-day:last-child { border-right: 0; }
.cah-cal-day.is-other { background: var(--cah-bg-soft); color: #a19f9d; }
.cah-cal-num { font-size: 12px; font-weight: 600; }
.cah-cal-day.is-today .cah-cal-num { background: var(--cah-primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-grid; place-items: center; }
.cah-cal-ev { display: block; font-size: 12px; padding: 2px 6px; border-radius: 2px; background: var(--cah-primary-light); color: var(--cah-primary-dark); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--cah-primary); }
.cah-cal-ev span { font-weight: 600; }
.cah-cal-ev:hover { background: var(--cah-primary); color: #fff; }

.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }

@media (max-width: 760px) {
  .cah-hero { grid-template-columns: 1fr 1fr; grid-template-rows: 240px 140px 140px; height: auto; }
  .cah-hero-1 { grid-column: 1 / span 2; grid-row: 1; }
  .cah-hero-1 .cah-hero-title { font-size: 24px; }
  .cah-hero-1 .cah-hero-text { padding: 16px 20px; }
  .cah-hero-title { font-size: 16px; }
  .cah-quick { grid-template-columns: 1fr; }
  .cah-tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cah-cards { grid-template-columns: 1fr; }
  /* tables become stacked cards */
  .cah-table thead { display: none; }
  .cah-table, .cah-table tbody, .cah-table tr, .cah-table td { display: block; width: 100%; box-sizing: border-box; }
  .cah-table tr { border: 1px solid var(--cah-border); border-radius: var(--cah-radius); margin: 0 0 10px; padding: 6px 0; }
  .cah-table td { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 42% 1fr; gap: 8px; }
  .cah-table td::before { content: attr(data-label); font-size: 12px; color: var(--cah-text-2); font-weight: 600; }
  .cah-table td:empty { display: none; }
  .cah-table td.cah-actions { display: flex; justify-content: flex-start; gap: 6px; }
  .cah-table td.cah-actions::before { content: none; }
  .cah-table-headonly { display: none; }
  .cah-dl { grid-template-columns: 1fr; }
  .cah-dl dt { border-bottom: 0; padding-bottom: 0; }
  .cah-cal-day { min-height: 64px; padding: 4px; }
  .cah-cal-ev { font-size: 10px; padding: 1px 3px; }
  .cah-cal-ev span { display: none; }
}
