/* ==========================================================================
   FMRA — Family Medicine Residents' Association, University of Alberta
   Design system: "Rotation Rings"
   - Deep sage green + warm gold, editorial serif + humanist sans + mono data
   - Signature element: concentric ring motif representing the two-year
     residency cycle, echoed as small ring markers throughout the site
   ========================================================================== */

:root {
  /* Color */
  --green-deep:  #06432D;
  --green:       #0C7A43;
  --green-mid:   #3F8F63;
  --green-soft:  #E6EFE8;
  --gold:        #E8AE2B;
  --gold-deep:   #A97A0F;
  --ink:         #17221C;
  --ink-soft:    #51605A;
  --paper:       #F2F4EF;
  --paper-alt:   #FFFFFF;
  --line:        #DBE3DA;
  --line-strong: #B9C6BC;

  /* Type */
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Layout */
  --max-width: 1140px;
  --radius: 4px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--green-deep);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  font-weight: 600;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.005em; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 var(--space-2); color: var(--ink-soft); }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Eyebrow / mono labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: var(--space-1);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 244, 239, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: nowrap;
  padding: 0.9rem 0;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--green-deep);
  flex-shrink: 0;
}
.wordmark .mark {
  display: inline-block;
  width: 4px;
  align-self: stretch;
  min-height: 1.6rem;
  background: linear-gradient(var(--green), var(--gold));
  border-radius: 2px;
  flex-shrink: 0;
}
.wordmark span.sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: nowrap;
}
.nav-links a {
  position: relative;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.3rem 0;
  white-space: nowrap;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--gold);
  transition: right 0.22s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  right: 0;
}
.nav-links a[aria-current="page"] { color: var(--green-deep); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  width: 42px;
  height: 38px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span { top: 18px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .wordmark span.sub { display: none; }
  .nav-links {
    position: fixed;
    top: 64px; right: 0; bottom: 0;
    width: min(78vw, 320px);
    background: var(--paper-alt);
    border-left: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: var(--space-3);
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--line); white-space: normal; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--green-deep);
  color: var(--paper-alt);
  border-color: var(--green-deep);
}
.btn-primary:hover { background: var(--green); border-color: var(--green); }
.btn-outline {
  background: transparent;
  color: var(--green-deep);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--green-deep); }
.btn-gold {
  background: var(--gold);
  color: var(--green-deep);
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--paper-alt); }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-5);
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}
.hero-copy p.lede {
  font-size: 1.15rem;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
.hero-rings {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  margin: 0 auto;
}
.hero-rings svg { width: 100%; height: 100%; }
.hero-rings .ring {
  fill: none;
  stroke-width: 1.6;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 1.6s ease forwards;
}
.hero-rings .ring.r1 { stroke: var(--green-deep); animation-delay: 0.05s; }
.hero-rings .ring.r2 { stroke: var(--green-mid); animation-delay: 0.25s; }
.hero-rings .ring.r3 { stroke: var(--gold); animation-delay: 0.45s; }
.hero-rings .marker { fill: var(--gold-deep); opacity: 0; animation: fadein 0.5s ease forwards; }
.hero-rings .marker.m1 { animation-delay: 1.1s; }
.hero-rings .marker.m2 { animation-delay: 1.3s; }
.hero-rings .marker.label { fill: var(--ink-soft); font-family: var(--font-mono); font-size: 9px; opacity: 0; animation: fadein 0.5s ease forwards; animation-delay: 1.5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-rings { max-width: 280px; order: -1; }
}

/* ---------- Sections ---------- */
section { padding: var(--space-5) 0; }
section.alt { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: var(--space-4); }

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.quick-link-card {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.quick-link-card:hover { border-color: var(--green); transform: translateY(-2px); }
.quick-link-card h3 { margin-bottom: 0.25rem; font-size: 1.1rem; }
.quick-link-card p { margin: 0; font-size: 0.92rem; }

/* ---------- Cards / grids ---------- */
.card {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.exec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}
.exec-card { text-align: left; }
.exec-photo {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--paper-alt);
  outline: 1px solid var(--line-strong);
  margin-bottom: var(--space-2);
  background: var(--green-soft);
}
.exec-card h3 { margin-bottom: 0.15rem; }
.exec-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
  display: block;
  margin-bottom: 0.5rem;
}
.exec-card a.email { font-size: 0.88rem; color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

.update-item, .resource-item {
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) 0;
}
.update-item:first-child, .resource-item:first-child { padding-top: 0; }
.update-date, .job-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--green-soft);
  color: var(--green-deep);
  border-radius: var(--radius);
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.4rem;
}

.job-item {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: var(--space-3);
  align-items: start;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.job-item:last-child { margin-bottom: 0; }
.job-info h3 { margin: 0.3rem 0 0.15rem; }
.job-org {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.job-info > p { margin: 0.3rem 0; }
.job-contact {
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.job-contact a { color: var(--green); }
.job-poster {
  justify-self: end;
  width: 100%;
  max-width: 200px;
}
.job-poster img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.job-poster img:hover { opacity: 0.85; }
@media (max-width: 700px) {
  .job-item { grid-template-columns: 1fr; }
  .job-poster { justify-self: stretch; max-width: none; }
  .job-poster img { height: auto; max-height: 320px; object-fit: contain; }
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 67, 45, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay .lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- Steps (process) ---------- */
.steps { counter-reset: step; display: grid; gap: var(--space-3); }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}
.step-num {
  counter-increment: step;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--gold-deep);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.step-num::before { content: counter(step); }

/* ---------- Forms / embeds ---------- */
.embed-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-alt);
}
.embed-wrap iframe { width: 100%; border: none; display: block; }

.callout {
  background: var(--green-soft);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.callout.gold { background: #FBF1DA; border-left-color: var(--gold-deep); }

table.rate-table { width: 100%; border-collapse: collapse; margin: var(--space-3) 0; }
table.rate-table th, table.rate-table td {
  text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
table.rate-table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-deep);
  color: #E7EFE8;
  padding: var(--space-5) 0 var(--space-3);
  margin-top: var(--space-5);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.site-footer h4 {
  color: #F2F4EF;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}
.site-footer a { color: #CFE0D5; text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { text-decoration: underline; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer p { color: #B8CFC0; font-size: 0.88rem; }
.footer-bottom {
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #9BB8A8;
  font-family: var(--font-mono);
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Page hero (non-home) ---------- */
.page-hero {
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: 1px solid var(--line);
}
.page-hero p.lede { max-width: 62ch; font-size: 1.05rem; }

/* ==========================================================================
   Job posting submission form (post-a-job.html)
   ========================================================================== */
#job-form {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 60ch;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.form-row input[type="text"],
.form-row input[type="file"],
.form-row textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
}

.form-row textarea {
  resize: vertical;
}

.form-row input[type="text"]:focus,
.form-row textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

#jf-submit {
  align-self: flex-start;
  border: none;
  cursor: pointer;
}

#jf-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#jf-status {
  font-size: 0.92rem;
  margin: 0;
}

#jf-status.success {
  color: var(--green-deep);
}

#jf-status.error {
  color: #A3341E;
}
