/* =====================================================
   TABLE OF CONTENTS
   1.   Variables
   1b.  Dark theme
   2.   Reset
   3.   Base elements
   4.   Layout (container, page grid)
   5.   Icons (SVG sprite)
   6.   Header (logo, theme button, toggle button, navigation)
   7.   Footer
   8.   Sidebar
   9.   Blog intro (heading box)
   10.  Blog cards
   11.  Blog detail (single article)
   11a. Breadcrumb (blog detail)
   12.  Article content (rich text)
   13.  Tags (blog cards and article)
   14.  Author profile (base, main content, sidebar)
   15.  Post meta (author photo + name + date)
   16.  Author box (end of article, for later)
   17.  Authors index (grid of author cards)
   17b. Dark mode overrides (stronger selectors)
   18.  Tablet  (768px and wider)
   19.  Desktop (1024px and wider)
   20.  Full width layout override (must stay last)
   ===================================================== */


:root {
  /* --- Wagtail light theme palette (official Wagtail design tokens) --- */
  --color-primary: #2e1f5e;       /* Wagtail purple: branding, panels, headings, buttons */
  --color-primary-200: #261a4e;   /* darker purple accent */

  --color-secondary: #007d7e;     /* Wagtail teal: action links, primary buttons */
  --color-secondary-600: #004345; /* hover for two-tone buttons */
  --color-secondary-400: #005b5e; /* hover states */
  --color-secondary-100: #00b0b1; /* highlights over dark backgrounds */
  --color-secondary-75: #80d7d8;  /* highlights over dark text */
  --color-secondary-50: #f2fcfc;  /* light backgrounds, highlighted fields */

  --color-white: #ffffff;         /* page and panel backgrounds, button text */
  --color-grey-600: #262626;      /* body copy */
  --color-grey-400: #5c5c5c;      /* help text, meta text */
  --color-grey-200: #929292;      /* dividers, button borders */
  --color-grey-150: #c8c8c8;      /* field borders */
  --color-grey-100: #e0e0e0;      /* dividers, panel borders */
  --color-grey-50: #f6f6f8;       /* panel backgrounds, row highlights */

  --color-info: #1d7792;          /* information messages */
  --color-info-bg: #e2f5fc;
  --color-positive: #1b8666;      /* success messages */
  --color-positive-bg: #e0fbf4;
  --color-warning: #faa500;       /* warnings */
  --color-warning-bg: #fff5d8;
  --color-critical: #ca3b3b;      /* errors, dangerous actions */
  --color-critical-bg: #fef0f0;

  /* --- Roles: use these in the rules below, so one change updates the whole site --- */
  --color-text: var(--color-grey-600);         /* main text */
  --color-text-muted: var(--color-grey-400);   /* dates, small meta text */
  --color-bg: var(--color-grey-50);            /* page background: lightest Wagtail grey */
  --color-surface: var(--color-white);         /* cards and widgets */
  --color-border: var(--color-grey-100);       /* lines between sections */
  --color-link: var(--color-secondary);        /* links */
  --color-link-hover: var(--color-secondary-400);
  --color-heading: var(--color-primary);       /* titles inside cards and widgets */
  --color-badge-bg: var(--color-primary);      /* category badge background */
  --color-badge-hover: var(--color-secondary); /* category badge hover background */
  --color-icon-muted: var(--color-grey-200);   /* breadcrumb chevrons and similar small icons */
  --color-btn-bg: #e6e6ec;                     /* CHANGED: subtle grey circle behind the theme button (light mode), a bit stronger so it shows on white */
  --color-btn-bg-hover: #d8d8e0;               /* CHANGED: slightly darker grey on hover */

  /* --- Layout and spacing --- */
  --card-space: 1.6rem;        /* one spacing value used everywhere in cards */
  --page-width: 120rem;        /* one width used by header AND content */
  --page-width-full: 100%;
  --page-top-space: 3rem;      /* one top space used by left content AND sidebar */

  /* --- Shape --- */
  --radius-pill: 10rem;        /* fully rounded ends for category badges and tags */
}

/* ---------- 1b. Dark theme ---------- */
/* CHANGED: colors now follow Wagtail's own dark look (grey scale + light teal).
   Only applies when JavaScript sets data-theme="dark" on <html>.
   It overrides the roles, so every rule using them changes automatically. */
[data-theme="dark"] {
  color-scheme: dark;                          /* dark scrollbars and form controls */

  --color-text: #ffffff;                       /* main text: white, like Wagtail dark */
  --color-text-muted: #c8c8c8;                 /* dates and small meta text (Wagtail grey-150) */
  --color-bg: #1a1a1a;                         /* page background: darker than the cards */
  --color-surface: #262626;                    /* cards, header, footer, widgets (Wagtail grey-600) */
  --color-border: #404040;                     /* thin lines between sections */
  --color-link: var(--color-secondary-75);     /* light teal (#80d7d8): readable on dark */
  --color-link-hover: #ffffff;                 /* white on hover */
  --color-heading: #ffffff;                    /* white titles */
  --color-badge-bg: var(--color-secondary);    /* teal badge (#007d7e) with white text */
  --color-badge-hover: var(--color-secondary-400);   /* slightly darker teal on hover */
  --color-icon-muted: #929292;                 /* chevrons stay visible on dark */
  --color-btn-bg: #333333;                     /* NEW: subtle dark circle, just lighter than the #262626 header */
  --color-btn-bg-hover: #404040;               /* NEW: a little lighter on hover */
}


/* ---------- 2. Reset ---------- */
*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;   /* padding and border stay inside the width */
}


/* ---------- 3. Base elements ---------- */
/* 62.5% of the browser's 16px = 10px, so 1rem = 10px (easy math: 1.8rem = 18px).
   A percentage (not px) keeps the user's browser font-size setting working. */
html {
  font-size: 62.5%;
}

/* Stops the left/right scrollbar: anything wider than the screen is cut off */
html,
body {
  overflow-x: clip;
}

body {
  font-family: "Source Sans 3", sans-serif;
  font-size: 1.8rem;
  color: var(--color-text);              /* Wagtail body copy color */
  background-color: var(--color-bg);     /* page background */
}

a {
  text-decoration: none;
  color: var(--color-text);
}

a:hover {
  color: var(--color-text-muted);
}

li {
  list-style-type: none;   /* no bullets by default */
}


/* ---------- 4. Layout ---------- */
.site-container {
  width: 100%;
}

/* Header content: same width and centering as .page-layout */
.inner {
  max-width: var(--page-width-full);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Page with sidebar (phone: one column) */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* phone: one column */
  gap: 2.4rem;
  width: 100%;
  max-width: var(--page-width);   /* same as .inner */
  margin: 0 auto;
  padding: var(--page-top-space) 2rem 0;   /* top space is set HERE only */
}

.page-main {
  min-width: 0;   /* stops wide content from pushing the sidebar out */
}

/* The first item on the left and the first item in the sidebar
   have no top margin, so both start at exactly the same height */
.page-main > :first-child,
.sidebar > :first-child {
  margin-top: 0;
}


/* ---------- 5. Icons (SVG sprite) ---------- */
/* Drawn by includes/icon.html from static/icons/sprite.svg.
   Size follows the text around it, so one icon fits every heading and paragraph. */
.icon {
  display: inline-block;
  width: 1.2em;               /* width scales with the font size around the icon */
  height: 1.2em;              /* same as width, so the icon stays square */
  flex-shrink: 0;             /* never squeezed inside a flex row */
  vertical-align: -0.2em;     /* sits slightly below the baseline, level with the text */
  fill: none;                 /* Lucide icons are outlines, not filled shapes */
  stroke: currentColor;       /* line color = text color, so hover colors work automatically */
  stroke-width: 2;            /* Lucide's normal line thickness */
  stroke-linecap: round;      /* rounded line ends */
  stroke-linejoin: round;     /* rounded corners */
}


/* ---------- 6. Header ---------- */
.site-header {
  background-color: var(--color-surface);   /* white header */
}

/* Logo */
.site-logo {
  flex: 1;   /* grow to fill all space left over, so the buttons stay on the right */
}

.logo-text {
  display: flex;
  flex-flow: column;
  line-height: 1;
  padding: 2.4rem 0;
}

.logo-title {
  font-size: 2.2rem;
  font-weight: 600;
  display: block;
  width: 100%;
}

.logo-tagline {
  font-size: 1.3rem;
  font-weight: normal;
  display: block;
  width: 100%;
}

/* Toggle button (menu / close icon, mobile only) */
.toggle-btn {
  flex: 0 0 auto;                 /* do not grow or shrink, size comes from min-width */
  display: flex;
  align-items: center;            /* icon in the vertical middle */
  justify-content: flex-end;      /* icon on the right edge */
  min-width: 4.4rem;              /* easy to tap with a finger (44px) */
  min-height: 4.4rem;
  padding: 0;                     /* buttons have default padding, remove it */
  border: 0;                      /* buttons have a default border, remove it */
  background: none;               /* buttons have a grey background, remove it */
  color: var(--color-text);       /* icon color follows this (currentColor) */
  font: inherit;                  /* use the site font, not the browser button font */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;   /* removes the colored flash when tapping */
}

/* Clear outline for keyboard users (Tab key) */
.toggle-btn:focus-visible {
  outline: 2px solid var(--color-link);   /* light teal in dark mode, so focus stays visible */
  outline-offset: 0.4rem;
  border-radius: 0.4rem;
}

/* Icon size: a bit bigger than the normal .icon size.
   Two classes make this rule stronger than the single .icon rule above. */
.toggle-btn .toggle-icon {
  width: 2.8rem;
  height: 2.8rem;
}

/* Closed menu: show the menu icon, hide the x icon */
.toggle-btn .toggle-icon-close {
  display: none;
}

/* Open menu (JavaScript adds .active): swap the icons */
.toggle-btn.active .toggle-icon-menu {
  display: none;
}

.toggle-btn.active .toggle-icon-close {
  display: inline-block;
}

/* Theme button (moon / sun icon, visible on every screen size) */
.theme-btn {
  display: flex;
  align-items: center;            /* icon in the vertical middle of the circle */
  justify-content: center;        /* CHANGED: icon in the horizontal middle (was flex-end) */
  align-self: center;             /* NEW: circle sits in the vertical middle of the header row */
  flex: 0 0 auto;                 /* keep its own size, never squeezed */
  width: 3.5rem;                  /* CHANGED: fixed width, so the shape is a true circle (44px tap size) */
  height: 3.5rem;                 /* CHANGED: same as width */
  margin-right: 0;                /* no extra gap, the menu button already has space on its left */
  padding: 0;                     /* remove the default button padding */
  border: 0;                      /* remove the default button border */
  border-radius: 50%;             /* NEW: fully round */
  background-color: var(--color-btn-bg);      /* CHANGED: subtle grey (light) or subtle dark (dark) */
  color: var(--color-text);       /* icon color follows this (currentColor) */
  font: inherit;                  /* use the site font, not the browser button font */
  cursor: pointer;
  transition: background-color 0.2s ease;     /* NEW: smooth hover color change */
  -webkit-tap-highlight-color: transparent;   /* removes the colored flash when tapping */
}

/* NEW: slightly stronger background on hover */
.theme-btn:hover {
  background-color: var(--color-btn-bg-hover);
}

/* Clear outline for keyboard users (Tab key) */
.theme-btn:focus-visible {
  outline: 2px solid var(--color-link);   /* light teal in dark mode, so focus stays visible */
  outline-offset: 0.2rem;                 /* CHANGED: smaller gap, because the circle is already a clear shape */
}

/* Icon size: smaller than the menu icon */
.theme-btn .theme-icon {
  width: 2rem;
  height: 2rem;
}

/* Light mode (default, no data-theme): show the moon, hide the sun */
.theme-btn .theme-icon-sun {
  display: none;
}

/* Dark mode (JavaScript sets data-theme="dark" on <html>): swap the icons */
[data-theme="dark"] .theme-btn .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-btn .theme-icon-sun {
  display: inline-block;
}

/* Navigation (mobile first) */
.header-nav {
  display: grid;
  grid-template-rows: 0fr;   /* height 0 = closed */
  opacity: 0;
  visibility: hidden;
  flex-basis: 100%;
  transition:
    grid-template-rows 0.3s ease,
    opacity 0.3s ease,
    visibility 0s linear 0.3s;   /* hide links after the animation ends */
}

.header-nav.open {
  grid-template-rows: 1fr;   /* full height = open */
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 0.3s ease,
    opacity 0.3s ease,
    visibility 0s linear 0s;
}

.header-nav .nav-menu {
  overflow: hidden;   /* hide the links while the height is small */
  min-height: 0;      /* allow the list to shrink to 0 */
}

.header-nav .menu-item {
  display: block;
  margin: 1rem 0;
}

.header-nav .menu-item:last-child {
  margin-bottom: 3rem;   /* space under Contact */
}


/* ---------- 7. Footer ---------- */
.footer-nav {
  background-color: var(--color-surface);   /* white footer */
}

.footer-menu {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
}

.footer-link {
  text-decoration: none;
  color: inherit;
}

.footer-text {
  text-align: center;
  padding: 1.5rem;
  font-size: 1.6rem;
  opacity: 0.8;
}


/* ---------- 8. Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;               /* same space between every widget */
  margin: 0 0 3rem;        /* same outer space as the blog cards */
}

.sidebar-widget {
  padding: 2rem;
  background-color: var(--color-surface);                         /* white, like your cards */
  border-radius: 1.2rem;
}

/* Widget title: heading color with a bottom border, no background */
.sidebar-widget-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  color: var(--color-heading);                     /* purple in light mode, white in dark mode */
  padding-bottom: 1.2rem;                          /* space between text and border */
  border-bottom: 1px solid var(--color-border);    /* soft line under the title */
  margin-bottom: var(--card-space);                /* space between border and content */
}


/* ---------- 9. Blog intro (heading box) ---------- */
/* Used by the blog index, categories, tags and authors headings */
.blog-intro {
  display: flex;
  flex-direction: column;                   /* mobile: image on top, text below */
  gap: var(--card-space);
  margin: 3rem 0;
  padding: 2rem;
  background-color: var(--color-surface);   /* white background */
  border-radius: 1.2rem;                    /* rounded corners */
}

.blog-intro-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.8rem;
}

.blog-intro-text {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);
}

.blog-intro-title {
  font-size: 2.8rem;
  line-height: 1.2;
}

.blog-intro-description {
  line-height: 1.6;
}

/* Space between rich text paragraphs (the reset removed all margins) */
.blog-intro-description p + p {
  margin-top: var(--card-space);
}


/* ---------- 10. Blog cards ---------- */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  margin: 3rem 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);          /* same space between every item in the card */
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

/* Category badges (also used on the blog detail page) */
.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.card-category {
  display: inline-block;                    /* keeps padding even when it is a link */
  background-color: var(--color-badge-bg);
  color: var(--color-white);
  font-size: 1.3rem;
  line-height: 1.4;
  padding: 0.4rem 1.4rem;
  border-radius: var(--radius-pill);        /* fully rounded (pill) */
  transition: background-color 0.2s ease;   /* smooth hover color change */
}

/* Category is now a link: keep the text white on hover (a:hover would turn it grey) */
.card-category:hover {
  color: var(--color-white);
  background-color: var(--color-badge-hover);   /* CHANGED: uses the role, so dark mode can differ */
}

/* Featured image (16:9 ratio) */
.card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.8rem;
}

/* Title and excerpt (the date is now .post-date in section 15) */
.card-title {
  font-size: 2.4rem;
  line-height: 1.3;
}

.card-excerpt {
  line-height: 1.6;
}

/* Read more link (margin-top: auto keeps it at the bottom of the card) */
.card-link {
  color: var(--color-link);
  font-weight: 600;
  margin-top: auto;
}

.card-link:hover {
  color: var(--color-link-hover);
}


/* ---------- 11. Blog detail (single article) ---------- */
.article {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);
  margin: 3rem 0;
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

.article-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.8rem;
}

.article-title {
  font-size: 3.2rem;
  line-height: 1.3;
}

/* Back link */
.article-back {
  color: var(--color-link);
  font-weight: 600;
}

.article-back:hover {
  color: var(--color-link-hover);
}


/* ---------- 11a. Breadcrumb (blog detail) ---------- */
/* Same box as .blog-intro: white surface, 1.2rem rounded corners, 2rem side space.
   Sits above the article, so the bottom space matches the 2.4rem gap between cards. */
.breadcrumb {
  margin: 0 0 2.4rem;
  padding: var(--card-space) 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

/* The list: one row, wraps to a new line on small screens */
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;   /* same size as .post-date on mobile */
}

/* One step: link + chevron side by side */
.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Link: house icon (Home only) and text on one line */
.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text-muted);
}

/* Teal on hover and keyboard focus (a:hover would turn it grey) */
.breadcrumb-link:hover,
.breadcrumb-link:focus-visible {
  color: var(--color-link);
}

/* Chevron between steps: light grey so it does not compete with the text */
.breadcrumb-separator {
  display: flex;
  color: var(--color-icon-muted);   /* CHANGED: uses the role, so dark mode can differ */
}

/* Current page: normal text color, bold, long titles wrap */
.breadcrumb-current {
  min-width: 0;
  font-weight: 600;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* The article has its own 3rem top margin; the breadcrumb already supplies the space */
.breadcrumb + .article {
  margin-top: 0;
}


/* ---------- 12. Article content (rich text) ---------- */
/* The reset removed margins and list bullets,
   so we add them back only inside the article. */
.article-content {
  line-height: 1.7;
}

.article-content > * + * {
  margin-top: var(--card-space);   /* same space between every block */
}

.article-content h2 {
  font-size: 2.6rem;
  line-height: 1.3;
  margin-top: 3.2rem;
}

.article-content h3 {
  font-size: 2.1rem;
  line-height: 1.3;
  margin-top: 2.4rem;
}

.article-content ul,
.article-content ol {
  padding-left: 2.4rem;
}

.article-content ul li {
  list-style-type: disc;
}

.article-content ol li {
  list-style-type: decimal;
}

.article-content a {
  color: var(--color-link);
  text-decoration: underline;
}

.article-content a:hover {
  color: var(--color-link-hover);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.8rem;
}


/* ---------- 13. Tags (blog cards and article) ---------- */
/* Row of tags under a card or article (wraps on small screens) */
.card-tags,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;                              /* tight space between tags */
}

/* One tag pill (outlined, fully rounded) */
.card-tag,
.article-tag {
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1.4;
  padding: 0.2rem 1rem;
  border: 1px solid var(--color-link);
  border-radius: var(--radius-pill);        /* fully rounded (pill) */
  color: var(--color-link);
  transition: background-color 0.2s ease, color 0.2s ease;   /* smooth hover */
}

/* Hover and keyboard focus: fill with the link color, dark text for contrast */
.card-tag:hover,
.card-tag:focus-visible,
.article-tag:hover,
.article-tag:focus-visible {
  color: var(--color-surface);              /* CHANGED: text uses the card color, readable in both themes */
  background-color: var(--color-link);
}


/* ---------- 14. Author profile ---------- */
/* Shared base (mobile: image on top, text below) */
.author-profile {
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

.author-profile-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-heading);   /* purple in light mode, white in dark mode */
  margin-bottom: var(--card-space);
}

.author-profile-body {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);
}

.author-photo {
  display: block;
  width: 100%;
  max-width: 16rem;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.8rem;
}

.author-profile-text {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.author-name {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.2;
}

.author-description {
  line-height: 1.6;
}

.author-link {
  color: var(--color-link);
  font-weight: 600;
}

.author-link:hover {
  color: var(--color-link-hover);
}

/* In the main content (home page) */
.page-main .author-profile {
  margin: 3rem 0;   /* same outer space as the blog cards */
}

/* In the sidebar: title gets a bottom border, same as the other sidebar widgets */
.sidebar .author-profile-title {
  padding-bottom: 1.2rem;                          /* space between text and border */
  border-bottom: 1px solid var(--color-border);    /* soft line under the title */
}

/* everything centered: round image, name, bio, link */
.sidebar .author-profile-body {
  align-items: center;
  text-align: center;
}

.sidebar .author-photo {
  width: 14rem;
  border-radius: 50%;   /* round image */
}

.sidebar .author-profile-text {
  align-items: center;
}


/* ---------- 15. Post meta (author photo + name + date) ---------- */
/* Used on every post card (blog index, categories, tags, authors)
   and on the blog detail page.
   One row at every screen size: [photo] Name · Date */
.post-meta {
  display: flex;
  flex-wrap: wrap;            /* wraps only if the row runs out of space */
  align-items: center;        /* photo, name and date share the same middle line */
  gap: 0.8rem;
}

/* Author chip: photo + name (a link when the Authors page exists) */
.post-author {
  display: flex;
  align-items: center;        /* photo and name on the same line */
  gap: 0.8rem;                /* space between photo and name */
}

/* Small round avatar with a teal border */
.post-author-photo {
  display: block;
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;                              /* never squeeze the photo in the flex row */
  object-fit: cover;                           /* crop instead of stretching */
  border: 2px solid var(--color-secondary);    /* 2px Wagtail teal (#007d7e) border */
  border-radius: 50%;                          /* round image, same as the sidebar author */
}

.post-author-name {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-text);   /* normal text color, not muted */
}

/* Hover and keyboard focus anywhere on the chip: teal name (a:hover would turn it grey) */
a.post-author:hover .post-author-name,
a.post-author:focus-visible .post-author-name {
  color: var(--color-link);
}

.post-date {
  font-size: 1.4rem;
  color: var(--color-text-muted);
}

/* Dot between author and date; only shows when an author exists */
.post-author + .post-date::before {
  content: "·";               /* middle dot separator */
  margin-right: 0.8rem;       /* space between the dot and the date */
}


/* ---------- 16. Author box (end of article, for later) ---------- */
/* Not used yet: kept for when the author box is added back under the post */
/* Mobile: photo on top, text below. The row layout is in the tablet section. */
.author-box {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);                   /* the article gap already adds space above */
  padding: 2rem;
  background-color: var(--color-bg);        /* light grey box inside the white article */
  border-radius: 0.8rem;
}

.author-box-photo {
  display: block;
  width: 9.6rem;
  height: 9.6rem;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;                       /* round image */
}

.author-box-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.author-box-label {
  font-size: 1.3rem;
  color: var(--color-text-muted);
}

.author-box-name {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-heading);              /* purple in light mode, white in dark mode */
}

.author-box-bio {
  line-height: 1.6;
}

.author-box-link {
  color: var(--color-link);
  font-weight: 600;
}

.author-box-link:hover {
  color: var(--color-link-hover);
}


/* ---------- 17. Authors index (grid of author cards) ---------- */
/* Authors index (/authors/): grid of author cards.
   The page heading uses .blog-intro, the same as categories and tags. */
.author-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);    /* mobile: one column */
  gap: 2.4rem;                              /* same space as .card-list */
  margin: 3rem 0;
}

.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;                      /* everything centered */
  text-align: center;
  gap: 0.8rem;
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

.author-card-photo {
  display: block;
  width: 9.6rem;
  height: 9.6rem;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.8rem;                    /* extra room under the photo */
}

.author-card-name {
  font-size: 2.2rem;
  line-height: 1.3;
}

.author-card-count {
  font-size: 1.4rem;
  color: var(--color-text-muted);           /* "3 posts" like a date */
}


/* ---------- 17b. Dark mode overrides (stronger selectors) ---------- */
/* CHANGED: no longer depends on one class name. Any heading inside the sidebar,
   or any element whose class contains "title", gets the heading color.
   [data-theme="dark"] + .sidebar + the element = more weight than a normal
   one-class rule, even one that loads later (for example from block.css). */
[data-theme="dark"] .sidebar h1,
[data-theme="dark"] .sidebar h2,
[data-theme="dark"] .sidebar h3,
[data-theme="dark"] .sidebar h4,
[data-theme="dark"] .sidebar h5,
[data-theme="dark"] .sidebar h6,
[data-theme="dark"] .sidebar [class*="title"],
[data-theme="dark"] .page-main .author-profile-title {
  color: var(--color-heading);                     /* white */
  border-bottom-color: var(--color-border);        /* soft dark line, not bright white */
}

/* Any horizontal line inside the sidebar uses the soft border color */
[data-theme="dark"] .sidebar hr {
  border-color: var(--color-border);
  background-color: var(--color-border);
}

/* Titles of the posts in the "Latest Posts" widget stay in the normal text color */
[data-theme="dark"] .sidebar a {
  color: var(--color-text);
}

[data-theme="dark"] .sidebar a:hover {
  color: var(--color-link);
}


/* =====================================================
   MEDIA QUERIES (all small-screen styles are above)
   ===================================================== */

/* ---------- 18. Tablet (768px and wider) ---------- */
@media screen and (min-width: 768px) {

  /* Header */
  .site-logo {
    flex-basis: auto;
  }

  .header-nav {
    display: flex;
    align-items: center;
    flex-basis: auto;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .header-nav .nav-menu {
    display: flex;
    overflow: visible;
  }

  .header-nav .menu-item {
    display: inline-block;
    margin: 0 0 0 2rem;
  }

  .header-nav .menu-item:last-child {
    margin-bottom: 0;   /* no extra space on desktop */
  }

  .toggle-btn {
    display: none;      /* no button on desktop */
  }

    /* Theme button: move it after the menu, on the right side */
  .theme-btn {
    order: 1;                    /* the menu has order 0, so this comes after it */
    margin-right: 0;             /* no gap needed on the right */
    margin-left: 2rem;           /* CHANGED: same space as between menu items, so the circle does not touch "Contact" */
  }

  /* Blog intro: image left, text right */
  .blog-intro {
    flex-direction: row;
    align-items: center;
  }

  .blog-intro-image {
    flex: 0 0 40%;
    width: 40%;
  }

  .blog-intro-text {
    flex: 1;
  }

  /* Breadcrumb: slightly larger text */
  .breadcrumb-list {
    font-size: 1.6rem;
  }

  /* Author profile in main content: image left, name + bio + link right */
  .page-main .author-profile-body {
    flex-direction: row;
    align-items: flex-start;
  }

  .page-main .author-photo {
    flex: 0 0 16rem;
    width: 16rem;
  }

  .page-main .author-profile-text {
    flex: 1;
  }

  /* Author box: photo left, text right */
  .author-box {
    flex-direction: row;
    align-items: flex-start;
  }

  /* Authors index: two columns */
  .author-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ---------- 19. Desktop (1024px and wider) ---------- */
@media screen and (min-width: 1024px) {

  /* Content on the left, 300px sidebar on the right (sidebar is NOT sticky) */
  .page-layout {
    grid-template-columns: minmax(0, 1fr) 30rem;
  }

  /* Authors index: three columns */
  .author-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Author box: a little more space on large screens */
  .author-box {
    padding: 2.4rem;
  }
}


/* ---------- 20. Full width layout (home page, no sidebar) ---------- */
/* Keep this at the very end so it wins over the desktop rule above */
.page-layout.page-layout--full {
  grid-template-columns: minmax(0, 1fr);   /* always one column */
}