* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;

  --bg: #EEF2F0;
  --card-bg: #ffffff;
  --text: #33312e;
  --text-muted: #46433f;

  --accent-text: #C1440E;    /* links, list markers, popover border/tail, robin breast */
  --accent-solid: #C1440E;   /* nav bar background, stays consistent in both modes */
  --accent-solid-hover: #9c360a;
  --accent-hover-bg: #ddd;
  --accent-hover-text: #000000;
  --nav-text: #f2f2f2;
  --link-visited: #d77b6b;
  --danger: #b5533e;
  --danger-hover: #96402f;

  --popover-bg: #E9F1F1;
  --popover-border: rgba(193, 68, 14, 0.35);
  --soft-border: #f0e4dc;
  --card-top: #8FB8C4;
  --shadow: rgba(0,0,0,0.05);
  --shadow-strong: rgba(0,0,0,0.14);

  --robin-body: #52504c;
  --robin-shade: #3f3d3a;
  --robin-beak: #ffaa1d;
  --robin-breast: #C1440E;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1d1c;
    --card-bg: #262826;
    --text: #ece9e4;
    --text-muted: #c9c5be;

    --accent-text: #FF9A5C;
    --accent-solid: #C1440E;
    --accent-hover-bg: #3a3733;
    --accent-hover-text: #ffffff;
    --nav-text: #fbeee7;
    --link-visited: #e8a98f;
    --danger: #d97a63;
    --danger-hover: #c2634d;

    --popover-bg: #24312f;
    --popover-border: rgba(255, 154, 92, 0.35);
    --soft-border: #3a3733;
    --card-top: #5f95a3;
    --shadow: rgba(0,0,0,0.5);
    --shadow-strong: rgba(0,0,0,0.6);

    --robin-body: #928d86;
    --robin-shade: #6f6b64;
    --robin-beak: #ffb85e;
    --robin-breast: #FF9A5C;
  }
}

img {
  border: 1px solid var(--soft-border);
  border-radius: 4px;
  padding: 5px;
  width: 100%;
}

body {
  font-family: Karla;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
}

ul li::marker {
  color: var(--accent-text);
}

/* Header/Blog Title */
.header {
  padding: 30px;
  text-align: center;
  background: var(--card-bg);
  border-radius: 25px 25px 0px 0px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.robin-icon {
  width: 68px;
  height: auto;
  flex-shrink: 0;
}

.header h1 {
  font-size: 50px;
  margin-bottom: 4px;
}

.header-text {
  text-align: left;
}

/* Style the top navigation bar */
.topnav-wrapper {
  position: relative;
}

.robin-perch {
  position: absolute;
  top: -28px;
  left: 0;
  width: 38px;
  height: auto;
  opacity: 1;
  transform: translate(0, 0);
  transition: transform 0.55s ease-in-out;
  pointer-events: none;
  z-index: 2;
}

@keyframes robin-flap {
  0%   { transform: rotate(0deg); }
  45%  { transform: rotate(28deg); }
  100% { transform: rotate(0deg); }
}

@keyframes robin-bob {
  0%   { transform: translateY(0); }
  45%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.robin-perch .robin-wing {
  transform-origin: 74px 53px;
}

.robin-perch.visible .robin-wing {
  animation: robin-flap 0.55s ease-in-out infinite;
}

.robin-perch.visible .robin-flight-body {
  animation: robin-bob 1.1s ease-in-out infinite;
}

.robin-perch .robin-leg {
  transition: opacity 0.15s ease;
}

.robin-perch.visible .robin-leg {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .robin-perch {
    transition: none;
  }
  .robin-perch.visible .robin-wing,
  .robin-perch.visible .robin-flight-body {
    animation: none;
  }
}

.topnav {
  overflow: hidden;
  background-color: var(--accent-solid);
  border-radius: 0px 0px 25px 25px;
}


a:link {
  color: var(--accent-text);
  background-color: transparent;
  text-decoration: none;
}
a:visited {
  color: var(--link-visited);
  background-color: transparent;
  text-decoration: none;
}
a:hover {
  background-color: transparent;
  text-decoration: underline;
}
a:active {
  background-color: transparent;
  text-decoration: underline;
}


/* Style the topnav links */
.topnav a {
  float: left;
  display: block;
  color: var(--nav-text);
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  transition: 0.3s;
}

/* Change color on hover */
.topnav a:hover {
  background-color: var(--accent-hover-bg);
  color: var(--accent-hover-text);
}

/* Create two unequal columns that floats next to each other */
/* Left column */
.leftcolumn {   
  float: left;
  width: 75%;
}

/* Right column */
.rightcolumn {
  float: left;
  width: 25%;
  background-color: var(--bg);
  padding-left: 20px;
}

/* Fake image */
.fakeimg {
  background-color: #aaa;
  width: 100%;
  padding: 20px;
}

/* Add a card effect for articles */
.card {
  background-color: var(--card-bg);
  padding: 20px;
  margin-top: 20px;
  border-radius: 25px;
  border-top: 4px solid var(--card-top);
  box-shadow: 0 2px 10px var(--shadow);
}

.card h2 {
  border-bottom: 2px solid var(--soft-border);
  padding-bottom: 8px;
  letter-spacing: 0.2px;
}

/* Robin "speech bubble" that reveals the plain-English explanation on hover/click */
.info-bubble {
  position: relative;
  display: inline-block;
  margin-left: 3px;
}

.info-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  vertical-align: super;
  line-height: 1;
}

.info-trigger svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
}

.info-qmark {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-text);
  line-height: 1;
}

.info-trigger:hover svg,
.info-trigger:focus-visible svg {
  transform: scale(1.12);
}

.info-trigger svg {
  transition: transform 0.15s ease;
}

.info-trigger:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 6px;
}

.info-popover {
  position: absolute;
  top: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 290px;
  max-width: 78vw;
  background: var(--popover-bg);
  border: 1px solid var(--popover-border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.88em;
  color: var(--text-muted);
  text-align: left;
  box-shadow: 0 6px 18px var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.info-popover::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 9px 9px 9px;
  border-style: solid;
  border-color: transparent transparent var(--popover-border) transparent;
}

.info-popover::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--popover-bg) transparent;
}

.info-bubble:hover .info-popover,
.info-bubble.open .info-popover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Clear floats after the columns */
.row::after {
  content: "";
  display: table;
  clear: both;
}

/* Footer */
.footer {
  padding: 20px;
  text-align: center;
  background: var(--soft-border);
  margin-top: 20px;
  border-radius: 25px;
}

/* Responsive layout - when the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 800px) {
  .leftcolumn, .rightcolumn {   
    width: 100%;
    padding: 0;
  }
}

/* Responsive layout - when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other */
@media screen and (max-width: 400px) {
  .topnav a {
    float: none;
    width: 100%;
  }
  .header-inner {
    flex-direction: column;
  }
  .header-text {
    text-align: center;
  }
  .info-popover {
    width: 230px;
  }
}

/* ---- Blog-specific components ---- */
.back-link {
  display: inline-block;
  margin-bottom: 4px;
  font-weight: 700;
}

.post-meta {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 12px;
}

.post-excerpt {
  margin: 8px 0 6px 0;
}

.read-more {
  font-weight: 700;
}

.note-callout {
  background: var(--popover-bg);
  border: 1px solid var(--popover-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 18px 0;
}

article.card h1 {
  font-size: 1.7em;
  margin-top: 4px;
  margin-bottom: 6px;
}

article.card p {
  line-height: 1.6;
}
