/*
  Ren Faire Fashion theme
  Layered over Clean's /assets/css/styles.css (Bootstrap 5 + Clean Blog).
  Fonts: Cormorant Garamond (display), EB Garamond (body), IM Fell English SC (labels).
*/

:root {
  --rff-parchment: #F4ECDD;
  --rff-ivory: #FBF7EF;
  --rff-ink: #2A211B;
  --rff-ink-soft: #3D322A;
  --rff-umber: #5E5047;
  --rff-accent: #7A2430;       /* oxblood */
  --rff-accent-dark: #561820;
  --rff-forest: #2F4A3A;
  --rff-gilt: #A8833A;         /* rules and ornaments only, never text on parchment */
  --rff-gilt-light: #D9B86A;   /* text on ink only */
  --rff-linen: #E3D5BC;
  --rff-line: #CDBB9C;

  --rff-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --rff-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --rff-label: 'IM Fell English SC', Georgia, 'Times New Roman', serif;

  --rff-wide: 1200px;
  --rff-text: 680px;

  /* Bootstrap variables Clean's CSS reads */
  --bs-body-bg: var(--rff-parchment);
  --bs-body-color: var(--rff-ink);
  --bs-body-font-family: var(--rff-body);
  --bs-primary: var(--rff-accent);
  --bs-primary-rgb: 122, 36, 48;
  --bs-link-color: var(--rff-accent);
  --bs-link-color-rgb: 122, 36, 48;
  --bs-link-hover-color: var(--rff-accent-dark);
  --bs-link-hover-color-rgb: 86, 24, 32;
  --bs-border-color: var(--rff-line);
}

/* ---------- Base ---------- */

html, body {
  background: var(--rff-parchment);
}

body {
  font-family: var(--rff-body);
  font-size: 1.3125rem; /* 21px */
  line-height: 1.7;
  color: var(--rff-ink);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--rff-display);
  font-weight: 600;
  color: var(--rff-ink);
  line-height: 1.12;
}

a {
  color: var(--rff-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover, a:focus {
  color: var(--rff-accent-dark);
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--rff-accent);
  outline-offset: 2px;
}

::selection {
  background: var(--rff-linen);
  color: var(--rff-ink);
}

hr {
  border: 0;
  border-top: 3px double var(--rff-gilt);
  opacity: 1;
}

.text-primary { color: var(--rff-accent) !important; }
.text-muted { color: var(--rff-umber) !important; }

.visually-hidden-label {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rff-label {
  font-family: var(--rff-label);
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  color: var(--rff-accent);
}

.rff-meta {
  font-style: italic;
  font-size: 1rem;
  color: var(--rff-umber);
}

.rff-fleuron {
  color: var(--rff-gilt);
  font-size: 1.375rem;
  letter-spacing: 0.75rem;
  text-align: center;
  line-height: 1;
}

.rff-wide {
  max-width: var(--rff-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.rff-narrow {
  max-width: calc(var(--rff-text) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Masthead ---------- */

.rff-masthead {
  border-bottom: 1px solid var(--rff-line);
}

.rff-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  font-family: var(--rff-label);
  font-size: 1rem;
  color: var(--rff-umber);
}

.rff-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.rff-search input {
  font-family: var(--rff-body);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  width: 200px;
  max-width: 60vw;
  border: 1px solid var(--rff-line);
  background: var(--rff-ivory);
  color: var(--rff-ink);
  border-radius: 0;
}

.rff-brand {
  text-align: center;
  padding-top: 2.5rem;
  padding-bottom: 1.75rem;
}

.rff-brand-name {
  display: inline-block;
  margin: 0.375rem 0 0.25rem;
  font-family: var(--rff-display);
  font-weight: 600;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--rff-ink);
  text-decoration: none;
}

.rff-brand-name:hover {
  color: var(--rff-ink);
}

.rff-tagline {
  margin: 0;
  font-family: var(--rff-display);
  font-style: italic;
  font-size: 1.375rem;
  color: var(--rff-umber);
}

.rff-nav {
  border-top: 3px double var(--rff-gilt);
  border-bottom: 3px double var(--rff-gilt);
}

.rff-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0 1.5rem;
  max-width: var(--rff-wide);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.75rem;
  font-family: var(--rff-label);
  font-size: 1.1875rem;
}

.rff-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 0.25rem;
  color: var(--rff-ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.rff-nav a:hover {
  color: var(--rff-accent);
}

.rff-nav a[aria-current="page"] {
  color: var(--rff-accent);
  border-bottom-color: var(--rff-accent);
}

/* ---------- Page header (non-article pages) ---------- */

.rff-page-header {
  text-align: center;
  padding-top: 3.5rem;
  padding-bottom: 2rem;
}

.rff-page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.rff-page-header .rff-subtitle {
  margin: 0;
  font-family: var(--rff-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--rff-umber);
}

/* ---------- Article header ---------- */

.rff-article-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.rff-article-header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5.5vw, 4.125rem);
  line-height: 1.04;
}

.rff-article-header .rff-subtitle {
  margin: 0;
  font-family: var(--rff-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--rff-umber);
}

.rff-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.rff-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  /* Many images are portraits; keep the head and shoulders in frame */
  object-position: 50% 22%;
}

/* ---------- Content sections ---------- */

.rff-content {
  padding-top: 3rem;
  padding-bottom: 1.5rem;
}

/* Prose blocks keep a readable measure even inside wide pages */
.rff-content .richtext,
.rff-content .code,
.rff-content .video,
.rff-content .image {
  max-width: var(--rff-text);
  margin-left: auto;
  margin-right: auto;
}

.richtext p,
.richtext ul,
.richtext ol {
  margin: 0 0 1.5rem;
}

.richtext h2 {
  margin: 2.75rem 0 1rem;
  font-size: 2.25rem;
}

.richtext h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.75rem;
}

.richtext blockquote,
blockquote {
  margin: 2.5rem 0;
  padding: 1rem 0;
  border: 0;
  border-top: 3px double var(--rff-gilt);
  border-bottom: 3px double var(--rff-gilt);
  text-align: center;
  font-family: var(--rff-display);
  font-style: italic;
  font-size: 2rem;
  line-height: 1.3;
  color: var(--rff-accent);
}

.richtext blockquote p,
blockquote p {
  margin: 0.5rem 0;
}

.richtext img {
  max-width: 100%;
  height: auto;
}

/* Drop cap on the first paragraph of an article */
.rff-article-body > .richtext:first-child > p:first-of-type::first-letter,
.rff-article-body > .umb-block-list > .richtext:first-child > p:first-of-type::first-letter {
  float: left;
  font-family: var(--rff-display);
  font-weight: 700;
  font-size: 5.75rem;
  line-height: 0.82;
  padding: 0.5rem 0.75rem 0 0;
  color: var(--rff-accent);
}

.image .caption,
figcaption,
.caption {
  margin-top: 0.625rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--rff-umber);
  text-align: center;
}

.rff-end-mark {
  margin: 2.5rem 0;
}

/* ---------- Section dividers ---------- */

.rff-divider {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  margin: 4rem 0 2rem;
}

.rff-divider::before,
.rff-divider::after {
  content: "";
  flex: 1;
  border-top: 3px double var(--rff-gilt);
}

.rff-divider h2 {
  margin: 0;
  font-size: 2.125rem;
  text-align: center;
}

/* ---------- Article cards ---------- */

.rff-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 2.5rem;
  align-items: center;
  background: var(--rff-ivory);
  border: 1px solid var(--rff-line);
  padding: 1.5rem;
}

.rff-featured-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rff-featured h2 {
  margin: 0;
  font-size: clamp(2.125rem, 4vw, 3.125rem);
  line-height: 1.08;
}

.rff-featured h2 a {
  color: var(--rff-ink);
  text-decoration: none;
}

.rff-featured h2 a:hover {
  color: var(--rff-accent);
}

.rff-featured p {
  margin: 0;
}

.rff-card-grid {
  display: grid;
  /* Fixed columns so rows stay even whatever the number of cards */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2rem;
}

@media (max-width: 991px) {
  .rff-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .rff-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rff-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--rff-ink);
  text-decoration: none;
}

.rff-card:hover {
  color: var(--rff-ink);
}

.rff-card:hover h3 {
  color: var(--rff-accent);
}

.rff-card h3 {
  margin: 0;
  font-size: 1.875rem;
  line-height: 1.12;
  transition: color 0.15s ease;
}

.rff-card p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--rff-ink-soft);
}

/* Old posts' summaries vary a lot in length; cap them so cards in a row match */
.rff-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

/* Keep dates on a common baseline at the bottom of each card */
.rff-card .rff-meta {
  margin-top: auto;
}

.rff-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 22%;
  background: var(--rff-linen);
}

.rff-featured .rff-thumb {
  aspect-ratio: 4 / 3;
}

/* Image well shown when an article has no main image */
.rff-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--rff-linen);
  background-image: repeating-linear-gradient(135deg, rgba(122, 36, 48, 0.06) 0 2px, transparent 2px 14px);
  color: var(--rff-gilt);
  font-size: 2rem;
}

/* ---------- Buttons ---------- */

.rff-button,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.625rem 1.375rem;
  background: var(--rff-accent);
  border: 1px solid var(--rff-accent);
  border-radius: 0;
  color: var(--rff-ivory);
  font-family: var(--rff-label);
  font-size: 1.125rem;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}

.rff-button:hover,
.btn-primary:hover,
.btn-primary:focus {
  background: var(--rff-accent-dark);
  border-color: var(--rff-accent-dark);
  color: var(--rff-ivory);
}

.rff-button-outline,
.btn-outline-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.625rem 1.5rem;
  background: transparent;
  border: 1px solid var(--rff-accent);
  border-radius: 0;
  color: var(--rff-accent);
  font-family: var(--rff-label);
  font-size: 1.125rem;
  text-transform: none;
  text-decoration: none;
}

.rff-button-outline:hover,
.btn-outline-primary:hover,
.btn-secondary:hover {
  background: var(--rff-accent);
  border-color: var(--rff-accent);
  color: var(--rff-ivory);
}

/* Category pills */
.badge {
  font-family: var(--rff-label);
  font-weight: 400;
  font-size: 0.9375rem;
  background: transparent !important;
  color: var(--rff-accent) !important;
  border: 1px solid var(--rff-line) !important;
  border-radius: 0 !important;
  padding: 0.3rem 0.6rem;
}

/* ---------- Pagination ---------- */

.pagination {
  gap: 0.375rem;
  margin-top: 3rem;
}

/* "Older posts" link under the homepage's latest posts, in place of pagination */
.rff-more {
  margin-top: 3rem;
  text-align: center;
}

.rff-more .rff-button-outline {
  gap: 0.5rem;
}

.pagination .page-link {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  border: 1px solid var(--rff-line);
  background: var(--rff-ivory);
  color: var(--rff-ink);
  font-family: var(--rff-label);
  font-size: 1.0625rem;
}

.pagination strong .page-link,
.pagination .page-link:hover {
  background: var(--rff-accent);
  border-color: var(--rff-accent);
  color: var(--rff-ivory) !important;
}

/* ---------- Author box ---------- */

.rff-author-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  background: var(--rff-ivory);
  border: 1px solid var(--rff-line);
  padding: 1.5rem;
  margin-top: 1rem;
}

.rff-author-box img,
.rff-author-box .rff-avatar-empty {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--rff-linen);
  flex: 0 0 auto;
}

.rff-author-box-body {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.rff-author-box-name {
  font-family: var(--rff-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--rff-ink);
  text-decoration: none;
}

.rff-author-box p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--rff-ink-soft);
}

/* Author cards on the authors list (Clean's markup) */
.card {
  background: var(--rff-ivory);
  border: 1px solid var(--rff-line);
  border-radius: 0;
}

.card-title {
  font-size: 1.75rem;
}

/* Contact form spam trap: off-screen rather than display:none, which some bots skip */
.rff-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Search results ---------- */

.rff-results {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rff-line);
}

.rff-results > li {
  border-bottom: 1px solid var(--rff-line);
}

.rff-result {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  color: var(--rff-ink);
  text-decoration: none;
}

.rff-result:hover {
  color: var(--rff-ink);
}

.rff-result-thumb {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  object-fit: cover;
  background: var(--rff-linen);
  border: 1px solid var(--rff-line);
}

.rff-result-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--rff-gilt);
}

.rff-result-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.rff-result-title {
  font-family: var(--rff-display);
  font-size: 1.625rem;
  line-height: 1.15;
  transition: color 0.15s ease;
}

.rff-result:hover .rff-result-title,
.rff-result:focus-visible .rff-result-title {
  color: var(--rff-accent);
}

.rff-result-summary {
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--rff-ink-soft);
}

@media (max-width: 575px) {
  .rff-result {
    gap: 1rem;
  }

  .rff-result-thumb {
    flex-basis: 84px;
    width: 84px;
    height: 84px;
  }

  .rff-result-title {
    font-size: 1.375rem;
  }
}

/* ---------- Forms (contact, search page) ---------- */

.form-control,
.form-select {
  font-family: var(--rff-body);
  font-size: 1.125rem;
  background: var(--rff-ivory);
  border: 1px solid var(--rff-line);
  border-radius: 0;
  color: var(--rff-ink);
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  background: var(--rff-ivory);
  border-color: var(--rff-accent);
  box-shadow: 0 0 0 2px rgba(122, 36, 48, 0.2);
}

.form-floating > label,
label {
  color: var(--rff-umber);
}

/* ---------- Code blocks (Clean's code snippet row) ---------- */

pre, code {
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */

.rff-footer {
  margin-top: 4.5rem;
  background: var(--rff-ink);
  color: #EADFCB;
  font-size: 1.0625rem;
}

.rff-footer a {
  color: #EADFCB;
}

.rff-footer a:hover {
  color: #FFFFFF;
}

.rff-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.rff-footer-name {
  font-family: var(--rff-display);
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 1.1;
  color: var(--rff-ivory);
}

.rff-footer-tagline {
  margin: 0.5rem 0 0;
  font-style: italic;
  color: var(--rff-line);
}

.rff-footer-heading {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--rff-label);
  color: var(--rff-gilt-light);
}

.rff-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.rff-footer .list-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rff-footer .list-inline img,
.rff-footer .list-inline svg {
  filter: invert(92%) sepia(10%) saturate(300%) hue-rotate(340deg);
}

.rff-footer-legal {
  padding-bottom: 2rem;
  font-size: 0.9375rem;
  color: var(--rff-line);
}

.rff-footer-legal p {
  margin: 0 0 0.25rem;
}

/* Rule sits inside the content width, not across the padding */
.rff-footer-legal p:first-child {
  border-top: 1px solid #4A3D33;
  padding-top: 1.25rem;
}

/* ---------- Clean Blog leftovers ---------- */

/* Clean's fixed navbar and image masthead are replaced; neutralise any leftover spacing */
#mainNav { display: none; }
header.masthead { display: none; }

@media (max-width: 575.98px) {
  body { font-size: 1.1875rem; }
  .rff-topbar { justify-content: center; text-align: center; }
  .rff-featured { padding: 1rem; gap: 1.5rem; }
  .richtext blockquote, blockquote { font-size: 1.625rem; }
}

/* ---------- In-text images ---------- */

/* Images from the old site sit beside the text, as they did there */
.rff-article-body .richtext img,
.rff-article-body .richtext .rff-inline-figure {
  float: left;
  max-width: 45%;
  height: auto;
  margin: 0.35rem 1.5rem 1rem 0;
}

.rff-article-body .richtext img {
  border: 1px solid var(--rff-line);
}

/* A captioned image: the wrapper floats, the image and caption stack inside it */
.rff-article-body .richtext .rff-inline-figure {
  display: block;
  width: min-content;
}

.rff-article-body .richtext .rff-inline-figure img {
  float: none;
  display: block;
  max-width: none;
  margin: 0;
}

/* ---------- Captions ---------- */

.rff-caption {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--rff-body);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--rff-umber);
}

.rff-inline-figure .rff-caption {
  min-width: 8rem;
}

.rff-hero .rff-caption {
  text-align: center;
}

.rff-article-body .richtext h2,
.rff-article-body .richtext h3,
.rff-article-body .richtext h4,
.rff-article-body .richtext hr {
  clear: both;
}

.rff-article-body .richtext::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 575px) {
  .rff-article-body .richtext img,
  .rff-article-body .richtext .rff-inline-figure {
    float: none;
    display: block;
    max-width: 100%;
    margin: 0 auto 1rem;
  }
}

/* ---------- Quote block ---------- */

/* The rules frame the quote and its citation together */
.rff-quote {
  margin: 2.5rem 0;
  padding: 1rem 0;
  border-top: 3px double var(--rff-gilt);
  border-bottom: 3px double var(--rff-gilt);
  text-align: center;
}

.rff-quote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}

.rff-quote figcaption {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--rff-body);
  font-size: 1rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--rff-umber);
}

.rff-quote figcaption::before {
  content: "— ";
}

/* ---------- Image pair carousel ---------- */

.rff-pair {
  margin: 2.5rem 0;
  --swiffy-slider-item-gap: 12px;
  --swiffy-slider-nav-light: var(--rff-ivory);
  --swiffy-slider-nav-dark: var(--rff-accent);
  --swiffy-slider-indicator-active: var(--rff-accent);
}

.rff-pair .slider-container > * img {
  object-position: 50% 22%;
  border: 1px solid var(--rff-line);
}

.rff-pair .slider-indicators > button {
  background-color: var(--rff-line);
}

.rff-pair .slider-indicators > button.active {
  background-color: var(--rff-accent);
}

.rff-pair .rff-caption {
  margin-top: 0.75rem;
}

/* Arrows: ivory discs with oxblood arrows, sitting on the image edges */
.rff-pair .slider-nav {
  opacity: 0.95;
  filter: drop-shadow(0 1px 2px rgba(42, 33, 27, 0.35));
}

/* Keep the pair side by side on phones too (swiffy drops to one image below 62rem) */
@media (max-width: 62rem) {
  .rff-pair .swiffy-slider {
    --swiffy-slider-item-count: 2;
  }
}
