/*
Theme Name: Dafa CF Theme
Theme URI: 
Author: AI Assistant
Author URI: 
Description: A WordPress theme ported from the EmDash Astro project.
Version: 1.0.0
Text Domain: dafacf
*/

:root {
  --wide-width: 1200px;
  --nav-height: 80px;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: monospace;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-soft: #60a5fa;
  --color-heading: #1e3a8a;
  --color-text-secondary: #4b5563;
  --color-border: #e5e7eb;
  --color-muted: #9ca3af;
}

/* Reset / Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: #1e293b;
  background-color: #fdfbf7;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  line-height: 1.2;
}

a {
  text-decoration: none;
}

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

/* Base.astro Styles */
main {
  min-height: calc(100vh - var(--nav-height) - 22rem);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(30, 58, 138, 0.1);
  background: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.nav-shell {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-lockup {
  text-decoration: none;
  color: inherit;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #1e3a8a;
  transition: color 0.2s ease;
}

.brand-lockup:hover .brand-title {
  color: #1d4ed8;
}

.brand-tagline {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-top: 0.25rem;
}

.site-logo-img {
  height: 3rem;
  width: auto;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #1e3a8a;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s ease;
}

.menu-toggle:active {
  transform: scale(0.9);
}

/* WP Nav Menu Reset */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: #4b5563;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #2563eb;
}

.nav-blog-link {
  color: #2563eb !important;
  font-weight: 800 !important;
}

.nav-register-btn {
  background: #2563eb;
  color: white !important;
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  transition: all 0.2s ease !important;
}

.nav-register-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  z-index: 10;
  color: #9ca3af;
  pointer-events: none;
  transition: color 0.3s ease;
}

.site-search {
  position: relative;
  width: 100%;
  max-width: 220px;
  height: 40px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: all 0.3s ease;
}

.search-wrapper:focus-within .site-search {
  background: white;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.search-wrapper:focus-within .search-icon {
  color: #2563eb;
}

.site-search-input {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  padding: 0 1rem 0 2.5rem !important;
  background: transparent !important;
  border: none !important;
  font-size: 1rem;
  outline: none;
  color: #1e293b;
  cursor: text;
}

@media (min-width: 1025px) {
  .search-wrapper.mobile-menu-search {
    width: 220px;
    margin: 0 1rem;
  }
}

@media (max-width: 1024px) {
  .search-wrapper.mobile-menu-search {
    width: 100%;
    margin: 0.5rem 0;
  }
  .mobile-menu-search .site-search {
    max-width: 100%;
  }
}

.site-footer {
  background: #1e3a8a;
  color: white;
  padding: 5rem 0;
}

.footer-shell {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-bottom: 5rem;
  padding-bottom: 5rem;
  border-bottom: 1px solid rgba(29, 78, 216, 0.5);
}

.footer-title {
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  font-weight: 800;
  color: white;
  margin-bottom: 2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.footer-copy {
  font-family: var(--font-serif, serif);
  font-size: 1.25rem;
  line-height: 1.75;
  color: #dbeafe;
  max-width: 28rem;
}

.footer-schedule {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.schedule-card {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 160ms ease;
  cursor: pointer;
}

.schedule-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.schedule-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 0.5rem;
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.schedule-days {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
}

.schedule-time {
  font-family: var(--font-mono);
  color: #bfdbfe;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #bfdbfe;
  font-weight: 500;
}

.footer-legal {
  display: flex;
  gap: 2rem;
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-legal a:hover {
  color: white;
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: rgba(253, 251, 247, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-direction: column;
    align-items: stretch;
    padding: 0 1.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 1.125rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .nav-register-btn {
    margin-top: 1rem;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .footer-primary {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .nav-shell {
    padding-inline: 1rem;
  }

  .nav-links {
    justify-content: center;
  }
}

/* index.astro Styles */
.fd-shell {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding-inline: 1.5rem;
}

.fd-section {
  padding: 6rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.fd-kicker {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent-soft);
}

.fd-hero {
  position: relative;
  z-index: 1;
  min-height: min(90vh, 56rem);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.fd-hero-media,
.fd-hero-image,
.fd-hero-overlay {
  position: absolute;
  inset: 0;
}

.fd-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 28% center;
}

.fd-hero-overlay {
  background:
    linear-gradient(
      270deg,
      rgba(253, 251, 247, 0.98) 20%,
      rgba(253, 251, 247, 0.55) 48%,
      rgba(253, 251, 247, 0.05) 78%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 50%,
      rgba(253, 251, 247, 0.2) 100%
    );
}

.fd-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.fd-hero-copy {
  width: min(42rem, 48%);
  margin-left: auto;
  text-align: right;
}

.fd-hero-copy h1,
.fd-heading-center h2,
.fd-sticky-copy h2,
.fd-posts-header h2 {
  font-family: var(--font-sans);
  color: var(--color-heading);
  font-weight: 800;
}

.fd-hero-copy h1 {
  margin-top: 1rem;
  font-size: clamp(2.6rem, 5vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.fd-lead {
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.fd-link-list {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.6rem;
}

.fd-link-list a {
  font-weight: 700;
  color: var(--color-heading);
}

.fd-actions {
  margin-top: 1.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.fd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fd-button-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

.fd-button-primary:hover {
  background: var(--color-accent-hover);
  color: white;
}

.fd-button-secondary {
  border: 1px solid color-mix(in srgb, var(--color-accent) 16%, transparent);
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-heading);
}

.fd-benefit-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr);
  gap: 2.5rem;
}

.fd-sticky-copy {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  align-self: start;
}

.fd-sticky-copy h2,
.fd-heading-center h2,
.fd-posts-header h2 {
  margin-top: 0.8rem;
  font-size: clamp(2.4rem, 4vw, 4.3rem);
  line-height: 0.95;
}

.fd-sticky-copy p:last-child {
  margin-top: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.fd-benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-border));
  border: 1px solid color-mix(in srgb, var(--color-accent) 10%, var(--color-border));
}

.fd-benefit-card {
  min-height: 23rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
}

.fd-benefit-stat {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 4.5rem;
  line-height: 1;
  color: rgba(15, 23, 42, 0.08);
}

.fd-benefit-icon {
  width: 4.2rem;
  height: 4.2rem;
  object-fit: contain;
  margin: 2rem 0;
}

.fd-benefit-card h3,
.fd-exercise-card h3 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.7rem;
}

.fd-benefit-card p,
.fd-exercise-card p {
  margin-top: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
}

.fd-intro {
  background: rgba(255, 255, 255, 0.35);
}

.fd-heading-center {
  text-align: center;
}

.fd-divider {
  width: 6rem;
  height: 1px;
  margin: 1.5rem auto 0;
  background: color-mix(in srgb, var(--color-heading) 25%, transparent);
}

.fd-intro-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.95fr);
  gap: 3rem;
  align-items: center;
}

.fd-prose {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--color-text-secondary);
}

.fd-prose-lead {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-heading);
}

.fd-prose p + p {
  margin-top: 1rem;
}

.fd-prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 4px solid var(--color-accent);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.4;
  color: var(--color-heading);
}

.fd-note {
  font-size: 0.95rem;
  font-style: italic;
}

.fd-video-wrap {
  position: relative;
}

.fd-video-wrap::before,
.fd-video-wrap::after {
  content: "";
  position: absolute;
  inset: -0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.fd-video-wrap::before {
  transform: rotate(2deg);
}

.fd-video-wrap::after {
  transform: rotate(-2deg);
}

.fd-video-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.fd-video {
  width: 100%;
  height: 100%;
  border: 0;
}

.fd-video-caption {
  display: block;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.fd-exercise-grid {
  display: flex;
  flex-flow: wrap;
  margin: 2rem 0 0;
  gap: 0;
}

.fd-post-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .fd-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .fd-post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fd-post-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.fd-post-thumbnail {
  display: block;
}

.fd-post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.fd-post-content {
  padding: 1.5rem;
}

.fd-post-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.fd-post-title a {
  color: var(--color-heading);
}

.fd-post-excerpt {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.fd-post-excerpt p {
  margin: 0;
}

.fd-exercise-card {
  flex: 1 1 0%;
  text-align: left;
  margin: 0 0.25rem 2rem;
}

.fd-exercise-image-wrap {
  text-align: center;
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.fd-exercise-image {
  width: 150px !important;
  height: auto;
}

.fd-exercise-header {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 0.5rem;
}

.fd-exercise-number {
  display: inline-block;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: 0.875rem;
  border: 0.125rem solid #f5b700;
  border-radius: 50%;
  background-color: #f5b700;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 2.125rem;
  text-align: center;
  vertical-align: top;
  flex-shrink: 0;
}

.fd-exercise-title {
  display: inline-block;
  width: 80%;
  color: #23408f;
  font-family: Arial, sans-serif;
  font-size: 1.375rem;
  font-weight: 200;
  line-height: 1.625rem;
  vertical-align: middle;
}

.fd-exercise-desc {
  margin-left: 3.125rem;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.25rem;
  text-align: justify;
  color: #343a40;
}

.fd-posts {
  border-bottom: none;
}

.fd-posts-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.fd-inline-link {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

@media (max-width: 1080px) {
  .fd-hero-copy {
    width: min(100%, 32rem);
  }

  .fd-benefit-layout,
  .fd-intro-grid,
  .fd-post-grid {
    grid-template-columns: 1fr !important;
  }

  .fd-exercise-grid {
    padding: 1.75rem 2rem;
  }
  .fd-exercise-title {
    font-size: 1.375rem !important;
  }

  .fd-benefit-grid {
    grid-template-columns: 1fr !important;
  }

  .fd-sticky-copy {
    position: static;
  }
}

@media (max-width: 500px) {
  .fd-exercise-grid {
    padding: 1.75rem 0;
  }

  .fd-exercise-card {
    width: 100%;
    margin: 0 0 2rem;
  }

  .fd-exercise-image-wrap {
    width: 100%;
    margin-top: 2rem;
  }

  .fd-exercise-image {
    width: 100% !important;
    max-width: 100%;
  }

  .fd-exercise-title {
    font-size: 1.375rem;
    line-height: 2.25rem;
  }

  .fd-exercise-desc {
    margin-left: 2.725rem;
    margin-right: 2.725rem;
    font-size: 1.125rem;
  }
}

@media (max-width: 720px) {
  .fd-shell {
    padding-inline: 1rem;
  }

  .fd-hero {
    min-height: 42rem;
  }

  .fd-hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(253, 251, 247, 0.1) 0%,
      rgba(253, 251, 247, 0.76) 48%,
      rgba(253, 251, 247, 0.98) 100%
    );
  }

  .fd-hero-content {
    justify-content: stretch;
    padding-top: 7rem;
    padding-bottom: 2rem;
  }

  .fd-hero-copy {
    width: 100%;
    text-align: left;
  }

  .fd-actions {
    justify-content: flex-start;
  }
}
