/* Alabama Fence Company — extras on top of Tailwind CLI (css/main.css) */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: #e85d04;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Focus rings */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #e85d04;
  outline-offset: 2px;
}

/* Nav links */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: #1b4332;
  background: #f5f5f4;
}

.nav-link.is-active {
  color: #e85d04;
  font-weight: 700;
  background: #fff7ed;
}

.nav-link-mobile {
  display: block;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link-mobile:hover {
  background: #f5f5f4;
}

.nav-link-mobile.is-active {
  color: #e85d04;
  font-weight: 700;
  background: #fff7ed;
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: #e85d04;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-accent:hover {
  background: #dc2f02;
}

.btn-accent:active {
  transform: scale(0.98);
}

.footer-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #fdba74;
}

/* Form controls (estimate form) */
.estimate-form input[type="text"],
.estimate-form input[type="tel"],
.estimate-form input[type="email"],
.estimate-form select,
.estimate-form textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d6d3d1;
  background: #fff;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.estimate-form input:hover,
.estimate-form select:hover,
.estimate-form textarea:hover {
  border-color: #a8a29e;
}

.estimate-form input:focus,
.estimate-form select:focus,
.estimate-form textarea:focus {
  border-color: #1b4332;
  box-shadow: 0 0 0 3px rgb(27 67 50 / 0.15);
  outline: none;
}

.estimate-form label {
  color: #334155;
  font-weight: 600;
}

.estimate-form .field-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #dc2626;
}

/* Article / CK content readability on service pages */
.article-content {
  max-width: 48rem;
  line-height: 1.7;
  color: #334155;
}

.article-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1b4332;
  letter-spacing: -0.02em;
}

.article-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1b4332;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.25rem;
}

.article-content li {
  margin-bottom: 0.35rem;
}

.article-content .lead {
  font-size: 1.125rem;
  color: #475569;
}

.article-content a {
  color: #e85d04;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: #dc2f02;
}

/* Empty / soft panels */
.empty-state {
  border: 1px dashed #d6d3d1;
  border-radius: 1rem;
  background: #fff;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}

/* Full-bleed dark heroes */
.ph-hero {
  background:
    linear-gradient(135deg, rgba(13, 27, 18, 0.9), rgba(27, 67, 50, 0.78)),
    repeating-linear-gradient(
      -12deg,
      #1b4332 0,
      #1b4332 18px,
      #2d6a4f 18px,
      #2d6a4f 36px
    );
}

/* Lighter page hero for inner pages */
.page-hero {
  background:
    linear-gradient(180deg, #ffffff 0%, #f5f5f4 100%);
  border-bottom: 1px solid #e7e5e4;
}

.ph-img {
  background:
    linear-gradient(160deg, #d8e2dc 0%, #95d5b2 45%, #2d6a4f 100%);
  display: grid;
  place-items: center;
  color: rgba(13, 27, 18, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ph-img::after {
  content: attr(data-label);
  padding: 0.5rem 0.75rem;
  text-align: center;
}

/* Soft card hover used site-wide */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.08),
    0 4px 6px -4px rgb(0 0 0 / 0.08);
}

/* Map placeholder */
.ph-map {
  background:
    linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 40%, #a5d6a7 100%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 24px,
      rgba(27, 67, 50, 0.06) 24px,
      rgba(27, 67, 50, 0.06) 25px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24px,
      rgba(27, 67, 50, 0.06) 24px,
      rgba(27, 67, 50, 0.06) 25px
    );
  display: grid;
  place-items: center;
  color: #1b4332;
  font-weight: 700;
  font-size: 0.875rem;
}

/* Sticky mobile CTA bar */
@media (max-width: 767px) {
  body {
    padding-bottom: 4.5rem;
  }
}

/* Mobile nav: ensure open state wins over Tailwind .hidden when toggled via JS */
#mobile-menu.is-open {
  display: block !important;
}

/* ----- Gallery lightbox ----- */
.gallery-item {
  cursor: pointer;
}

.gallery-item:focus-visible {
  outline: 2px solid #e85d04;
  outline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(13, 27, 18, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__dialog {
  position: relative;
  width: min(100%, 56rem);
  max-height: min(90vh, 52rem);
  display: flex;
  flex-direction: column;
  background: #0d1b12;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.lightbox.is-open .lightbox__dialog {
  transform: scale(1);
}

.lightbox__stage {
  position: relative;
  flex: 1;
  min-height: 12rem;
  max-height: 70vh;
  display: grid;
  place-items: center;
  background: #0d1b12;
}

.lightbox__stage img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__placeholder {
  width: 100%;
  height: min(70vh, 28rem);
  min-height: 16rem;
}

.lightbox__meta {
  padding: 1rem 1.25rem 1.15rem;
  background: #fff;
  color: #1a1a1a;
}

.lightbox__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1b4332;
}

.lightbox__caption {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(232, 93, 4, 0.9);
}

.lightbox__close {
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox__nav--prev {
  left: 0.75rem;
}

.lightbox__nav--next {
  right: 0.75rem;
}

.lightbox__counter {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox__nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.4rem;
  }

  .lightbox__nav--prev {
    left: 0.4rem;
  }

  .lightbox__nav--next {
    right: 0.4rem;
  }
}

/* Testimonials */
.t-reviews {
  border-top: 1px solid #e7e5e4;
  border-bottom: 1px solid #e7e5e4;
  background:
    linear-gradient(180deg, #f5f5f4 0%, #ffffff 42%, #f5f5f4 100%);
}

.t-carousel {
  position: relative;
}

.t-carousel__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.t-carousel__nav.is-hidden {
  display: none;
}

.t-carousel__viewport {
  overflow: hidden;
  touch-action: pan-y;
}

.t-carousel__track {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.t-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.t-carousel__card {
  position: relative;
  height: 100%;
  min-height: 16.5rem;
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  padding: 1.5rem 1.35rem 1.25rem;
  box-shadow: 0 8px 24px rgb(27 67 50 / 0.05);
  overflow: hidden;
}

.t-carousel__card::before {
  content: "“";
  position: absolute;
  top: 0.2rem;
  right: 0.9rem;
  font-size: 4.25rem;
  line-height: 1;
  font-weight: 800;
  color: #d8f3dc;
  pointer-events: none;
}

.t-carousel__stars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.12rem;
  margin-bottom: 0.85rem;
  color: #f5c518;
}

.t-carousel__star {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgb(180 130 0 / 0.15));
}

.t-carousel__quote {
  position: relative;
  z-index: 1;
  flex: 1;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  font-weight: 500;
  color: #1e293b;
}

.t-carousel__person {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #f5f5f4;
}

.t-carousel__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 9999px;
  background: #1b4332;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.t-carousel__name {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1b4332;
}

.t-carousel__place {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: #64748b;
}

.t-carousel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid #e7e5e4;
  border-radius: 9999px;
  background: #fff;
  color: #1b4332;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease;
}

.t-carousel__btn:hover {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}

.t-carousel__btn:active {
  transform: scale(0.96);
}

.t-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.t-carousel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 1.15rem;
}

.t-carousel__footer.is-hidden {
  display: none;
}

.t-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.t-carousel__dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: #d6d3d1;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.t-carousel__dot.is-active {
  width: 1.4rem;
  background: #1b4332;
}

.t-carousel__count {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #78716c;
}

@media (min-width: 768px) {
  .t-carousel__slide {
    flex-basis: calc((100% - 1.25rem) / 2);
  }
}

@media (min-width: 1024px) {
  .t-carousel__slide {
    flex-basis: calc((100% - 2.5rem) / 3);
  }

  .t-carousel__card {
    min-height: 17rem;
    padding: 1.65rem 1.5rem 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-carousel__track {
    transition: none;
  }
}

/* Services listing — detailed type blocks */
.svc-type__grid {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

.svc-type__media {
  display: block;
  overflow: hidden;
  border-radius: 1.25rem;
}

.svc-type__img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
}

.svc-type__copy {
  min-width: 0;
}

@media (min-width: 1024px) {
  .svc-type__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 3rem;
  }

  .svc-type__grid--reverse .svc-type__media {
    order: 2;
  }

  .svc-type__grid--reverse .svc-type__copy {
    order: 1;
  }

  .svc-type__img {
    height: 22rem;
  }
}
