/* ==========================================================================
   FLTA – responsive template for MODX Revolution
   Layout inspired by the original flta-layout.css (MODX Evolution)
   ========================================================================== */

:root {
  --bg:        #ffffcc;   /* page background (original) */
  --panel:     #fffab8;   /* boxes: header, menu, content, footer (original) */
  --border:    #000;
  --text:      #222;
  --muted:     #5c5a45;
  --accent:    #d10000;   /* active menu item */
  --link:      #0a3a8c;
  --shadow:    rgb(154, 153, 122);
  --row-line:  rgba(0, 0, 0, .12);
  --row-hover: rgba(255, 255, 255, .55);
  --focus:     #1a56db;

  --gap:       8px;
  --radius:    0;         /* set e.g. 6px for slightly rounded boxes */
  --sidebar:   270px;
  --font:      Tahoma, Verdana, "Segoe UI", Geneva, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

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

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

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  padding: 8px 12px; background: #fff; border: 2px solid var(--border);
  color: var(--text); font-weight: bold;
}
.skip-link:focus { top: 8px; }

img.logo {
  background: #fff;
  padding: 5px;
  object-fit: contain;
  box-shadow: 5px 5px 5px var(--shadow);
}

/* ---------- Page grid ---------- */
.site {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--gap);
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "header"
    "toggle"
    "nav"
    "main"
    "partners"
    "footer";
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.site-header   { grid-area: header; }
.nav-toggle    { grid-area: toggle; }
.site-nav      { grid-area: nav; }
.site-main     { grid-area: main; }
.site-partners { grid-area: partners; }
.site-footer   { grid-area: footer; }

/* ---------- Header ---------- */
.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "logo  partner"
    "title title";
  align-items: center;
  gap: 12px 16px;
  padding: 10px;
}
.site-header__logo    { grid-area: logo; }
.site-header__title   { grid-area: title; }
.site-header__partner { grid-area: partner; }

.site-header a { color: inherit; text-decoration: none; }
.site-header a:hover { text-decoration: underline; }

.site-header__logo img { height: 72px; width: auto; }

.site-name {
  margin: 0 0 .5em;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: bold;
}
.site-meta {
  margin: 0 0 .5em;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.35;
}
.site-meta:last-child { margin-bottom: 0; }

.site-header__partner { justify-self: end; }
.site-header__partner img { display: block; width: auto; max-width: 100%; max-height: 64px; }

/* ---------- Mobile menu button ---------- */
.nav-toggle {
  display: none;               /* only shown when JS is available, see below */
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: bold 1rem var(--font);
  cursor: pointer;
  text-align: left;
}
.js .nav-toggle { display: flex; }

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 22px; height: 2px;
  background: currentColor;
  transition: transform .2s, opacity .2s;
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before,
.nav-toggle__icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after  { top:  7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after  { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Navigation (mobile first) ---------- */
.site-nav { padding: 4px 0; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--text); text-decoration: none; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }

.site-nav .nav-list > li { border-top: 1px solid var(--row-line); }
.site-nav .nav-list > li:first-child { border-top: 0; }

.site-nav li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav li > a {
  flex: 1 1 auto;
  display: block;
  padding: 11px 14px;
}
.site-nav li > ul { flex: 0 0 100%; padding-bottom: 6px; }
.site-nav li li > a { padding: 8px 14px 8px 30px; }

.site-nav .here > a    { font-weight: bold; }
.site-nav .current > a { color: var(--accent); font-weight: bold; }

/* sub-menu toggle buttons (inserted by flta.js) */
.subnav-toggle {
  flex: 0 0 48px;
  height: 44px;
  margin-right: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  position: relative;
}
.subnav-toggle::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -70%) rotate(45deg);
  transition: transform .2s;
}
.subnav-toggle[aria-expanded="true"]::before { transform: translate(-50%, -30%) rotate(-135deg); }

.js .site-nav li.has-children:not(.is-expanded) > ul { display: none; }

/* ---------- Partner logos ---------- */
.site-partners { padding: 12px; }
.partner-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.partner-grid li { display: flex; justify-content: center; }
.partner-grid img {
  display: block;
  width: 100%;
  max-width: 110px;
  height: 80px;
}

/* ---------- Main content ---------- */
.site-main { padding: 10px 14px 18px; min-width: 0; }
.site-main:focus { outline: none; }

.breadcrumbs ol {
  list-style: none; margin: 0 0 .5em; padding: 0;
  display: flex; flex-wrap: wrap;
  font-size: .95rem;
}
.breadcrumbs li + li::before { content: "\00bb"; padding: 0 .45em; }

.page-title,
.content-body h1,
.content-body h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: .6em 0 .7em;
}
.content-body h3 { font-size: 1.15rem; }
.content-body h4 { font-size: 1rem; }

.content-body iframe,
.content-body video { max-width: 100%; }

/* Tables: the old content contains fixed widths (style="width:1040px") */
.content-body table {
  width: 100% !important;
  height: auto !important;
  border-collapse: collapse;
}
.content-body td,
.content-body th {
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}
.content-body thead td,
.content-body thead th,
.content-body th { font-weight: bold; }
.content-body thead tr { border-bottom: 2px solid var(--border); }
.content-body tbody tr { border-bottom: 1px solid var(--row-line); }
.content-body tbody tr:hover { background: var(--row-hover); }

.content-body td.monthtitle { font-weight: bold; text-align: center; }

.table-scroll {             /* wrapper added by flta.js */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1em;
}

/* Calendar colour codes (original) */
td.national { background-color: #ffff33; }
td.fn  { background-color: silver; }
td.gt  { background-color: red; }
td.rh  { background-color: #3366ff; }
td.ffw { background-color: lime; }
td.dw  { background-color: fuchsia; }
td.ad  { background-color: #ffcc00; }

/* ---------- Footer ---------- */
.site-footer { padding: 6px 14px; font-size: .9rem; }
.site-footer p { margin: .5em 0; }
.site-footer a { color: inherit; }
.site-footer__stats { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Tablet  (≥ 600px)
   ========================================================================== */
@media (min-width: 600px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo title"
      "logo partner";
    align-items: start;
  }
  .site-header__logo img { height: 90px; }
  .site-name { font-size: 1.35rem; }
  .site-header__partner { justify-self: start; }
  .site-header__partner img { max-height: 80px; }
}

/* ==========================================================================
   Desktop  (≥ 900px): sidebar layout like the original site
   ========================================================================== */
@media (min-width: 900px) {
  .site {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "header   header"
      "nav      main"
      "partners main"
      "footer   footer";
  }

  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "logo title partner";
    align-items: start;
  }
  .site-header__logo img { height: 100px; }
  .site-name { font-size: 1.5rem; }
  .site-header__partner { justify-self: end; }
  .site-header__partner img { width: auto; max-width: 340px; max-height: 120px; }

  .nav-toggle,
  .js .nav-toggle { display: none; }

  /* Sidebar menu: always visible, fully expanded, classic bullets */
  .js .site-nav,
  .site-nav { display: block; padding: 8px 10px 10px; }
  .site-partners { align-self: start; }
  .partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .partner-grid img { height: 90px; }

  .site-nav .nav-list > li { border-top: 0; }
  .site-nav li { display: list-item; }
  .site-nav .nav-list { list-style: disc; padding-left: 20px; }
  .site-nav .nav-sub  { list-style: circle; padding: 0 0 0 20px; }
  .site-nav li > a,
  .site-nav li li > a { display: inline; padding: 0; }
  .site-nav li { padding: 1px 0; }

  .subnav-toggle { display: none; }
  .js .site-nav li.has-children:not(.is-expanded) > ul { display: block; }

  .site-main { min-height: 450px; padding: 8px 16px 20px; }
  .page-title, .content-body h1, .content-body h2 { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
