/* =====================================================================
   Torba Farm — UI / layout refinements (loaded after styles-*.css)
   Non-destructive overrides: typography, spacing, alignment, responsive.
   ===================================================================== */

/* ---------- 1. Base rendering & readability ---------- */
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }

/* Justified body copy reads poorly (rivers/gaps) — align left/start */
.text-justify { text-align: left !important; }

/* Comfortable measure + leading for body copy */
p, .sd-bd-lt-16, .sd-bd-lt-18, .exp-text, .txt-placeholder-14 {
  line-height: 1.7;
}

/* ---------- 2. Headings: line-height, tracking, fluid sizing ----------
   Original rules use the `font:` shorthand which resets line-height to
   `normal` and forbids tracking, so we restore both and make sizes fluid. */
.pm-bd-ld-38 { font-size: clamp(1.9rem, 1.15rem + 2.4vw, 2.6rem) !important; line-height: 1.18 !important; letter-spacing: -0.01em; }
.pm-bd-ld-32 { font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.1rem) !important; line-height: 1.22 !important; letter-spacing: -0.01em; }
.pm-bd-ld-28 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.8rem)  !important; line-height: 1.25 !important; letter-spacing: -0.005em; }
.pm-bd-ld-18 { line-height: 1.5 !important; }
h2, h3, h4 { text-wrap: balance; }

/* ---------- 3. Buttons: alignment, sizing, motion ---------- */
.btn { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease; }
.btn-color-pm,
.btn-color-pm-mobile,
.btn-primary,
.btn-outline-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
}
.btn-color-pm, .btn-color-pm-mobile { padding: .7rem 1.5rem; border-radius: 999px; font-weight: 600; }
.btn-color-pm i, .btn-color-pm-mobile i, .btn-primary i { font-size: 1.15em; line-height: 0; }
.btn-color-pm:hover, .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(1, 63, 52, .28); }
.btn-outline-light:hover { transform: translateY(-2px); }
.slider-buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.slider-buttons .me-2 { margin-right: 0 !important; }

/* Keyboard focus visibility (a11y) */
a:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 3px solid rgba(213, 171, 154, .9);
  outline-offset: 2px;
}

/* ---------- 4. Top header & navbar ---------- */
.top-header { padding-block: .5rem; }
.navbar .nav-link {
  letter-spacing: .01em;
  padding-inline: .85rem !important;
  transition: color .15s ease;
}
.navbar .nav-link:hover { color: var(--pm) !important; }
.navbar-brand .logo { transition: transform .2s ease; }
.navbar-brand:hover .logo { transform: scale(1.03); }
.dropdown-menu {
  border: 0;
  border-radius: .75rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  padding: .4rem;
  margin-top: .4rem !important;
}
.dropdown-menu .dp-menu { border-radius: .5rem; padding: .5rem .85rem; transition: background-color .15s ease; }
.dropdown-menu .dp-menu:hover { background-color: var(--lg-pm); }

/* ---------- 5. Hero / slider ---------- */
.carousel-caption.slider-content { text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.carousel-caption.slider-content h1 { max-width: min(24ch, 100%); text-wrap: pretty; }
.carousel-caption.slider-content p  { max-width: 52ch; }
/* Make the prev/next controls discoverable on hover */
#sliderCarousel:hover .carousel-control-prev,
#sliderCarousel:hover .carousel-control-next { opacity: .9; }

/* ---------- 6. Programs grid cards (.pg-card / .program-card / .pn-card) ---------- */
.pg-card .position-relative { overflow: hidden; border-radius: .9rem; }
.program-card {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
/* Readability scrim behind the white title text */
.pg-card .position-relative::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.28) 38%, rgba(0,0,0,0) 62%);
  pointer-events: none;
}
.pg-card .overlay-content.pn-card {
  z-index: 2;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1rem;
}
.pg-card .pn-card h4 {
  font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem);
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.pg-card .pn-card .bi-arrow-right-circle { transition: transform .25s ease; }
.pg-card:hover .program-card { transform: scale(1.06); }
.pg-card:hover .pn-card .bi-arrow-right-circle { transform: translateX(4px); }

/* ---------- 7. Section rhythm ---------- */
.explore, .Sanitary-container, .exp-card { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.explore .row + .row { margin-top: 1.5rem; }

/* Feature list (Native Flora Revival, etc.) vertical rhythm */
.explore .d-flex.align-items-center { margin-bottom: .35rem; }

/* Dining list separators a touch lighter */
.exp-card hr { opacity: .12; }

/* ---------- 8. Footer ---------- */
.footer-logo, footer img { max-width: 100%; height: auto; }

/* =====================================================================
   Responsive optimisation
   ===================================================================== */

/* Tablets and below */
@media (max-width: 991.98px) {
  .navbar-nav { gap: .15rem; }
  .navbar .nav-link { padding-block: .55rem !important; }
  /* Mobile "Book Your Visit" gets breathing room inside the collapsed menu */
  .btn-color-pm-mobile { width: 100%; }
  .program-card { height: 260px; }
}

/* Phones */
@media (max-width: 767.98px) {
  .carousel-caption.slider-content { left: 1rem; right: 1rem; bottom: auto; top: 50%; transform: translateY(-50%); text-align: left; padding: 0; }
  .carousel-caption.slider-content p { max-width: 100%; }
  .slider-buttons .btn { flex: 1 1 auto; }

  /* Floating "Sustainable..." text box: let it sit naturally, no overflow */
  .Sanitary-container .position-absolute.s-box {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    margin-top: -2.5rem;
    padding-inline: 1rem;
  }
  .s-box-inner { padding: 1.25rem !important; }

  .program-card { height: 220px; }
  .explore .text-center, .exp-card { text-align: left; }
}

/* Small phones */
@media (max-width: 479.98px) {
  .top-header .container { font-size: .8rem; }
  .btn-color-pm, .btn-primary, .btn-outline-light { width: 100%; }
  .slider-buttons { flex-direction: column; align-items: stretch; }
}
