/*
Theme Name: Tap Into Ataxia Child
Template: generatepress
Author: DK Designs
Version: 1.0
*/

/* Trust colors & spacing */
:root {
  --tia-primary: #2a5a8a;
  --tia-accent: #3da9fc;
  --tia-text: #333;
  --tia-text-light: #666;
  --tia-bg: #fff;
  --tia-header-bg: #2a5a8a;
  --tia-footer-bg: #1a3a5a;
  --tia-spacing: 1rem;
  --tia-max-width: 760px;
  --tia-section-padding: 2rem 1rem;
  --tia-content-max: 960px;
}

/* Smooth scroll for anchor links */
.tia-one-page-root {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* One Page Layout - Mobile First */
.tia-one-page {
  margin: 0;
  padding: 0;
  line-height: 1.7;
  color: var(--tia-text);
  background: var(--tia-bg);
}

.tia-one-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.tia-header {
  background: var(--tia-header-bg);
  color: #fff;
  padding: var(--tia-spacing) 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: padding 0.25s ease;
}

.tia-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: gap 0.25s ease;
}

/* Shrunk header when scrolled */
.tia-header.tia-header-scrolled {
  padding: 0.5rem 1rem;
}

.tia-header.tia-header-scrolled .tia-header-inner {
  gap: 0.5rem;
}

/* Mobile: logo on top, hamburger centered below */
.tia-mobile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
}

.tia-logo-mobile {
  display: flex;
  justify-content: center;
}

.tia-nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
}

.tia-nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tia-header.tia-nav-open .tia-nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.tia-header.tia-nav-open .tia-nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.tia-header.tia-nav-open .tia-nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.tia-logo-desktop {
  display: none;
}

/* Mobile: compact header + fix anchor scroll position */
@media (max-width: 599px) {
  .tia-nav-centered .tia-logo-desktop {
    display: none !important;
  }

  .tia-header {
    padding: 0.5rem 1rem;
  }

  .tia-header-inner {
    gap: 0.5rem;
  }

  .tia-mobile-header {
    gap: 0.5rem;
  }

  .tia-logo-img {
    height: clamp(56px, 14vw, 80px);
  }

  .tia-site-title {
    font-size: 1rem;
  }

  /* Match scroll-margin and scroll-padding to header height so anchors land correctly */
  .tia-one-page-root {
    scroll-padding-top: 265px;
  }

  .tia-main .tia-hero-section,
  .tia-main .tia-content-section {
    scroll-margin-top: 265px;
  }
}

/* Mobile: collapsible nav */
.tia-nav-centered {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tia-header.tia-nav-open .tia-nav-centered {
  max-height: 80vh;
}

.tia-nav-centered .tia-nav-list {
  flex-direction: column;
  width: 100%;
  padding: 0.5rem 0;
}

.tia-nav-left,
.tia-nav-right {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}

.tia-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tia-logo-img {
  display: block;
  /* Responsive: scales with viewport */
  height: clamp(88px, 14vw, 160px);
  width: auto;
  max-width: none;
  object-fit: contain;
  transition: height 0.25s ease;
}

.tia-header.tia-header-scrolled .tia-logo-img {
  height: clamp(48px, 8vw, 72px);
}

.tia-site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: font-size 0.25s ease;
}

.tia-header.tia-header-scrolled .tia-site-title {
  font-size: 1rem;
}

.tia-site-title:hover {
  color: var(--tia-accent);
}

.tia-nav-list a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9375rem;
}

.tia-nav-list a:hover {
  color: #fff;
}

.tia-nav-list a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: #fff;
}

/* Main Content */
.tia-main {
  flex: 1;
  padding: 0;
  overflow-x: hidden;
}

.tia-main > * {
  box-sizing: border-box;
}

/* ============================================
   TIA Page Sections - Responsive & Spacing
   ============================================ */

/* Section base: consistent padding, scroll-margin for anchor nav */
.tia-main .tia-hero-section,
.tia-main .tia-content-section {
  padding: var(--tia-section-padding);
  scroll-margin-top: 100px;
}

.tia-main .tia-content-section {
  max-width: var(--tia-content-max);
  margin-left: auto;
  margin-right: auto;
}

/* Hero: media-text block */
.tia-hero-section .wp-block-media-text {
  min-height: 0;
  gap: 1.5rem;
}

.tia-hero-section .wp-block-media-text__content {
  padding: 1.5rem 1rem;
}

.tia-hero-section .wp-block-media-text__media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.tia-hero-section .wp-block-heading {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* Columns: stack on mobile, side-by-side on tablet+ */
.tia-main .wp-block-columns {
  flex-wrap: wrap;
  gap: 1.5rem;
}

.tia-main .wp-block-column {
  min-width: 0;
}

@media (max-width: 599px) {
  .tia-main .wp-block-column {
    flex-basis: 100% !important;
  }
}

/* Cover blocks: responsive height */
.tia-main .wp-block-cover {
  min-height: clamp(120px, 25vw, 180px);
}

.tia-main .wp-block-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Spacing between cover block and content below */
#ataxia .wp-block-cover,
#donate .wp-block-cover,
#resources .wp-block-cover {
  margin-bottom: 2rem;
}

/* Images: always responsive */
.tia-main .wp-block-image img,
.tia-main figure img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Details (expandable): consistent spacing */
.tia-main .wp-block-details {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.tia-main .wp-block-details summary {
  cursor: pointer;
  font-weight: 600;
}

.tia-main .wp-block-details[open] summary {
  margin-bottom: 0.75rem;
}

/* Buttons: full width on small screens */
.tia-main .wp-block-buttons {
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Spacing below buttons in Ataxia section */
#ataxia .wp-block-buttons {
  margin-bottom: 2rem;
}

/* GiveWP donation form container */
.tia-main .give-block-container {
  max-width: 100%;
}

/* Consistent block spacing within sections */
.tia-main .tia-content-section .wp-block-columns + .wp-block-columns {
  margin-top: 2rem;
}

/* Story section: more padding between subsections */
#story .wp-block-columns {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

#story .wp-block-columns:first-child {
  margin-top: 0;
}

#story .wp-block-columns:last-child {
  margin-bottom: 0;
}

/* Hero Section (legacy) */
.tia-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tia-hero-image {
  position: absolute;
  inset: 0;
}

.tia-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tia-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem;
}

.tia-hero-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 3rem);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Content Sections */
.tia-section {
  padding: 2rem 1rem;
  scroll-margin-top: 80px;
}

.tia-content-section {
  max-width: 960px;
  margin: 0 auto;
}

.tia-section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.tia-section-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  border-radius: 4px;
}

.tia-section-text {
  text-align: center;
}

.tia-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--tia-text);
}

.tia-section-para {
  margin: 0;
  font-size: 1rem;
  color: var(--tia-text-light);
  line-height: 1.6;
}

/* Alternate section backgrounds */
.tia-content-section:nth-of-type(even) {
  background: #f8f9fa;
}

/* Footer */
.tia-footer {
  background: var(--tia-footer-bg);
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem;
  margin-top: auto;
}

.tia-footer-inner {
  max-width: var(--tia-max-width);
  margin: 0 auto;
  text-align: center;
}

.tia-footer-text {
  margin: 0;
  font-size: 0.875rem;
}

/* Tablet and up - logo centered between nav links */
@media (min-width: 600px) {
  :root {
    --tia-spacing: 1.25rem;
    --tia-section-padding: 2.5rem 1.5rem;
  }

  .tia-mobile-header {
    display: none;
  }

  .tia-nav-toggle {
    display: none;
  }

  .tia-logo-mobile {
    display: none;
  }

  .tia-logo-desktop {
    display: inline-flex;
  }

  .tia-nav-centered {
    max-height: none;
    overflow: visible;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
  }

  .tia-nav-centered .tia-nav-list {
    flex-direction: row;
    padding: 0;
    width: auto;
  }

  .tia-nav-left {
    flex: 1;
    justify-content: flex-end;
    gap: 1.5rem;
  }

  .tia-nav-right {
    flex: 1;
    justify-content: flex-start;
    gap: 1.5rem;
  }

  .tia-logo {
    flex-shrink: 0;
    order: 0;
  }

  .tia-logo-img {
    /* Tablet: 96–140px */
    height: clamp(96px, 12vw, 140px);
  }

  .tia-site-title {
    font-size: 1.5rem;
  }

  .tia-section-inner {
    flex-direction: row;
    gap: 1.5rem;
    text-align: left;
  }

  .tia-section-inner .tia-section-image {
    max-width: 280px;
    flex-shrink: 0;
  }

  .tia-section-text {
    text-align: left;
  }

  .tia-section {
    padding: 2.5rem 1.5rem;
  }
}

/* Desktop */
@media (min-width: 900px) {
  :root {
    --tia-spacing: 1.5rem;
    --tia-section-padding: 3rem 2rem;
  }

  .tia-nav-centered {
    gap: 2.5rem;
  }

  .tia-nav-left,
  .tia-nav-right {
    gap: 2rem;
  }

  .tia-logo-img {
    /* Desktop: 120–180px */
    height: clamp(120px, 14vw, 180px);
  }

  .tia-section-inner .tia-section-image {
    max-width: 320px;
  }

  .tia-section {
    padding: 3rem 2rem;
  }
}