/* Didsbury Wholefoods: tokens, base, header, footer, plain pages and Elementor helpers.
   Pastel on light oat, dark green text, square corners everywhere. */

:root {
  --ink: #1E3F16;        /* dark green: all text */
  --ink-soft: #45603A;   /* secondary text */
  --mid: #296E11;        /* mid green: buttons */
  --sign: #CBE1D5;       /* shop-sign green */
  --oat: #F0F2E7;        /* page background */
  --oat-deep: #E1E4CF;   /* Beth's poster oat, for the odd band */
  --sky: #D9E7F1;
  --lemon: #F6EEB8;
  --pebble: #ECEBE4;
  --deep-sky: #2F6F95;   /* small details only, never text */
  --white: #FFFFFF;
  --line: rgba(30, 63, 22, .16);
  --font: 'soleil', 'Soleil', 'Figtree', system-ui, sans-serif;
}

/* Elementor's global defaults (used by any widget without its own colour or font) follow the brand.
   Beats the kit's .elementor-kit-N rule on specificity. */
body[class*="elementor-kit-"] {
  --e-global-color-primary: #1E3F16;
  --e-global-color-secondary: #1E3F16;
  --e-global-color-text: #1E3F16;
  --e-global-color-accent: #296E11;
  --e-global-typography-primary-font-family: var(--font);
  --e-global-typography-secondary-font-family: var(--font);
  --e-global-typography-text-font-family: var(--font);
  --e-global-typography-accent-font-family: var(--font);
  --e-global-typography-primary-font-weight: 500;
  --e-global-typography-secondary-font-weight: 500;
  --e-global-typography-text-font-weight: 400;
  --e-global-typography-accent-font-weight: 600;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
* { border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--oat); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.6; }
a { color: inherit; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--ink); font-weight: 600; line-height: 1.2; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.caps { text-transform: uppercase; font-weight: 500; line-height: 1.05; letter-spacing: .01em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.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; }
.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 1000; background: var(--white); padding: 10px 14px; }
.skip-link:focus { left: 12px; }

/* Links and buttons. "body" outranks Elementor's .elementor a { text-decoration: none }. */
body a.dw-text-link, .dw-text-link .elementor-heading-title {
  font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
body a.dw-text-link:hover, .dw-text-link:hover .elementor-heading-title, .dw-sign:hover .dw-text-link .elementor-heading-title {
  text-decoration-color: var(--deep-sky); text-decoration-thickness: 2px;
}
.dw-btn, .wp-element-button, .wp-block-button__link {
  display: inline-block; font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: .02em; line-height: 1.6;
  padding: 14px 26px; border: 1px solid var(--mid); border-radius: 0; background: var(--mid); color: #fff;
  text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.dw-btn:hover, .wp-element-button:hover, .wp-block-button__link:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Notes: shop messages as a quiet line, not a box (inc/notices.php). A small coloured label, the sentence, text links,
   and a hairline under it. The selectors with WooCommerce's classes beat its own notice box, icon and clearfix. */
.dw-note, .woocommerce-message.dw-note, .woocommerce-info.dw-note, .woocommerce-error.dw-note {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; width: auto; margin: 0 0 24px; padding: 0 0 12px;
  font-size: 15px; line-height: 1.5; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); list-style: none;
}
.dw-note::before, .dw-note::after { content: none; display: none; }
/* WooCommerce focuses its messages when a page loads, so screen readers read them out. They can't be tabbed to, so no focus box. */
.woocommerce-notices-wrapper:focus, .woocommerce-NoticeGroup:focus, .dw-note:focus { outline: none; }
.dw-note-label { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mid); }
.dw-note--notice .dw-note-label { color: var(--ink-soft); }
.dw-note--error .dw-note-label { color: #B84B5E; }
.dw-note-text, .dw-note-list { flex: 1 1 260px; min-width: 0; margin: 0; }
.dw-note-list { padding: 0; list-style: none; }
.dw-note-list li { margin: 0; padding: 0; list-style: none; }
.dw-note-list li + li { margin-top: 4px; }
.dw-note-list .dw-note-links { margin-left: .5em; }
.dw-note-links { display: inline-flex; flex-wrap: wrap; gap: 4px 18px; }
.dw-note a { color: var(--ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a.dw-note-link { font-weight: 600; text-decoration: underline; white-space: nowrap; }
a.dw-note-link::after { content: " \2192"; }
.dw-note a:hover { text-decoration-color: var(--deep-sky); text-decoration-thickness: 2px; }

/* Floating notes (assets/js/notes.js): a white slip at the top right, under the header; along the bottom on phones.
   The thin bar along its foot runs down while it waits, and stops while it's held. */
.dw-toasts { position: fixed; z-index: 1000; top: var(--dw-toasts-top, 16px); right: 16px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.dw-note.is-floating {
  position: relative; margin: 0; padding: 14px 44px 16px 16px; background: var(--white); border: 1px solid var(--line);
  animation: dw-note-in .25s ease-out both; transition: opacity .3s;
}
.dw-note.is-floating::after {
  content: ""; display: block; position: absolute; left: 0; bottom: 0; height: 2px; background: var(--mid); opacity: .35;
  animation: dw-note-wait var(--dw-wait, 6s) linear forwards;
}
.dw-note.is-held::after { animation-play-state: paused; }
.dw-note.is-leaving { opacity: 0; }
.dw-note-close {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; padding: 0; font: inherit; font-size: 20px; line-height: 1;
  color: var(--ink-soft); background: none; border: 0; cursor: pointer;
}
.dw-note-close:hover, .dw-note-close:focus-visible { color: var(--ink); }
@keyframes dw-note-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes dw-note-wait { from { width: 100%; } to { width: 0; } }
@media (max-width: 640px) {
  .dw-toasts { top: auto; right: 0; bottom: 0; left: 0; width: auto; gap: 0; }
  .dw-note.is-floating { border-width: 1px 0 0; animation-name: dw-note-up; }
  @keyframes dw-note-up { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  .dw-note.is-floating { animation: none; }
}

/* Shown to shop staff, who have no admin bar */
.staff-bar { background: var(--ink); color: var(--oat); font-size: 14px; padding: 7px 0; }
.staff-bar a { color: inherit; text-underline-offset: 3px; }

/* Header */
.site-head { background: var(--oat); border-bottom: 1px solid var(--line); }
.head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-top: 18px; padding-bottom: 18px; }
.nav-list { display: flex; gap: 32px; margin: 0; padding: 0; list-style: none; font-size: 15px; font-weight: 500; }
.nav-l { grid-column: 1; justify-self: end; margin-right: 44px; }
.head-r { grid-column: 3; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-left: 44px; }
.logo { grid-column: 2; display: block; }
.site-head .logo-img { display: block; height: 90px; width: auto; }
.nav a { display: inline-block; white-space: nowrap; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"], .nav .current-menu-item > a { border-bottom-color: var(--deep-sky); }
.basket { display: inline-block; font-size: 15px; color: var(--ink); text-decoration: none; white-space: nowrap; border: 1px solid var(--ink); padding: 7px 13px; }
.basket:hover { background: var(--ink); color: #fff; }
.account-link { display: inline-block; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; }
.account-link:hover { border-bottom-color: var(--line); }
.account-link[aria-current="page"] { border-bottom-color: var(--deep-sky); }
@media (max-width: 1200px) {
  .head { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 22px; padding-top: 16px; padding-bottom: 14px; }
  .head-r { display: contents; }
  .logo { order: -1; flex-basis: 100%; display: flex; justify-content: center; }
  .nav-list { gap: 22px; }
  .nav-l, .nav-r { margin: 0; }
}
@media (max-width: 860px) {
  .site-head .logo-img { height: 76px; }
  .basket { padding: 5px 10px; font-size: 14px; }
  .account-link { font-size: 14px; }
}

/* Footer */
.site-foot { background: var(--sign); padding: 56px 0 28px; }
.foot-logo { display: block; width: fit-content; margin: 0 auto 40px; }
.site-foot .foot-logo-img { display: block; height: 70px; width: auto; }
.foot-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 32px; }
.foot-grid .foot-closed { margin-top: 8px; font-weight: 600; }
.dw-closed-note { margin: 0 0 24px; padding: 12px 16px; background: var(--lemon); color: var(--ink); font-size: 15px; line-height: 1.5; }
.foot-h { font-size: 17px; font-weight: 600; line-height: 1.4; margin: 0 0 6px; }
.foot-grid p { margin: 0; font-size: 15px; }
.credits { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 1100px) { .foot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* Plain pages (basket, checkout, account, policies, posts) */
.page-head { background: var(--oat-deep); padding: 56px 0 44px; }
.page-title { font-size: clamp(34px, 4.4vw, 56px); margin: 0; }
.page-body { padding-top: 48px; padding-bottom: 96px; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 28px 0; border-bottom: 1px solid var(--line); }
.post-list h2 { font-size: 24px; }
.post-list h2 a { text-decoration: none; }
@media (max-width: 760px) { .page-head { padding: 40px 0 30px; } .page-body { padding-top: 32px; padding-bottom: 72px; } }

/* Elementor helpers (Advanced > CSS Classes) */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.elementor-button { border-radius: 0; }
a.e-con { color: inherit; text-decoration: none; }
.dw-ph-label .elementor-heading-title { display: inline-block; font-size: 12px; line-height: 1.4; background: rgba(255, 255, 255, .78); padding: 3px 8px; }
.dw-illo { pointer-events: none; user-select: none; }
