/*
Theme Name: SmartStart Knowledge Hub
Theme URI: https://smartstart.org.za/
Author: SmartStart
Description: A minimal knowledge hub theme for SmartStart early learning. Includes a front page with a hero image and five research topic links.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smartstart-hub
*/

/* ==========================================================
   SmartStart Knowledge Hub
   Brand colours live in :root. Swap the hex values here to
   match the official brand palette and the whole page updates.
   ========================================================== */

:root {
  --ss-navy:   #2e1646;   /* deep purple: text, footer */
  --ss-purple: #5b2c83;   /* primary */
  --ss-yellow: #fdb913;   /* highlight */
  --ss-orange: #f58220;   /* accent */
  --ss-pink:   #e8478b;   /* accent */
  --ss-violet: #8a4fc7;   /* accent */

  --ink:       var(--ss-navy);
  --ink-soft:  #5a4a6e;
  --paper:     #ffffff;
  --mist:      #f7f4fa;
  --line:      #e4dcec;

  --font: "Avenir Next", "Nunito", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --radius: 14px;
  --wrap: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ss-yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

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

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

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}

.logo img { height: 44px; width: auto; }

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

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink-soft);
  padding-block: .25rem;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.site-nav a:hover { color: var(--ink); border-color: var(--ss-purple); }

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

.hero {
  position: relative;
  min-height: clamp(380px, 62vh, 620px);
  display: flex;
  align-items: flex-end;
  background: linear-gradient(135deg, var(--ss-purple), var(--ss-pink));
  color: #fff;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* Darkens the lower part of the image so the text stays readable */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(46, 22, 70, .85) 0%, rgba(46, 22, 70, .35) 45%, rgba(46, 22, 70, 0) 75%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  padding-block: clamp(2rem, 6vw, 4rem);
}

.hero h1 {
  margin: 0 0 .75rem;
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 800;
  max-width: 16ch;
}

.hero p {
  margin: 0;
  max-width: 52ch;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(255, 255, 255, .92);
}

/* Brand colour strip beneath the hero */
.colour-bar {
  display: flex;
  height: 8px;
}
.colour-bar span { flex: 1; }
.colour-bar span:nth-child(1) { background: var(--ss-purple); }
.colour-bar span:nth-child(2) { background: var(--ss-yellow); }
.colour-bar span:nth-child(3) { background: var(--ss-orange); }
.colour-bar span:nth-child(4) { background: var(--ss-pink); }
.colour-bar span:nth-child(5) { background: var(--ss-violet); }

/* ---------- Intro ---------- */

.intro {
  padding-block: clamp(3rem, 7vw, 5rem) 1.5rem;
}

.intro h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  max-width: 24ch;
}

.intro p {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
}

/* ---------- Topics ---------- */

.topics {
  padding-block: 1.5rem clamp(3rem, 7vw, 5rem);
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.topic {
  --tone: var(--ss-purple);
}
.topic:nth-child(1) { --tone: var(--ss-purple); }
.topic:nth-child(2) { --tone: var(--ss-yellow); }
.topic:nth-child(3) { --tone: var(--ss-orange); }
.topic:nth-child(4) { --tone: var(--ss-pink); }
.topic:nth-child(5) { --tone: var(--ss-violet); }

.topic-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--mist);
  border-radius: var(--radius);
  border-left: 8px solid var(--tone);
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
}

.topic-link:hover {
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 10px 28px rgba(46, 22, 70, .08);
}

.topic h3 {
  margin: 0 0 .3rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.topic p {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1rem;
}

.topic-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--tone);
  color: var(--ink);
  font-weight: 800;
  transition: transform .2s;
}

.topic-cta svg { width: 20px; height: 20px; }

.topic-link:hover .topic-cta { transform: translateX(4px); }

/* White arrow on the darker tones for contrast */
.topic:nth-child(1) .topic-cta,
.topic:nth-child(4) .topic-cta,
.topic:nth-child(5) .topic-cta { color: #fff; }

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

.site-footer {
  background: var(--ss-navy);
  color: rgba(255, 255, 255, .8);
  padding-block: 2.5rem;
  font-size: .95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .site-nav { display: none; }
  .topic-link { padding: 1.25rem; gap: 1rem; }
  .topic-cta { width: 2.5rem; height: 2.5rem; }
}

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

/* ---------- Content pages (topic pages, posts) ---------- */

.page-content {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.page-content .page-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  border-left: 8px solid var(--ss-purple);
  padding-left: 1rem;
}

.entry-content {
  max-width: 70ch;
}

.entry-content a { color: var(--ss-purple); }
.entry-content img { height: auto; border-radius: var(--radius); }

.alignleft  { float: left;  margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { margin-inline: auto; display: block; }

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