/*
 * 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,
:root[data-theme="light"] {
  /* 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;
}

.footer-search {
  flex: 1 1 auto;
  max-width: 420px;
}
.footer-search label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: "Ubuntu", sans-serif;
  font-weight: 500;
  color: var(--q2-bg);
}
.footer-search .search-wrapper form {
  display: flex;
  margin: 0;
  gap: 0.5rem;
}
.footer-search .search-input {
  flex: 1 1 auto;
  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: var(--q2-bg);
  font-family: "Ubuntu", sans-serif;
}
.footer-search .search-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}
.footer-search .search-input:focus {
  outline: 2px solid var(--q2-focus-ring);
  background: rgba(255, 255, 255, 0.2);
}
.footer-search .search-submit {
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: var(--q2-radius);
  background: #2a1700;
  color: var(--q2-bg);
  cursor: pointer;
  font-family: "Ubuntu", sans-serif;
}
.footer-search .search-submit:hover {
  background: #754000;
}
.footer-search .search-submit img {
  filter: brightness(0) invert(1);
  width: 16px;
  height: 16px;
}

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

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

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

.footer-democracy {
  margin: 0;
  text-align: right;
  font-family: "Ubuntu", sans-serif;
}

.footer-powered,
.footer-copyright {
  margin: 0.5rem 0 0;
  text-align: center;
  font-family: "Ubuntu", sans-serif;
}

/* 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%;
}

/* Whole card main link and 3:2 thumbnail */
.card-main-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-main-link:hover {
  text-decoration: none;
}
.card-main-link .card-title {
  color: var(--q2-text-strong);
}

/* 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: 3 / 2;
  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);
}
