/*
Theme Name: Prioryrooms Tailwind
Theme URI: https://theprioryroom.local
Author: Fryloop
Description: Custom classic theme for The Priory Room using Tailwind CSS and native WordPress/WooCommerce features.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: prioryrooms-tailwind
*/

/* 
 * This file only contains the theme header and a tiny safety rule.
 * All real styling is compiled into assets/build/prioryrooms.css via Tailwind.
 */

body {
  margin: 0;
}

/* All links and buttons site-wide: Beautifully Delicious Sans (override Tailwind/body font) */
body a,
body button,
body input[type="submit"],
body input[type="button"],
a,
button,
input[type="submit"],
input[type="button"] {
  font-family: 'Beautifully Delicious Sans', sans-serif !important;
}

/* Homepage hero: flexbox; on desktop content is centered (justify-content + align-items) */
.priory-home-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}
.priory-home-hero .priory-home-hero-content {
  width: 100%;
  max-width: 72rem;
  padding-bottom: 4rem;
  text-align: left;
}
@media (min-width: 1024px) {
  .priory-home-hero {
    justify-content: center;
    align-items: center;
  }
  /* Content block must not be full width so align-items: center can center it */
  .priory-home-hero .priory-home-hero-content {
    width: auto;
    max-width: 72rem;
    padding-bottom: 0;
  }
}

/* Hero sections: full-bleed background image positioning helpers */
.priory-hero-section {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
/* Centered variant: text sits in the middle of the hero */
.priory-hero-section.priory-hero-center {
  align-items: center;
}
.priory-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
/* Hero background image: cover the section, centered */
.priory-hero-bg.priory-hero-bg-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.priory-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.priory-hero-content-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  padding-bottom: 3rem;
}
@media (min-width: 1024px) {
  .priory-hero-content-wrap {
    padding-bottom: 4rem;
  }
}
/* Centered hero: no bottom padding offset, just even vertical padding */
.priory-hero-center .priory-hero-content-wrap {
  padding-bottom: 0;
  padding-top: 6rem; /* clear the fixed header when hero starts at top */
  text-align: center;
}
@media (min-width: 768px) {
  .priory-hero-center .priory-hero-content-wrap {
    padding-top: 7rem;
  }
}
/* Services hero: main already has margin below header, so less top padding inside hero */
.priory-hero-services-height .priory-hero-content-wrap {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}
@media (min-width: 768px) {
  .priory-hero-services-height .priory-hero-content-wrap {
    padding-top: 2rem;
  }
}
@media (min-width: 768px) {
  .priory-hero-services-height .priory-hero-content-wrap {
    padding-bottom: 4rem;
  }
}

/* Services/category hero: fixed min-height 60vh so background image always shows */
.priory-hero-section.priory-hero-services-height {
  min-height: 60vh;
  height: 60vh;
  flex-shrink: 0;
  box-sizing: border-box;
}
/* Fallback dark background so hero text is always readable if image fails */
.priory-hero-services-bg {
  background-color: #2c2c2c;
}
/* Soft gradient overlay (no solid bar) – keeps image visible, improves text contrast */
.priory-hero-overlay-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(30, 28, 25, 0.25) 0%,
    rgba(30, 28, 25, 0.45) 50%,
    rgba(30, 28, 25, 0.65) 100%
  );
  pointer-events: none;
}
/* Hero text block: one max-width so heading and paragraph align, centered */
.priory-hero-text-inner {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  text-align: center;
}
/* Services hero title – always white, no background on wrap */
.priory-hero-services-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: #fff !important;
  line-height: 1.15;
  margin-bottom: 1rem;
  margin-top: 0;
}
/* Services hero description – white, aligned with title */
.priory-hero-services-desc {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9) !important;
  margin: 0;
}
/* Content section below hero: stay in flow, never overlap hero; enough padding so pills aren’t cut off */
#primary .priory-services-content-section {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding-bottom: 3rem;
}
@media (min-width: 1024px) {
  #primary .priory-services-content-section {
    padding-bottom: 4rem;
  }
}

/* Hero text block: responsive width on homepage hero */
.priory-hero-text-block {
  width: 100%;
}
@media (min-width: 1024px) {
  .priory-hero-text-block {
    max-width: 65%;
  }
}

/*
 * Non-homepage pages: push #primary content below the fixed header
 * (tight padding so no light strip shows between header and hero).
 */
body:not(.home) #primary.site-main {
  padding-top: 4.5rem;
}
@media (min-width: 768px) {
  body:not(.home) #primary.site-main {
    padding-top: 4.5rem;
  }
}

/* Single service: enforce 2-column layout and readable widths */
.priory-single-service .priory-service-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 768px) {
  .priory-single-service .priory-service-two-col {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}
@media (min-width: 1024px) {
  .priory-single-service .priory-service-two-col {
    gap: 3.5rem;
  }
}
/* Swap columns: first column (content) → right, second column (booking) → left */
@media (min-width: 768px) {
  .priory-single-service .priory-service-two-col > div:first-child {
    order: 2;
    min-width: 0;
  }
  .priory-single-service .priory-service-two-col > div:last-child {
    order: 1;
    min-width: 0;
    position: sticky;
    top: 7rem;
  }
}
@media (max-width: 767px) {
  .priory-single-service .priory-service-two-col > div:first-child,
  .priory-single-service .priory-service-two-col > div:last-child {
    min-width: 0;
  }
}
.priory-single-service .priory-service-two-col .prose {
  max-width: 65ch;
}

/* Single service hero when it shows post content (swapped): keep text readable */
.single-service-hero .single-service-hero-content {
  color: rgba(255, 255, 255, 0.9);
}
.single-service-hero .single-service-hero-content p {
  margin-bottom: 0.75em;
}
.single-service-hero .single-service-hero-content p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   MOBILE RESPONSIVENESS  ·  max-width: 767px
   Pure CSS overrides — no PHP edits, no Tailwind rebuild.
   All rules use !important to reliably beat compiled Tailwind.
   Desktop (768px+) is completely unaffected.
   ============================================================ */
@media (max-width: 767px) {

  /* ── Header ─────────────────────────────────────────────── */

  #site-header > div {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Shrink logo */
  #site-header img {
    height: 2rem !important;
  }

  /* Hide "Get in Touch" CTA from header — reachable via mobile menu → Contact */
  #site-header > div > div:last-child {
    display: none !important;
  }

  /* ── Homepage Hero ───────────────────────────────────────── */

  /* Hero: don't force full viewport height on mobile — it creates
     a massive empty image wall above the text. Use auto height so
     the section grows to fit the content with comfortable breathing room. */
  .priory-home-hero {
    min-height: 0 !important;
    height: auto !important;
    justify-content: flex-start !important;
    padding-top: 5rem !important; /* clear fixed header */
    padding-bottom: 0 !important;
  }

  /* Content: sits at the top (below header) with good side padding */
  .priory-home-hero .priory-home-hero-content {
    padding-top: 2.5rem !important;
    padding-bottom: 3rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* Darker gradient: portrait photo is bright, text must remain legible */
  .priory-home-hero-gradient {
    background: linear-gradient(
      to top,
      rgba(30, 28, 25, 0.97) 0%,
      rgba(30, 28, 25, 0.85) 30%,
      rgba(30, 28, 25, 0.60) 58%,
      rgba(30, 28, 25, 0.28) 100%
    ) !important;
  }

  /* Hero heading overrides inline style="font-size: clamp(1.4rem,4vw,2.2rem)"
     4vw of 390px = ~15px — far too small. Force a readable size. */
  .priory-home-hero h1,
  .priory-home-hero .priory-hero-text-block h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.875rem !important;
  }

  .priory-home-hero p,
  .priory-home-hero .priory-hero-text-block p {
    font-size: 0.9375rem !important;
    line-height: 1.65 !important;
  }

  /* Stack CTA buttons full-width */
  .priory-home-hero .flex.flex-row.flex-wrap {
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-bottom: 1.5rem !important;
  }
  .priory-home-hero .flex.flex-row.flex-wrap > a {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* ── Section padding (all pages) ────────────────────────── */
  /* Compiled .section-pad = py-16 px-6. Tighten on mobile. */
  .section-pad {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* Inner max-w-6xl content wrappers: full-width side padding */
  .max-w-6xl {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* ── Feature / service card grids ───────────────────────── */
  /* grid-cols-2 lg:grid-cols-4 → single column on mobile */
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Service section title + "View all" row: stack vertically */
  .flex.flex-wrap.items-end.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* Section headings (h2): more readable size */
  .section-pad h2,
  #primary section h2 {
    font-size: 1.4rem !important;
    line-height: 1.25 !important;
  }

  /* ── Philosophy section image ────────────────────────────── */
  /* Cap portrait width so it doesn't dominate the screen */
  #philosophy .aspect-\[3\/4\] {
    max-width: 18rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* ── Instagram embeds ────────────────────────────────────── */
  /* Inline min-width: 326px causes horizontal overflow — nuke it */
  .priory-instagram-embed iframe {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 380px !important;
  }

  /* ── Discover / Offers section images ───────────────────── */
  .aspect-square.rounded-\[3rem\],
  .aspect-\[4\/3\].rounded-\[3rem\] {
    max-height: 20rem !important;
  }

  /* ── Contact form card ───────────────────────────────────── */
  .bg-priory-light.rounded-\[2rem\] {
    padding: 1.5rem !important;
    border-radius: 1.25rem !important;
  }

  /* ── Services / Category hero (non-home pages) ───────────── */
  .priory-hero-section.priory-hero-services-height {
    min-height: 0 !important;
    height: auto !important;
  }

  .priory-hero-center .priory-hero-content-wrap {
    padding-top: 5rem !important;
    padding-bottom: 2.5rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  .priory-hero-services-title {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.75rem !important;
  }

  .priory-hero-services-desc {
    font-size: 0.9375rem !important;
    line-height: 1.65 !important;
  }

  /* ── Services archive / category filter pills ────────────── */
  /* Pills already wrap — just tighten side padding */
  .priory-services-content-section {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    padding-top: 2rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Filter pill row: allow them to scroll horizontally on mobile */
  .priory-services-content-section .flex.flex-wrap.justify-center.gap-3 {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    padding-bottom: 0.5rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 1.5rem !important;
  }
  .priory-services-content-section .flex.flex-wrap.justify-center.gap-3::-webkit-scrollbar {
    display: none;
  }

  /* Service grid: already sm:grid-cols-2 — on mobile (< sm=640px) it's 1 col.
     Since 390px < 640px, it should already be 1 col. Reinforce: */
  .priory-services-content-section .grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Single service page ─────────────────────────────────── */
  /* Hero padding */
  .single-service-hero {
    padding-top: 5rem !important;
    padding-bottom: 2rem !important;
    min-height: 0 !important;
  }

  .single-service-hero .max-w-6xl {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Service article: tighter side padding */
  .priory-single-service {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* Stat tiles grid: keep 2-col on mobile (compact tiles) */
  /* Recommended treatments grid: single col */
  section.bg-priory-light .grid.grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }

  /* ── About page ──────────────────────────────────────────── */
  /* Page header: tighter padding */
  .has-hero header.relative.bg-priory-cream {
    padding-top: 2rem !important;
    padding-bottom: 2.5rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  .has-hero header.relative.bg-priory-cream h1 {
    font-size: 1.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Core values: md:grid-cols-3 → 1 col on mobile automatically.
     Reduce card padding */
  .bg-white.p-8.rounded-3xl {
    padding: 1.5rem !important;
  }

  /* ── Contact page ────────────────────────────────────────── */
  /* The grid md:grid-cols-2 stacks automatically on mobile.
     Ensure the map has a sensible height */
  .overflow-hidden.rounded-xl.aspect-\[4\/3\] {
    aspect-ratio: 4 / 2.5 !important;
  }

  /* ── About page breadcrumb nav ───────────────────────────── */
  .has-hero > nav.max-w-6xl {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* ── Footer ──────────────────────────────────────────────── */
  /* Footer grid md:grid-cols-3 → stacks to 1 col on mobile automatically.
     Tighten padding. */
  #site-footer > div:first-child {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  #site-footer .grid {
    gap: 2rem !important;
    text-align: center !important;
  }

  /* ── Non-home page main content top offset ───────────────── */
  body:not(.home) #primary.site-main {
    padding-top: 3.5rem !important;
  }

}

