/*
 Theme Name:   Hillside Sanctuary
 Theme URI:    https://hillsidesanctuary.pt
 Description:  AI-managed child theme for Hillside Sanctuary Lda agroturismo website. Mobile-first responsive design with earth-tone palette.
 Author:       Agent Zero — AZ-WP-001
 Author URI:   https://thesynergygroup.ch
 Template:     astra
 Version:      1.0.0
 License:      Proprietary
 Text Domain:  hsp-sanctuary
*/

/* ============================================================
   HSP DESIGN SYSTEM — Mobile-First Responsive
   ============================================================ */

/* -- CSS Custom Properties (Design Tokens) -- */
:root {
  /* Earth-tone palette */
  --hsp-olive:       #5C6B3C;
  --hsp-olive-light: #7A8C5A;
  --hsp-olive-dark:  #3E4A28;
  --hsp-terracotta:  #C4704A;
  --hsp-terracotta-light: #D4896A;
  --hsp-stone:       #B8A88A;
  --hsp-stone-light: #D4C8B0;
  --hsp-cream:       #F5F0E8;
  --hsp-cream-dark:  #E8E0D0;
  --hsp-charcoal:    #2C2C2C;
  --hsp-white:       #FDFCFA;

  /* Typography */
  --hsp-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --hsp-font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hsp-font-size-base: 1rem;
  --hsp-line-height:  1.6;

  /* Spacing scale */
  --hsp-space-xs:  0.25rem;
  --hsp-space-sm:  0.5rem;
  --hsp-space-md:  1rem;
  --hsp-space-lg:  2rem;
  --hsp-space-xl:  3rem;
  --hsp-space-2xl: 5rem;

  /* Border radius */
  --hsp-radius-sm: 4px;
  --hsp-radius-md: 8px;
  --hsp-radius-lg: 16px;

  /* Shadows */
  --hsp-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --hsp-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --hsp-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Layout */
  --hsp-max-width: 1200px;
  --hsp-gutter:    1rem;
}

/* -- Base Reset & Typography -- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--hsp-font-body);
  font-size: var(--hsp-font-size-base);
  line-height: var(--hsp-line-height);
  color: var(--hsp-charcoal);
  background-color: var(--hsp-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--hsp-font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--hsp-olive-dark);
  margin-top: 0;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

a {
  color: var(--hsp-terracotta);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--hsp-olive);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* -- Layout Containers -- */
.hsp-container {
  width: 100%;
  max-width: var(--hsp-max-width);
  margin: 0 auto;
  padding: 0 var(--hsp-gutter);
}

.hsp-section {
  padding: var(--hsp-space-xl) 0;
}

.hsp-section--cream {
  background-color: var(--hsp-cream);
}

.hsp-section--olive {
  background-color: var(--hsp-olive);
  color: var(--hsp-white);
}

.hsp-section--olive h2,
.hsp-section--olive h3 {
  color: var(--hsp-cream);
}

/* -- Grid System (CSS Grid, mobile-first) -- */
.hsp-grid {
  display: grid;
  gap: var(--hsp-space-lg);
}

/* 1 column on mobile (default) */
.hsp-grid--2 { grid-template-columns: 1fr; }
.hsp-grid--3 { grid-template-columns: 1fr; }
.hsp-grid--4 { grid-template-columns: 1fr; }

/* -- Buttons -- */
.hsp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  min-height: 44px;  /* Touch-friendly: 44px minimum */
  min-width: 44px;
  font-family: var(--hsp-font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--hsp-radius-md);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
}

.hsp-btn:active {
  transform: scale(0.98);
}

.hsp-btn--primary {
  background-color: var(--hsp-terracotta);
  color: var(--hsp-white);
}

.hsp-btn--primary:hover {
  background-color: var(--hsp-terracotta-light);
  color: var(--hsp-white);
}

.hsp-btn--secondary {
  background-color: var(--hsp-olive);
  color: var(--hsp-white);
}

.hsp-btn--secondary:hover {
  background-color: var(--hsp-olive-light);
  color: var(--hsp-white);
}

.hsp-btn--outline {
  background-color: transparent;
  border: 2px solid var(--hsp-olive);
  color: var(--hsp-olive);
}

.hsp-btn--outline:hover {
  background-color: var(--hsp-olive);
  color: var(--hsp-white);
}

/* -- Hero Section (Six Senses-inspired) -- */
.hsp-hero {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: var(--hsp-olive-dark);
}

.hsp-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(44, 44, 44, 0.05) 0%,
    rgba(44, 44, 44, 0.25) 40%,
    rgba(62, 74, 40, 0.7) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hsp-hero__image {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.hsp-hero__content {
  position: relative;
  z-index: 2;
  padding: var(--hsp-space-2xl) var(--hsp-gutter) var(--hsp-space-xl);
  color: var(--hsp-white);
  max-width: var(--hsp-max-width);
  margin: 0 auto;
  width: 100%;
}

.hsp-hero__content h1 {
  color: var(--hsp-white);
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: var(--hsp-space-md);
}

.hsp-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  margin-bottom: var(--hsp-space-lg);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
  font-weight: 300;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* Scroll indicator */
.hsp-hero__scroll {
  position: absolute;
  bottom: var(--hsp-space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: hsp-scroll-hint 2s ease-in-out infinite;
}

.hsp-hero__scroll::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(255,255,255,0.6);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  transform: rotate(45deg);
}

@keyframes hsp-scroll-hint {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* Homepage hero — taller */
.hsp-homepage .hsp-hero {
  min-height: 90vh;
  align-items: center;
}

.hsp-homepage .hsp-hero__content {
  text-align: center;
}

.hsp-homepage .hsp-hero__content h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
}

/* Partner hero — shorter, wide */
.hsp-partner-single .hsp-hero {
  min-height: 50vh;
}

.hsp-hero--partner::after {
  background: linear-gradient(
    180deg,
    rgba(44, 44, 44, 0.1) 0%,
    rgba(62, 74, 40, 0.8) 100%
  );
}

/* -- Section Dividers -- */
.hsp-section + .hsp-section::before {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--hsp-terracotta);
  margin: 0 auto;
  opacity: 0.5;
}

.hsp-section--olive + .hsp-section::before,
.hsp-section + .hsp-section--olive::before,
.hsp-section--cream + .hsp-section--cream::before {
  display: none;
}

/* -- Breadcrumb -- */
.hsp-breadcrumb {
  font-size: 0.8rem;
  margin-bottom: var(--hsp-space-sm);
  opacity: 0.8;
}

.hsp-breadcrumb a {
  color: var(--hsp-stone-light);
  text-decoration: underline;
}

.hsp-breadcrumb__sep {
  margin: 0 var(--hsp-space-xs);
}

/* -- Card Component (premium) -- */
.hsp-card {
  background: var(--hsp-white);
  border-radius: var(--hsp-radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.03);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
  .hsp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
  }
}

/* -- Card Image Wrapper with gradient overlay -- */
.hsp-card__image-wrap {
  position: relative;
  overflow: hidden;
}

.hsp-card__image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0,0,0,0.12));
  pointer-events: none;
}

@media (hover: hover) {
  .hsp-card:hover .hsp-card__image {
    transform: scale(1.03);
  }
}

.hsp-card__image-wrap .hsp-card__image {
  transition: transform 0.4s ease;
}

.hsp-card__image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--hsp-cream) 0%, var(--hsp-stone-light) 100%);
}

/* Skeleton shimmer for loading states */
.hsp-skeleton {
  background: linear-gradient(90deg, var(--hsp-cream) 25%, var(--hsp-cream-dark) 50%, var(--hsp-cream) 75%);
  background-size: 200% 100%;
  animation: hsp-shimmer 1.5s infinite;
}

@keyframes hsp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hsp-card__image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.hsp-card__body {
  padding: var(--hsp-space-md) var(--hsp-space-lg);
}

.hsp-card__title {
  font-size: 1.125rem;
  margin-bottom: var(--hsp-space-sm);
}

.hsp-card__meta {
  font-size: 0.875rem;
  color: var(--hsp-stone);
}

/* -- Filter Bar (category pills) -- */
.hsp-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hsp-space-sm);
  margin-bottom: var(--hsp-space-xl);
}

.hsp-filter-pill {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--hsp-stone);
  border-radius: var(--hsp-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hsp-charcoal);
  text-decoration: none;
  transition: all 0.2s ease;
}

.hsp-filter-pill:hover {
  background-color: var(--hsp-olive);
  color: var(--hsp-white);
  border-color: var(--hsp-olive);
}

.hsp-filter-pill--active {
  background-color: var(--hsp-olive-dark);
  color: var(--hsp-white);
  border-color: var(--hsp-olive-dark);
}

/* -- Partner Single Page -- */
.hsp-partner-detail {
  padding-top: var(--hsp-space-xl);
  padding-bottom: var(--hsp-space-xl);
}

.hsp-partner-detail__specialty {
  margin-bottom: var(--hsp-space-lg);
}

.hsp-partner-detail__sidebar .hsp-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--hsp-space-sm);
}

.hsp-partner-detail__sidebar .hsp-btn {
  margin-top: var(--hsp-space-md);
  width: 100%;
  text-align: center;
}

/* -- Pagination -- */
.hsp-pagination {
  padding: var(--hsp-space-xl) 0;
  text-align: center;
}

.hsp-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: var(--hsp-space-sm);
}

.hsp-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--hsp-space-sm);
  border: 1px solid var(--hsp-stone-light);
  border-radius: var(--hsp-radius-md);
  font-size: 0.875rem;
  color: var(--hsp-charcoal);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.hsp-pagination .page-numbers:hover {
  background-color: var(--hsp-cream);
}

.hsp-pagination .page-numbers.current {
  background-color: var(--hsp-olive);
  color: var(--hsp-white);
  border-color: var(--hsp-olive);
}

/* -- Partner Directory Grid -- */
.hsp-partner-grid {
  display: grid;
  gap: var(--hsp-space-lg);
  grid-template-columns: 1fr;
}

.hsp-partner-card {
  display: flex;
  flex-direction: column;
}

.hsp-partner-card__category {
  display: inline-block;
  padding: var(--hsp-space-xs) var(--hsp-space-sm);
  background-color: var(--hsp-olive-light);
  color: var(--hsp-white);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--hsp-radius-sm);
  margin-bottom: var(--hsp-space-sm);
  width: fit-content;
}

.hsp-partner-card__town {
  font-size: 0.875rem;
  color: var(--hsp-stone);
  margin-bottom: var(--hsp-space-sm);
}

.hsp-partner-card__impact {
  margin-top: auto;
  padding-top: var(--hsp-space-md);
  border-top: 1px solid var(--hsp-cream-dark);
  font-size: 0.8rem;
  color: var(--hsp-olive);
  font-weight: 500;
}

/* -- Five Pillars Section -- */
.hsp-pillars {
  display: grid;
  gap: var(--hsp-space-lg);
  grid-template-columns: 1fr;
  text-align: center;
}

.hsp-pillar__icon {
  font-size: 2.5rem;
  margin-bottom: var(--hsp-space-sm);
}

.hsp-section--olive .hsp-pillar h3 {
  color: var(--hsp-cream);
  font-size: 1.125rem;
}

.hsp-section--olive .hsp-pillar p {
  color: var(--hsp-stone-light);
  font-size: 0.9rem;
}

/* -- Homepage specific -- */
.hsp-homepage .hsp-hero {
  min-height: 85vh;
}

.hsp-homepage .hsp-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

/* -- Booking Calendar Wrapper -- */
.hsp-booking-wrap {
  background: var(--hsp-cream);
  border-radius: var(--hsp-radius-lg);
  padding: var(--hsp-space-lg);
}

/* -- Tractor Cost Estimate -- */
.hsp-tractor-estimate {
  background: var(--hsp-olive);
  color: var(--hsp-white);
  padding: var(--hsp-space-lg);
  border-radius: var(--hsp-radius-lg);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

/* -- Footer -- */
.hsp-footer {
  background-color: var(--hsp-olive-dark);
  color: var(--hsp-stone-light);
  padding: var(--hsp-space-xl) 0;
}

.hsp-footer a {
  color: var(--hsp-stone-light);
}

.hsp-footer a:hover {
  color: var(--hsp-terracotta-light);
}

/* ============================================================
   BREAKPOINTS — Tablet (768px)
   ============================================================ */
@media (min-width: 768px) {
  :root {
    --hsp-gutter: 1.5rem;
  }

  .hsp-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .hsp-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .hsp-grid--4 { grid-template-columns: repeat(2, 1fr); }

  .hsp-partner-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hsp-pillars {
    grid-template-columns: repeat(3, 1fr);
  }

  .hsp-hero {
    min-height: 70vh;
  }
}

/* ============================================================
   BREAKPOINTS — Laptop (1024px)
   ============================================================ */
@media (min-width: 1024px) {
  :root {
    --hsp-gutter: 2rem;
  }

  .hsp-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .hsp-grid--4 { grid-template-columns: repeat(3, 1fr); }

  .hsp-partner-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hsp-pillars {
    grid-template-columns: repeat(5, 1fr);
  }

  .hsp-hero {
    min-height: 80vh;
  }
}

/* ============================================================
   BREAKPOINTS — Desktop (1440px)
   ============================================================ */
@media (min-width: 1440px) {
  .hsp-grid--4 { grid-template-columns: repeat(4, 1fr); }

  .hsp-partner-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
