/**
 * =============================================================================
 * BLOCK: Site Footer (.site-footer)
 * =============================================================================
 * Extracted from the validated Crops page footer CSS.
 * 3-column layout: Main Pages | Tagline + Newsletter | Policies + Social.
 *
 * A7 (2026-07): hardcoded font-size / spacing / rgba values replaced by their
 * exact-match design tokens (no visual delta). Off-scale one-offs (30px, 50px,
 * 44px control sizes, 0.6/0.25 alphas, 520/1440px, 1px borders) left as-is.
 * =============================================================================
 */

.site-footer {
  background: var(--color-secondary);
  padding: var(--space-30) 0 var(--space-20);
  border-top: 1px solid var(--color-white-10);
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--padding-x);
}

/* --- Logo section with decorative divider lines --- */
.footer-logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-10);
  margin-bottom: 50px;
}

.footer-logo-section::before,
.footer-logo-section::after {
  content: '';
  flex: 1;
  height: 1px;
}

.footer-logo-section::before {
  background: linear-gradient(90deg, transparent, var(--color-white-20));
}

.footer-logo-section::after {
  background: linear-gradient(90deg, var(--color-white-20), transparent);
}

.footer-logo {
  height: 40px;
}

.footer-logo img {
  height: 100%;
  width: auto;
}

/* --- 3-column grid --- */
.footer-main {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: var(--space-40);
  margin-bottom: 50px;
}

/* Balance the row: the last column (Policies + Social) hugs the content's
   right edge, mirroring the left column, instead of sitting left-aligned in
   its cell and leaving a wide gap on the right. */
.footer-main > .footer-column:last-child {
  text-align: right;
}

.footer-main > .footer-column:last-child .footer-social {
  justify-content: flex-end;
}

/* Footer column titles are <h2>: the footer has no <h2>/<h3> ancestor, so
   h3/h4 broke the document outline. Sizes are set here, not by the tag. */
.footer-column h2 {
  font-family: var(--font-gilroy);
  font-size: var(--text-xl);
  margin-bottom: var(--space-12);
  color: var(--color-white);
  font-weight: var(--fw-bold);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-7);
}

.footer-links a {
  font-family: var(--font-inter);
  color: var(--color-white-70);
  text-decoration: none;
  transition: color var(--transition-base);
  font-weight: var(--fw-regular);
  font-size: var(--text-md);
}

.footer-links a:hover {
  color: var(--color-white);
}

/* "Cookie settings": a button (it opens the consent banner, it goes nowhere),
   styled like the links around it. */
.footer-links__button {
  font-family: var(--font-inter);
  font-weight: var(--fw-regular);
  font-size: var(--text-md);
  color: var(--color-white-70);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-base);
}

.footer-links__button:hover,
.footer-links__button:focus-visible {
  color: var(--color-white);
}

/* --- Center column: tagline + newsletter --- */
.footer-center {
  text-align: center;
}

.footer-center h2 {
  font-family: var(--font-gilroy);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  margin-bottom: 30px;
  line-height: 1.3;
}

.footer-newsletter {
  display: flex;
  gap: 0;
  background: var(--color-white-15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  overflow: hidden;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-12);
  max-width: 520px;
  margin: 0 auto;
}

.footer-newsletter input {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--space-5) 0;
  color: var(--color-white);
  font-family: var(--font-inter);
  font-size: var(--text-md);
  font-weight: var(--fw-regular);
}

.footer-newsletter input::placeholder {
  color: var(--color-white-50);
}

.footer-newsletter input:focus {
  outline: none;
}

.footer-newsletter button {
  background: var(--color-white);
  border: none;
  border-radius: var(--radius-circle);
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-base);
  color: var(--color-secondary);
}

.footer-newsletter button:hover {
  transform: scale(1.05);
}

.footer-newsletter button svg {
  width: 20px;
  height: 20px;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-8);
  font-family: var(--font-inter);
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.6);
  font-weight: var(--fw-regular);
}

.footer-info svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* --- GDPR consent checkbox ---
   Sits inside the <form> but outside the pill (.footer-newsletter), so the
   pill keeps its fixed flex row. Muted like .footer-info: it is a legal
   mention, it should not compete with the field above it. */
.footer-consent {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-3);
  /* Narrower than the 520px pill so the two lines of text sit visually inside
     it rather than spilling past its edges. */
  max-width: 460px;
  margin: var(--space-5) auto 0;
  /* The column is centred, but a two-line legal sentence reads far better
     flush left against its own checkbox. */
  text-align: left;
  cursor: pointer;
}

.footer-consent__box {
  /* accent-color styles the native control, so there is no custom box to keep
     in sync with the browser's focus ring and checked state. */
  accent-color: var(--color-light-green);
  width: 16px;
  height: 16px;
  min-width: 16px;
  /* Optical alignment with the cap height of the first line. */
  margin-top: 3px;
  cursor: pointer;
}

.footer-consent__text {
  font-family: var(--font-inter);
  /* Off the type scale on purpose: the smallest token is --text-xs (12px) and
     the sentence needs 10px to fit on one line in the 438px of text space left
     inside the 460px block (measured: 13px wants 522px, 11px wants 441px,
     10px wants 401px). Editing the wording or widening the block are the two
     things that will break the single line, so re-measure if either changes. */
  font-size: 10px;
  font-weight: var(--fw-regular);
  /* Roomier than the 1.45 used at 13px: at this size the line needs the air,
     and there is only one line to space out anyway. */
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

/* Hold the single line only where there is room for it. Narrow screens give
   the block ~328px of text space, so one line is impossible at any readable
   size there and it must be allowed to wrap: an unconditional `nowrap` would
   push the sentence out of the viewport instead. */
@media (min-width: 768px) {
  .footer-consent__text {
    white-space: nowrap;
  }
}

.footer-consent__text a {
  color: var(--color-white);
  text-decoration: underline;
}

.footer-consent__text a:hover {
  color: var(--color-light-green);
}

/* Flagged by the view script when someone submits without ticking. */
.footer-consent.is-missing .footer-consent__text {
  color: var(--color-red-500);
}

.footer-consent.is-missing .footer-consent__box {
  outline: 2px solid var(--color-red-500);
  outline-offset: 2px;
}

/* --- Newsletter feedback message --- */
.footer-newsletter-msg {
  text-align: center;
  margin-top: var(--space-6);
  font-family: var(--font-inter);
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
}

.footer-newsletter-msg.is-success {
  color: var(--color-light-green);
}

.footer-newsletter-msg.is-error {
  color: var(--color-red-500);
}

/* --- Social section --- */
.footer-social-section {
  margin-top: var(--space-20);
}

.footer-social-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-8);
}

.footer-social {
  display: flex;
  gap: var(--space-6);
}

.footer-social a {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-white);
  /* Unified brand colour for every social icon (was two hardcoded greens). */
  background: var(--color-light-green); /* #8FBF48 */
  transition:
    background var(--transition-base),
    transform var(--transition-base);
}

/* Hover: the green circle fades out (only the white glyph remains over the
   footer), then lifts slightly for feedback. */
.footer-social a:hover {
  background: transparent;
  transform: translateY(-2px);
}

/* --- Bottom bar --- */
.footer-bottom {
  padding-top: 50px;
  border-top: 1px solid var(--color-white-15);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-10);
}

.footer-bottom p {
  font-family: var(--font-inter);
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.6);
  font-weight: var(--fw-regular);
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  .footer-container {
    padding: 0 var(--padding-x-md);
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-20);
    text-align: center;
  }

  /* Reset the desktop right-alignment of the last column (Policies + Social)
     so it centers like the other columns on mobile. These override the
     higher-specificity desktop rules further up the file. */
  .footer-main > .footer-column:last-child {
    text-align: center;
  }

  .footer-main > .footer-column:last-child .footer-social {
    justify-content: center;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4) var(--space-10);
  }

  .footer-links li {
    margin-bottom: 0;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-social-section {
    margin-top: var(--space-12);
  }
}

@media (max-width: 767px) {
  .footer-container {
    padding: 0 var(--padding-x-sm);
  }

  .footer-main {
    gap: 30px;
  }

  .footer-center h2 {
    font-size: 24px;
  }
}
