/*
 * V3 site-shell module: site-footer
 *
 * CSS isolation: every selector rooted under
 *   .pd-section--site-footer[data-pd-module]
 *
 * Class/attribute selectors only - no element selectors.
 *
 * Canonical tokens used:
 *   --pd-color-surface, --pd-color-surface-alt, --pd-color-text,
 *   --pd-color-muted, --pd-color-muted-bg, --pd-color-border,
 *   --pd-color-primary, --pd-color-secondary, --pd-color-on-dark,
 *   --pd-color-on-secondary
 *   --pd-font-heading, --pd-font-body
 *   --pd-radius-sm, --pd-radius-md
 *   --pd-space-2, --pd-space-3, --pd-space-4, --pd-space-5,
 *   --pd-space-6, --pd-space-8
 *
 * Variants:
 *   simple      site name + footer nav + copyright
 *   columns     brand + nav + contact / social columns
 *   compact     single-row footer
 *   cta-footer  closing CTA strip + columns layout below
 *   widgets     four WP sidebars rendered as a 4-column grid
 *               (collapses to 2 then 1) with a brand + nav + social
 *               meta row above the copyright row. Falls back to the
 *               simple variant in PHP when all four sidebars are empty,
 *               so no widget-specific CSS is needed for the empty case.
 */

.pd-section--site-footer[data-pd-module] {
  display: block;
  width: 100%;
  margin-top: auto;
  background: var(--pd-color-surface-alt);
  color: var(--pd-color-text);
  font-family: var(--pd-font-body);
  border-top: 1px solid var(--pd-color-border);
  padding-block: var(--pd-space-8);
  box-sizing: border-box;
}

.pd-section--site-footer[data-pd-module][data-surface="surface"] {
  background: var(--pd-color-surface);
}
.pd-section--site-footer[data-pd-module][data-surface="surface-alt"] {
  background: var(--pd-color-surface-alt);
}
.pd-section--site-footer[data-pd-module][data-surface="primary"] {
  background: var(--pd-color-primary);
  color: var(--pd-color-on-dark);
  border-top-color: transparent;
}
.pd-section--site-footer[data-pd-module][data-surface="secondary"] {
  background: var(--pd-color-secondary);
  color: var(--pd-color-on-secondary);
  border-top-color: transparent;
}
.pd-section--site-footer[data-pd-module][data-surface="transparent"] {
  background: transparent;
  border-top-color: transparent;
}

.pd-section--site-footer[data-pd-module][data-surface="primary"] .pd-site-footer__copy,
.pd-section--site-footer[data-pd-module][data-surface="secondary"] .pd-site-footer__copy,
.pd-section--site-footer[data-pd-module][data-surface="primary"] .pd-site-footer__tagline,
.pd-section--site-footer[data-pd-module][data-surface="secondary"] .pd-site-footer__tagline {
  color: var(--pd-color-surface);
  opacity: 0.85;
}
/* Social row contrast on dark tones. The shared .pd-social-link
 * primitive (components.css) inherits color, so on primary/secondary
 * surfaces icons render in --pd-color-on-dark via the surface root
 * color flip. The hover background is intentionally lifted on dark
 * surfaces so the rounded hit-target stays visible. */
.pd-section--site-footer[data-pd-module][data-surface="primary"] .pd-social-link:hover,
.pd-section--site-footer[data-pd-module][data-surface="secondary"] .pd-social-link:hover,
.pd-section--site-footer[data-pd-module][data-surface="primary"] .pd-social-link:focus-visible,
.pd-section--site-footer[data-pd-module][data-surface="secondary"] .pd-social-link:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: var(--pd-color-on-dark);
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__social-row {
  display: inline-flex;
  align-items: center;
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-6);
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-3);
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__logo {
  display: block;
  max-height: 2.5rem;
  width: auto;
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__name {
  font-family: var(--pd-font-heading);
  font-weight: 700;
  font-size: 1.0625rem;
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__nav-region {
  min-width: 0;
}

/* Footer nav-list / nav-link / contact-list / social rules are kernel-
 * owned (see components.css) so the section CSS does not need to
 * redeclare them under its module scope. Variant-specific overrides
 * below use class/attribute selectors only. */

.pd-section--site-footer[data-pd-module] .pd-site-footer__copy-row {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-2);
  padding-top: var(--pd-space-4);
  border-top: 1px solid var(--pd-color-border);
  font-size: 0.875rem;
}

.pd-section--site-footer[data-pd-module][data-surface="primary"] .pd-site-footer__copy-row,
.pd-section--site-footer[data-pd-module][data-surface="secondary"] .pd-site-footer__copy-row {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__copy-contact {
  margin: 0;
  color: var(--pd-color-muted);
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__contact-summary {
  margin: 0;
  color: var(--pd-color-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.pd-section--site-footer[data-pd-module] .pd-site-footer__address {
  margin: 0;
  font-style: normal;
  white-space: pre-wrap;
}

@media (min-width: 36rem) {
  .pd-section--site-footer[data-pd-module] .pd-site-footer__copy-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Variant: simple */
.pd-section--site-footer[data-pd-module][data-pd-variant="simple"] .pd-site-footer__simple-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pd-space-4);
  text-align: center;
}

.pd-section--site-footer[data-pd-module][data-pd-variant="simple"] .pd-site-footer__nav-list--centered {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--pd-space-2) var(--pd-space-5);
}

/* Variant: compact */
.pd-section--site-footer[data-pd-module][data-pd-variant="compact"] {
  padding-block: var(--pd-space-5);
}
.pd-section--site-footer[data-pd-module][data-pd-variant="compact"] .pd-site-footer__compact-row {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-3);
  align-items: center;
  text-align: center;
}
.pd-section--site-footer[data-pd-module][data-pd-variant="compact"] .pd-site-footer__nav-list--compact {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--pd-space-2) var(--pd-space-4);
  font-size: 0.875rem;
}

@media (min-width: 36rem) {
  .pd-section--site-footer[data-pd-module][data-pd-variant="compact"] .pd-site-footer__compact-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

/* Variant: columns and cta-footer share the columns layout */
.pd-section--site-footer[data-pd-module][data-pd-variant="columns"] .pd-site-footer__columns,
.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pd-space-6);
}

@media (min-width: 48rem) {
  .pd-section--site-footer[data-pd-module][data-pd-variant="columns"] .pd-site-footer__columns,
  .pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__columns {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--pd-space-8);
  }
}

.pd-section--site-footer[data-pd-module][data-pd-variant="columns"] .pd-site-footer__contact-column,
.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__contact-column {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-4);
}

/* Variant: cta-footer strip */
.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__cta-strip {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-3);
  align-items: flex-start;
  padding: var(--pd-space-6);
  border-radius: var(--pd-radius-md);
  background: var(--pd-color-surface);
  border: 1px solid var(--pd-color-border);
  margin-bottom: var(--pd-space-3);
}

.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"][data-surface="primary"] .pd-site-footer__cta-strip,
.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"][data-surface="secondary"] .pd-site-footer__cta-strip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__cta-intro {
  margin: 0;
  font-family: var(--pd-font-heading);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.3;
}

.pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__cta-button {
  align-self: flex-start;
}

@media (min-width: 48rem) {
  .pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__cta-strip {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--pd-space-5);
  }
  .pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__cta-intro {
    flex: 1 1 auto;
  }
  .pd-section--site-footer[data-pd-module][data-pd-variant="cta-footer"] .pd-site-footer__cta-button {
    flex: 0 0 auto;
  }
}

/* Variant: widgets */
.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widgets {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pd-space-6);
}

@media (min-width: 36rem) {
  .pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--pd-space-6) var(--pd-space-8);
  }
}

@media (min-width: 60rem) {
  .pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widgets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--pd-space-6) var(--pd-space-8);
  }
}

.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widget-area {
  display: flex;
  flex-direction: column;
  gap: var(--pd-space-3);
  min-width: 0;
}

.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widget {
  display: block;
  margin: 0;
}

.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widget + .pd-site-footer__widget {
  margin-top: var(--pd-space-4);
}

.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widget-title {
  margin: 0 0 var(--pd-space-2);
  font-family: var(--pd-font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: inherit;
}

.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widgets-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pd-space-3);
  text-align: center;
  margin-top: var(--pd-space-6);
  padding-top: var(--pd-space-5);
  border-top: 1px solid var(--pd-color-border);
}

.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"][data-surface="primary"] .pd-site-footer__widgets-meta,
.pd-section--site-footer[data-pd-module][data-pd-variant="widgets"][data-surface="secondary"] .pd-site-footer__widgets-meta {
  border-top-color: rgba(255, 255, 255, 0.18);
}

@media (min-width: 48rem) {
  .pd-section--site-footer[data-pd-module][data-pd-variant="widgets"] .pd-site-footer__widgets-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-section--site-footer[data-pd-module] .pd-site-footer__nav-list [href],
  .pd-section--site-footer[data-pd-module] .pd-site-footer__nav-link {
    transition: none;
  }
}
