/* ==========================================================================
   Malta Association of Dietitians — stylesheet
   Palette drawn from the Association's emblem: the Maltese cross (red),
   the fork-and-leaf mark (forest green), and its gold ring.
   ========================================================================== */

:root {
  --cream:        #F7F3E9;
  --cream-dim:    #EFE9D9;
  --forest:       #143A2C;
  --forest-mid:   #1F5C41;
  --forest-soft:  #E4ECE4;
  --leaf:         #6FA23A;
  --cross:        #C22331;
  --gold:         #AD8A3F;
  --gold-text:    #82682F; /* darkened for AA contrast on cream/paper */
  --gold-on-dark: #D0A64C; /* lightened for AA contrast on forest */
  --ink:          #1C2320;
  --ink-soft:     #4A5450;
  --paper:        #FFFFFE;

  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans:  "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --max: 1180px;
  --edge: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--forest);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { max-width: 62ch; }

a { color: inherit; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Focus states — kept visible everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cross);
  outline-offset: 3px;
}

/* --------------------------------- Header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 233, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(173, 138, 63, 0.35);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand img {
  height: 42px;
  width: 42px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--serif);
  color: var(--forest);
  line-height: 1.05;
}

.brand-text .full {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.brand-text .sub {
  display: block;
  font-size: 0.72rem;
  font-family: var(--sans);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.main-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.main-nav a:not(.btn):hover {
  border-color: var(--gold);
  color: var(--forest);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--forest);
  border-radius: 6px;
  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(--forest);
  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); }

/* -------------------------------- Buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--forest);
  color: var(--cream);
}
.btn-primary:hover { background: var(--forest-mid); }

.btn-ghost {
  background: transparent;
  border-color: var(--forest);
  color: var(--forest);
}
.btn-ghost:hover { background: var(--forest-soft); }

.btn-line {
  background: transparent;
  color: var(--forest);
  padding-left: 0;
  border-bottom: 1.5px solid var(--gold);
  border-radius: 0;
}
.btn-line:hover { color: var(--cross); border-color: var(--cross); }

/* ---------------------------------- Hero ---------------------------------- */

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--sans);
  color: var(--gold-text);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
}

.hero h1 em {
  font-style: italic;
  color: var(--cross);
}

.hero .lede {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 2.1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art .ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(173, 138, 63, 0.4);
  border-radius: 50%;
  transform: scale(1.18);
}

.hero-art img {
  width: min(360px, 78%);
  animation: emblem-in 1.1s ease-out both;
}

@keyframes emblem-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.hero-stats {
  margin-top: 2.4rem;
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.hero-stats div strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--forest);
}

.hero-stats div span {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ------------------------------- Section base ------------------------------ */

section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--gold-text);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.kicker .cross-mark { color: var(--cross); font-size: 1rem; }

.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.section-head p {
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.alt { background: var(--paper); }

/* --------------------------------- Mission -------------------------------- */

.mission {
  text-align: center;
}

.mission blockquote {
  margin: 0 auto;
  max-width: 46ch;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.4;
  color: var(--forest);
}

.mission .rule {
  width: 64px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 1.8rem;
}

.mission cite {
  display: block;
  margin-top: 1.6rem;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ------------------------------- Objectives -------------------------------- */

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem 3rem;
}

.objective {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 0;
  border-top: 1px solid rgba(20, 58, 44, 0.12);
}

.objective .mark {
  flex: none;
  color: var(--cross);
  font-size: 1.1rem;
  line-height: 1.5;
}

.objective h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.25rem;
}

.objective p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.objectives-note {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ------------------------------- Membership -------------------------------- */

.membership-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.tier {
  background: var(--paper);
  padding: 1.9rem 1.7rem 2.1rem;
  border-radius: 6px;
  border-top: 4px solid var(--forest);
  display: flex;
  flex-direction: column;
}

.tier.assoc { border-top-color: var(--leaf); }
.tier.student { border-top-color: var(--gold); }

.tier .tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.tier h3 {
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
}

.tier p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  margin-bottom: 1rem;
}

.tier ul {
  margin: 0 0 1.4rem;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  flex-grow: 1;
}

.tier li { margin-bottom: 0.45rem; }

.tier .btn { align-self: flex-start; }

.membership-footnote {
  margin-top: 1.8rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--gold);
  padding-left: 1rem;
}

/* -------------------------------- Committee -------------------------------- */

.committee-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem 2rem;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-card h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest);
}

.member-card span {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* ------------------------------- Events / CPD ------------------------------- */

.events-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.events-copy p { color: var(--ink-soft); }

.events-copy ul {
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
}
.events-copy li { margin-bottom: 0.5rem; }

.next-card {
  background: var(--forest);
  color: var(--cream);
  border-radius: 6px;
  padding: 2rem;
}

.next-card .tag {
  font-size: 0.78rem;
  color: var(--gold-on-dark);
  font-weight: 700;
  margin-bottom: 0.8rem;
  display: block;
}

.next-card h3 {
  color: var(--cream);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.next-card p {
  color: rgba(247, 243, 233, 0.8);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ---------------------------------- News ----------------------------------- */

.news-list {
  border-left: 2px solid rgba(173, 138, 63, 0.5);
  max-width: 720px;
}

.news-item {
  position: relative;
  padding: 0 0 2.2rem 1.8rem;
}

.news-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cross);
}

.news-item time {
  display: block;
  font-size: 0.85rem;
  color: var(--gold-text);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.news-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.news-item p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  margin: 0;
}

/* --------------------------------- Contact ---------------------------------- */

.contact-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.contact-wrap-simple { align-items: center; }

.contact-info dl {
  margin: 1.6rem 0 0;
}

.contact-info dt {
  font-size: 0.82rem;
  color: var(--gold-text);
  font-weight: 700;
  margin-top: 1.3rem;
}

.contact-info dd {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
}

.contact-info a { color: var(--forest); text-decoration: underline; text-decoration-color: rgba(173,138,63,0.5); }

.contact-cta {
  background: var(--paper);
  padding: 2.4rem 2rem;
  border-radius: 6px;
  text-align: center;
}

.contact-cta p {
  margin: 0 auto 1.4rem;
  color: var(--ink-soft);
  max-width: 32ch;
}

/* --------------------------------- Footer ----------------------------------- */

.site-footer {
  background: var(--forest);
  color: rgba(247, 243, 233, 0.85);
  padding: 3rem 0 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid rgba(247, 243, 233, 0.18);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.footer-brand img { height: 38px; width: 38px; }

.footer-brand span {
  font-family: var(--serif);
  color: var(--cream);
  font-size: 1.05rem;
}

.site-footer h4 {
  color: var(--cream);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.site-footer a { text-decoration: none; color: rgba(247, 243, 233, 0.85); }
.site-footer a:hover { color: var(--gold-on-dark); }

.footer-bottom {
  padding-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: rgba(247, 243, 233, 0.6);
}

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

@media (max-width: 980px) {
  .events-wrap,
  .contact-wrap { grid-template-columns: 1fr; }
  .objectives-grid,
  .committee-grid { grid-template-columns: 1fr 1fr; }
  .membership-grid { grid-template-columns: 1fr; max-width: 480px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem var(--edge);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .main-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
  }

  .main-nav .btn { margin-top: 1.2rem; }

  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 260px; margin: 0 auto; }
  .hero .lede { max-width: none; }

  .objectives-grid,
  .committee-grid { grid-template-columns: 1fr; }

  .footer-top { grid-template-columns: 1fr; }
}
