/* =========================================
   0) Base Reset & Design Tokens
   ========================================= */
:root {
  --maxw: 1000px;
  --navy: #0a3161;
  --text: #222;
  --muted: #444;
  --link: #0056b3;
  --link-hover: #003d80;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.1);
  --header-radius: 16px;
  --card-radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* =========================================
   1) Typography & Body
   - Body = Source Sans Pro (calm)
   - Headings + .site-header = Raleway
   ========================================= */
body {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #fff;

  /* NOTE: leave spacing to main/layout; top margin/padding here can
     create unexpected space above the sticky header */
}

/* Headings use Raleway (also applied to header container for consistent feel) */
h1, h2, h3, h4, h5, h6,
.site-header {
  font-family: "Raleway", sans-serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 2rem 0 1rem;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1rem; }

/* Paragraphs & Lists */
p { margin: 0 0 1rem; }
ul, ol { margin: 1rem 0 1rem 2rem; }

/* Links inside main content */
main a {
  color: var(--link);
  text-decoration: underline;
}
main a:hover { color: var(--link-hover); }

/* Code */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}
pre code { display: block; padding: 1rem; overflow-x: auto; }

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid #ccc;
  color: #555;
  background: #fafafa;
}

/* Images */
img { margin: 1rem 0; border-radius: 6px; }

/* Buttons */
button, .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--link-hover); }

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* =========================================
   2) Layout
   ========================================= */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem; /* page gutters */
}

/* =========================================
   3) Site Header (sticky, rounded, compact on scroll)
   ========================================= */
.site-header {
  background: #3a5a91;                 /* medium navy interior */
  color: #fff;
  margin: 0 auto 2rem;
  padding: 1rem 1.25rem;
  max-width: var(--maxw);
  border-radius: var(--header-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);

  /* Thicker dark navy border */
  border: 4px solid #0a3161;

  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease;
}




/* Header title row */
.header-flag { display: flex; align-items: center; gap: 0.6rem; }
.header-flag .star { color: #ffd700; font-size: 1.4rem; line-height: 1; }

.site-title {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 2rem;
  transition: font-size 0.2s ease;
}

/* Compact-on-scroll state */
/* Compact state: lighter interior */
.site-header.compact {
/*  background: #5a7ab8;*/
  padding: 0.6rem 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.site-header.compact .site-title { font-size: 1.1rem; }
/* Hide the star rows when header is compact */
.site-header.compact .header-stars {
  display: none;
}
.site-header.compact .header-flag .star {
  display: none;
}

/* Static centered row of stars  */
.header-stars {
  margin-bottom: 0.4rem;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}
.header-stars::before {
  /* plenty of stars to cover very wide screens */
  content: "★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★";
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0.35rem; /* spacing between stars */
}
@media (max-width: 520px) {
  .header-stars::before {
    font-size: 0.8rem;
    letter-spacing: 0.25rem;
  }
}

/* Responsive sizing */
@media (max-width: 520px) {
  .header-stars {
    font-size: 0.75rem;
    letter-spacing: 0.3rem;
  }
}


/* Nav */
.nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* Header nav links (card-like buttons) */
.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);  /* subtle frosted white overlay */
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover/focus: brighten the white overlay */
.nav a:hover,
.nav a:focus {
  background: rgba(255, 255, 255, 0.30);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Active/current page link: stronger white to signal selection */
.nav a.active,
.nav a[aria-current="page"],
.nav a[aria-current="true"] {
  background: rgba(255, 255, 255, 0.45);  /* bolder white overlay */
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transform: none; /* stable, no lift */
}

.nav a:visited { color: #f0f4ff; }
.nav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* =========================================
   4) Components
   ========================================= */
/* Signature (handwritten-style) */
.signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* Conversational callout */
.callout {
  background: #f9f9fc;
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #333;
  position: relative;
}
.callout {
border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  background: #f5f7fb;                 /* light navy-tinted background */
  border: 1px solid #d6dce8;           /* soft border */
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  color: #1a1d2c;                      /* darker navy text for readability */
}

/* =========================================
   5) Topics Grid (emoji left, text left, equal heights)
   ========================================= */
.topics-grid {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch; /* make all li equal height per row */
}

.topic-card {
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  display: flex; /* allows the link to stretch full height */
}

.topic-card a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  flex: 1; /* link stretches to fill li */
}

.topic-icon {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.topic-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topic-text h2 {
  font-size: 1.35rem;
  margin: 0 0 0.4rem;
  color: var(--navy);
}

/* Unclamped default for topic text paragraphs */
.topic-text p {
  font-size: 1rem;
  color: #333;
  margin: 0;
}

/* Clamp ONLY on the landing page grid */
.topics-grid .topic-text p {
  font-size: 0.85rem; /* smaller intro on cards */
  display: -webkit-box;
  -webkit-line-clamp: 3;   /* allow 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hover effect for cards */
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.06) saturate(1.04);
}

/* =========================================
   6) Responsive Tweaks
   ========================================= */
@media (max-width: 520px) {
  .site-title { font-size: 1.2rem; }
  .nav { gap: 0.6rem; }
}
