/* ==========================================================================
   Theme tokens
   Palette: main #2788a0 (teal) · contrast #16242f (deep navy) · highlight #f9f8f7 (warm off-white)

   Roles:
     - main       -> header, footer, all headings (h1-h6), hyperlinks
     - contrast   -> body text
     - highlight  -> body background, and text/elements shown against a
                     main-colored background (header/footer content)

   Bulma 1.x reads color via HSL custom properties, so we set those directly
   rather than recompiling Sass. https://bulma.io/documentation/customize/concepts/
   ========================================================================== */

:root {
  --color-primary:   #2788a0; /* "main" */
  --color-contrast:  #16242f; /* "contrast" */
  --color-hue:       #f9f8f7; /* "highlight" */
  --color-highlight: var(--color-hue);

  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;

  color-scheme: light;

  /* Bulma neutral (grey) ramp — tuned to the warm off-white "highlight" color */
  --bulma-scheme-h: 30deg;
  --bulma-scheme-s: 12%;
  --bulma-light-l: 95%;
  --bulma-dark-l: 15%;

  /* Bulma brand colors — primary & link both use the main teal */
  --bulma-primary-h: 192deg;
  --bulma-primary-s: 61%;
  --bulma-primary-l: 39%;

  --bulma-link-h: 192deg;
  --bulma-link-s: 61%;
  --bulma-link-l: 34%;

  --bulma-body-background-color: var(--color-highlight);
  --bulma-body-color: var(--color-contrast);
  --bulma-family-primary: var(--font-body);
}

/* Bulma 1.x flips several of the above under prefers-color-scheme: dark.
   We keep this site single-themed (matching the supplied brand palette
   exactly), so pin the same values there too. */
@media (prefers-color-scheme: dark) {
  :root {
    --bulma-scheme-h: 30deg;
    --bulma-scheme-s: 12%;
    --bulma-light-l: 95%;
    --bulma-dark-l: 15%;
    --bulma-body-background-color: var(--color-highlight);
    --bulma-body-color: var(--color-contrast);
  }
}

/* ==========================================================================
   Typography — Helvetica Neue everywhere, including the Bulma components
   that set their own font-family explicitly (buttons, inputs, titles...).
   ========================================================================== */

html, body,
.title, .subtitle,
.button, .input, .textarea, .select select,
.navbar-item, .navbar-link,
.tag, .label, .help,
.menu-label, .menu-list,
.breadcrumb, .pagination,
.box, .card, .notification, .message,
.dropdown-item {
  font-family: var(--font-body);
}

body {
  background-color: var(--color-highlight);
  color: var(--color-contrast);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: var(--color-primary);
}

a:hover {
  color: var(--color-contrast);
}

strong, b {
  color: var(--color-primary);
  font-weight: 700;
}

/* ==========================================================================
   Full-viewport-height shell — header sticky, footer always at the bottom
   of the viewport even on short pages.
   ========================================================================== */

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-shell {
  flex: 1 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.site-footer {
  flex-shrink: 0;
}

/* ==========================================================================
   Navbar — sticky, deep-navy header, the one bold anchor element on the page
   ========================================================================== */

.site-navbar {
  background-color: var(--color-contrast);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-navbar .site-brand {
  color: var(--color-highlight);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-navbar .site-logo {
  display: inline-flex;
  color: var(--color-highlight);
}

.site-navbar .site-brand:hover {
  color: var(--color-primary);
  background-color: transparent;
}

.site-navbar .navbar-item,
.site-navbar .navbar-link {
  color: var(--color-highlight);
  background-color: transparent;
}

.site-navbar .navbar-item:hover,
.site-navbar .navbar-link:hover {
  color: var(--color-primary);
  background-color: transparent;
}

.site-navbar .navbar-burger {
  color: var(--color-highlight);
}

.site-navbar .navbar-burger span {
  background-color: currentColor;
  height: 2px;
}

.site-navbar .navbar-burger:hover {
  color: var(--color-primary);
  background-color: transparent;
}

@media screen and (max-width: 1023px) {
  .site-navbar .navbar-menu {
    background-color: var(--color-contrast);
  }
}

/* ---- Search box (in navbar) ---- */

.site-search {
  position: relative;
  flex-grow: 0;
}

.site-search-box {
  position: relative;
  width: 100%;
}

.site-search-input {
  width: 100%;
  min-width: 220px;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(249, 248, 247, 0.35);
  background-color: rgba(249, 248, 247, 0.12);
  color: var(--color-highlight);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.site-search-input::placeholder {
  color: rgba(249, 248, 247, 0.7);
}

.site-search-input:focus {
  outline: none;
  border-color: var(--color-highlight);
  background-color: rgba(249, 248, 247, 0.18);
}

.site-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background-color: var(--color-highlight);
  color: var(--color-contrast);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(22, 36, 47, 0.2);
  padding: 0.5rem 0;
  z-index: 50;
  max-height: 22rem;
  overflow-y: auto;
}

.site-search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-search-results li {
  border-bottom: 1px solid hsl(30deg, 12%, 90%);
}

.site-search-results li:last-child {
  border-bottom: none;
}

.site-search-results a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--color-contrast);
  font-size: 0.9375rem;
}

.site-search-results a:hover {
  background-color: hsl(30deg, 14%, 95%);
  color: var(--color-primary);
}

.site-search-empty {
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: hsl(206deg, 12%, 48%);
}

@media screen and (max-width: 1023px) {
  .site-search-input {
    min-width: 0;
  }
}

/* ==========================================================================
   Two-column shell: sidebar + main content.
   Grid (not Bulma columns) so we control stacking order explicitly on mobile.
   ========================================================================== */

.site-columns {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media screen and (max-width: 900px) {
  .site-columns {
    grid-template-columns: 1fr;
  }
  .sidebar-column {
    order: 2;
  }
  .main-column {
    order: 1;
  }
}

/* ==========================================================================
   Sidebar — calendar, recent posts, popular tags
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 5.5rem; /* clears the sticky navbar */
}

@media screen and (max-width: 900px) {
  .sidebar {
    position: static;
  }
}

.sidebar-section {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid hsl(30deg, 12%, 88%);
}

.sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-promo {
  line-height: 0; /* removes the small inline-image gap under the link */
}

.sidebar-promo a {
  display: block;
  border-radius: 6px;
  overflow: hidden;
}

.sidebar-promo-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 6px;
}

.sidebar-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.sidebar-subheading {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-contrast);
  margin: 0.9rem 0 0.4rem;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-list li {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  line-height: 1.4;
}

.sidebar-list a {
  color: var(--color-primary);
}

.sidebar-list-date {
  font-size: 0.75rem;
  color: hsl(206deg, 12%, 52%);
}

.sidebar-empty {
  font-size: 0.875rem;
  color: hsl(206deg, 12%, 52%);
  list-style: none;
}

/* ---- Calendar widget ---- */

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.calendar-month-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-contrast);
}

.calendar-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

.calendar-nav-btn:hover {
  background-color: hsl(30deg, 14%, 92%);
}

.calendar-nav-btn:disabled {
  color: hsl(206deg, 12%, 75%);
  cursor: not-allowed;
}

.calendar-nav-btn:disabled:hover {
  background-color: transparent;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: hsl(206deg, 12%, 55%);
  margin-bottom: 0.25rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border-radius: 4px;
}

.calendar-cell-blank {
  background: none;
}

.calendar-cell-day {
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-contrast);
  font-family: var(--font-body);
}

.calendar-cell-day:hover {
  background-color: hsl(30deg, 14%, 90%);
}

.calendar-cell-day.has-posts {
  background-color: hsl(192deg, 55%, 90%);
  color: var(--color-primary);
  font-weight: 700;
}

.calendar-cell-day.has-posts:hover {
  background-color: hsl(192deg, 55%, 84%);
}

.calendar-cell-day.is-selected {
  background-color: var(--color-primary);
  color: var(--color-highlight);
}

.calendar-cell-day.is-future {
  color: hsl(206deg, 12%, 78%);
  cursor: not-allowed;
}

.calendar-cell-day.is-future:hover {
  background-color: transparent;
}

.calendar-day-posts {
  margin-top: 0.75rem;
}

/* ---- Tag cloud ---- */

.tag-cloud {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: hsl(192deg, 55%, 93%);
  color: var(--color-primary);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.tag-pill:hover {
  background-color: var(--color-primary);
  color: var(--color-highlight);
}

.tag-pill-count {
  font-size: 0.6875rem;
  opacity: 0.75;
}

.tag-cloud-full .tag-pill {
  font-size: 0.875rem;
}

/* ==========================================================================
   Homepage hero / intro
   ========================================================================== */

.hero-intro {
  padding-bottom: 1.5rem;
}

.hero-intro-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-intro-desc {
  font-size: 1.125rem;
  color: hsl(206deg, 16%, 38%);
  max-width: 40rem;
}

@media screen and (max-width: 768px) {
  .hero-intro-title {
    font-size: 1.75rem;
  }
}

/* ==========================================================================
   Post list — hairline-divided entries, deliberately not a card grid
   ========================================================================== */

.post-list-wrap {
  max-width: 46rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list-item {
  padding: 2rem 0;
  border-bottom: 1px solid hsl(30deg, 12%, 88%);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-date {
  font-size: 0.875rem;
  color: hsl(206deg, 12%, 48%);
  margin-bottom: 0.35rem;
}

.post-list-title {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-list-excerpt {
  color: hsl(206deg, 14%, 32%);
  line-height: 1.65;
  margin-bottom: 0.5rem;
  max-width: 42rem;
}

.post-list-more {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* ==========================================================================
   Single post / page
   ========================================================================== */

.post-wrap {
  max-width: 42rem;
  margin: 0 auto;
}

.post-back {
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-meta {
  color: hsl(206deg, 12%, 48%);
  font-size: 0.9375rem;
}

.tag-label {
  color: var(--color-primary);
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--color-contrast);
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content a {
  text-decoration: underline;
  text-decoration-color: hsl(192deg, 45%, 70%);
  text-underline-offset: 2px;
}

.post-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1.25rem;
  color: hsl(206deg, 14%, 32%);
  margin: 1.5rem 0;
}

.post-content pre {
  background-color: var(--color-contrast);
  color: var(--color-highlight);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
}

.post-content code {
  background-color: hsl(30deg, 20%, 92%);
  color: var(--color-contrast);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

@media screen and (max-width: 768px) {
  .post-title {
    font-size: 1.75rem;
  }
}

/* ---- Previous/next post navigation ---- */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(30deg, 12%, 88%);
}

.post-nav-item {
  flex: 1 1 0;
  min-width: 0;
}

.post-nav-next {
  text-align: right;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-nav-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(206deg, 12%, 48%);
}

.post-nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-nav a:hover .post-nav-title {
  color: var(--color-contrast);
}

@media screen and (max-width: 600px) {
  .post-nav {
    flex-direction: column;
  }

  .post-nav-next {
    text-align: left;
  }
}

/* ==========================================================================
   Tag archive page
   ========================================================================== */

.tag-archive {
  max-width: 46rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--color-primary);
  color: var(--color-highlight);
  padding: 2.5rem 1.5rem;
}

.site-footer-inner {
  text-align: center;
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--color-highlight);
}

.site-footer a:hover {
  color: var(--color-contrast);
}

.site-footer-dot {
  margin: 0 0.5rem;
}

/* ==========================================================================
   Accessibility — visible focus states throughout
   ========================================================================== */

a:focus-visible,
button:focus-visible,
.navbar-burger:focus-visible,
.button:focus-visible,
.calendar-cell-day:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.site-navbar :focus-visible {
  outline-color: var(--color-highlight);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}