/* =========================================================
   SP — ABOUT US PAGE STYLING
   Design language: Matches Contact page and site-wide design
   - Typography: SF Pro, matching site fonts
   - Colors: #1A1A1A (text), #6E6E6E (muted), #FFF (white)
   - Border radius: 10px
   ========================================================= */

/* Design tokens (matching Contact page) */
body:has(.sp-about-hero),
body:has(.sp-about-principles){
  --sp-max: 1200px;
  --sp-pad: 32px;
  --sp-gap: 28px;
  
  --sp-text: #1A1A1A;
  --sp-muted: #6E6E6E;
  --sp-line: #ECECEC;
  --sp-card: #FFF;
  
  --sp-radius: 10px;
  --sp-shadow: 0 8px 18px rgba(0,0,0,.08);
}

/* Remove white space above hero (Astra theme spacing) */
body:has(.sp-about-hero) .site-content,
body:has(.sp-about-hero) .content-area,
body:has(.sp-about-hero) .site-main,
body:has(.sp-about-hero) #primary{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body:has(.sp-about-hero) .site-content .ast-container,
body:has(.sp-about-hero) .ast-container{
  padding-top: 0 !important;
}

body:has(.sp-about-hero) .entry-header{
  margin: 0 !important;
  padding: 0 !important;
  display: none !important; /* Hide default page title */
}

body:has(.sp-about-hero) .entry-content > *:first-child{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* =========================================================
   1) HERO SECTION - Match Contact Page
   ========================================================= */

/* Hero container - full width */
.sp-about-hero{
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  min-height: 300px !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-radius: 0 !important;
  position: relative !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

/* Set background image for Cover block */
.sp-about-hero .wp-block-cover__image-background{
  object-fit: cover !important;
  object-position: center !important;
  width: 100% !important;
  height: 100% !important;
}

/* Overlay for readability (matching contact page) */
.sp-about-hero::before{
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.35) 42%,
    rgba(0,0,0,.10) 100%
  ) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

/* Hero inner container */
.sp-about-hero .wp-block-cover__inner-container{
  position: relative !important;
  z-index: 2 !important;
  max-width: var(--sp-max) !important;
  margin: 0 auto !important;
  padding: 84px var(--sp-pad) 56px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
}

/* Hero heading "About Us" - Match "How to Rent" page styling */
.sp-about-hero h1,
.sp-about-hero .wp-block-heading,
.sp-about-hero .wp-block-cover__inner-container h1,
.sp-about-hero .wp-block-cover__inner-container .wp-block-heading,
.sp-about-hero-title,
.sp-about-hero-title h1,
.sp-about-hero-title .wp-block-heading{
  color: #fff !important;
  text-align: center !important;
  margin: 0 auto !important;
  width: 100% !important;
  display: block !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Match default WordPress/Astra heading sizes - ensure h1 is large like "How to Rent" */
.sp-about-hero h1,
.sp-about-hero .wp-block-heading h1,
.sp-about-hero .wp-block-cover__inner-container h1,
.sp-about-hero-title h1{
  font-size: 2.5rem !important; /* ~40px - typical WordPress h1 size */
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

.sp-about-hero h2,
.sp-about-hero .wp-block-heading h2,
.sp-about-hero .wp-block-cover__inner-container h2,
.sp-about-hero-title h2{
  font-size: 2rem !important; /* ~32px - typical WordPress h2 size */
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

/* If it's a heading block without explicit h1/h2, treat as h1 */
.sp-about-hero .wp-block-heading:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.sp-about-hero-title .wp-block-heading:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* =========================================================
   2) SECOND SECTION - Text Content (Black Text)
   Match proportions to reference: ~30-35% heading, ~65-70% paragraph
   ========================================================= */

/* Target the Columns block containing heading and paragraph */
body:has(.sp-about-content) .entry-content .wp-block-columns,
body:has(.sp-about-content) .wp-block-columns{
  max-width: var(--sp-max) !important;
  margin: 0 auto !important;
  padding: 60px var(--sp-pad) !important;
  gap: 40px !important; /* Space between columns */
  align-items: center !important;
}

/* First column - "About Spherical" heading (~30-35% width) */
body:has(.sp-about-content) .entry-content .wp-block-columns .wp-block-column:first-child,
body:has(.sp-about-content) .wp-block-columns .wp-block-column:first-child{
  flex-basis: 33.33% !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  min-width: 0 !important;
}

/* Second column - Paragraph text (~65-70% width) */
body:has(.sp-about-content) .entry-content .wp-block-columns .wp-block-column:last-child,
body:has(.sp-about-content) .wp-block-columns .wp-block-column:last-child{
  flex-basis: 66.67% !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  min-width: 0 !important;
}

/* If there are more than 2 columns, reset to default */
body:has(.sp-about-content) .entry-content .wp-block-columns .wp-block-column:nth-child(n+3),
body:has(.sp-about-content) .wp-block-columns .wp-block-column:nth-child(n+3){
  flex-basis: auto !important;
  flex-grow: 1 !important;
}

.sp-about-content{
  max-width: 50% !important; /* About half the screen width */
  max-width: calc(100vw / 2) !important; /* Fallback calc */
  margin: 0 auto !important;
  padding: 60px var(--sp-pad) !important;
}

.sp-about-content p,
.sp-about-content .wp-block-paragraph{
  font-size: 18px !important;
  font-weight: 590 !important;
  font-family: "SF Pro Display","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif !important;
  color: var(--sp-text) !important;
  line-height: 1.5 !important;
  margin: 0 0 18px 0 !important;
}

.sp-about-content p:last-child,
.sp-about-content .wp-block-paragraph:last-child{
  margin-bottom: 0 !important;
}

/* =========================================================
   3) THIRD SECTION - Full Screen Image with Text Overlays
   ========================================================= */

/* Full screen image background - Full viewport height */
.sp-about-principles{
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  min-height: 100vh !important; /* Full viewport height */
  height: 100vh !important; /* Ensure it covers entire screen */
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  overflow: hidden !important;
  margin-bottom: 0 !important;
  /* Preserve any background-image set inline by WordPress */
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Ensure the Cover block's background image is visible */
.sp-about-principles .wp-block-cover__image-background{
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  z-index: 0 !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* If it's an img tag */
.sp-about-principles .wp-block-cover__image-background img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* If it's a span/div with background-image style */
.sp-about-principles .wp-block-cover__image-background[style*="background-image"]{
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  display: block !important;
}

/* Ensure Cover block background overlay doesn't conflict */
.sp-about-principles .wp-block-cover__background{
  opacity: 0 !important; /* Hide default overlay if it exists */
  display: none !important;
}

/* Overlay for readability - very light so image shows through clearly */
.sp-about-principles::before{
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0,0,0,.15) !important; /* Very light overlay */
  z-index: 1 !important;
  pointer-events: none !important;
}

/* Inner container for positioning - Full height */
.sp-about-principles .wp-block-cover__inner-container{
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
  max-width: var(--sp-max) !important;
  margin: 0 auto !important;
  padding: 60px var(--sp-pad) !important;
  min-height: 100vh !important; /* Match parent height */
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: stretch !important;
}

/* Top left paragraph - Three 100% Principles */
.sp-about-principles-top{
  align-self: flex-start !important;
  max-width: 500px !important;
  margin-bottom: auto !important;
}

.sp-about-principles-top p,
.sp-about-principles-top .wp-block-paragraph{
  font-size: 18px !important;
  font-weight: 590 !important;
  font-family: "SF Pro Display","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif !important;
  color: #fff !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

/* Bottom right section - Paragraph + Button */
.sp-about-principles-bottom{
  align-self: flex-end !important;
  text-align: right !important;
  max-width: 500px !important;
  margin-top: auto !important;
}

.sp-about-principles-bottom p,
.sp-about-principles-bottom .wp-block-paragraph{
  font-size: 18px !important;
  font-weight: 590 !important;
  font-family: "SF Pro Display","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif !important;
  color: #fff !important;
  line-height: 1.5 !important;
  margin: 0 0 20px 0 !important;
}

/* Book Now Button - Match home page hero button exactly */
.sp-about-principles-bottom .sp-book-now-button,
.sp-about-principles-bottom a.sp-book-now-button,
.sp-about-principles-bottom .wp-block-button a,
.sp-about-principles-bottom .wp-block-button__link,
.sp-about-principles-bottom .wp-block-buttons .wp-block-button a,
.sp-about-principles-bottom .wp-block-buttons .wp-block-button__link{
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 16px !important;
  font-weight: 590 !important;
  line-height: 1 !important;
  border-radius: 999px !important;
  padding: 10px 16px !important;
  background: #ffffff !important;
  color: #1A1A1A !important;
  border: 1px solid rgba(255,255,255,0.65) !important;
  box-shadow: none !important;
  text-decoration: none !important;
  background-image: none !important;
  display: inline-block !important;
  cursor: pointer !important;
}

.sp-about-principles-bottom .sp-book-now-button:hover,
.sp-about-principles-bottom a.sp-book-now-button:hover,
.sp-about-principles-bottom .wp-block-button a:hover,
.sp-about-principles-bottom .wp-block-button__link:hover,
.sp-about-principles-bottom .wp-block-buttons .wp-block-button a:hover,
.sp-about-principles-bottom .wp-block-buttons .wp-block-button__link:hover{
  transform: translateY(-1px) !important;
  transition: transform .12s ease, background .12s ease !important;
  background: rgba(255,255,255,0.92) !important;
  color: #1A1A1A !important;
  text-decoration: none !important;
}

/* =========================================================
   4) RESPONSIVE
   ========================================================= */

@media (max-width: 980px){
  body:has(.sp-about-hero){ --sp-pad: 22px; }
  
  .sp-about-hero .wp-block-cover__inner-container{
    padding: 72px var(--sp-pad) 44px !important;
  }
  
  /* Let about paragraph go wider on tablets/phones */
  .sp-about-content{
    max-width: 100% !important;
  }
  
  /* Stack columns on mobile */
  body:has(.sp-about-content) .entry-content .wp-block-columns,
  body:has(.sp-about-content) .wp-block-columns{
    flex-direction: column !important;
    gap: 24px !important;
  }
  
  body:has(.sp-about-content) .entry-content .wp-block-columns .wp-block-column:first-child,
  body:has(.sp-about-content) .entry-content .wp-block-columns .wp-block-column:last-child,
  body:has(.sp-about-content) .wp-block-columns .wp-block-column:first-child,
  body:has(.sp-about-content) .wp-block-columns .wp-block-column:last-child{
    flex-basis: 100% !important;
    width: 100% !important;
  }
  
  .sp-about-principles .wp-block-cover__inner-container{
    padding: 40px var(--sp-pad) !important;
    min-height: 100vh !important; /* Maintain full height on mobile */
  }
  
  .sp-about-principles-top,
  .sp-about-principles-bottom{
    max-width: 100% !important;
    align-self: center !important;
    text-align: center !important;
  }
  
  .sp-about-principles-bottom{
    margin-top: 40px !important;
  }
}

@media (max-width: 560px){
  .sp-about-hero .wp-block-cover__inner-container{
    padding: 60px var(--sp-pad) 36px !important;
  }
  
  .sp-about-content{
    max-width: 100% !important;
    padding: 40px var(--sp-pad) !important;
  }
  
  .sp-about-content p,
  .sp-about-content .wp-block-paragraph{
    font-size: 14px !important;
  }
  
  .sp-about-principles{
    min-height: 100vh !important; /* Maintain full height on small screens */
  }
  
  .sp-about-principles .wp-block-cover__inner-container{
    padding: 30px var(--sp-pad) !important;
    min-height: 100vh !important; /* Maintain full height on small screens */
  }
  
  .sp-about-principles-top p,
  .sp-about-principles-bottom p,
  .sp-about-principles-top .wp-block-paragraph,
  .sp-about-principles-bottom .wp-block-paragraph{
    font-size: 16px !important;
  }
}

/* =========================================================
   Remove white spacing below principles section (above footer)
   ========================================================= */

/* Remove margin/padding from principles section */
.sp-about-principles{
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Remove spacing after principles section */
body:has(.sp-about-principles) .entry-content > .sp-about-principles ~ *,
body:has(.sp-about-principles) .entry-content > *:last-child{
  margin-bottom: 0 !important;
}

/* Remove bottom padding from entry-content */
body:has(.sp-about-principles) .entry-content{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Remove spacing from site-content and content-area */
body:has(.sp-about-principles) .site-content,
body:has(.sp-about-principles) .content-area,
body:has(.sp-about-principles) .site-main{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Remove spacing from ast-container */
body:has(.sp-about-principles) .ast-container{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
