/*
Theme Name: Minimal Foundation
Theme URI: https://theedgeofeternity.com/
Author: David Ellinger / ChatGPT
Description: A lightweight, Classic Editor friendly WordPress theme with clean defaults, standard links, simple menus, and minimal styling.
Version: 1.7.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minimal-foundation
*/

:root {
  --mf-white: #ffffff;
  --mf-soft-white: #f7f7f7;
  --mf-cream: #fff3d0;
  --mf-cream-strong: #fff7df;
  --mf-text: #111111;
  --mf-body-text: #222222;
  --mf-muted: #555555;
  --mf-line: #dddddd;
  --mf-line-soft: #eeeeee;

  --mf-link: #0000ee;
  --mf-link-hover: #0000cc;
  --mf-link-visited: #551a8b;

  --mf-gold: #ffd86b;
  --mf-blue: #4fa3ff;
  --mf-cyan: #48e6ff;
  --mf-red: #ff5b52;
  --mf-green: #8ee878;
  --mf-violet: #b98cff;

  --mf-max-width: 1100px;
  --mf-content-width: 980px;
  --mf-radius: 14px;
}

/* Predictable sizing prevents padded 100% containers from overflowing. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Base document */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--mf-body-text);
  background: var(--mf-white);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

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

input,
select,
textarea,
button {
  max-width: 100%;
  font: inherit;
}

/* Standard links */
a,
a:link {
  color: var(--mf-link);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:visited {
  color: var(--mf-link-visited);
}

a:hover,
a:focus-visible {
  color: var(--mf-link-hover);
}


.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  color: var(--mf-text);
  background: var(--mf-gold);
  font-weight: 900;
}

.skip-link:focus {
  left: 0.75rem;
}

/* Header */
.site-header {
  color: var(--mf-text);
  background: var(--mf-white);
  border-bottom: 1px solid var(--mf-line);
}

.site-header-inner {
  width: min(100%, var(--mf-max-width));
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin: 0;
  border: 0;
  line-height: 1;
  text-decoration: none;
}

.custom-logo {
  display: block;
  width: auto;
  max-height: 82px;
}

.site-title {
  margin: 0;
  color: var(--mf-text);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 850;
  line-height: 1.1;
}

.site-title a,
.site-title a:link,
.site-title a:visited {
  color: var(--mf-text);
  text-decoration: none;
}

.site-title a:hover,
.site-title a:focus-visible {
  color: var(--mf-text);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.site-description {
  margin: 0.2rem 0 0;
  color: var(--mf-muted);
  font-size: 0.95rem;
}

/* Navigation */
.site-navigation {
  display: flex;
  align-items: center;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu li {
  margin: 0;
  padding: 0;
}

.primary-menu a,
.primary-menu a:link {
  color: var(--mf-link);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.primary-menu a:visited {
  color: var(--mf-link-visited);
}

.primary-menu a:hover,
.primary-menu a:focus-visible {
  color: var(--mf-link-hover);
}


/* Breadcrumbs */
.mf-breadcrumbs {
  margin: 0 0 1rem;
  color: var(--mf-muted);
  font-size: 0.95rem;
}

.mf-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mf-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.mf-breadcrumbs li + li::before {
  content: "/";
  color: var(--mf-muted);
}

.mf-breadcrumbs a,
.mf-breadcrumbs a:link {
  color: var(--mf-link);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.mf-breadcrumbs span[aria-current="page"] {
  color: var(--mf-muted);
}

/* Layout */
.site-main {
  background: var(--mf-white);
}

.content-wrap {
  width: min(100%, var(--mf-content-width));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1.25rem;
}

.breadcrumb-wrap {
  padding-top: 1rem;
  padding-bottom: 0;
}

.breadcrumb-wrap .mf-breadcrumbs {
  margin-bottom: 0;
}

.entry-title {
  margin: 0 0 1.2rem;
  color: var(--mf-text);
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.entry-content > :first-child {
  margin-top: 0;
}

.entry-content > :last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  color: var(--mf-text);
  background: var(--mf-white);
  border-top: 1px solid var(--mf-line);
}

.site-footer-inner {
  width: min(100%, var(--mf-max-width));
  margin: 0 auto;
  padding: 1.15rem 1.25rem;
  color: var(--mf-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* Simple reusable content helpers */
.front-page-content,
.raw-page-content {
  margin: 0;
  padding: 0;
}

.mf-section {
  padding: 1.25rem 0;
  background: var(--mf-white);
}

.front-page-content > .mf-section:first-child,
.raw-page-content > .mf-section:first-child {
  padding-top: 2rem;
}

.front-page-content > .mf-section:last-of-type,
.raw-page-content > .mf-section:last-of-type {
  padding-bottom: 1.5rem;
}

.mf-section + .mf-section {
  border-top: 1px solid var(--mf-line-soft);
}

.mf-container {
  width: min(100%, var(--mf-content-width));
  margin: 0 auto;
  padding: 0 1.25rem;
}

.mf-section h1,
.mf-section h2,
.mf-section h3,
.mf-faq-section h1,
.mf-faq-section h2,
.mf-faq-section h3 {
  margin: 0;
  color: var(--mf-text);
  line-height: 1.15;
}

.mf-section p,
.mf-faq-section p {
  margin: 0;
}

.mf-divider {
  height: 6px;
  width: 100%;
  margin: 0 0 0.75rem;
  border: 0;
  background: var(--mf-blue);
}

.mf-divider.gold { background: var(--mf-gold); }
.mf-divider.blue { background: var(--mf-blue); }
.mf-divider.cyan { background: var(--mf-cyan); }
.mf-divider.red { background: var(--mf-red); }
.mf-divider.green { background: var(--mf-green); }
.mf-divider.violet { background: var(--mf-violet); }

.mf-kicker {
  margin: 0 0 0.45rem;
  color: var(--mf-muted);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mf-lead {
  max-width: 760px;
  margin: 0.7rem 0 0;
  font-size: clamp(1.08rem, 2.1vw, 1.26rem);
}

.mf-container > p:not([class]) {
  margin-top: 0.85rem;
}

.mf-card {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  background: var(--mf-white);
}

.mf-note {
  margin: 0.85rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 7px solid var(--mf-gold);
  border-radius: var(--mf-radius);
  background: var(--mf-cream-strong);
  color: var(--mf-text);
  font-weight: 650;
}

.mf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.mf-mini-card {
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  background: var(--mf-soft-white);
  overflow: hidden;
}

.mf-mini-card-title {
  margin: 0;
  padding: 0.7rem 0.9rem;
  color: var(--mf-text);
  font-weight: 850;
  background: var(--mf-gold);
}

.mf-mini-card-body {
  padding: 0.9rem;
}

.mf-mini-card-body p {
  margin: 0;
}

.mf-mini-card:nth-child(1) .mf-mini-card-title { background: var(--mf-blue); }
.mf-mini-card:nth-child(2) .mf-mini-card-title { background: var(--mf-violet); }
.mf-mini-card:nth-child(3) .mf-mini-card-title { background: var(--mf-gold); }
.mf-mini-card:nth-child(4) .mf-mini-card-title { background: var(--mf-green); }

.mf-button {
  display: inline-flex;
  max-width: 100%;
  text-align: center;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.72rem 1rem;
  border: 2px solid var(--mf-text);
  border-radius: 999px;
  color: var(--mf-text) !important;
  background: var(--mf-gold);
  font-weight: 900;
  text-decoration: none !important;
}

.mf-button:hover,
.mf-button:focus-visible {
  color: var(--mf-text) !important;
  background: var(--mf-cyan);
}

.mf-button-secondary {
  background: var(--mf-soft-white);
}

.mf-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

/* Dedicated 404 page */
.error-404 {
  max-width: 760px;
}

.error-404 > :last-child {
  margin-bottom: 0;
}

.entry-content a,
.raw-page-content a,
.error-404 a:not(.mf-button) {
  overflow-wrap: anywhere;
}

/* FAQ helper classes */
.mf-faq-section {
  padding: 1.35rem 0;
  background: var(--mf-cream);
  color: var(--mf-text);
  border-top: 1px solid #eadfce;
  border-bottom: 1px solid #eadfce;
}

.mf-faq {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mf-faq details {
  border: 1px solid var(--mf-line);
  border-left: 7px solid var(--mf-gold);
  border-radius: var(--mf-radius);
  background: var(--mf-white);
  overflow: hidden;
}

.mf-faq details:nth-child(6n+1) { border-left-color: var(--mf-gold); }
.mf-faq details:nth-child(6n+2) { border-left-color: var(--mf-blue); }
.mf-faq details:nth-child(6n+3) { border-left-color: var(--mf-cyan); }
.mf-faq details:nth-child(6n+4) { border-left-color: var(--mf-green); }
.mf-faq details:nth-child(6n+5) { border-left-color: var(--mf-violet); }
.mf-faq details:nth-child(6n+6) { border-left-color: var(--mf-red); }

.mf-faq summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  color: var(--mf-text);
  background: var(--mf-white);
  font-weight: 850;
}

.mf-faq details[open] summary {
  border-bottom: 1px solid var(--mf-line);
  background: #fffaf0;
}

.mf-faq-answer {
  padding: 0.85rem 1rem 1rem;
  color: var(--mf-text);
  background: var(--mf-white);
}

.mf-faq-answer p {
  margin: 0;
}



.mf-support-reminder {
  margin: 0.85rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 7px solid var(--mf-green);
  border-radius: var(--mf-radius);
  background: var(--mf-soft-white);
  color: var(--mf-text);
  font-weight: 650;
}

.mf-support-list {
  margin: 0.85rem 0 0 1.25rem;
  padding: 0;
}

.mf-support-list li {
  margin: 0.25rem 0;
  padding: 0;
}

.mf-closing-note {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-left: 7px solid var(--mf-violet);
  border-radius: var(--mf-radius);
  background: var(--mf-cream-strong);
  color: var(--mf-text);
  font-weight: 650;
}

/* Donation page helpers */
.mf-donate-panel {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--mf-line);
  border-left: 7px solid var(--mf-gold);
  border-radius: var(--mf-radius);
  background: var(--mf-cream-strong);
  color: var(--mf-text);
}

.mf-donate-panel > :first-child {
  margin-top: 0;
}

.mf-donate-panel > :last-child {
  margin-bottom: 0;
}

.mf-donation-shortcode {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  background: var(--mf-soft-white);
}

.mf-donation-shortcode > :first-child {
  margin-top: 0;
}

.mf-donation-shortcode > :last-child {
  margin-bottom: 0;
}

/* Blog, archive cards, search, and sharing */
.mf-blog-header {
  margin-bottom: 1.5rem;
}

.mf-blog-intro {
  max-width: 760px;
  margin: -0.35rem 0 1.25rem;
}

.mf-blog-intro > :first-child {
  margin-top: 0;
}

.mf-blog-intro > :last-child {
  margin-bottom: 0;
}

.mf-blog-search {
  max-width: 760px;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  background: var(--mf-soft-white);
}

.mf-blog-search label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--mf-text);
  font-weight: 800;
}

.mf-search-controls {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

.mf-search-controls input[type="search"] {
  flex: 1 1 18rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 2px solid #777777;
  border-radius: 8px;
  color: var(--mf-text);
  background: var(--mf-white);
}

.mf-search-controls button {
  flex: 0 0 auto;
  padding: 0.65rem 1rem;
  border: 2px solid var(--mf-text);
  border-radius: 8px;
  color: var(--mf-text);
  background: var(--mf-gold);
  font-weight: 850;
  cursor: pointer;
}

.mf-search-controls button:hover,
.mf-search-controls button:focus-visible {
  background: var(--mf-cyan);
}

.mf-blog-list {
  margin-top: 1rem;
}

.post-summary {
  padding: 1.35rem 0;
  border-top: 1px solid var(--mf-line-soft);
}

.post-summary:first-of-type {
  border-top: 0;
}

.mf-post-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.mf-post-thumbnail {
  display: block;
  flex: 0 0 min(var(--mf-archive-thumbnail-width, 150px), 32%);
  width: min(var(--mf-archive-thumbnail-width, 150px), 32%);
  border: 1px solid var(--mf-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--mf-soft-white);
  line-height: 0;
}

.mf-post-thumbnail img {
  display: block;
  width: 100%;
  aspect-ratio: 300 / 158;
  object-fit: cover;
}

.mf-post-card-content {
  flex: 1 1 auto;
  min-width: 0;
}

.mf-post-card-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  line-height: 1.25;
}

.post-meta {
  margin: 0.35rem 0 0;
  color: var(--mf-muted);
  font-size: 0.95rem;
}

.mf-post-excerpt {
  margin: 0.65rem 0 0;
}

.mf-share-links {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin: 1.25rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--mf-line-soft);
  font-size: 0.95rem;
}

.mf-share-label {
  color: var(--mf-text);
  font-weight: 850;
}

.mf-share-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mf-share-links li {
  margin: 0;
}

.mf-grouped-search-results {
  margin-top: 1.75rem;
}

.mf-search-group + .mf-search-group {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 4px solid var(--mf-line-soft);
}

.mf-search-group > h2 {
  margin: 0 0 0.8rem;
}

.mf-search-result {
  padding: 1rem 0;
  border-top: 1px solid var(--mf-line-soft);
}

.mf-search-result:first-of-type {
  border-top: 0;
}

.mf-search-result h3,
.mf-search-result p {
  margin-top: 0;
}

.mf-search-result h3 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.mf-search-result p {
  margin-bottom: 0.35rem;
}

.mf-search-source {
  color: var(--mf-muted);
  font-size: 0.92rem;
}

.mf-no-search-results {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 7px solid var(--mf-gold);
  background: var(--mf-cream-strong);
}

.post-navigation {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mf-line-soft);
}

/* Editor-friendly FAQ sections inserted inside normal article content. */
.mf-faq-inline {
  margin: 2rem 0 0;
  padding: 1.25rem;
  border: 1px solid #eadfce;
  border-radius: var(--mf-radius);
}

.mf-faq-inline-inner {
  width: 100%;
  margin: 0 auto;
}

.mf-faq-inline h2,
.mf-faq-inline h3 {
  margin-top: 0;
}

.mf-faq details:target {
  scroll-margin-top: 1.5rem;
  outline: 4px solid var(--mf-cyan);
  outline-offset: 3px;
}

/* Accessibility */
a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 4px solid var(--mf-gold);
  outline-offset: 4px;
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Responsive */
@media (max-width: 820px) {
  .mf-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    font-size: 17px;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .primary-menu {
    gap: 0.8rem;
  }

  .mf-grid-4 {
    grid-template-columns: 1fr;
  }

  .mf-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mf-button {
    width: 100%;
  }

  .mf-search-controls,
  .mf-post-card-inner {
    flex-direction: column;
  }

  .mf-search-controls button,
  .mf-post-thumbnail {
    width: 100%;
  }

  .mf-post-thumbnail {
    max-width: 300px;
  }

  .mf-faq-inline {
    padding: 1rem;
  }
}
