/*
Theme Name: KLI Theme
Theme URI: https://kinneyleadership.com
Author: Together We Church
Description: Custom theme for Kinney Leadership Institute website.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: kli-theme
*/

/* ========================================================================
   CSS RESET & BASE
   ======================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

/* ========================================================================
   FONTS
   ======================================================================== */

@font-face {
  font-family: 'Geist Sans';
  src: url('./assets/fonts/GeistVF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('./assets/fonts/GeistMonoVF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ========================================================================
   CSS CUSTOM PROPERTIES
   ======================================================================== */

:root {
  /* Colors */
  --color-white: #ffffff;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  --color-black: #000000;

  /* Theme tokens */
  --background: var(--color-white);
  --foreground: var(--color-gray-900);
  --primary: var(--color-gray-900);
  --primary-foreground: var(--color-white);
  --card: #f5f5f5;
  --border: #e5e5e5;

  /* Typography */
  --font-sans: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

  /* Spacing */
  --container-padding: 1rem;
  --section-padding-y: 5rem;

  /* Border radius */
  --radius: 0.25rem;
  --radius-lg: 0.8rem;

  /* Breakpoints (for reference) */
  /* sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1376px */
}

/* ========================================================================
   BODY & TYPOGRAPHY
   ======================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--foreground);
  background-color: var(--background);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: normal;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 1.5rem; }
}

/* ========================================================================
   CONTAINER
   ======================================================================== */

.container {
  width: 100%;
  max-width: 86rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ========================================================================
   PROSE (Rich text content)
   ======================================================================== */

.prose {
  max-width: 65ch;
  line-height: 1.75;
}

.prose p {
  margin-bottom: 1.25em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose h1 {
  font-size: 2.25rem;
  margin-bottom: 0.25em;
  margin-top: 1.5em;
}

.prose h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25em;
  margin-top: 1.5em;
  font-weight: 600;
}

.prose h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25em;
  margin-top: 1.5em;
  font-weight: 600;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose strong {
  font-weight: 700;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1em;
  font-style: italic;
  margin: 1.5em 0;
}

.prose-lg {
  font-size: 1.125rem;
  line-height: 1.8;
}

.prose-lg p {
  margin-bottom: 1.5em;
}

.prose-invert {
  color: var(--color-white);
}

.prose-invert a {
  color: var(--color-white);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: var(--radius);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn--default {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn--default:hover {
  background-color: var(--color-gray-700);
}

.btn--outline {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background-color: var(--background);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn--outline:hover {
  background-color: var(--color-gray-100);
}

.btn--lg {
  height: 2.75rem;
  padding: 0.5rem 2rem;
  border-radius: 0.375rem;
}

.btn--section-dark {
  background-color: var(--color-white);
  color: var(--color-gray-900);
  padding: 0.75rem 2rem;
  font-weight: 500;
  transition: background-color 0.15s;
}

.btn--section-dark:hover {
  background-color: var(--color-gray-200);
}

.btn--section-light {
  background-color: var(--color-gray-900);
  color: var(--color-white);
  padding: 0.75rem 2rem;
  font-weight: 500;
  transition: background-color 0.15s;
}

.btn--section-light:hover {
  background-color: var(--color-gray-700);
}

/* ========================================================================
   SITE HEADER
   ======================================================================== */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: transparent;
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.site-header__logo {
  margin-bottom: 0.75rem;
}

.site-header__logo img {
  width: 120px;
  height: auto;
}

/* Mobile menu toggle */
.site-header__toggle {
  display: block;
  color: rgba(255, 255, 255, 0.9);
}

.site-header__toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 768px) {
  .site-header__toggle {
    display: none;
  }
}

/* Navigation */
.site-header__nav {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.site-header__nav.is-open {
  display: flex;
  background: rgba(0, 0, 0, 0.85);
  padding: 1.5rem 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
}

@media (min-width: 768px) {
  .site-header__nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 4rem;
    margin-top: 0;
  }
}

.site-header__nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  transition: color 0.15s;
}

.site-header__nav a:hover {
  color: #ffffff;
}

/* ========================================================================
   SITE FOOTER
   ======================================================================== */

.site-footer {
  background-color: var(--color-gray-900);
  color: var(--color-white);
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer__inner {
  text-align: center;
  font-size: 0.875rem;
}

.site-footer__items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.site-footer__sep {
  display: none;
}

@media (min-width: 640px) {
  .site-footer__sep {
    display: inline;
  }
}

.site-footer a {
  text-decoration: underline;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--color-gray-300);
}

/* ========================================================================
   HEROES
   ======================================================================== */

/* KLI Hero (home page branded hero) */
.hero--kli {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: -10.4rem;
}

.hero--kli__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero--kli__overlay-dark {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero--kli__overlay-diagonal {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30, 30, 30, 0.7) 0%,
    rgba(30, 30, 30, 0.7) 50%,
    rgba(80, 80, 80, 0.5) 50%,
    rgba(80, 80, 80, 0.5) 100%
  );
}

.hero--kli__content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding-top: 14rem;
}

.hero--kli__logo {
  max-width: 400px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* High Impact Hero */
.hero--high-impact {
  position: relative;
  margin-top: -10.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  min-height: 80vh;
  overflow: hidden;
}

.hero--high-impact__bg {
  position: absolute;
  inset: 0;
}

.hero--high-impact__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero--high-impact__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero--high-impact__content {
  position: relative;
  z-index: 10;
  max-width: 36.5rem;
  text-align: center;
  padding: 16rem 1rem 2rem;
}

.hero--high-impact__content .prose {
  margin-bottom: 1.5rem;
}

.hero--high-impact__links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
}

/* Medium Impact Hero */
.hero--medium-impact {
  padding-top: 2rem;
}

.hero--medium-impact__content {
  margin-bottom: 2rem;
}

.hero--medium-impact__content .prose {
  margin-bottom: 1.5rem;
}

.hero--medium-impact__links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.hero--medium-impact__media {
  margin-left: -1rem;
  margin-right: -1rem;
}

@media (min-width: 768px) {
  .hero--medium-impact__media {
    margin-left: -2rem;
    margin-right: -2rem;
  }
}

.hero--medium-impact__media img {
  width: 100%;
  height: auto;
}

/* Low Impact Hero */
.hero--low-impact {
  padding-top: 4rem;
}

.hero--low-impact__content {
  max-width: 48rem;
}

.hero--low-impact__content .prose {
  margin-bottom: 1.5rem;
}

.hero--low-impact__links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

/* ========================================================================
   SECTION BLOCK
   ======================================================================== */

.block-section {
  padding: var(--section-padding-y) 1rem;
}

.block-section--white {
  background-color: var(--color-white);
  color: var(--color-gray-900);
}

.block-section--gray {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
}

.block-section--dark {
  background-color: var(--color-gray-900);
  color: var(--color-white);
}

.block-section__inner {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.block-section__heading {
  font-size: 2.25rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .block-section__heading {
    font-size: 3.75rem;
  }
}

.block-section__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.block-section__logo {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

.block-section__logo img {
  max-width: 250px;
  height: auto;
  object-fit: contain;
}

/* ========================================================================
   CONTENT BLOCK
   ======================================================================== */

.block-content {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.block-content__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 4rem;
}

@media (min-width: 1024px) {
  .block-content__grid {
    grid-template-columns: repeat(12, 1fr);
  }
}

.block-content__col--full {
  grid-column: span 4;
}

.block-content__col--half {
  grid-column: span 4;
}

.block-content__col--one-third {
  grid-column: span 4;
}

.block-content__col--two-thirds {
  grid-column: span 4;
}

@media (min-width: 768px) {
  .block-content__col--half,
  .block-content__col--one-third,
  .block-content__col--two-thirds {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .block-content__col--full { grid-column: span 12; }
  .block-content__col--half { grid-column: span 6; }
  .block-content__col--one-third { grid-column: span 4; }
  .block-content__col--two-thirds { grid-column: span 8; }
}

/* ========================================================================
   CTA BLOCK
   ======================================================================== */

.block-cta {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .block-cta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.block-cta__content {
  max-width: 48rem;
  display: flex;
  align-items: center;
}

.block-cta__content .prose p:last-child {
  margin-bottom: 0;
}

.block-cta__links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ========================================================================
   MEDIA BLOCK
   ======================================================================== */

.block-media img {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  height: auto;
}

.block-media__caption {
  margin-top: 1.5rem;
}

/* ========================================================================
   FORM BLOCK
   ======================================================================== */

.block-form {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.block-form__intro {
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .block-form__intro {
    margin-bottom: 3rem;
  }
}

.block-form__wrapper {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (min-width: 1024px) {
  .block-form__wrapper {
    padding: 1.5rem;
  }
}

/* WPForms style overrides to match site design */
.block-form .wpforms-container .wpforms-form .wpforms-field {
  margin-bottom: 1.5rem;
}

.block-form .wpforms-container .wpforms-form .wpforms-field:last-child {
  margin-bottom: 0;
}

.block-form .wpforms-container .wpforms-form .wpforms-field-label {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.block-form .wpforms-container .wpforms-form input[type="text"],
.block-form .wpforms-container .wpforms-form input[type="email"],
.block-form .wpforms-container .wpforms-form input[type="number"],
.block-form .wpforms-container .wpforms-form textarea,
.block-form .wpforms-container .wpforms-form select {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}

.block-form .wpforms-container .wpforms-form input:focus,
.block-form .wpforms-container .wpforms-form textarea:focus,
.block-form .wpforms-container .wpforms-form select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.block-form .wpforms-container .wpforms-form .wpforms-submit-container button {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.15s;
  border: none;
}

.block-form .wpforms-container .wpforms-form .wpforms-submit-container button:hover {
  background-color: var(--color-gray-700);
}

/* ========================================================================
   FAQ BLOCK
   ======================================================================== */

.block-faq {
  background-color: var(--color-white);
  color: var(--color-gray-900);
  padding: var(--section-padding-y) 1rem;
}

.block-faq__inner {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.block-faq__heading {
  font-size: 1.875rem;
  text-align: center;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .block-faq__heading {
    font-size: 2.25rem;
  }
}

.block-faq__list {
  border-top: 1px solid var(--color-gray-200);
}

.block-faq__item {
  border-bottom: 1px solid var(--color-gray-200);
}

.block-faq__question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 1.125rem;
}

@media (min-width: 768px) {
  .block-faq__question {
    font-size: 1.25rem;
  }
}

.block-faq__question-text {
  padding-right: 1rem;
}

.block-faq__chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.block-faq__item.is-open .block-faq__chevron {
  transform: rotate(180deg);
}

.block-faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding-bottom 0.3s ease;
}

.block-faq__item.is-open .block-faq__answer {
  max-height: 1000px;
  padding-bottom: 1.25rem;
}

.block-faq__answer-inner {
  color: var(--color-gray-600);
}

/* ========================================================================
   CURRENT RESIDENTS PAGE
   ======================================================================== */

.residents-page {
  position: relative;
  min-height: 100vh;
  margin-top: -10.4rem;
  padding-top: 22rem;
  padding-bottom: 5rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.residents-page__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.residents-page__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30, 30, 30, 0.85) 0%,
    rgba(30, 30, 30, 0.85) 50%,
    rgba(80, 80, 80, 0.75) 50%,
    rgba(80, 80, 80, 0.75) 100%
  );
}

.residents-page__inner {
  position: relative;
  z-index: 10;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.residents-page__heading {
  font-size: 2.25rem;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .residents-page__heading {
    font-size: 3rem;
  }
}

.residents-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .residents-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.resident-card__photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 1rem;
  overflow: hidden;
}

.resident-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resident-card__name {
  font-size: 1.25rem;
  color: var(--color-white);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.resident-card__bio {
  color: var(--color-gray-300);
  font-size: 0.875rem;
  line-height: 1.625;
}

/* ========================================================================
   404 PAGE
   ======================================================================== */

.page-404 {
  padding: 7rem 0;
}

.page-404 h1 {
  margin-bottom: 0;
}

.page-404 p {
  margin-bottom: 1rem;
}

/* ========================================================================
   WORDPRESS-SPECIFIC OVERRIDES
   ======================================================================== */

/* Ensure main content fills available space */
.site-main {
  flex: 1;
}

/* Alignment classes */
.alignwide {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100%;
}

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
