/* ==========================================================================
   Brimacombecourse.org — site stylesheet
   Palette carried over from the original FrontPage "Ice" theme.
   ========================================================================== */

:root {
  /* text / headings (Ice theme body + banner colour) */
  --navy:        #003572;
  --navy-deep:   #000080;   /* original page titles */
  /* nav buttons (sampled from the Ice theme button graphics) */
  --btn-top:     #0a71e9;
  --btn-bottom:  #0967d3;
  --btn-hover-top:    #429aff;
  --btn-hover-bottom: #3d8ce7;
  --btn-current-top:    #5fa9fe;
  --btn-current-bottom: #5497e5;
  /* links (Ice theme) */
  --link:        #1f86ff;
  --link-visited:#005dc9;
  --link-active: #62a9ff;
  /* accents */
  --alert:       #d00000;   /* the red announcement text */
  --band:        #c0c0c0;   /* grey sub-title band on the course page */
  --rule:        #c1c1c1;
  --panel:       #f3f6fa;
  --border:      #d1d1d1;
  --white:       #ffffff;

  --font: Verdana, Arial, Helvetica, sans-serif;
  --font-title: "Times New Roman", Times, Georgia, serif;
  --radius: 6px;
  --sidebar: 190px;
  --content-w: 1148px;   /* .site max-width minus its side padding */
  --hdr-h: 104px;        /* fixed header height (desktop) */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  /* always reserve the scrollbar's space so short pages (home) and long pages
     have exactly the same width - no sideways shift when switching pages */
  overflow-y: scroll;
  scrollbar-gutter: stable;
  /* keep focused fields / anchors clear of the fixed header */
  scroll-padding-top: calc(var(--hdr-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--navy);
  background: var(--white);
}

img { max-width: 100%; height: auto; }

a:link    { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover   { color: var(--link-active); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--btn-hover-top);
  outline-offset: 2px;
}

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; }
h2 { font-size: 1.3rem;  margin: 1.8rem 0 .6rem; }
h3 { font-size: 1.08rem; margin: 1.4rem 0 .4rem; }
p  { margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.5rem 0; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */

/* "Frames" layout: fixed header bar + fixed left menu; only the page content
   scrolls (normal browser scrolling, nothing moves or resizes while scrolling). */
.site {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--hdr-h) + 22px) 16px 0;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-areas:
    "nav main"
    "nav footer";
  column-gap: 32px;
}

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: 22px;
  /* line the header contents up with the centred page below */
  padding: 0 max(16px, calc((100% - var(--content-w)) / 2));
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 4px 10px -8px rgba(0,0,0,.35);
}
.site-header .logo { flex: 0 0 auto; line-height: 0; }
.site-header .logo img { width: 104px; height: auto; display: block; }
.site-header .page-title {
  font-family: var(--font-title);
  font-weight: bold;
  color: var(--navy);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  margin: 0;
  line-height: 1.15;
}
.site-header .page-title small {
  display: block;
  font-size: .62em;
  font-weight: normal;
}

.site-nav {
  position: fixed;
  top: calc(var(--hdr-h) + 22px);
  bottom: 0;
  left: max(16px, calc((100% - var(--content-w)) / 2));
  width: var(--sidebar);
  overflow-y: auto;          /* only scrolls if the window is very short */
  padding: 0 4px 16px 2px;   /* room for button shadows */
}
main       { grid-area: main; min-width: 0; padding-bottom: 2rem; }
.site-footer {
  grid-area: footer;
  border-top: 1px solid var(--rule);
  padding: 12px 0 28px;
  font-size: .75rem;
  color: #4a5d78;
}

/* ---------- Navigation: CSS recreation of the Ice buttons ---------- */

.nav-toggle { display: none; }

.site-nav h2 {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5a6f8c;
  margin: 0 0 8px 2px;
  font-weight: bold;
}
.site-nav h2:not(:first-child) { margin-top: 22px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0 0 9px; }

.site-nav a.btn-nav {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-size: .8rem;
  letter-spacing: .03em;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid #fff;
  background: linear-gradient(var(--btn-top), var(--btn-bottom));
  box-shadow: 0 3px 4px -1px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.25);
  transition: background .15s ease, transform .1s ease;
}
.site-nav a.btn-nav:hover {
  background: linear-gradient(var(--btn-hover-top), var(--btn-hover-bottom));
}
.site-nav a.btn-nav:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.site-nav a.btn-nav[aria-current="page"] {
  background: linear-gradient(var(--btn-current-top), var(--btn-current-bottom));
}
.site-nav a.btn-nav.highlight {
  background: linear-gradient(#e0262b, #b8141a);
  font-weight: bold;
}

/* ---------- Content helpers ---------- */

.band {
  background: var(--band);
  color: var(--navy);
  text-align: center;
  font-size: 1.2rem;
  padding: 8px 12px;
  margin: 0 0 1rem;
}

.alert {
  color: var(--alert);
  font-weight: bold;
}
.notice {
  border-left: 5px solid var(--alert);
  background: #fff4f4;
  color: var(--alert);
  font-weight: bold;
  padding: 10px 14px;
  margin: 0 0 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.notice.info {
  border-left-color: var(--btn-top);
  background: var(--panel);
  color: var(--navy);
  font-weight: normal;
}

.lead { font-size: 1.12rem; }
.big  { font-size: 1.4rem; font-weight: bold; }
.small { font-size: .82rem; }
.muted { color: #5a6f8c; }
.justify { text-align: justify; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1.25rem; }
.facts dt { font-weight: bold; }
.facts dd { margin: 0; }

address { font-style: normal; margin: 0 0 1rem; }

.panel {
  background: var(--panel);
  border: 1px solid #dfe6ef;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 1.25rem;
}

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* Home page */
.home-hero { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
.home-hero img { width: 300px; }
.quote {
  font-style: italic;
  color: var(--navy-deep);
  font-size: 1.2rem;
  margin: 2.2rem 0 .5rem;
  line-height: 1.5;
}
.quote-by { margin-left: 8rem; }
.quote-context { font-size: .85rem; margin-top: 3rem; }

/* People (staff page) */
.person {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #e6e6e6;
}
.person img { width: 138px; border-radius: 4px; }
.person h3 { margin-top: 0; }
.person p { margin-bottom: .4rem; }

figure { margin: 0 0 1.5rem; }
figure img { border-radius: 4px; display: block; }
figcaption { font-size: .82rem; color: #5a6f8c; margin-top: .3rem; }
.float-right { float: right; margin: 0 0 1rem 1.5rem; }
.float-left  { float: left;  margin: 0 1.5rem 1rem 0; }
.clear { clear: both; }

/* Tables (winners, lectures) */
table.list { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; }
table.list th, table.list td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid #e6e6e6; }
table.list th { background: var(--panel); }
table.list td.yr { font-weight: bold; white-space: nowrap; width: 4.5rem; }

ul.dots { list-style: none; padding: 0; margin: 0 0 1.25rem; columns: 2; column-gap: 2rem; }
ul.dots li { break-inside: avoid; padding: 2px 0; }

/* Publications */
.pub-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.pub-tools input { flex: 1 1 260px; }
ol.pubs { padding-left: 2.6rem; }
ol.pubs li { margin: 0 0 .85rem; }
ol.pubs strong { color: var(--navy); }

.map-embed { width: 100%; max-width: 640px; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); }

/* ---------- Forms ---------- */

form.styled { max-width: 760px; }
fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 18px 6px;
  margin: 0 0 1.25rem;
}
legend { font-weight: bold; padding: 0 6px; color: var(--navy); }

.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.field { grid-column: span 12; margin-bottom: 12px; }
.field.half  { grid-column: span 6; }
.field.third { grid-column: span 4; }
.field.quarter { grid-column: span 3; }

label { display: block; font-size: .82rem; font-weight: bold; margin-bottom: 4px; color: var(--navy); }
label .req { color: var(--alert); }
label .opt { color: #7a4b8c; font-weight: normal; font-style: italic; }
.hint { font-size: .76rem; color: #5a6f8c; margin-top: 3px; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: #111;
  padding: 7px 9px;
  border: 1px solid #919398;
  border-radius: 4px;
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] {
  border-color: var(--alert);
  background: #fff7f7;
}
.err { color: var(--alert); font-size: .76rem; margin-top: 3px; min-height: 0; }
.err:empty { display: none; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; font-size: .9rem; margin-bottom: 10px; }
.check input { margin-top: 4px; }
.choice-group { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 10px; }
.choice-group label { font-weight: normal; font-size: .9rem; display: flex; gap: 8px; align-items: center; margin: 0; }

.form-errors { margin-bottom: 1rem; }
.form-errors:empty { display: none; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1rem 0 2rem; }

.btn {
  display: inline-block;
  font: inherit;
  font-size: .92rem;
  padding: 9px 22px;
  border-radius: 5px;
  border: 1px solid var(--btn-bottom);
  color: #fff;
  background: linear-gradient(var(--btn-top), var(--btn-bottom));
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 3px rgba(0,0,0,.2);
}
a.btn:link, a.btn:visited { color: #fff; }
.btn:hover { background: linear-gradient(var(--btn-hover-top), var(--btn-hover-bottom)); color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.secondary, a.btn.secondary:link, a.btn.secondary:visited { background: #fff; color: var(--navy); border-color: #919398; }
.btn.secondary:hover, a.btn.secondary:hover { background: var(--panel); color: var(--navy); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .site {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "footer";
  }
  :root { --hdr-h: 64px; }
  .site { padding-top: calc(var(--hdr-h) + 14px); }
  .site-header { gap: 12px; }
  .site-header .logo img { width: 56px; }
  .site-header .page-title { font-size: 1.08rem; }
  .site-header .page-title small { font-size: .78em; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    margin-left: auto; padding: 8px 14px;
    font: inherit; font-size: .9rem; color: #fff;
    background: linear-gradient(var(--btn-top), var(--btn-bottom));
    border: 0; border-radius: 5px; cursor: pointer;
  }
  /* menu = drop-down panel under the header bar */
  .site-nav {
    top: var(--hdr-h);
    bottom: auto;
    left: 0; right: 0; width: auto;
    max-height: calc(100vh - var(--hdr-h));
    max-height: calc(100dvh - var(--hdr-h));
    z-index: 19;
    background: var(--white);
    padding: 14px 16px 18px;
    box-shadow: 0 10px 20px rgba(0,0,0,.18);
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav .nav-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .site-nav h2:not(:first-child) { margin-top: 0; }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero img { width: 220px; }
  .quote { margin-top: 0; }
  .quote-by { margin-left: 2rem; }
  .cols-2 { grid-template-columns: 1fr; }
  .field.half, .field.third, .field.quarter { grid-column: span 12; }
  .float-right, .float-left { float: none; margin: 0 0 1rem; }
  ul.dots { columns: 1; }
  .justify { text-align: left; }   /* justified text leaves gaps on narrow screens */
}
@media (max-width: 520px) {
  .site-nav .nav-groups { grid-template-columns: 1fr; }
  .person { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: .4rem; }
}

/* ---------- Print (registration page is often printed) ---------- */

@media print {
  .site { display: block; max-width: none; padding-top: 0; }
  .site-header { position: static; height: auto; padding: 0 0 8px; box-shadow: none; }
  .site-nav, .nav-toggle, .actions, .skip-link, .site-footer { display: none !important; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; }
  input, select, textarea { border: 0; border-bottom: 1px solid #000; border-radius: 0; }
  fieldset { break-inside: avoid; }
}

/* ---------- Awards page: cards for awards with pages on this site ---------- */
.award-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 0 0 1.5rem;
}
.award-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid #dfe6ef;
  border-top: 4px solid var(--btn-top);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.award-card h3 { margin: 0 0 .25rem; font-size: 1.02rem; }
.award-card .by { font-size: .76rem; color: #5a6f8c; margin: 0 0 .6rem; }
.award-card p { font-size: .88rem; margin: 0 0 .9rem; }
.award-card .btn { margin-top: auto; align-self: flex-start; font-size: .82rem; padding: 6px 14px; }
a.ext::after { content: " \2197"; font-size: .9em; }   /* ↗ marks links that leave the site */