/*
Theme Name: Modern Food Blog
Author: Recipe Relish
Description: A professional modern WordPress food blog theme with editorial homepage sections, recipe cards, category browsing, page templates, responsive menus, widget areas, and polished layouts for posts, pages, archives, search, authors, and 404 pages.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: modern-food-blog
Tags: blog, food-and-drink, custom-background, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, right-sidebar, theme-options, translation-ready, wide-blocks
*/

:root {
  --mfb-bg: #f7f3ee;
  --mfb-surface: #ffffff;
  --mfb-surface-alt: #eef4ee;
  --mfb-ink: #1d1b18;
  --mfb-muted: #706a63;
  --mfb-line: #ded5ca;
  --mfb-primary: #b8322a;
  --mfb-primary-dark: #8f251f;
  --mfb-green: #2f6f55;
  --mfb-yellow: #eab648;
  --mfb-blue: #2f5f79;
  --mfb-shadow: 0 18px 46px rgba(40, 32, 24, 0.12);
  --mfb-radius: 8px;
  --mfb-wrap: min(1180px, calc(100% - 32px));
  --mfb-content: min(780px, calc(100% - 32px));
  --mfb-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mfb-display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--mfb-bg);
  color: var(--mfb-ink);
  font-family: var(--mfb-font);
  line-height: 1.65;
  margin: 0;
  text-rendering: optimizeLegibility;
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  display: block;
  height: auto;
}

a {
  color: var(--mfb-primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: var(--mfb-green);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--mfb-ink);
  font-family: var(--mfb-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.65em;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 5rem);
}

h2 {
  font-size: clamp(1.85rem, 3vw, 3rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

p {
  margin: 0 0 1.1em;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border: 1px solid var(--mfb-line);
  padding: 0.75rem;
  text-align: left;
}

blockquote {
  background: var(--mfb-surface-alt);
  border-left: 4px solid var(--mfb-primary);
  border-radius: var(--mfb-radius);
  color: var(--mfb-muted);
  font-family: var(--mfb-display);
  font-size: 1.28rem;
  margin: 2rem 0;
  padding: 1.1rem 1.3rem;
}

input[type="search"],
input[type="email"],
input[type="text"],
input[type="url"],
input[type="password"],
textarea,
select {
  background: #fff;
  border: 1px solid var(--mfb-line);
  border-radius: 8px;
  color: var(--mfb-ink);
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  width: 100%;
}

textarea {
  min-height: 150px;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(184, 50, 42, 0.28);
  outline-offset: 3px;
}

.wrap {
  margin-inline: auto;
  width: var(--mfb-wrap);
}

.content-wrap {
  margin-inline: auto;
  width: var(--mfb-content);
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.screen-reader-text:focus {
  background: var(--mfb-ink);
  border-radius: 8px;
  clip: auto;
  clip-path: none;
  color: #fff;
  height: auto;
  left: 1rem;
  padding: 0.7rem 1rem;
  top: 1rem;
  width: auto;
  z-index: 100000;
}

.site-header {
  background: rgba(247, 243, 238, 0.95);
  border-bottom: 1px solid var(--mfb-line);
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-bar .site-header {
  top: 32px;
}

.topbar {
  background: var(--mfb-ink);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.topbar .wrap {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 36px;
}

.topbar a {
  color: #fff;
  text-decoration: none;
}

.header-main {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 82px;
}

.site-branding {
  min-width: 190px;
}

.custom-logo-link img {
  max-height: 58px;
  width: auto;
}

.site-title {
  font-family: var(--mfb-display);
  font-size: 1.82rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.site-title a {
  color: var(--mfb-ink);
  text-decoration: none;
}

.site-description {
  color: var(--mfb-muted);
  font-size: 0.84rem;
  margin: 0.35rem 0 0;
}

.main-navigation {
  justify-self: center;
}

.main-navigation ul {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  border-radius: 8px;
  color: var(--mfb-ink);
  display: block;
  font-size: 0.93rem;
  font-weight: 800;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  background: #f3ddd8;
  color: var(--mfb-primary-dark);
}

.menu-toggle {
  align-items: center;
  background: var(--mfb-ink);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: none;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  background: currentColor;
  border-radius: 1px;
  content: "";
  display: block;
  height: 2px;
  position: relative;
  width: 19px;
}

.menu-toggle span::before {
  position: absolute;
  top: -6px;
}

.menu-toggle span::after {
  position: absolute;
  top: 6px;
}

.header-search {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  width: min(292px, 28vw);
}

.search-form {
  align-items: stretch;
  display: flex;
  gap: 0.45rem;
}

.search-form label,
.header-search label {
  flex: 1;
  min-width: 0;
}

.header-search input {
  min-height: 40px;
  padding: 0.55rem 0.72rem;
}

.btn,
button,
input[type="submit"],
.search-submit,
.wp-block-button__link,
.read-more {
  align-items: center;
  background: var(--mfb-primary);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 0.68rem 1rem;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn:hover,
.btn:focus,
button:hover,
input[type="submit"]:hover,
.search-submit:hover,
.wp-block-button__link:hover,
.read-more:hover {
  background: var(--mfb-primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn--ghost {
  background: #fff;
  border-color: var(--mfb-line);
  color: var(--mfb-ink);
}

.btn--ghost:hover,
.btn--ghost:focus {
  background: var(--mfb-green);
  border-color: var(--mfb-green);
  color: #fff;
}

.site-main {
  min-height: 58vh;
}

.hero {
  background: linear-gradient(90deg, rgba(29, 27, 24, 0.73), rgba(29, 27, 24, 0.24)), var(--hero-image, none);
  background-position: center;
  background-size: cover;
  color: #fff;
  min-height: min(700px, calc(100vh - 118px));
  padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(2.5rem, 6vw, 4.8rem);
}

.hero-grid {
  align-items: end;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.hero-content {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  color: var(--mfb-primary);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
}

.hero .eyebrow {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  color: var(--mfb-primary-dark);
  padding: 0.34rem 0.58rem;
}

.hero h1,
.hero p {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.24);
}

.hero p {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  max-width: 650px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--mfb-radius);
  box-shadow: var(--mfb-shadow);
  color: var(--mfb-ink);
  padding: 1.35rem;
}

.hero-panel h2 {
  font-size: 1.35rem;
  margin-bottom: 0.45rem;
}

.hero-panel p {
  color: var(--mfb-muted);
  text-shadow: none;
}

.quick-stats {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1rem;
}

.quick-stats span {
  background: var(--mfb-surface-alt);
  border-radius: 8px;
  display: block;
  font-weight: 900;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.quick-stats small {
  color: var(--mfb-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-block {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-header {
  align-items: end;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.section-header p {
  color: var(--mfb-muted);
  max-width: 580px;
}

.category-rail {
  background: #fff;
  border-bottom: 1px solid var(--mfb-line);
  border-top: 1px solid var(--mfb-line);
  padding: 1rem 0;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-list a,
.category-list span {
  background: var(--mfb-surface-alt);
  border: 1px solid #dbe7d9;
  border-radius: 999px;
  color: var(--mfb-ink);
  display: inline-flex;
  font-weight: 850;
  padding: 0.62rem 0.9rem;
  text-decoration: none;
}

.category-list a:hover {
  background: var(--mfb-green);
  border-color: var(--mfb-green);
  color: #fff;
}

.post-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.post-card,
.widget,
.comment-body,
.single-card,
.not-found {
  background: var(--mfb-surface);
  border: 1px solid var(--mfb-line);
  border-radius: var(--mfb-radius);
  box-shadow: 0 12px 32px rgba(40, 32, 24, 0.07);
  overflow: hidden;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.post-card__image {
  aspect-ratio: 4 / 3;
  background: var(--mfb-surface-alt);
  display: block;
  overflow: hidden;
}

.post-card__image img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
  width: 100%;
}

.post-card:hover .post-card__image img {
  transform: scale(1.04);
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.15rem;
}

.post-card__meta,
.entry-meta,
.entry-footer,
.comment-metadata {
  color: var(--mfb-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 0.45rem 0.75rem;
}

.post-card__title {
  font-size: 1.35rem;
  margin: 0.42rem 0;
}

.post-card__title a,
.entry-title a {
  color: var(--mfb-ink);
  text-decoration: none;
}

.post-card__title a:hover,
.entry-title a:hover {
  color: var(--mfb-primary);
}

.post-card__excerpt {
  color: var(--mfb-muted);
  font-size: 0.94rem;
}

.recipe-facts {
  border-top: 1px solid var(--mfb-line);
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
  padding-top: 0.9rem;
}

.recipe-facts span {
  color: var(--mfb-ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.recipe-facts small {
  color: var(--mfb-muted);
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.featured-layout .post-card:first-child {
  min-height: 100%;
}

.featured-layout .post-card:first-child .post-card__title {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.stacked-cards {
  display: grid;
  gap: 1.25rem;
}

.recipe-finder {
  background: var(--mfb-ink);
  color: #fff;
  padding: clamp(2rem, 5vw, 3.2rem) 0;
}

.recipe-finder h2,
.recipe-finder p,
.recipe-finder .section-kicker {
  color: #fff;
}

.recipe-finder__grid {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
}

.recipe-finder .search-form {
  background: #fff;
  border-radius: var(--mfb-radius);
  padding: 0.55rem;
}

.recipe-finder .search-field {
  border: 0;
}

.about-band {
  background: #fff;
  border-bottom: 1px solid var(--mfb-line);
  border-top: 1px solid var(--mfb-line);
}

.about-grid {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: 0.9fr 1.1fr;
}

.about-image {
  border-radius: var(--mfb-radius);
  box-shadow: var(--mfb-shadow);
  overflow: hidden;
}

.about-image img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.layout-sidebar {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 320px;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.archive-header,
.page-header,
.single-header {
  margin-bottom: 1.8rem;
}

.archive-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-card {
  overflow: hidden;
}

.single-header {
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

.single-featured-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.single-featured-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.entry-content,
.page-content,
.single-content {
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

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

.entry-content a {
  font-weight: 700;
}

.entry-content .alignwide {
  margin-left: max(-120px, calc((100% - var(--mfb-wrap)) / 2));
  margin-right: max(-120px, calc((100% - var(--mfb-wrap)) / 2));
}

.entry-content .wp-block-image,
.entry-content .wp-block-gallery,
.entry-content .wp-block-cover {
  margin: 2rem 0;
}

.entry-footer {
  border-top: 1px solid var(--mfb-line);
  padding-top: 1rem;
}

.post-navigation,
.posts-navigation,
.pagination {
  margin: 2rem 0;
}

.post-navigation .nav-links,
.posts-navigation .nav-links,
.pagination .nav-links,
.page-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.pagination a,
.pagination span,
.page-links a,
.page-links span {
  background: #fff;
  border: 1px solid var(--mfb-line);
  border-radius: 8px;
  color: var(--mfb-ink);
  display: inline-flex;
  min-width: 38px;
  padding: 0.45rem 0.7rem;
  text-align: center;
  text-decoration: none;
}

.pagination .current,
.page-links .current {
  background: var(--mfb-primary);
  color: #fff;
}

.sidebar-area {
  display: grid;
  gap: 1.1rem;
}

.widget {
  padding: 1.25rem;
}

.widget-title,
.widget h2,
.widget h3 {
  font-size: 1.25rem;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget li + li {
  border-top: 1px solid var(--mfb-line);
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.newsletter-band {
  background: var(--mfb-primary);
  color: #fff;
  padding: clamp(2rem, 5vw, 3rem) 0;
}

.newsletter-band h2,
.newsletter-band p,
.newsletter-band .section-kicker {
  color: #fff;
}

.newsletter-grid {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
}

.newsletter-form {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--mfb-radius);
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem;
}

.newsletter-form input {
  border: 0;
}

.newsletter-form button {
  background: var(--mfb-ink);
  white-space: nowrap;
}

.site-footer {
  background: var(--mfb-ink);
  color: #f7efe7;
}

.footer-widgets {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.site-footer a,
.site-footer h2,
.site-footer h3,
.site-footer h4 {
  color: #fff;
}

.site-footer .widget {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: none;
}

.site-info {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  padding: 1.1rem 0;
  text-align: center;
}

.comments-area {
  margin-top: 2rem;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-body {
  margin-bottom: 1rem;
  padding: 1.25rem;
}

.comment-form {
  display: grid;
  gap: 1rem;
}

.comment-form p {
  margin: 0;
}

.error-404 {
  padding: clamp(4rem, 9vw, 7rem) 0;
  text-align: center;
}

.not-found {
  padding: clamp(1.5rem, 5vw, 3rem);
}

.template-intro {
  background: #fff;
  border-bottom: 1px solid var(--mfb-line);
  padding: clamp(2.6rem, 6vw, 4.6rem) 0;
}

.contact-grid {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 0.9fr 1.1fr;
}

.contact-panel {
  background: #fff;
  border: 1px solid var(--mfb-line);
  border-radius: var(--mfb-radius);
  padding: 1.4rem;
}

@media (max-width: 1040px) {
  .header-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .main-navigation,
  .header-search {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .main-navigation {
    display: none;
  }

  .main-navigation.is-open {
    display: block;
  }

  .main-navigation ul {
    align-items: stretch;
    flex-direction: column;
  }

  .header-search {
    width: 100%;
  }

  .hero-grid,
  .layout-sidebar,
  .recipe-finder__grid,
  .newsletter-grid,
  .about-grid,
  .featured-layout,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 520px;
  }

  .post-grid,
  .post-grid--four,
  .archive-grid,
  .footer-widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  :root {
    --mfb-wrap: min(100% - 22px, 1180px);
    --mfb-content: min(100% - 22px, 780px);
  }

  .admin-bar .site-header {
    top: 0;
  }

  .topbar .wrap,
  .section-header,
  .hero-actions,
  .post-navigation .nav-links,
  .posts-navigation .nav-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar .wrap {
    gap: 0.35rem;
    padding: 0.5rem 0;
  }

  .site-title {
    font-size: 1.55rem;
  }

  .header-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 10vw, 2.45rem);
    overflow-wrap: break-word;
  }

  .hero {
    min-height: auto;
  }

  .quick-stats,
  .post-grid,
  .post-grid--four,
  .archive-grid,
  .footer-widgets,
  .sidebar-area {
    grid-template-columns: 1fr;
  }

  .search-form,
  .newsletter-form {
    flex-direction: column;
  }

  .recipe-facts {
    grid-template-columns: 1fr;
  }
}
