:root {
  /* Accent colors */
  --accent-primary: #7d4a8c;
  --accent-secondary: #c94a6f;
  --banner-overlay: rgba(31, 26, 46, 0.35);

  /* Background overrides — cool lavender tones */
  --color-bg-body: #e6e3ee;
  --color-surface: #f3f1f6;
  --color-surface-alt: #ece9f2;
  --color-border: #d8d4e2;

  /* Thumbnail sizes — change these to resize thumbnails everywhere */
  --thumb-w: 360px;
  --thumb-h: 270px;
  --thumb-w-mobile: 200px;
  --thumb-h-mobile: 150px;
}

html { font-size: 16px; }

/* ===== Site banner (full width, above menubar, text top-left) ===== */

.site-banner {
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
  margin: 0;
}

.site-banner img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  margin: 0;
}

.site-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--banner-overlay) 0%,
    rgba(31, 26, 46, 0.1) 60%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  padding: 2.5rem 3rem;
}

.site-banner__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.01em;
}

.site-banner__subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: #f0e0eb;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

/* ===== Post-page banner ===== */

.site-banner--post {
  height: 280px;
}

.site-banner--post .site-banner__overlay {
  background: linear-gradient(
    to right,
    var(--banner-overlay) 0%,
    rgba(31, 26, 46, 0.15) 70%,
    transparent 100%
  );
  justify-content: flex-end;
  padding: 2rem 3rem;
}

.site-banner--post .site-banner__title {
  font-size: 2.5rem;
  line-height: 1.2;
}

.site-banner--post .site-banner__subtitle {
  font-size: 1rem;
  font-family: monospace;
  opacity: 0.85;
}

/* Hide the in-content title on post pages — banner replaces it */
.body--page .post__title:first-of-type,
.body--page .post > header > h1.post__title {
  display: none;
}

/* Hide the site logo on post pages — the banner is the new header */
.body--page .logo { display: none; }

@media (max-width: 768px) {
  .site-banner--post { height: 180px; }
  .site-banner--post .site-banner__overlay { padding: 1.25rem 1.5rem; }
  .site-banner--post .site-banner__title { font-size: 1.5rem; }
  .site-banner--post .site-banner__subtitle { font-size: 0.85rem; }
}

/* Pull white panel up flush against banner */
.container.container--outer {
  margin-top: 0;
}

@media (max-width: 768px) {
  .site-banner { height: 220px; }
  .site-banner__overlay { padding: 1.5rem; }
  .site-banner__title { font-size: 1.25rem; }
  .site-banner__subtitle { font-size: 0.85rem; }
}

/* ===== Hide site title (logo) on home — banner replaces it there ===== */
.body--home .logo { display: none; }

/* ===== List pages (homepage, /post/, taxonomy pages) ===== */

.list__item {
  display: grid;
  grid-template-columns: var(--thumb-w) 1fr;
  grid-template-areas:
    "thumb header"
    "thumb excerpt";
  column-gap: 1rem;
  row-gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
}

.list__item:nth-child(even) {
  grid-template-columns: 1fr var(--thumb-w);
  grid-template-areas:
    "header thumb"
    "excerpt thumb";
}

.list__thumbnail {
  grid-area: thumb;
  float: none;
  margin: 0;
  padding: 0;
  width: var(--thumb-w);
  height: var(--thumb-h);
  overflow: hidden;
  background: #222;
  border-radius: 2px;
}
.list__thumbnail .thumbnail__link {
  display: block;
  width: 100%;
  height: 100%;
}
.list__thumbnail img,
.list__thumbnail .thumbnail__image {
  width: var(--thumb-w);
  height: var(--thumb-h);
  max-width: var(--thumb-w);
  object-fit: cover;
  display: block;
  margin: 0;
}
.list__thumbnail .thumbnail__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a2444 0%, #1f1a2e 100%);
}

.list__header { grid-area: header; min-width: 0; }
.list__title,
.list__title a {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent-primary);
  text-decoration: none;
}
.list__title a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}
.list__meta {
  font-size: 0.85rem;
  opacity: 0.6;
  font-family: monospace;
}

.list__excerpt {
  grid-area: excerpt;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .list__item,
  .list__item:nth-child(even) {
    grid-template-columns: var(--thumb-w-mobile) 1fr;
    grid-template-areas:
      "thumb header"
      "thumb excerpt";
  }
  .list__thumbnail {
    width: var(--thumb-w-mobile);
    height: var(--thumb-h-mobile);
  }
  .list__thumbnail img,
  .list__thumbnail .thumbnail__image {
    width: var(--thumb-w-mobile);
    height: var(--thumb-h-mobile);
    max-width: var(--thumb-w-mobile);
  }
}

/* ===== Site header / nav ===== */

.logo__text,
.logo__title,
.logo__link,
.logo__link:visited { color: var(--accent-primary); }

.menu__link { color: #ddd; }
.menu__link:hover { color: var(--accent-secondary); }

/* ===== Sidebar widget headers ===== */
.widget__title,
.widget-taglist__title { color: var(--accent-primary); }

/* ===== Single post pages ===== */

.post__title,
.post__title a,
.post__content h1 { color: var(--accent-primary); }

.post__content h2,
.post__content h3,
.post__content h4,
.post__content h5 { color: black; }

.post__content a,
.post__content a:visited { color: var(--accent-primary); }
.post__content a:hover { color: var(--accent-secondary); }

/* ===== Widen the main content area ===== */

.container.container--outer {
  max-width: 95vw;
  width: 95vw;
}
.container { max-width: 95vw; }

@media (min-width: 2000px) {
  .container.container--outer,
  .container {
    max-width: 1600px;
    width: 1600px;
  }
}

/* ===== Column widths: wider posts column, narrower sidebar ===== */

.primary { flex: 1 0 80%; }
.sidebar { flex: 1 0 17.5%; }

/* ===== Images inside post bodies — fit to content column ===== */

.post__content img {
  max-width: 100%;
  max-height: 600px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 1rem auto;
  border-radius: 2px;
}

/* ===== Float images for magazine-style text wrap ===== */

.post__content img.float-right,
.post__content .float-right {
  float: right;
  margin: 0.25rem 0 1rem 1.5rem;
  max-width: 45%;
  max-height: none;
  display: inline;
}

.post__content img.float-left,
.post__content .float-left {
  float: left;
  margin: 0.25rem 1.5rem 1rem 0;
  max-width: 45%;
  max-height: none;
  display: inline;
}

/* Optional border styling for floated images */
.post__content img.float-right,
.post__content img.float-left {
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 4px;
  background: #fff;
}

/* Clear floats to break out below an image */
.post__content .clear {
  clear: both;
  display: block;
}

/* On mobile, drop the float so images stack normally */
@media (max-width: 600px) {
  .post__content img.float-right,
  .post__content img.float-left,
  .post__content .float-right,
  .post__content .float-left {
    float: none;
    max-width: 100%;
    margin: 1rem auto;
    display: block;
  }
}

/* ===== Figures (captions) ===== */
.post__content figure {
  margin: 1.5rem 0;
  text-align: center;
}
.post__content figure img {
  margin: 0 auto;
}
.post__content figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.7;
  font-style: italic;
}

/* ===== Image gallery — grid layout with auto-fit columns ===== */

.post__content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 1.5rem 0;
  clear: both;
}

.post__content .gallery a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: #222;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--color-border);
}

.post__content .gallery img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: transform 0.3s ease;
}

.post__content .gallery a:hover img {
  transform: scale(1.05);
}

/* Caption variant — use <figure> instead of <a> */
.post__content .gallery figure {
  margin: 0;
  text-align: center;
}
.post__content .gallery figcaption {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}
