/*
Theme Name: Dorset Cereals
Theme URI: https://dorsetcereals.co.uk/
Author: William Jeffree
Author URI: https://dorsetcereals.co.uk/
Description: Custom theme for the Dorset Cereals website.
Version: 1.0.7
Text Domain: dorset-cereals
*/

@font-face {
  font-family: "Gotham Pro";
  src: url("assets/fonts/GothamPro-Medium.woff2") format("woff2"),
       url("assets/fonts/GothamPro-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gotham Pro";
  src: url("assets/fonts/GothamPro.woff2") format("woff2"),
       url("assets/fonts/GothamPro.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --dc-bg: #004446;
  --dc-text: #ffffff;
  --dc-muted: rgba(255, 255, 255, 0.9);
  --dc-accent: #8cf3f4;
  --dc-border: rgba(255, 255, 255, 0.28);
  --dc-max-width: 78.25rem;
  --dc-paper-texture: url("assets/Background-Texture-Supplied-1.png");
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--dc-page-bg, var(--dc-bg));
  color: var(--dc-text);
  font-family: "Gotham Pro", "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--dc-paper-texture);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.55;
  mix-blend-mode: multiply;
  pointer-events: none;
}

a {
  color: var(--dc-accent);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Gotham Pro", "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  line-height: 1.4;
  margin: 0 0 0.75rem;
  color: var(--dc-text);
}

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

p {
  margin: 0 0 1.25rem;
  color: var(--dc-muted);
}

main {
  max-width: var(--dc-max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

main.page-standard {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.page:not(.dc-coming-soon-page) {
  overflow-x: hidden;
  overflow-x: clip;
}

.site-main {
  position: relative;
  z-index: 1;
}

.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

.product-theme--full {
  margin: 0 0 2.5rem;
  padding: 0;
  border-radius: 0;
}

body.single-product {
  --dc-text: #ffffff;
  --dc-muted: rgba(255, 255, 255, 0.9);
  --dc-border: rgba(255, 255, 255, 0.35);
  --dc-accent: #8cf3f4;
}

body.single-product a {
  color: var(--dc-accent);
}

.site-header {
  border-bottom: 0 solid var(--dc-border);
  background: transparent;
}

.site-header__inner {
  max-width: var(--dc-max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dc-text);
}

.site-logo--image .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.site-logo--image .custom-logo {
  max-height: 40px;
  width: auto;
}

.site-header__nav {
  margin-left: auto;
}

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

.site-header__menu li {
  margin: 0;
}

.site-header__menu a {
  color: var(--dc-text);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.92;
  transition: color 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header__menu a:hover,
.site-header__menu a:focus {
  text-decoration: none;
  color: #fff;
  opacity: 1;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
}

.site-footer__inner {
  width: min(100%, var(--dc-max-width));
  max-width: var(--dc-max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

.site-footer__heading {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.95);
}

.site-footer__heading--sub {
  margin-top: 1rem;
}

.site-footer__brand {
  margin: 0 0 0.65rem;
}

.site-footer__logo {
  display: inline-block;
}

.site-footer__logo-image {
  max-height: 40px;
  width: auto;
  display: block;
}

.site-footer__tagline {
  margin-bottom: 0.55rem;
}

.site-footer p {
  margin: 0 0 0.45rem;
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.92);
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
}

.site-footer__social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.site-footer__social-list li {
  margin: 0;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transform: scale(1);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), border-color 240ms ease, color 240ms ease;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus {
  border-color: #fff;
  color: #fff;
  text-decoration: none;
  transform: scale(1.12);
}

.site-footer__social-link i {
  font-size: 1.08rem;
  line-height: 1;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-footer__social-link:hover i,
.site-footer__social-link:focus i {
  transform: scale(1.08);
}

.site-footer__social-empty {
  text-align: center;
}

.site-footer__col--social {
  text-align: center;
}

.site-footer__col--contact {
  text-align: right;
}

.site-footer__menu-nav {
  margin: 0 0 1rem;
}

.site-footer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.site-footer__menu li {
  margin: 0;
}

.site-footer__menu a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer__menu a:hover,
.site-footer__menu a:focus {
  color: #fff;
  text-decoration: none;
}

.site-footer__legal-divider {
  margin-top: 1.6rem;
  margin-bottom: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.site-footer__legal-line {
  margin: 0 auto;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.4;
}

.site-footer__copyright-line {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer__registration-line {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.92);
}

.site-footer__registered-address-line {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.84);
}

.product-hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
}

.product-hero__media {
  padding: 0;
  display: block;
}

.product-hero__media img {
  width: 100%;
  max-width: 100%;
}

.product-hero__title {
  font-size: clamp(2rem, 3vw, 2.75rem);
  color: var(--dc-palette-secondary);
}

.product-hero__summary {
  font-size: 1.05rem;
}

.product-hero__description {
  font-size: 1.05rem;
  color: var(--dc-text);
}

.product-hero__ingredients p {
  color: var(--dc-text);
}

.product-hero__ingredients-note {
  margin: -0.625rem 0 1rem;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: var(--dc-muted);
}

.product-hero__may-also-contain {
  margin: 0.8rem 0 0;
  color: var(--dc-muted);
}

.product-hero__ingredients strong {
  font-weight: 700;
}

.product-hero__ingredients h2,
.product-hero__nutrition h2 {
  margin-top: 1rem;
}

.product-meta {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--dc-muted);
}

.product-hero__nutrition {
  margin-top: 1.25rem;
}

.product-hero__nutrition h2 {
  margin-bottom: 0.75rem;
}

.product-meta__divider {
  margin: 0 0.35rem;
  color: var(--dc-border);
}

.product-card {
  background: #fff;
  border: 1px solid var(--dc-border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 8px 18px rgba(30, 28, 24, 0.05);
}

.product-theme {
  --dc-page-bg: var(--dc-bg);
}

.product-theme .product-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(1px);
}

body.single-product .product-theme .product-card {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: var(--dc-palette-secondary);
  box-shadow: none;
}

.page-standard__hero {
  position: relative;
  /* Locked banner ratios — 20:7 desktop, 1:1 mobile.
     --dc-page-desktop / --dc-page-mobile are set as inline CSS custom properties from PHP.
     If no mobile image is uploaded, PHP passes the desktop URL for both. */
  width: 100%;
  aspect-ratio: 20 / 7;
  min-height: 220px;
  display: grid;
  place-items: center;
  background-color: #03292b;
  background-image: var(--dc-page-desktop);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

@media (max-width: 768px) {
  .page-standard__hero {
    aspect-ratio: 1 / 1;
    background-image: var(--dc-page-mobile);
  }
}

.page-standard__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--dc-overlay-opacity, 0.42));
  pointer-events: none;
}

.page-standard__hero-inner {
  position: relative;
  z-index: 1;
  width: min(100%, var(--dc-max-width));
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
  text-align: center;
}

.page-standard__title {
  margin: 0;
  color: #fff;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.page-standard__intro {
  margin: 0.85rem auto 0;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  line-height: 1.45;
}

.page-standard__content-wrap {
  width: min(100%, var(--dc-max-width));
  margin: 0 auto;
  margin-top: 1.6rem;
  padding: 2.4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}

.page-standard__content-wrap--single-column {
  grid-template-columns: 1fr;
}

.product-directory__content-wrap {
  grid-template-columns: 1fr;
}

.product-directory__intro {
  margin-bottom: 0.75rem;
}

.page-standard__content p {
  color: var(--dc-muted);
}

.page-standard__supporting {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.page-standard__supporting--floating {
  position: relative;
  min-height: 30rem;
}

.page-standard__supporting-item {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.page-standard__supporting-item img {
  width: 100%;
  height: auto;
  display: block;
}

.product-card--details {
  margin-top: 0;
  border-radius: 0;
  border: 0;
  border-top: 5px solid #fff;
}

.product-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 2rem;
}

.product-related {
  margin-top: 2.25rem;
}

.product-related h2 {
  margin: 60px 0 40px;
  text-align: center;
}

.product-directory .product-related h2 {
  margin-top: 0;
}

.product-related__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.product-related__link {
  display: block;
  width: min(220px, 100%);
  color: inherit;
  text-decoration: none;
}

.product-related__link:hover,
.product-related__link:focus {
  text-decoration: none;
}

.product-related__thumb {
  position: relative;
  display: block;
  overflow: hidden;
}

.product-related__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}

.product-related__link:hover .product-related__thumb::after,
.product-related__link:focus .product-related__thumb::after {
  opacity: 1;
}

.product-related__link img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 280ms ease;
}

.product-related__link:hover img,
.product-related__link:focus img {
  transform: scale(1.01);
}

.product-related__placeholder {
  min-height: 160px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  opacity: 0.85;
}

.product-related h3 {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  color: var(--dc-text);
  text-align: center;
}

/* ── Homepage template ────────────────────────────────────────────────────── */

/* No extra padding — .page-standard__content-wrap handles its own top spacing,
   matching the gap used on regular page banners. */
.dc-homepage__content-section {
  padding: 0;
}

/* Product range section sits flush with the content above it */
.dc-homepage__product-section {
  padding-bottom: 4rem;
}

/* Use the same max-width container used elsewhere on standard pages */
.dc-homepage__content-section .page-standard__content-wrap,
.dc-homepage__product-section {
  max-width: var(--dc-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Slide headings on the homepage use <h2> so the page retains a proper
   heading hierarchy — style them to match the h1 used on Coming Soon */
.dc-coming-soon__slide-heading {
  font-size: clamp(1rem, 2.5vw, 1.7rem);
}

/* ─────────────────────────────────────────────────────────────────────────── */

body.has-fade-in .fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

body.has-fade-in .fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.has-fade-in .page-standard__title.fade-in {
  transition-duration: 1200ms;
}

@media (prefers-reduced-motion: reduce) {
  body.has-fade-in .fade-in,
  body.has-fade-in .fade-in.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.product-details {
  display: grid;
  gap: 1.5rem;
}

.product-details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 1rem;
  align-items: start;
}

.product-details-layout--no-media {
  grid-template-columns: 1fr;
}

.product-details-panel--draggable {
  margin-top: 0;
}

.product-details-layout__copy p {
  color: var(--dc-muted);
}

.product-details-layout__media {
  display: grid;
  gap: 0.9rem;
}

.product-details-layout__media--draggable {
  position: relative;
  min-height: 30rem;
}

.product-details-layout__image {
  margin: 0;
  background: transparent;
}

.product-details-layout__image img {
  width: 100%;
  height: auto;
  display: block;
}

.product-details-layout__image--side-pack img {
  width: auto;
  max-width: min(100%, 13.5rem);
  max-height: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.product-details__item h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--dc-text);
}

.nutrition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: #fff;
}

.nutrition-table caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dc-text);
}

.nutrition-table th,
.nutrition-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--dc-border);
  border-right: 1px solid var(--dc-border);
}

.nutrition-table thead th {
  background: #f4f1ea;
  text-align: right;
  color: var(--dc-text);
  font-weight: 600;
  border-top: 1px solid var(--dc-border);
}

.nutrition-table thead th:first-child {
  text-align: left;
}

.nutrition-table tbody th {
  text-align: left;
  color: var(--dc-text);
  font-weight: 500;
  background: #f8f6f2;
}

.nutrition-table td {
  text-align: right;
  color: var(--dc-muted);
}

body.single-product .nutrition-table {
  background: transparent;
}

body.single-product .nutrition-table thead th {
  background: rgba(255, 255, 255, 0.14);
}

body.single-product .nutrition-table tbody th {
  background: rgba(255, 255, 255, 0.1);
}

body.single-product .nutrition-table td,
body.single-product .nutrition-table th,
body.single-product .nutrition-note,
body.single-product .product-hero__description,
body.single-product .product-hero__ingredients p,
body.single-product .product-meta {
  color: var(--dc-muted);
}

body.single-product .nutrition-table th,
body.single-product .nutrition-table td {
  border-color: var(--dc-palette-secondary);
}

.nutrition-table tr:last-child th,
.nutrition-table tr:last-child td {
  border-bottom: none;
}

.nutrition-table th:last-child,
.nutrition-table td:last-child {
  border-right: none;
}

.nutrition-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--dc-muted);
}

@media (max-width: 900px) {

  .product-hero {
    grid-template-columns: 1fr;
  }

  .product-columns {
    grid-template-columns: 1fr;
  }

  .page-standard__content-wrap {
    grid-template-columns: 1fr;
  }

  .page-standard__supporting {
    min-height: 0;
  }

  .product-related__link {
    width: min(200px, calc(50% - 0.55rem));
  }

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

  .site-footer__inner {
    padding: 1.8rem 1.5rem;
  }

  .product-details-layout {
    grid-template-columns: 1fr;
  }

  .product-details-layout__media--draggable {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .product-related__link {
    width: 100%;
    max-width: 320px;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .site-footer__col--contact {
    text-align: left;
  }

  .site-footer__menu {
    align-items: flex-start;
  }
}

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

hr {
  border: 0;
  border-top: 1px solid var(--dc-border);
  margin: 2rem 0;
}
