footer {
  margin-top: auto;
  font-size: 0.875rem;
}

/* --- top link columns --- */
.footer-top {
  background: var(--footer-top);
  padding: 1.5rem 1.5rem 2rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.footer-columns {
  /* 1152px = the header's 1200px column minus its 1.5rem side gutters; the
     footer bands carry the gutters themselves, so inner content aligns */
  max-width: 1152px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 700px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

/* --- brand head: logo + tagline + social --- */
.footer-head {
  max-width: 1152px;
  margin: 0 auto 1.5rem;
}

.footer-brandrow {
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 2.5rem;
  padding-left: calc(2px + 0.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}

.footer-logo {
  display: inline-block;
  line-height: 0;
}

.footer-logo img {
  height: 90px;
  width: auto;
  display: block;
}

.footer-tagline {
  font-family: var(--font-script);
  font-size: 3rem;
  font-weight: 400;
  line-height: 0.9;
  color: var(--footer-ink);
  margin-bottom: 9px;
}

.footer-tagline:lang(km) {
  font-family: var(--font-script-km);
  font-size: 2.8rem;
  line-height: 1.2;
  margin-bottom: -3.5px;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0 0.85rem calc(2px + 0.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}

.footer-social-link {
  display: inline-flex;
  color: var(--footer-ink);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.footer-social-link svg {
  width: 22px;
  height: 22px;
  display: block;
}

.footer-social-link:hover {
  color: #111;
  transform: translateY(-1px);
}

.footer-col-head {
  align-self: flex-start;
  font-weight: 700;
  font-size: 1.1rem;
  color: #3a3a3a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-left: calc(2px + 0.5rem);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.footer-col a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #3a3a3a;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.footer-col a::before {
  content: "";
  flex-shrink: 0;
  width: 2px;
  height: 0.65em;
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
}

.footer-col a:hover {
  color: #111;
  text-decoration: underline;
}

/* --- bottom bar --- */
.footer-bottom {
  background: var(--footer-bottom);
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-bottom-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-selects {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.footer-flag {
  flex-shrink: 0;
  line-height: 0;
}

/* The wrapper draws the box, so strip the global select's own frame and
   pull its chevron in tight against the text */
.footer-select {
  background-color: transparent;
  background-position: right 0 center;
  border: none;
  outline: none;
  font-size: 0.82rem;
  color: #222;
  padding: 0 0.95rem 0 0;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* --- mobile: stack, everything on one left edge --- */
@media (max-width: 600px) {
  /* The 2px + 0.5rem inherited from the desktop rules is the width of the
     link bullet bar plus its gap, which is what .footer-col-head is indented
     by. Keeping it here is what puts the logo, the icons, the headings and
     the links all on the same left edge. */

  /* logo on top, tagline left-aligned below it */
  .footer-brandrow {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .footer-tagline {
    text-align: left;
    font-size: clamp(1.75rem, 11vw, 3rem);
    line-height: 1;
    margin-bottom: 0;
  }

  .footer-tagline:lang(km) {
    font-size: clamp(1.6rem, 9vw, 2.8rem);
    margin-bottom: 0;
  }

  .footer-social {
    justify-content: flex-start;
  }

  /* single full-width column, so each block starts at the same left edge
     instead of the group being centred as one unit */
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  /* selects above the copyright, both hard left, indented to match the
     band above (the bottom bar has no bullet bars of its own to offset) */
  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-left: calc(2px + 0.5rem);
  }
}
