/*
Theme Name: Evesham Market
Author: Evesham Market
Version: 1.0.0
Description: Evesham Charter Market branding, Alegreya typography and responsive WordPress layouts.
Text Domain: evesham-market
*/

:root {
  --em-background: #fff;
  --em-surface: #fff;
  --em-text: #181d19;
  --em-muted: #545f57;
  --em-green: #007533;
  --em-red: #80158a;
  --em-blue: #164c35;
  --em-green-light: #edf5ee;
  --em-red-light: #f5edf6;
  --em-blue-light: #f4f1e5;
  --em-accent: var(--em-green);
  --em-border: #ccd7cd;
  --em-gold: #d0a820;
  --em-asparagus: #71b14b;
  --em-heading: "Alegreya", Georgia, serif;
  --em-body: "Alegreya", Georgia, serif;
  --em-content-width: 52rem;
  --em-wide-width: 76rem;
  --em-gutter: clamp(1rem, 4vw, 2rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--em-text);
  background: var(--em-background);
  font-family: var(--em-body);
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--em-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

:focus-visible {
  outline: 3px solid var(--em-accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.65em;
  font-family: var(--em-heading);
  font-weight: 700;
  line-height: 1.12;
}

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

h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
}

h3 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

p,
ul,
ol,
blockquote,
figure {
  margin-top: 0;
  margin-bottom: 1.25em;
}

blockquote {
  margin-left: 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--em-accent);
  font-size: 1.2em;
}

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

button,
.button,
.wp-element-button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--em-accent);
  border-radius: 0;
  color: var(--em-surface);
  background: var(--em-accent);
  font-family: var(--em-heading);
  cursor: pointer;
}

.green {
  background-color: var(--em-green);
}

.red {
  background-color: var(--em-red);
}

.blue {
  background-color: var(--em-blue);
}

.greenlight {
  background-color: var(--em-green-light);
}

.redlight {
  background-color: var(--em-red-light);
}

.bluelight {
  background-color: var(--em-blue-light);
}

input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--em-border);
  border-radius: 0;
  color: var(--em-text);
  background: var(--em-surface);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  padding: 0.7rem 1rem;
  clip: auto;
  color: var(--em-surface);
  background: var(--em-text);
}

.site-header {
  position: relative;
  border-bottom: 1px solid var(--em-border);
}

.site-header__inner,
.site-footer__inner,
.site-main,
.page-header {
  width: min(100% - (2 * var(--em-gutter)), var(--em-wide-width));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  min-height: 8.5rem;
  padding-block: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

.custom-logo-link {
  display: block;
}

.custom-logo {
  width: auto;
  max-height: 6.5rem;
  max-width: 6.5rem;
}

.site-title {
  margin: 0;
  font-family: var(--em-heading);
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 700;
  max-width: 15rem;
  line-height: 1;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

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

.menu-toggle {
  display: none;
}

.primary-menu,
.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu a,
.footer-menu a {
  color: inherit;
  font-family: var(--em-heading);
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.footer-menu a:hover {
  color: var(--em-accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.site-main {
  min-height: 60vh;
  padding-block: clamp(2.25rem, 5vw, 4.5rem);
}

.page-header {
  padding-top: clamp(2.25rem, 5vw, 4.5rem);
}

.page-header + .site-main {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.entry,
.content-narrow,
.comments-area,
.post-navigation {
  width: min(100%, var(--em-content-width));
  margin-inline: auto;
}

.entry + .entry {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding-top: clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--em-border);
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-title {
  overflow-wrap: anywhere;
}

.entry-title a {
  color: inherit;
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--em-accent);
}

.entry-meta,
.entry-footer,
.archive-description,
.search-summary {
  color: var(--em-muted);
  font-size: 0.9rem;
}

.entry-meta {
  margin-top: -0.65rem;
}

.entry-thumbnail {
  margin-bottom: 2rem;
}

.entry-content > :where(*),
.entry-summary > :where(*) {
  max-width: var(--em-content-width);
  margin-inline: auto;
}

.entry-content > .alignwide,
.entry-summary > .alignwide {
  width: min(var(--em-wide-width), calc(100vw - (2 * var(--em-gutter))));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.entry-content > .alignfull,
.entry-summary > .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.wp-block-separator {
  border: 0;
  border-top: 1px solid var(--em-border);
}

.wp-block-table table {
  border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
  padding: 0.6rem;
  border: 1px solid var(--em-border);
}

.em-three-cta {
  margin-block: clamp(2.5rem, 6vw, 5rem);
}

.em-three-cta__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
}

.em-three-cta__column {
  display: flex;
  min-width: 0;
  min-height: 21rem;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 3rem);
}

.em-three-cta__column > :last-child {
  margin-bottom: 0;
}

.em-three-cta__column .wp-block-buttons {
  margin-top: auto;
  padding-top: 1.5rem;
}

.em-three-cta__column .wp-block-button {
  background: transparent;
}

.em-three-cta__column .wp-block-button__link {
  border: 1px solid transparent;
  color: var(--em-surface);
  text-decoration: none;
}

.em-three-cta__column .wp-block-button.green .wp-block-button__link {
  border-color: var(--em-green);
  background-color: var(--em-green);
}

.em-three-cta__column .wp-block-button.red .wp-block-button__link {
  border-color: var(--em-red);
  background-color: var(--em-red);
}

.em-three-cta__column .wp-block-button.blue .wp-block-button__link {
  border-color: var(--em-blue);
  background-color: var(--em-blue);
}

.em-three-cta__column .wp-block-button__link:hover {
  filter: brightness(0.88);
}

.pagination,
.posts-navigation,
.post-navigation {
  margin-top: 3rem;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-next {
  margin-left: auto;
  text-align: right;
}

.comments-area {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--em-border);
}

.comment-list {
  padding-left: 1.25rem;
}

.site-footer {
  padding-block: 2.5rem;
  border-top: 4px solid var(--em-green);
  color: #fff;
  background: #123d28;
  font-size: 0.9rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 64rem) {
  .em-three-cta__columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .em-three-cta__column {
    min-height: 0;
  }
}

@media (max-width: 48rem) {
  .site-header__inner {
    min-height: 6rem;
    gap: 0.75rem;
  }

  .menu-toggle {
    display: none;
    flex: 0 0 auto;
    min-height: 2.4rem;
    padding: 0.35rem 0.65rem;
  }

  .site-navigation {
    position: absolute;
    z-index: 20;
    top: 100%;
    right: 0;
    left: 0;
    display: block;
    padding: 1rem var(--em-gutter) 1.4rem;
    border-bottom: 1px solid var(--em-border);
    background: var(--em-background);
  }

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

  .primary-menu {
    display: grid;
    gap: 0.85rem;
  }

  .primary-menu a {
    display: block;
    font-size: 1.25rem;
  }

  .site-footer__inner {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}


.em-three-cta__column {
	position: relative;
	cursor: pointer;
}

.em-three-cta__column .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.em-three-cta__column:has(.wp-block-button__link:hover) {
	filter: brightness(0.97);
}

.em-three-cta__column:has(.wp-block-button__link:focus-visible) {
	outline: 3px solid currentColor;
	outline-offset: -3px;
}

.em-three-cta__column .wp-block-heading {
	font-size: clamp(1.55rem, 2.8vw, 2.15rem);
	overflow-wrap: normal;
	word-break: normal;
	hyphens: none;
}
/* Brand details and shared content controls. Existing em-* tokens remain available to plugins. */
.site-header::before {
  content: "";
  display: block;
  height: 7px;
  background: var(--em-green);
}
.site-header::after {
  content: "";
  position: absolute;
  bottom: -5px;
  inset-inline: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, #181d19 0 16px, #fff 16px 32px);
}
.primary-menu { align-items: center; }
.primary-menu a { display: inline-block; padding-block: .55rem; font-weight: 600; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #fff; }
.site-main .entry-header { padding-bottom: 1.25rem; border-bottom: 1px solid var(--em-border); }
.site-main .entry-header::after { content: ""; display: block; width: 3rem; height: 4px; margin-top: 1.25rem; background: var(--em-green); }
.home .site-main > .entry > .entry-header { margin-bottom: 2.5rem; }
.home .entry-header .entry-title { color: var(--em-green); font-size: clamp(2.5rem, 6vw, 4.25rem); }
.entry-content { overflow-wrap: break-word; }
.entry-content :where(h2,h3,h4) { margin-top: 1.5em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content :where(table) { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.entry-content :where(th,td) { padding: .7rem .85rem; border: 1px solid var(--em-border); text-align: left; vertical-align: top; }
.entry-content :where(th) { background: var(--em-green-light); font-weight: 700; }
.entry-content :where(tbody tr:nth-child(even)) { background: #f6f8f4; }
.wp-block-table { overflow-x: auto; }
input[type="checkbox"], input[type="radio"] { width: 1.1em; height: 1.1em; accent-color: var(--em-green); vertical-align: middle; flex: 0 0 auto; }
input[type="file"] { max-width: 100%; }
input:disabled, button:disabled, select:disabled { cursor: not-allowed; opacity: .65; }
button, .button, .wp-element-button, input[type="submit"] { font-weight: 600; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
button:hover, .button:hover, .wp-element-button:hover, input[type="submit"]:hover { background-color: #005b28; color: #fff; }
.wp-block-button.is-style-outline .wp-block-button__link { color: var(--em-green); background: transparent; }
.wp-block-button.is-style-outline .wp-block-button__link:hover { color: #fff; background: var(--em-green); }
.em-three-cta__column p { max-width: 36ch; }
.em-three-cta__column .wp-block-heading { margin-top: 0; }
.em-three-cta__column .wp-block-button__link:focus-visible { outline-offset: 5px; }
.em-three-cta__column .wp-block-button__link { text-decoration: none; }
.em-three-cta__column { cursor: auto; }
/* Extended link belongs only to a panel containing a single destination. */
.em-three-cta__column a:not(.wp-block-button__link), .em-three-cta__column button, .em-three-cta__column input { position: relative; z-index: 2; }
@media (max-width: 60rem) and (min-width: 48.01rem) {
  .site-header__inner { flex-wrap: wrap; gap: .5rem 2rem; }
  .site-navigation { width: 100%; }
}
@media (max-width: 48rem) {
  .site-header__inner { flex-wrap: wrap; }
  .site-branding { flex: 1; gap: .65rem; }
  .custom-logo { width: 4.25rem; max-height: 4.25rem; }
  .site-wordmark { max-width: 12rem; }
  .site-title { font-size: 1.2rem; line-height: 1.1; }
  .site-description { display: none; }
  .site-navigation { position: static; width: 100%; }
  .site-header.has-navigation-js .menu-toggle { display: inline-flex; }
  .site-header.has-navigation-js .site-navigation { display: none; }
  .site-header.has-navigation-js .site-navigation.is-open { display: block; }
  .primary-menu a { min-height: 44px; }
  .entry-content :where(th,td) { padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  button, .button, .wp-element-button, input[type="submit"] { transition: none; }
}
@media print {
  .site-navigation, .menu-toggle, .site-header::after { display: none !important; }
  .site-footer { background: white; color: black; }
  .site-footer a { color: black; }
  .site-main { width: 100%; padding: 1rem 0; }
}
