/* =========================================================
   The Lifestyle Companionship — custom design system layer
   Works alongside Tailwind utilities loaded in base.html
   ========================================================= */

:root {
  --navy: #1E4E5C;
  --navy-deep: #12313C;
  --navy-light: #3D7A8A;
  --green: #3CAE4C;
  --green-dark: #1F6B3B;
  --green-light: #EAF6EC;
  --green-pale: #F4FAF3;
  --cream: #FBF9F4;
  --ink: #1C2B2E;
  --slate: #5B6E71;
  --focus-ring: #E9A23B;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--navy-deep);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 0 0 0.6rem 0;
  z-index: 100;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

a, button {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--green);
  color: #fff;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(18, 49, 60, 0.08);
}

.nav-link {
  position: relative;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  padding: 0.4rem 0.1rem;
  transition: color 0.2s ease;
  text-decoration: none;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2.5px;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.25s ease;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--navy);
}
.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link-active::after {
  width: 100%;
}
.nav-link-active {
  color: var(--navy);
}

.menu-bar {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--navy);
  border-radius: 2px;
  margin: 3px 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
#menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}
#menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.mobile-menu {
  border-top: 1px solid rgba(18, 49, 60, 0.08);
  background: var(--cream);
}
.mobile-nav-link {
  padding: 0.85rem 0.5rem;
  font-weight: 700;
  color: var(--navy-deep);
  border-radius: 0.6rem;
  text-decoration: none;
}
.mobile-nav-link:hover {
  background: var(--green-light);
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 8px 20px -6px rgba(60, 174, 76, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -6px rgba(31, 107, 59, 0.55);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--navy);
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--navy);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.55);
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-outline-light:hover,
.btn-outline-light:focus-visible {
  background: #fff;
  color: var(--navy-deep);
  transform: translateY(-2px);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-light) 100%);
}

.hero-leaf-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: radial-gradient(circle at 20% 30%, #fff 0, transparent 45%),
    radial-gradient(circle at 80% 70%, #fff 0, transparent 40%);
  pointer-events: none;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}

.floating-badge {
  animation: float 5s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

/* ---------- Sections / cards ---------- */

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-dark);
}
.section-eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--green);
  border-radius: 2px;
  display: inline-block;
}

.card {
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px -6px rgba(18, 49, 60, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(18, 49, 60, 0.22);
}

.value-card {
  position: relative;
  overflow: hidden;
}
.value-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--navy-light));
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: var(--green-light);
  color: var(--green-dark);
  flex-shrink: 0;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .floating-badge {
    animation: none;
  }
}

/* ---------- Timeline (Our Story) ---------- */

.timeline-line {
  background: linear-gradient(180deg, var(--green) 0%, var(--navy-light) 100%);
}

/* ---------- Forms ---------- */

.form-field {
  width: 100%;
  border: 1.5px solid rgba(18, 49, 60, 0.18);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-field:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(60, 174, 76, 0.18);
  outline: none;
}
.form-label {
  display: block;
  font-weight: 700;
  color: var(--navy-deep);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}
.form-required {
  color: var(--green-dark);
}
input[type="file"].form-field {
  padding: 0.6rem 1rem;
  cursor: pointer;
}
input[type="file"].form-field::file-selector-button {
  border: none;
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  margin-right: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
input[type="file"].form-field::file-selector-button:hover {
  background: var(--green);
  color: #fff;
}
.form-error {
  color: #B3261E;
  font-size: 0.85rem;
  margin-top: 0.3rem;
  font-weight: 600;
}

.alert-success {
  background: var(--green-light);
  border: 1.5px solid var(--green);
  color: var(--green-dark);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
}

/* ---------- Footer ---------- */

.footer-heading {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--green);
}
.footer-link {
  color: rgba(251, 249, 244, 0.78);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-link:hover,
.footer-link:focus-visible {
  color: #fff;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}
.social-icon:hover,
.social-icon:focus-visible {
  background: var(--green);
  transform: translateY(-2px);
}

.admin-link {
  color: rgba(251, 249, 244, 0.35);
  text-decoration: none;
  font-size: 0.8rem;
  border-left: 1px solid rgba(251, 249, 244, 0.2);
  padding-left: 1rem;
  transition: color 0.2s ease;
}
.admin-link:hover,
.admin-link:focus-visible {
  color: rgba(251, 249, 244, 0.85);
}

/* ---------- Misc ---------- */

.stat-number {
  font-family: "Fraunces", serif;
  font-weight: 700;
  color: var(--navy);
}

.text-balance {
  text-wrap: balance;
}

.divider-wave {
  display: block;
  width: 100%;
  height: auto;
}

.photo-frame {
  position: relative;
  border-radius: 1.75rem;
  overflow: hidden;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.photo-frame:hover img {
  transform: scale(1.05);
}

/* ---------- Gallery ---------- */

.filter-pill {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  border: 1.5px solid rgba(18, 49, 60, 0.15);
  color: var(--navy-deep);
  text-decoration: none;
  transition: all 0.2s ease;
}
.filter-pill:hover,
.filter-pill:focus-visible {
  border-color: var(--green);
  color: var(--green-dark);
}
.filter-pill-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.filter-pill-active:hover,
.filter-pill-active:focus-visible {
  background: var(--navy-deep);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1.25rem;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--green-light);
  box-shadow: 0 4px 20px -8px rgba(18, 49, 60, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -10px rgba(18, 49, 60, 0.28);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.08);
}
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  background: linear-gradient(180deg, transparent 50%, rgba(18, 49, 60, 0.78) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus-visible .gallery-item-overlay {
  opacity: 1;
}
.gallery-item-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: left;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] {
  display: none;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 49, 60, 0.92);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1000px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 1rem;
  box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  background: #0d2530;
}
.lightbox-caption {
  margin-top: 1rem;
  text-align: center;
  max-width: 640px;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: var(--green);
  border-color: var(--green);
}
.lightbox-close {
  top: -1rem;
  right: -1rem;
}
@media (max-width: 640px) {
  .lightbox-close { top: -3.5rem; right: 0; }
}
.lightbox-prev {
  left: -1rem;
  top: 50%;
  transform: translate(-100%, -50%);
}
.lightbox-next {
  right: -1rem;
  top: 50%;
  transform: translate(100%, -50%);
}
@media (max-width: 900px) {
  .lightbox-prev { left: 0.5rem; transform: translateY(-50%); }
  .lightbox-next { right: 0.5rem; transform: translateY(-50%); }
}

/* =========================================================
   Loading states — button spinners + full-page navigation loader
   ========================================================= */

/* ---------- In-button spinner ---------- */

.btn-primary,
.btn-secondary,
.btn-outline-light,
.dash-nav-link {
  position: relative;
}

/* Keep text + icon on one row after loading.js wraps them in .btn-label.
   Tailwind preflight sets svg { display: block }, which otherwise stacks. */
.btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-spinner {
  display: none;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: btn-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn-secondary .btn-spinner {
  border: 2.5px solid rgba(30, 78, 92, 0.25);
  border-top-color: var(--navy);
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* When a button is submitting: dim label, show spinner, block interaction */
button.is-loading,
a.is-loading {
  pointer-events: none;
  opacity: 0.85;
  cursor: default;
}
button.is-loading .btn-label,
a.is-loading .btn-label {
  visibility: hidden;
}
button.is-loading .btn-spinner,
a.is-loading .btn-spinner {
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner,
  .tlc-loader-ring {
    animation-duration: 1.6s;
  }
}

/* ---------- Full-page navigation loader ---------- */

.tlc-page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 49, 60, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.tlc-page-loader.is-active {
  opacity: 1;
  visibility: visible;
}

.tlc-loader-badge {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.45);
}

.tlc-loader-badge img {
  width: 2.9rem;
  height: 2.9rem;
  object-fit: contain;
}

.tlc-loader-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3.5px solid rgba(60, 174, 76, 0.2);
  border-top-color: var(--green);
  border-right-color: var(--green);
  animation: btn-spin 0.9s linear infinite;
}
