/* Vital Attraction — modern static site */

:root {
  --color-primary: #a52a2a;
  --color-primary-dark: #7a1a1a;
  --color-accent: #e04545;
  --color-warm: #f0a030;
  --color-warm-soft: #ffe4a8;
  --color-nav: #f5b942;
  --color-nav-deep: #e89420;
  --color-surface: #fff9f0;
  --color-surface-alt: #fff0d6;
  --color-cream: var(--color-surface);
  --color-text: #3a2218;
  --color-text-muted: #6b4a38;
  --color-white: #ffffff;
  --color-border: rgba(165, 42, 42, 0.14);
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --shadow-sm: 0 1px 3px rgba(100, 40, 20, 0.08);
  --shadow-md: 0 10px 36px rgba(120, 30, 20, 0.22);
  --radius: 12px;
  --max-width: 1100px;
  --nav-width: 220px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text);
  background:
    radial-gradient(ellipse 80% 50% at 15% 20%, rgba(255, 180, 40, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 85% 75%, rgba(255, 100, 50, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 60% 10%, rgba(255, 220, 80, 0.35) 0%, transparent 45%),
    linear-gradient(155deg, #c41e1e 0%, #e85a20 35%, #d4381a 65%, #9a1515 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--color-nav);
  color: var(--color-primary-dark);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* Layout shell */
.site-wrapper {
  max-width: calc(var(--max-width) + var(--nav-width) + 4rem);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.site-grid {
  display: grid;
  grid-template-columns: var(--nav-width) 1fr;
  gap: 0;
  background: var(--color-cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Sidebar / navigation */
.site-nav {
  background: linear-gradient(180deg, #ffc94a 0%, #f5a623 45%, #e8881a 100%);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.nav-hero {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-primary-dark);
}

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

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0;
  flex: 1;
}

.nav-menu a {
  display: block;
  padding: 0.85rem 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: rgba(255, 255, 255, 0.5);
  border-left-color: #a01818;
  color: #7a1010;
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffc94a 0%, #f0a030 100%);
  color: #6b2010;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  font-size: 1.4rem;
  line-height: 1;
}

/* Main content */
.site-main {
  padding: 2rem 2.5rem 2.5rem;
  min-width: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.site-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--color-primary);
  margin: 0;
}

.site-logo img {
  max-height: 70px;
  width: auto;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.3;
  color: var(--color-primary-dark);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.lead {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--color-text-muted);
}

.highlight {
  color: var(--color-accent);
  font-weight: 600;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2rem 0;
  background: linear-gradient(90deg, #fff3cc 0%, #ffe8a0 50%, #ffd878 100%);
  border: 1px solid rgba(232, 148, 32, 0.35);
  border-radius: var(--radius);
}

.pillar {
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
}

.pillar:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: rgba(180, 80, 20, 0.25);
}

.pillar-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  letter-spacing: 0.02em;
}

.content-block {
  margin-bottom: 1.25rem;
}

.content-block p {
  margin: 0 0 1rem;
  text-align: justify;
}

.content-block ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.content-block li {
  margin-bottom: 0.75rem;
}

.emphasis {
  color: var(--color-accent);
  font-style: italic;
}

/* Page intro (shared with homepage) */
.page-intro,
.home-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.page-intro-media img,
.home-intro .hero-image img {
  width: 200px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--color-surface-alt);
}

.page-intro--wide .page-intro-media img {
  width: 280px;
}

.page-intro--portrait .page-intro-media img {
  width: 220px;
  max-height: 320px;
  object-fit: cover;
}

.home-intro .hero-image img {
  border-radius: 50%;
}

.home-intro .hero-image {
  margin: 0;
}

.page-intro-media {
  margin: 0;
}

.page-intro-text h1,
.home-intro-text h1 {
  margin-top: 0;
}

.page-subtitle {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: -0.25rem 0 1rem;
}

.hero-image {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-image img {
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--color-surface-alt);
}

.image-caption {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* Term definitions (Chi Neng page) */
.terms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0 0 2rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.term {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.term:nth-child(odd) {
  border-right: 1px solid var(--color-border);
}

.term:last-child,
.term:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}

.term-name {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.term-desc {
  font-size: 0.95rem;
  color: var(--color-text);
}

.term--full {
  grid-column: 1 / -1;
  border-right: none !important;
}

/* Quote / emphasis block */
.quote-block {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  background: linear-gradient(90deg, #fff0d0 0%, #fff8ec 100%);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.quote-block p {
  margin: 0;
  color: var(--color-accent);
  font-style: italic;
}

.quote-block p + p {
  margin-top: 0.5rem;
}

/* Section heading with divider */
.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  margin-bottom: 0.5rem;
}

.page-heading .lead {
  margin: 0;
}

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.two-col .content-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--color-surface-alt);
}

/* Elements table */
.elements-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.elements-table th,
.elements-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

.elements-table tr:last-child th,
.elements-table tr:last-child td {
  border-bottom: none;
}

.elements-table th {
  width: 90px;
  font-weight: 700;
  background: var(--color-surface-alt);
}

.elements-table td {
  background: var(--color-white);
}

.element-water { color: #3a5fc7; }
.element-wood { color: #2a7a2a; }
.element-fire { color: #c03030; }
.element-earth { color: #9a7209; }
.element-metal { color: #555; }

/* Schedule block */
.schedule {
  background: linear-gradient(135deg, #fff6e0 0%, #ffe8b8 100%);
  border: 1px solid rgba(232, 148, 32, 0.35);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.schedule h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.schedule h3 {
  margin-top: 0;
  color: var(--color-primary);
}

.schedule ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.schedule li {
  padding: 0.35rem 0;
  padding-left: 1rem;
  position: relative;
}

.schedule li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

.contact-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-top: 2rem;
}

.contact-card h3 {
  color: var(--color-warm-soft);
  margin-top: 0;
}

.contact-card a {
  color: var(--color-warm-soft);
}

.contact-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.contact-card dt {
  font-weight: 600;
  opacity: 0.85;
}

.contact-card dd {
  margin: 0;
}

/* Contact page */
.contact-panel {
  background: linear-gradient(135deg, #fff6e0 0%, #ffe4b0 100%);
  border: 1px solid rgba(232, 148, 32, 0.35);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.contact-info .lead {
  margin-bottom: 0.25rem;
}

.contact-info .brand {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 0.25rem;
}

.contact-info h2 {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 500;
}

.contact-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.contact-info dt {
  font-weight: 600;
  color: var(--color-text-muted);
}

.contact-info dd {
  margin: 0;
}

.contact-photo img {
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  max-width: 180px;
  border: 3px solid var(--color-white);
}

/* Video embeds */
.video-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fff8ec 0%, #fff0d0 100%);
  border: 1px solid rgba(232, 148, 32, 0.3);
  border-radius: var(--radius);
}

.video-section h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.video-section > p:last-child {
  margin-bottom: 0;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #1a1a1a;
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-credit {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Slideshow / gallery */
.gallery {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fff8ec 0%, #fff0d0 100%);
  border: 1px solid rgba(232, 148, 32, 0.3);
  border-radius: var(--radius);
}

.gallery-viewport {
  position: relative;
  background: #2a2420;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
}

.gallery-viewport img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.4s ease;
}

.gallery-caption {
  text-align: center;
  padding: 1rem 0 0.5rem;
  font-weight: 500;
  font-family: var(--font-serif);
  color: var(--color-primary-dark);
  min-height: 2.5rem;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 1rem;
}

.gallery-controls button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-primary-dark);
  transition: background 0.2s;
}

.gallery-controls button:hover {
  background: var(--color-nav);
}

.gallery-counter {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  min-width: 4rem;
  text-align: center;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.gallery-thumbs button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  aspect-ratio: 1;
}

.gallery-thumbs button.active,
.gallery-thumbs button:hover {
  border-color: var(--color-accent);
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Benefit list */
.benefit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--color-border);
}

.benefit-list li {
  padding: 0.85rem 0 0.85rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.benefit-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-primary);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: linear-gradient(180deg, #ffc94a 0%, #f0a030 100%);
  border: 1px solid rgba(200, 100, 20, 0.3);
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: #6b2010;
}

.back-to-top:hover {
  background: linear-gradient(180deg, #ffd878 0%, #f5b942 100%);
  color: #5a1808;
}

/* Responsive */
@media (max-width: 768px) {
  .site-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, 85vw);
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
  }

  .site-nav.open {
    transform: translateX(0);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
  }

  .nav-overlay.open {
    display: block;
  }

  .site-main {
    padding: 1.5rem 1.25rem 2rem;
  }

  .site-header {
    flex-direction: column;
    text-align: center;
  }

  .two-col,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-photo {
    text-align: center;
  }

  .contact-photo img {
    margin: 0 auto;
  }

  .home-intro,
  .page-intro {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .home-intro .hero-image img,
  .page-intro-media img {
    margin: 0 auto;
  }

  .page-intro--wide .page-intro-media img,
  .page-intro--portrait .page-intro-media img {
    width: min(280px, 100%);
  }

  .terms {
    grid-template-columns: 1fr;
  }

  .term:nth-child(odd) {
    border-right: none;
  }

  .term:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
  }

  .pillars {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pillar:not(:last-child)::after {
    display: none;
  }

  .pillar:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .gallery-viewport img {
    transition: none;
  }
}
