/*
 * Mattved — legacy Pelican palette applied to the Quark 2 base
 *
 * This file is loaded last, after theme.css and fonts.css, so it can
 * override CSS custom properties and specific rules without !important.
 * Legacy source: ___legacy/themes/Mattved/templates/partials/style.html
 */

:root {
  /* Page canvas -> legacy --body_bg */
  --q2-bg: #ffffdd;
  /* Card / content surface -> legacy --article_bg */
  --q2-bg-elev: #fefefe;
  --q2-bg-muted: #fdfdca;

  /* Body text -> legacy --body_c */
  --q2-text: #333332;
  --q2-text-strong: #2a1700;
  --q2-text-muted: #8f7450;

  /* Headings / links / accent -> legacy --header_btn_bg / --header_btn_hv */
  --q2-accent: #5a3200;
  --q2-accent-contrast: #fefefe;
  --q2-link: #5a3200;
  --q2-focus-ring: rgba(117, 64, 0, 0.45);

  /* Header bar -> legacy --header_bg */
  --q2-nav-bg: #2a1700;
  --q2-nav-border: rgba(42, 23, 0, 0.4);

  --pico-font-family-sans-serif: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pico-font-family-display: "Ubuntu", sans-serif;
  --pico-font-family-monospace: "Ubuntu Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body,
p,
li,
.card-body {
  font-family: "Literata", serif;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.dropmenu > ul > li > a,
.btn {
  font-family: "Ubuntu", sans-serif;
}

code, pre, kbd, samp {
  font-family: "Ubuntu Mono", ui-monospace, monospace;
}

/* Header: force the dark legacy bar regardless of scroll state, with light text */
#header {
  background: var(--q2-nav-bg) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 3px solid rgba(0, 0, 0, 0.35);
}
#header .navbar-brand,
#header .dropmenu > ul > li > a,
#header .login-status-wrapper {
  color: #fefefe;
}
#header .dropmenu > ul > li > a:hover:not(.active) {
  color: #ffffff;
}
#header .dropmenu > ul > li > a.active {
  color: #ffffff;
}

/* Legacy pill-style nav buttons */
#header .dropmenu > ul > li > a {
  background: #5a3200;
  border-radius: 5px;
  padding: 0.4em 0.9em;
  text-transform: uppercase;
  font-weight: 450;
  font-size: 0.9em;
  transition: background 0.6s;
}
#header .dropmenu > ul > li > a:hover {
  background: #754000;
}

/* Header layout: logo | search | nav | actions */
#header .navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 120px;
  transition: min-height 0.25s ease;
}
body.scrolled #header .navbar {
  min-height: 72px;
}

.navbar-brand {
  flex-shrink: 0;
}
.navbar-brand img {
  height: 90px;
  width: auto;
  display: block;
  transition: height 0.25s ease;
}
body.scrolled .navbar-brand img {
  height: 52px;
}

.header-search {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  max-width: 420px;
  margin: 0 1rem;
}
.header-search .search-wrapper {
  width: 100%;
}
.header-search .search-wrapper form {
  display: flex;
  margin: 0;
}
.header-search .search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--q2-radius);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffdd;
  font-family: "Ubuntu", sans-serif;
}
.header-search .search-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}
.header-search .search-input:focus {
  outline: 2px solid var(--q2-focus-ring);
  background: rgba(255, 255, 255, 0.2);
}

/* Hide desktop search on very small screens; mobile overlay search is used instead */
@media (max-width: 640px) {
  .header-search {
    display: none;
  }
}

/* Mobile search in overlay */
.mobile-search {
  margin: 1rem 0;
}
.mobile-search .search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--q2-border-strong);
  border-radius: var(--q2-radius);
  background: var(--q2-bg-elev);
  color: var(--q2-text);
  font-family: "Ubuntu", sans-serif;
}

/* Footer: legacy dark band with page-background lettering */
#footer {
  background: #5a3200;
  border-top: 5px solid #2a1700;
  color: #ffffdd;
}
#footer a {
  color: #ffffdd;
  text-decoration: underline;
}
#footer a:hover {
  color: #ffffff;
}

.footer-powered {
  margin: 0.25rem 0 0.75rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  flex-wrap: wrap;
}
.footer-social a img {
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter 1s, opacity 1s;
  width: 32px;
  height: 32px;
}
.footer-social a img:hover {
  filter: grayscale(0);
  opacity: 1;
  transition: filter 0.4s, opacity 0.4s;
}

/* Default pages: no white card background, show like a blog post */
#body-wrapper > .container > .content-item {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* Blog card grid: capped tile width so cards don't stretch full-width on narrow screens */
.blog-grid {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  justify-content: center;
  align-items: stretch;
}
@media (min-width: 560px) {
  .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px)) !important;
  }
}
@media (min-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px)) !important;
  }
}
.blog-grid > .card {
  width: 100%;
  height: 100%;
}

/* Date badge on blog cards: top-right over the photo, page-background text */
.card-image-wrap {
  position: relative;
}
.card-image-wrap .card-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.card-date-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  background: #5a3200;
  color: #ffffdd;
  padding: 0.25rem 0.6rem;
  border-radius: 0 0 0 5px;
  font-family: "Ubuntu", sans-serif;
  font-size: 0.8rem;
}
.card-date-badge .blog-date,
.card-date-badge .blog-date i,
.card-date-badge time {
  color: #ffffdd;
}
.card-date-badge .blog-date i {
  opacity: 1;
}

/* Card body text colour */
.card-body {
  color: var(--q2-text);
}
