/* =========================================================
   J Y & CO footer (compact) + side-rail fixes, 20 Nov 2026
   ========================================================= */

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

.footer {
  background: var(--jy-black, #2B323A);
  color: #cfcfca;
  padding: 1.6rem 0 0.9rem;
  margin-top: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

.footer .container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 40px);
  padding-right: clamp(20px, 4vw, 40px);
}

/* Four columns, all top-aligned, same rhythm */
.footer-content {
  display: grid;
  grid-template-columns: repeat(4, auto); justify-content: space-between;
  column-gap: 1.5rem;
  align-items: start;
  gap: 2.25rem;
}

.footer .footer-section h4 {
  position: relative;
  color: #ffffff !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  padding-bottom: 0.45rem;
}

.footer .footer-section h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 2px;
  background: var(--jy-gold, #ffed00);
}

.footer-section p,
.footer-section address {
  color: #cfcfca;
  font-size: 0.88rem;
  font-style: normal;
  line-height: 1.5;
  margin: 0 0 0.4rem;
}

.footer-section .footer-meta {
  color: #9d9a92;
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.footer a,
.footer a:visited,
.footer a[href^="tel"],
.footer a[x-apple-data-detectors],
.footer span[x-apple-data-detectors] {
  color: #cfcfca !important;
  text-decoration: none !important;
  font-size: inherit !important;
  font-family: inherit !important;
  transition: color 0.15s ease;
}

.footer a:hover,
.footer a:focus-visible { color: var(--jy-gold, #ffed00) !important; }

.footer a:focus-visible {
  outline: 2px solid var(--jy-gold, #ffed00);
  outline-offset: 2px;
}

.footer a.footer-map { color: var(--jy-gold, #ffed00) !important; white-space: nowrap; margin-left: 0.9rem; }

/* Link lists: identical spacing in Services and Quick Links */
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  row-gap: 0.32rem;
}

.footer-links li { margin: 0; line-height: 1.4; }

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.footer a.jy-social {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem 0.28rem 0.5rem;
  border: 1px solid rgba(216, 216, 211, 0.28);
  border-radius: 7px;
  font-size: 0.82rem !important;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer a.jy-social:hover,
.footer a.jy-social:focus-visible {
  color: #2B323A !important;
  background: var(--jy-gold, #ffed00);
  border-color: var(--jy-gold, #ffed00);
  outline: none;
}

.footer-info li { color: #cfcfca; }

/* Bottom bar: copyright left, ICAI line centred, legal links right */
.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem 1.5rem;
  margin-top: 1.2rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p { margin: 0; font-size: 0.78rem; color: #8a939c; }
.footer-bottom .footer-icai { color: var(--jy-gold, #ffed00); text-align: center; }

.footer-legal { display: flex; gap: 1.1rem; font-size: 0.78rem; justify-self: end; }

@media (max-width: 1180px) {
  .footer-bottom { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-legal { justify-self: center; }
}

@media (max-width: 1279px) {
  .footer-content { grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; }
}

@media (max-width: 600px) {
  .footer { padding-top: 1.4rem; }
  .footer-content { grid-template-columns: 1fr 1fr; gap: 1.3rem 1.25rem; }
  .footer-content .footer-section:nth-child(-n+2),
  .footer-content .footer-section:nth-child(5) { grid-column: 1 / -1; }
}

/* Deep links to services land below the fixed header */
.service-card[id] { scroll-margin-top: 110px; }

/* =========================================================
   Side navigation rail: one consistent look on every section,
   compact on smaller screens, and hidden while the footer is in view
   ========================================================= */
html body .jy-rail,
html body .jy-rail.on-light {
  background: rgba(36, 36, 36, 0.94) !important;
  border: 1px solid rgba(255, 237, 0, 0.22) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: none !important;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

html body .jy-rail .rail-link,
html body .jy-rail.on-light .rail-link,
html body .jy-rail .rail-list li:last-child .rail-link,
html body .jy-rail.on-light .rail-list li:last-child .rail-link {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html body .jy-rail .rail-link .rail-ico { color: var(--jy-gold, #ffed00); }

html body .jy-rail .rail-link:hover,
html body .jy-rail.on-light .rail-link:hover,
html body .jy-rail.on-light .rail-list li:last-child .rail-link:hover {
  background: rgba(255, 237, 0, 0.16) !important;
  border-color: rgba(255, 237, 0, 0.45) !important;
}

html body .jy-rail .rail-link.active,
html body .jy-rail.on-light .rail-link.active,
html body .jy-rail .rail-list li:last-child .rail-link.active {
  background: var(--jy-gold, #ffed00) !important;
  color: #2B323A !important;
  border-color: var(--jy-gold, #ffed00) !important;
  box-shadow: none !important;
}

html body .jy-rail .rail-link.active .rail-ico { color: #2B323A; }

/* Fade the rail away while the footer is on screen */
html body .jy-rail.jy-rail-away {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(16px);
  pointer-events: none;
}

/* Laptops and tablets: slimmer rail so it does not cover content */
@media (min-width: 769px) and (max-width: 1440px) {
  html body .jy-rail { width: 68px; padding: 5px; right: 8px; border-radius: 14px; }
  html body .jy-rail .rail-link { height: 50px; font-size: 0.6rem; border-radius: 10px; }
}

/* Icon-only social links, sitting on the sixth row of Quick Links */
.footer-links li.footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 !important;
  line-height: 1.4;
}
.footer .footer-links li.footer-social a {
  display: inline-flex !important;
  align-items: center;
  line-height: 0;
  padding: 0;
  border: 0;
}
.footer-links li.footer-social svg { width: 17px; height: 17px; display: block; }
