/* Branch announcement pages (/mount-dora-branch-renderings, /orlando-branch):
   full-bleed photo hero followed by an image gallery. */

@media (prefers-reduced-motion: no-preference) {
  html:has(.cfb-branch-hero) {
    scroll-behavior: smooth;
  }
}

/* ---------- Hero ---------- */
.cfb-branch-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: clamp(34rem, 82svh, 52rem);
}

.cfb-branch-hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--cfb-branch-hero-focus, center);
}

.cfb-branch-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(1, 36, 39, 0.9) 0%, rgba(1, 36, 39, 0.68) 34%, rgba(1, 36, 39, 0.18) 64%, rgba(1, 36, 39, 0) 84%),
    linear-gradient(0deg, rgba(1, 36, 39, 0.85) 0%, rgba(1, 36, 39, 0) 48%),
    linear-gradient(180deg, rgba(1, 36, 39, 0.5) 0%, rgba(1, 36, 39, 0) 24%);
}

.cfb-branch-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--cfb-gradient-daylight);
}

.cfb-branch-hero__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 8rem 2rem 4.5rem;
}

.cfb-branch-hero__copy {
  max-width: 48rem;
}

.cfb-branch-hero .cfb-branch-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem !important;
  letter-spacing: 0.14em;
}

.cfb-branch-hero__eyebrow::before {
  content: "";
  flex: none;
  width: 2.5rem;
  height: 2px;
  background: var(--cfb-sky);
}

.cfb-branch-hero .cfb-branch-hero__title {
  margin: 0;
  font-family: "Spectral", Georgia, serif !important;
  font-size: clamp(2.75rem, 6vw, 5rem) !important;
  font-weight: 400 !important;
  line-height: 1.04 !important;
  letter-spacing: -0.045em;
  text-transform: none !important;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(1, 36, 39, 0.35);
}

.cfb-branch-hero .cfb-branch-hero__lead {
  margin: 1.25rem 0 0;
  font-family: "DM Sans", system-ui, sans-serif !important;
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem) !important;
  line-height: 1.5;
}

.cfb-page-redesign .cfb-branch-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
  padding: 0.95rem 1.5rem;
  border: 2px solid var(--cfb-light);
  border-radius: 0;
  background: transparent;
  color: var(--cfb-light) !important;
  font-family: "DM Sans", system-ui, sans-serif !important;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cfb-page-redesign .cfb-branch-hero__cta:hover {
  border-color: var(--cfb-sky);
  background: var(--cfb-sky);
  color: var(--cfb-shadow) !important;
}

.cfb-page-redesign .cfb-branch-hero__cta:focus-visible {
  outline: 3px solid var(--cfb-sky);
  outline-offset: 4px;
}

.cfb-branch-hero__cta svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.cfb-branch-hero__cta:hover svg {
  transform: translateY(3px);
}

@media (max-width: 767px) {
  .cfb-branch-hero {
    min-height: clamp(32rem, 88svh, 44rem);
  }

  .cfb-branch-hero::before {
    background:
      linear-gradient(0deg, rgba(1, 36, 39, 0.95) 0%, rgba(1, 36, 39, 0.72) 42%, rgba(1, 36, 39, 0.12) 78%, rgba(1, 36, 39, 0) 100%),
      linear-gradient(180deg, rgba(1, 36, 39, 0.45) 0%, rgba(1, 36, 39, 0) 22%);
  }

  .cfb-branch-hero__inner {
    padding: 6rem 1.25rem 3rem;
  }

  .cfb-branch-hero .cfb-branch-hero__eyebrow {
    gap: 0.625rem;
    font-size: 0.75rem !important;
    letter-spacing: 0.1em;
  }

  .cfb-branch-hero__eyebrow::before {
    width: 1.75rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cfb-branch-hero__image {
    animation: cfb-branch-hero-settle 9s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .cfb-branch-hero__copy > * {
    animation: cfb-branch-hero-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .cfb-branch-hero__copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .cfb-branch-hero__copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .cfb-branch-hero__copy > :nth-child(4) {
    animation-delay: 0.24s;
  }
}

@keyframes cfb-branch-hero-settle {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

@keyframes cfb-branch-hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Gallery ---------- */
.cfb-branch-gallery-section {
  scroll-margin-top: 6rem;
}

.cfb-branch-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cfb-branch-gallery__item:first-child,
.cfb-branch-gallery__item:last-child:nth-child(even) {
  grid-column: 1 / -1;
}

.cfb-branch-gallery__link {
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: #e8eeee;
}

.cfb-branch-gallery__link:focus-visible {
  outline: 3px solid #00a9e0;
  outline-offset: 3px;
}

.cfb-branch-gallery__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  transition: transform 0.3s ease;
}

.cfb-branch-gallery__link:hover .cfb-branch-gallery__img {
  transform: scale(1.02);
}

@media (max-width: 767px) {
  .cfb-branch-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cfb-branch-gallery__img {
    transition: none;
  }
}
