/**
 * Footer Styles - Compiled from LocalGov Base Theme and East Cambs Custom Theme
 *
 * This file contains:
 * 1. Base footer styles from localgov_base theme
 * 2. Pre-footer section (3 columns above main footer)
 * 3. Main footer section
 * 4. Post-footer section (3 columns below main footer)
 * 5. Housekeeping/copyright section
 * 6. Custom East Cambs overrides and styling
 */


/* ============================================
   BASE FOOTER STYLES (from localgov_base)
   ============================================ */

.lgd-footer {
  margin-block-start: clamp(1rem, 10vw, var(--section-spacing-vertical-footer));
}

/* ============================================
   PRE-FOOTER SECTION
   ============================================ */

.lgd-footer__pre-footer {
  padding-block: clamp(1rem, 10vw, var(--section-spacing-vertical-pre-footer));
  color: var(--color-pre-footer-text);
  background-color: var(--color-section-pre-footer-bg);
}

.lgd-footer__pre-footer a {
  color: var(--color-pre-footer-link);
}

/* Headings in pre-footer */
.lgd-footer__pre-footer h2,
.lgd-footer__pre-footer h3,
.lgd-footer__pre-footer h4,
.lgd-footer__pre-footer h5,
.lgd-footer__pre-footer h6 {
  color: var(--color-pre-footer-heading);
}

/* ============================================
   MAIN FOOTER SECTION
   ============================================ */

.lgd-footer__footer {
  padding-block: clamp(1rem, 10vw, var(--section-spacing-vertical-footer));
  color: var(--color-footer-text);
  background-color:white;
}

.lgd-footer__footer a {
  color: var(--color-footer-link);
}

/* Custom override - force black color for footer links */
.lgd-footer__footer a {
  color: black !important;
}

/* Headings in main footer */
.lgd-footer__footer h2,
.lgd-footer__footer h3,
.lgd-footer__footer h4,
.lgd-footer__footer h5,
.lgd-footer__footer h6 {
  color: var(--color-footer-heading);
}

/* ============================================
   POST-FOOTER SECTION
   ============================================ */

.lgd-footer__post-footer {
  padding-block: clamp(1rem, 10vw, var(--section-spacing-vertical-post-footer));
  color: var(--color-post-footer-text);
  background-color: var(--color-section-post-footer-bg);
}

.lgd-footer__post-footer a {
  color: var(--color-post-footer-link);
}

/* Headings in post-footer */
.lgd-footer__post-footer h2,
.lgd-footer__post-footer h3,
.lgd-footer__post-footer h4,
.lgd-footer__post-footer h5,
.lgd-footer__post-footer h6 {
  color: var(--color-post-footer-heading);
}

/* ============================================
   HOUSEKEEPING / COPYRIGHT SECTION
   ============================================ */

.lgd-footer__housekeeping {
  padding-block: var(--section-spacing-vertical-housekeeping);
  color: var(--color-housekeeping-text);
  background-color: var(--color-section-housekeeping-bg);
}

.lgd-footer__housekeeping a {
  color: var(--color-housekeeping-link);
}

/* Headings in housekeeping */
.lgd-footer__housekeeping h2,
.lgd-footer__housekeeping h3,
.lgd-footer__housekeeping h4,
.lgd-footer__housekeeping h5,
.lgd-footer__housekeeping h6 {
  color: var(--color-housekeeping-heading);
}

/* ============================================
   CUSTOM EAST CAMBS FOOTER BLOCKS
   ============================================ */

/* Footer Name and Address Block */
#block-eastcambs-theme-footernameandaddress {
  padding: 0.5rem 0;
  position: relative;
}

#block-eastcambs-theme-footernameandaddress:before {
  content: "";
  background-color: #f3f3f3;;
  width: 100dvw;
  height: 100%;
  position: absolute;
  top: 0;
  left: calc((100dvw - 100%) / 2 * -1);
}

#block-eastcambs-theme-footernameandaddress .field--name-body {
  position: relative;
}

.footer-name {
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.5rem;
  margin-bottom: 0;
}

.footer-address {
  font-weight: 500;
  font-size: 1.2rem;
  margin-bottom: 0;
}

/* Social Sharing Buttons */
#block-localgov-base-bettersocialsharingbuttons {
  float: right;
  margin-top: -3rem;
  position: relative;
}

#block-localgov-base-bettersocialsharingbuttons .contextual {
  display: none;
}

.social-sharing-buttons__button {
  display: inline-flex;
  background-color: transparent;
}

.social-sharing-buttons__button svg {
  display: block;
}

/* Footer Menu Block */
#block-eastcambs-theme-footermenu {
  background-color: white;
  padding: 1rem 0;
}

#block-eastcambs-theme-footermenu ul:not(.contextual-links) {
  padding-inline-start: 0;
}

#block-eastcambs-theme-footermenu ul:not(.contextual-links) li {
  list-style: none;
  display: inline-block;
  font-size: 1rem;
  font-weight: 300;
}

@media screen and (min-width: 768px) {
  #block-eastcambs-theme-footermenu ul:not(.contextual-links) li {
    margin-right: 3rem;
  }
}

#block-eastcambs-theme-footermenu ul:not(.contextual-links) li a {
  text-decoration: none;
}

#block-eastcambs-theme-footermenu ul:not(.contextual-links) li a:hover {
  text-decoration: underline;
}

/* ============================================
   MOBILE RESPONSIVE OVERRIDES (480px)
   ============================================ */

@media screen and (max-width: 480px) {
  .footer-name {
    line-height: 2rem !important;
  }

  #block-eastcambs-theme-footernameandaddress {
    padding: 1rem 0 0.5rem !important;
  }

  #block-localgov-base-bettersocialsharingbuttons p {
    margin: 0;
  }
}

/* ============================================
   TABLET/MOBILE RESPONSIVE (720px)
   ============================================ */

@media screen and (max-width: 768px) {
  #block-eastcambs-theme-footermenu ul:not(.contextual-links) {
    display: grid;
    align-items: center;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 3rem;
  }
}

@media screen and (max-width: 720px) {
  #block-localgov-base-bettersocialsharingbuttons {
    margin: 0;
    float: unset;
  }

  #block-localgov-base-bettersocialsharingbuttons:before {
    content: "";
    background-color: var(--color-grey-lighter);
    width: 100dvw;
    height: 100%;
    position: absolute;
    top: 0;
    left: calc((100dvw - 100%) / 2 * -1);
  }

  #block-localgov-base-bettersocialsharingbuttons .social-sharing-buttons {
    position: relative;
  }
}
