/* Layout: mobile-first directory. Sticky top bar, card lists, bottom tab bar on phones. */
:root {
  --bg: #F5F8F8;
  --surface: #FFFFFF;
  --ink: #18303A;
  --muted: #536A72;
  --line: #DCE6E7;
  --accent: #0E7470;
  --accent-ink: #FFFFFF;
  --sun: #F4B53F;

  --teal: #0E7470;   --teal-soft: #DDF1EE;
  --blue: #2D5EA6;   --blue-soft: #E1EAF8;
  --sunc: #A86400;   --sun-soft: #FCEBC4;
  --berry: #9C3469;  --berry-soft: #F6DDEA;
  --leaf: #3A7D3D;   --leaf-soft: #DFF0DC;
  --coral: #C24A35;  --coral-soft: #FADFD8;
  --violet: #6B45B5; --violet-soft: #E9E1F8;

  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(24, 48, 58, .06), 0 6px 18px rgba(24, 48, 58, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1B20; --surface: #172830; --ink: #E6F0F0; --muted: #9DB3B8; --line: #29404A;
    --accent: #4FC2B9; --accent-ink: #0B1F22; --sun: #F4B53F;
    --teal: #5FCBC2; --teal-soft: #173A3B; --blue: #8DB2F0; --blue-soft: #1C2F4A;
    --sunc: #F2BE5C; --sun-soft: #3A2E14; --berry: #EA8DBB; --berry-soft: #3B2132;
    --leaf: #8ACB84; --leaf-soft: #1F3520; --coral: #F2967F; --coral-soft: #3D231D;
    --violet: #B9A2F0; --violet-soft: #2B2342;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1B20; --surface: #172830; --ink: #E6F0F0; --muted: #9DB3B8; --line: #29404A;
  --accent: #4FC2B9; --accent-ink: #0B1F22; --sun: #F4B53F;
  --teal: #5FCBC2; --teal-soft: #173A3B; --blue: #8DB2F0; --blue-soft: #1C2F4A;
  --sunc: #F2BE5C; --sun-soft: #3A2E14; --berry: #EA8DBB; --berry-soft: #3B2132;
  --leaf: #8ACB84; --leaf-soft: #1F3520; --coral: #F2967F; --coral-soft: #3D231D;
    --violet: #B9A2F0; --violet-soft: #2B2342;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

[data-color="teal"]  { --cc: var(--teal);  --cc-soft: var(--teal-soft); }
[data-color="blue"]  { --cc: var(--blue);  --cc-soft: var(--blue-soft); }
[data-color="sun"]   { --cc: var(--sunc);  --cc-soft: var(--sun-soft); }
[data-color="berry"] { --cc: var(--berry); --cc-soft: var(--berry-soft); }
[data-color="leaf"]  { --cc: var(--leaf);  --cc-soft: var(--leaf-soft); }
[data-color="coral"] { --cc: var(--coral); --cc-soft: var(--coral-soft); }
[data-color="violet"] { --cc: var(--violet); --cc-soft: var(--violet-soft); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--body);
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 760px) { body { padding-bottom: 0; } }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); }
h2 { font-size: 1.3rem; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .875rem; color: var(--muted); }
.ic { width: 22px; height: 22px; flex: none; }
.ic-s { width: 16px; height: 16px; }

.wrap {
  max-width: 1080px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.section { padding-block: 28px 8px; display: grid; gap: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-weight: 700; border-radius: 999px; padding: 12px 22px; border: 0;
}
.btn:hover { filter: brightness(1.08); }
.btn-small { padding: 8px 16px; font-size: .9rem; }
.link { font-weight: 600; }

/* Top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.brand-mark { width: auto; height: 44px; border-radius: 10px; background: #FFFFFF; padding: 2px 4px; }
.hero-logo { width: 150px; height: auto; border-radius: 22px; background: #FFFFFF; padding: 8px; box-shadow: var(--shadow); }
.foot-logo { width: 96px; height: auto; border-radius: 14px; background: #FFFFFF; padding: 6px; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav > a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; }
@media (max-width: 759px) { .topnav { display: none; } }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding-block: 14px 0; font-size: .875rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 600; }

/* Home hero */
.hero { background: var(--teal-soft); border-bottom: 1px solid var(--line); }
.banner-wrap { padding-block: 20px 0; }
.banner { width: 100%; height: auto; border-radius: 18px; box-shadow: var(--shadow); }
.hero-in { padding-block: 24px 32px; display: grid; gap: 14px; }
.hero-in > * { max-width: 760px; }
.hero h1 { color: var(--ink); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.search {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 6px 4px 18px; box-shadow: var(--shadow); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; padding: 12px 8px 12px 0; }
.results { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.results a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.results a:hover { background: var(--bg); }
.results img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #FFFFFF; }
.results b { display: block; line-height: 1.3; }
.results span span { color: var(--muted); font-size: .85rem; }
.results p { padding: 8px; color: var(--muted); }

/* Category tiles */
.cats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 14px; row-gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s;
}
.cat:hover { transform: translateY(-2px); border-color: var(--cc); }
.cat-icon { grid-row: 1 / 4; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--cc-soft); color: var(--cc); }
.cat-icon .ic { width: 28px; height: 28px; }
.cat-name { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.cat-blurb { color: var(--muted); font-size: .925rem; line-height: 1.45; }
.cat-count { font-size: .8rem; font-weight: 700; color: var(--cc); letter-spacing: .02em; margin-top: 4px; }

/* Page heads */
.page-head { display: flex; align-items: center; gap: 16px; padding-block: 18px 4px; }
.page-head > div { display: grid; gap: 6px; min-width: 0; }
.head-icon { display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 18px; background: var(--cc-soft); color: var(--cc); }
.head-icon .ic { width: 32px; height: 32px; }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cc, var(--accent)); }

/* Disciplines and provinces */
.subs, .provs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.sub, .prov {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 700;
}
.sub:hover, .prov:hover { border-color: var(--accent); }
.count { font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--teal-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prov-empty { color: var(--muted); font-weight: 600; }
.prov-empty .count { background: transparent; color: var(--muted); font-weight: 600; }

/* Listing cards */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--cc); box-shadow: var(--shadow); }
.card-logo { width: 88px; height: 56px; border-radius: 14px; flex: none; object-fit: contain; background: #FFFFFF; padding: 4px; border: 1px solid var(--line); }
.card-logo.is-initials, .listing-logo.is-initials { padding: 0; border: 0; background: transparent; object-fit: contain; }
.card-body { display: grid; gap: 4px; min-width: 0; }
.card-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-tagline { color: var(--muted); font-size: .925rem; line-height: 1.45; }
.tag-featured { font-family: var(--body); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--sun); color: #3A2600; border-radius: 6px; padding: 2px 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.chip-cat { background: var(--cc-soft); color: var(--cc); border-color: transparent; }
.chip-date { background: var(--sun-soft); color: var(--sunc); border-color: transparent; }
.chip-ok { background: var(--leaf-soft); color: var(--leaf); border-color: transparent; }

.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.ad-note { font-size: .8rem; font-weight: 700; color: var(--muted); }
.ad-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.notice { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.notice ul { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; max-width: 75ch; }
.notice li::marker { color: var(--accent); }
.notice p { color: var(--muted); font-size: .925rem; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 14px 0; }
.jump a { font-weight: 700; text-decoration: none; background: var(--teal-soft); color: var(--accent); border-radius: 999px; padding: 6px 14px; }
.empty { display: grid; justify-items: start; gap: 12px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px; color: var(--muted); }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.cta > div:first-child { display: grid; gap: 6px; flex: 1 1 320px; min-width: 0; }
.cta p { color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* Listing page */
.listing-head { background: var(--cc-soft); border-bottom: 1px solid var(--line); margin-top: 14px; padding-bottom: 18px; }
.listing-head-in { display: flex; gap: 20px; align-items: center; padding-block: 24px 16px; }
.listing-logo { width: auto; min-width: 112px; max-width: min(260px, 100%); height: 112px; border-radius: 26px; flex: none; background: #FFFFFF; padding: 8px; box-shadow: var(--shadow); object-fit: contain; }
.listing-title { display: grid; gap: 8px; min-width: 0; }
.sample-note { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--coral); }
@media (max-width: 559px) {
  .listing-head-in { flex-direction: column; align-items: flex-start; gap: 14px; }
  .listing-logo { height: 96px; min-width: 96px; border-radius: 20px; }
}
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; font-size: .85rem; font-weight: 700;
}
.act .ic { color: var(--cc); }
.act:hover { border-color: var(--cc); }

.listing-body { display: grid; gap: 24px; padding-block: 24px 32px; }
@media (min-width: 880px) { .listing-body { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .listing-side { position: sticky; top: 84px; } }
.listing-main, .listing-side { display: grid; gap: 24px; min-width: 0; align-content: start; }
.block { display: grid; gap: 12px; }
.desc { max-width: 65ch; }
.services { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.services li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: .925rem; }
.contact-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.details { margin: 0; display: grid; gap: 12px; }
.details div { display: grid; gap: 1px; }
.details dt { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.gallery { display: grid; gap: 8px; grid-template-columns: repeat(6, 1fr); }
.gallery a { display: block; border-radius: 12px; overflow: hidden; background: var(--line); aspect-ratio: 4 / 3; grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.03); }
.g1 a { grid-column: span 6; aspect-ratio: 16 / 9; }
.g2 a, .g4 a { grid-column: span 3; }
.g3 a:first-child, .g5 a:first-child { grid-column: span 6; aspect-ratio: 16 / 9; }
.g3 a:not(:first-child) { grid-column: span 3; }
.g5 a:not(:first-child) { grid-column: span 3; }
@media (min-width: 700px) { .g5 a:not(:first-child) { grid-column: span 3; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.lightbox::backdrop { background: rgba(8, 16, 20, .9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(92vw, 1000px); max-height: 84vh; border-radius: 12px; }
.lb-btn { position: fixed; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #18303A; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-close { top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); }
.lb-prev { left: calc(10px + env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
.lb-next { right: calc(10px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }

/* Terms */
.prose { max-width: 720px; }
.prose ol { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }

/* Footer and tab bar */
.foot { border-top: 1px solid var(--line); margin-top: 40px; background: var(--surface); }
.foot-in { padding-block: 22px; display: grid; gap: 10px; font-size: .9rem; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 700; border-radius: 10px; }
.tabbar a:hover { color: var(--accent); }
@media (min-width: 760px) { .tabbar { display: none; } }

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