/* ==========================================================================
   CSS Reset and Base Styles
   ========================================================================== */

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

body {
  margin: 0;
  word-break: break-word;
  text-wrap: wrap; /* or text-wrap: balance; */
}

/* Root Variables - Mobile First */
:root {
  /* Colors */
  --color-background: #ffffff;
  --color-text-primary: #1d1d1d;
  --color-text-secondary: #7c7c7c;
  --color-accent-light: #b9dfdf;
  --color-accent: #72b4b2;
  --color-accent-dark: #5a9391;
  --color-coral: #f77668;
  --color-coral-light: #ff8e8e;
  --color-teal: #4ecdc4;
  --color-black: #000000;
  --color-white: #ffffff;
  --color-border: #000000;
  --color-neutral: #f5f5f5;

  /* Typography - Mobile First */
  --font-family-primary: "Fustat", sans-serif;
  --font-family-secondary: "Source Serif 4", serif;
  --font-family-tertiary: "Inter", sans-serif;
  --font-family-utility: "IBM Plex Sans Condensed", sans-serif;
  font-weight: 500;
  font-style: normal;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-xs: 0.75rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 2.5rem;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing - Mobile First */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --spacing-4xl: 6rem;
  --spacing-5xl: 8rem;

  /* Layout - Mobile First */
  --container-max-width: 1200px;
  --container-md-width: 800px;
  --header-height: 60px; /* Mobile header height */

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;

  /* Z-index */
  --z-header: 100;
  --z-modal: 1000;
  --z-tooltip: 1100;
}
.desktop-only,
.mobile-only {
  display: none;
}

/* ==========================================================================
   Base HTML Elements - Mobile First
   ========================================================================== */

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-tertiary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* body.logged-in header {
  margin-top: 32px;
} */

/* ==========================================================================
   Unified Typography System
   ========================================================================== */

/* Base heading styles - apply to semantic HTML elements */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

strong {
  font-weight: var(--font-weight-bold);
}
/* Typography utility classes for consistent styling */
.text-display {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-tight);
}

.text-heading-1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
}

h2,
.text-heading-2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h3,
.text-heading-3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  padding: var(--spacing-md) 0 0 0;
  margin-bottom: var(--spacing-md);
}

.text-heading-4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  padding: var(--spacing-sm) 0 0 0;
  margin-bottom: var(--spacing-sm);
}

.text-body-large {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

/* .text-body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
} */

.text-body-small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.text-caption {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
}
a,
.text-link {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
  text-decoration: underline;
  text-decoration-color: var(--color-coral-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.text-link:hover,
.text-link:focus {
  color: var(--color-coral);
  text-decoration: none;
}

/* Text color utilities */
.text-primary {
  color: var(--color-text-primary);
}
.text-secondary {
  color: var(--color-text-secondary);
}
.text-accent {
  color: var(--color-accent);
}

/* Text weight utilities */
.text-light {
  font-weight: var(--font-weight-light);
}
.text-regular {
  font-weight: var(--font-weight-regular);
}
.text-medium {
  font-weight: var(--font-weight-medium);
}
.text-semibold {
  font-weight: var(--font-weight-semibold);
}
.text-bold {
  font-weight: var(--font-weight-bold);
}

hr.wp-block-separator {
  border-bottom: 1px solid;
  margin: var(--spacing-3xl) auto;
}
.back-to-top a {
  font-family: var(--font-family-utility);
  text-transform: uppercase;
  font-size: var(--font-size-sm);
}
.back-to-top a::before {
  content: "arrow_upward";
  font-family: "Material Symbols Outlined";
  font-size: 1rem;
  color: var(--color-black);
  padding-right: 4px;
  transform: translateY(10%);
  text-decoration: none;
  display: inline-block;
  color: var(--color-coral);
}

/* Text List Styling */
main ul,
main ol {
  background-color: var(--color-neutral);
  padding: var(--spacing-lg);
  border-radius: 4px;
  margin: var(--spacing-md) 0;
}

main li {
  margin-bottom: var(--spacing-sm);
  margin-left: var(--spacing-md);
}

main li a {
  text-decoration: underline;
  color: var(--color-coral);
  cursor: pointer;
}

.wp-block-quote {
  border-left: 3px solid;
  border-color: var(--color-accent);
  margin: 40px 20px;
  font-style: italic;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}
.wp-block-quote p:nth-child(2) {
  font-style: normal;
  font-family: var(--font-family-tertiary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}

.numbers {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.numbers .wp-block-group {
  background-color: var(--color-neutral);
  padding: 20px;
}

@media (min-width: 810px) {
  .numbers {
    flex-direction: row;
  }
}

/* ==========================================================================
   Skip Link for Accessibility
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: var(--z-tooltip);
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-accent);
  color: var(--color-white);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  border-radius: 4px;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* ==========================================================================
   Header and Navigation - Mobile First
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background-color: white;
  border-bottom: 1px solid #d0d0d0;
  transition: all var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md); /* Mobile padding */
  height: var(--header-height);
  background-color: rgba(255, 255, 255);
}

/* Brand/Logo - Mobile First */
.brand {
  position: relative;
  z-index: 100;
}
.brand-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.brand-link:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.brand-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-black);
  line-height: var(--line-height-tight);
  margin: 0;
}

.brand-tagline {
  font-family: var(--font-family-utility);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: var(--line-height-tight);
  padding: 0;
  margin: 0;
}

/* Mobile Menu Toggle - Visible by Default (Mobile First) */
.menu-toggle {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  gap: 4px;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.menu-toggle:hover {
  background-color: rgba(114, 180, 178, 0.1);
}

.menu-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.menu-toggle-icon {
  width: 20px;
  height: 2px;
  background-color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

/* Navigation Menu - Mobile First (Hidden by Default) */
.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: -1; /* behind header on mobile */
  background-color: var(--color-background);
  border-bottom: 1px solid #d7d7d7;
  /* flex-direction: column; */
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-lg);
  margin: 0;
  /* gap: var(--spacing-lg); */
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  list-style: none;
}

.menu-item {
  margin: var(--spacing-md) 0;
}

.nav-menu.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav-link {
  font-family: var(--font-family-utility);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  color: var(--color-text-primary);
  letter-spacing: 0.05em;
  padding: var(--spacing-sm) 0;
  position: relative;
  transition: color var(--transition-fast);
  text-transform: uppercase;
}

.current_page_item .nav-link {
  text-decoration: underline;
  text-decoration-color: var(--color-coral-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-link:hover,
.nav-link:focus {
  color: var(--color-coral);
  outline: none;
}

.nav-link.active {
  color: var(--color-accent);
}

/* ==========================================================================
   Main Content - Mobile First
   ========================================================================== */

.main {
  margin-top: var(--header-height);
}

/* ==========================================================================
   Hero Section - Mobile First
   ========================================================================== */

.hero-container {
  /* background-image: url("../../public/test.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat; */
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: var(--spacing-4xl);
  min-height: calc(100vh - var(--header-height));
  padding: var(--spacing-3xl) var(--spacing-md);
  position: relative;
  max-width: var(--container-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Hero Background Video */
.hero-video {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 55%; /* Fixed height for consistent coverage */
  object-fit: contain;
  pointer-events: none; /* Ensure video doesn't interfere with interactions */
  transition: opacity var(--transition-normal);
  display: none;
}

/* Video Loading Placeholder */
.hero-video-placeholder {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  /* background: linear-gradient(
    135deg,
    rgba(114, 180, 178, 0.1) 0%,
    rgba(255, 107, 107, 0.1) 100%
  ); */
  z-index: -2; /* Behind video */
  opacity: 1;
  transition: opacity var(--transition-slow);
}

/* Hide placeholder when video is loaded */
.hero-video.loaded + .hero-video-placeholder {
  opacity: 0;
}

.hero-text {
  margin: 0 auto;
  text-align: center;
  max-width: 800px;
  font-family: var(--font-family-tertiary);
  font-weight: var(--font-weight-regular);
}

/* Allow line breaks in hero text on mobile only */
.hero-intro {
  white-space: pre-line;
  z-index: 60;
  position: relative;
}

.hero-cursor {
  display: inline-block;
  font-weight: var(--font-weight-regular);
  animation: blink 1s infinite;
  margin-left: var(--spacing-xs);
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Scratch-out effect using SVG */
.scratched-out {
  position: relative;
  display: inline-block;
}

.scratch-svg-container {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-80%) translateY(15px) scaleX(1.4); /* Mobile positioning */
  width: 100%;
  height: auto;
  pointer-events: none;
}

.scratch-svg {
  width: 100%;
  height: auto;
}

.scratch-path {
  fill: none;
  stroke: #0b42db;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3px;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

/* Handwritten SVG effect */
.handwritten-svg-container {
  position: absolute;
  transform: translateX(-35%) translateY(-60px);
  opacity: 1;
  width: 450px; /* Mobile width */
}

.handwritten-svg {
  width: 350px;
  max-width: 350px;
  height: auto;
}

.handwritten-path {
  fill: none;
  stroke: #0b42db;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3px;
  /* Hide paths by default to prevent flash before animation */
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

/* ==========================================================================
   Mission Section - Mobile First
   ========================================================================== */

.mission {
  background-color: var(--color-coral);
  color: var(--color-white);
  /* position: relative; */
}

.mission-content {
  margin: 0 auto;
  padding: var(--spacing-3xl) var(--spacing-md); /* Mobile padding */
  display: grid;
  grid-template-columns: 1fr; /* Mobile: single column */
}

.mission h2 {
  color: var(--color-white);
}

.mission-text:last-child {
  margin-bottom: 0;
}

.mission-tags {
  display: flex;
  flex-wrap: wrap;
  background-color: #ffc4af;
  padding: var(--spacing-xl) var(--spacing-md); /* Mobile padding */
  color: var(--color-coral);
}

.tag {
  font-family: var(--font-family-utility);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-black);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 10px;
}

.tag:nth-last-child(2),
.tag:last-child {
  padding: 0 0 0 10px;
}

/* ==========================================================================
   Teaching Section - Mobile First
   ========================================================================== */

.teaching,
.design {
  padding: var(--spacing-3xl) var(--spacing-md); /* Mobile padding */
  background-color: var(--color-background);
}

.teaching-container,
.design-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-family-utility);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  display: block;
  margin-bottom: var(--spacing-md);
}

.teaching-intro {
  max-width: 800px;
}

.teaching-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: single column */
  margin: var(--spacing-xl) 0;
}

/* Column title styles removed - using unified typography system */

.teaching-item {
  margin-bottom: var(--spacing-sm);
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}

.teaching-item:last-child {
  margin-bottom: 0;
}

.teaching-icon {
  color: var(--color-accent);
  font-size: 1.6em;
  flex-shrink: 0;
  margin-top: 2px; /* Adjusted to align better with heading baseline */
}

.teaching-item .text-heading-4 {
  padding: 0;
  margin: 04px 0 0 0;
}

.teaching-footer {
  text-align: left;
}

/* ==========================================================================
   Design Section - Mobile First
   ========================================================================== */

.design {
  background-color: var(--color-neutral);
}

/* ==========================================================================
   CTA Section - Mobile First
   ========================================================================== */

/* Case studies and card styles removed - unused */

/* ==========================================================================
   CTA Section - Mobile First
   ========================================================================== */

.cta {
  background-color: var(--color-accent-light);
  padding: var(--spacing-xl) var(--spacing-md); /* Mobile padding */
}

.cta-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column; /* Mobile: stacked */
  text-align: center;
}

/* ==========================================================================
   Footer - Mobile First
   ========================================================================== */

.footer {
  background-color: var(--color-black);
  color: var(--color-white);
  padding: var(--spacing-3xl) var(--spacing-md); /* Mobile padding */
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-xl);
  flex-direction: column; /* Mobile: stacked */
}

.footer-content {
  flex: 1;
  max-width: 600px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

.footer-disclaimer {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: rgba(255, 255, 255, 0.7);
}

.footer-social {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: flex-start; /* Mobile alignment */
}

.social-link {
  font-family: var(--font-family-utility);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.social-link:hover,
.social-link:focus {
  /* color: var(--color-accent); */
  outline: none;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--color-coral-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ==========================================================================
   Unified Button System with Codrops Animation
   ========================================================================== */

/* Base button */
.button {
  position: relative;
  display: inline-block;
  overflow: hidden;
  font-family: var(--font-family-utility);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--spacing-md) var(--spacing-xl);
  color: var(--color-black);
  cursor: pointer;
  transition: none;
}

/* Animation pseudo-elements */
.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-accent);
  -webkit-clip-path: polygon(0% 0%, 100% 0, 100% 50%, 100% 100%, 0% 100%);
  clip-path: polygon(0% 0%, 100% 0, 100% 50%, 100% 100%, 0% 100%);
  transition: clip-path 0.4s cubic-bezier(0.2, 1, 0.8, 1),
    -webkit-clip-path 0.4s cubic-bezier(0.2, 1, 0.8, 1);
}

/* Hover state animation */
.button:hover::before {
  -webkit-clip-path: polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
  clip-path: polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
}

/* Text span animation */
.button span {
  display: block;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.8, 1);
}

.button:hover span {
  transform: translate3d(-10px, 0, 0);
}

/* Hover and focus states */
.button:hover,
.button:focus {
  color: var(--color-black);
}

/* Special positioning and styling for replay button */
.replay-btn {
  display: flex;
  align-items: center;
  margin: 0 auto;
  font-family: var(--font-family-utility);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 50;
  background: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
}

.replay-btn .material-icons {
  margin-right: 4px;
}

/* Case study template system removed - unused */

/* Responsive design */
@media (max-width: 768px) {
  .case-hero {
    padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-3xl);
  }

  .case-hero-image {
    height: 200px;
  }

  .overview-grid {
    gap: var(--spacing-lg);
  }

  /* Unused case study responsive styles removed */
}

/* ==========================================================================
   Figma Prototype Case Study Styles
   ========================================================================== */

/* Figma Hero Section */
.figma-hero {
  background: linear-gradient(
    to bottom,
    #f5f5f5 0%,
    #f5f5f5 calc(var(--spacing-5xl) + var(--spacing-2xl) + 133px),
    #ffffff calc(var(--spacing-5xl) + var(--spacing-2xl) + 133px),
    #ffffff 100%
  );
  padding: var(--spacing-5xl) 0;
  margin-top: var(--header-height);
  text-align: center;
}

.figma-hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.figma-breadcrumb {
  color: #da9796;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 var(--spacing-2xl) 0;
}

.figma-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-5xl) 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.figma-hero-image {
  width: 100%;
  max-width: 1000px;
  height: 400px;
  background-color: #d0d0d0;
  margin: 0 auto;
  border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .figma-hero {
    background: linear-gradient(
      to bottom,
      #f5f5f5 0%,
      #f5f5f5 calc(var(--spacing-3xl) + var(--spacing-2xl) + 83px),
      #ffffff calc(var(--spacing-3xl) + var(--spacing-2xl) + 83px),
      #ffffff 100%
    );
    padding: var(--spacing-3xl) 0;
  }

  .figma-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-3xl);
  }

  .figma-hero-image {
    height: 250px;
  }

  .figma-hero-container {
    padding: 0 var(--spacing-md);
  }
}

/* ==========================================================================
   Content Page Styles
   ========================================================================== */

/* Teaching Hero Section */
.page-hero {
  background-color: var(--color-accent-light);
  padding: var(--spacing-md) 0 var(--spacing-xl);
  margin-top: var(--header-height);
}

.page-hero .text-heading-1 {
  margin-bottom: 0;
}

.page-hero-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* Table of Contents - Sticky Navigation */
.teaching-toc {
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  transition: var(--transition-normal);
}

.teaching-toc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-lg);
}

.teaching-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.teaching-toc-header h2 {
  margin: 0;
}

.teaching-toc-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.teaching-toc-list li {
  margin: 0 0 0 0;
  padding: 0 var(--spacing-sm);
}
.teaching-toc-list ul {
  padding: 0 0 0 var(--spacing-xl);
  margin: 0;
}
.teaching-toc-list ul li {
  margin: 0 0 0 16px;
}
.teaching-toc-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  /* font-size: var(--font-size-sm); */
  font-weight: var(--font-weight-medium);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.teaching-toc-link:hover,
.teaching-toc-link:focus {
  color: var(--color-coral);
  background-color: rgba(255, 0, 0, 0.05);
}

.teaching-toc-link.active {
  color: var(--color-coral);
  background-color: rgba(255, 0, 0, 0.1);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-fast);
}

/* Mobile TOC Toggle */
.mobile-toc-toggle {
  display: none;
  background: var(--color-coral-light);
  color: white;
  border: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  align-items: center;
  gap: var(--spacing-xs);
}

.mobile-toc-toggle .material-symbols-outlined {
  font-size: 1.2rem;
  transition: transform 0.2s ease-out;
}

/* Page Teaching Content */
.page-teaching-content {
  padding: var(--spacing-3xl) 0 var(--spacing-5xl) 0;
}

.page-teaching-content-container {
  max-width: var(--container-md-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* just change this from section to h2 and 140 to 300 */
.page-teaching-content-container .section-label {
  margin-bottom: var(--spacing-2xl);
  scroll-margin-top: var(
    --header-height
  ); /* Refined offset for better positioning */
}

.teaching-section:last-child {
  margin-bottom: 0;
}

.teaching-section h2 {
  margin-bottom: var(--spacing-xl);
}

.teaching-text-content {
  max-width: 800px;
}

.teaching-text-content p {
  margin-bottom: var(--spacing-md);
}

.teaching-text-content p:last-child {
  margin-bottom: 0;
}

/* Course Structure Styling */
/* .course-structure {
  background-color: #f9f9f9;
  padding: var(--spacing-lg);
  border-radius: 4px;
  margin: var(--spacing-md) 0;
}

.structure-item {
  margin-bottom: var(--spacing-lg);
}

.structure-item:last-child {
  margin-bottom: 0;
}

.structure-item h6 {
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

.structure-item ul {
  margin-top: var(--spacing-xs);
  margin-bottom: 0;
}

.structure-item ul ul {
  margin-top: var(--spacing-xs);
  padding-left: var(--spacing-lg);
} */

/* Case Study Link Styling */
.case-study-link,
.emphasis-block {
  border: 1px solid var(--color-coral);
  padding: var(--spacing-lg);
  background-color: rgba(247, 118, 104, 0.1);
  margin: var(--spacing-xl) 0;
}

.case-study-link .wp-block-columns {
  margin: 0;
}
.case-study-link ul {
  background-color: transparent;
}
.case-study-link li {
  margin: 0;
}
.case-study-link .section-label {
  margin-bottom: var(--spacing-xl);
}
.case-study-link h2 {
  margin-bottom: var(--spacing-md);
  font-family: var(--font-family-secondary);
}

.case-study-link .wp-block-post-excerpt__more-text {
  margin-top: var(--spacing-lg);
}

/* .case-study-link .case-study-inner {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-black);
} */

/* .case-study-link .case-study-text {
  display: flex;
  flex-direction: column;
} */

/* .case-study-link figure {
  width: 100%;
  height: 100%;
  overflow: hidden;
} */

.case-study-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hide desktop image on mobile, and vice versa */
/* .case-study-link .desktop-only {
  display: none;
} */

@media (min-width: 768px) {
  /* .case-study-link .mobile-only {
    display: none;
  }
*/
  .case-study-link .desktop-only {
    display: block;
  }

  /* .case-study-link figure {
    width: 100%;
    height: 100%;
    overflow: hidden;
  } */
}

.emphasis-block ul {
  background-color: initial;
  padding: initial;
  border: inital;
  margin: initial;
}
/* Responsive Design */
@media (max-width: 768px) {
  /* Mobile layout - stack TOC above content */
  .teaching-layout-container {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .teaching-hero {
    padding: var(--spacing-3xl) 0 var(--spacing-lg) 0;
  }

  .teaching-hero-container {
    padding: 0 var(--spacing-md);
  }

  .teaching-toc {
    position: sticky;
    top: var(--header-height);
    background-color: #f9f9f9;
    z-index: 40;
    width: auto;
    border-bottom: 1px solid #d7d7d7;
    border-radius: 0;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .teaching-toc-container {
    padding: var(--spacing-md);
  }

  .teaching-toc-header {
    margin-bottom: var(--spacing-xs);
  }

  .teaching-toc-list {
    display: block !important; /* Override desktop flex layout */
    flex-direction: column;
    width: 100%;
    gap: 0; /* Remove gap to prevent layout issues */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out, opacity 0.15s ease-out;
    flex-wrap: nowrap;
  }

  .teaching-toc-list.active {
    max-height: 80vh; /* Allow up to 80% of viewport height for navigation items */
    opacity: 1;
    overflow-y: auto; /* Add scrolling if content exceeds available space */
  }

  /* .teaching-toc-list li {
    margin-bottom: var(--spacing-xs);
    width: 100%;
  } */

  .teaching-toc-list .teaching-toc-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px; /* Minimum touch target size */
    padding: var(--spacing-sm) var(--spacing-sm);
    transition: all var(--transition-fast);
  }

  .teaching-toc-list .teaching-toc-link.active {
    background-color: rgba(255, 0, 0, 0.1);
    font-weight: var(--font-weight-semibold);
  }

  .teaching-toc-list li:last-child {
    margin-bottom: 0;
  }

  .mobile-toc-toggle {
    display: flex;
    min-height: 44px; /* Minimum touch target size for mobile accessibility */
  }
  /*
  .teaching-content {
    padding: var(--spacing-2xl) 0 var(--spacing-4xl) 0;
  } */

  .teaching-content-container {
    padding: 0 var(--spacing-md);
  }
  /* Reduced mobile offset to bring headings up */
  /* .teaching-section {
    scroll-margin-top: 140px;
    margin-bottom: var(--spacing-4xl);
  } */

  .teaching-subsection {
    margin-bottom: var(--spacing-lg);
  }

  /* Mobile scroll margin for h2 elements to position below collapsed TOC */
  .page-teaching-content-container h2 {
    scroll-margin-top: 460px;
  }

  .course-structure {
    padding: var(--spacing-md);
  }

  .structure-item {
    margin-bottom: var(--spacing-md);
  }
}

/* Single Case Study template */
.single-case-study-hero {
  /* Simulates grey only behind the top part of the image using a gradient */
  background: #f5f5f5;
  padding: var(--spacing-3xl) 0 var(--spacing-xl);
  margin-top: var(--header-height);
}

.single-case-study-hero.thumbnail {
  background: linear-gradient(
    to bottom,
    #f5f5f5,
    #f5f5f5 60%,
    #ffffff 40%,
    #ffffff
  );
}

.single-case-study-hero-container {
  max-width: var(--container-md-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.single-case-study-hero h1 {
  font-family: var(--font-family-secondary);
  margin-bottom: var(--spacing-md);
}
.breadcrumb {
  font-family: var(--font-family-utility);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--color-coral);
  display: inline-block;
  transition: color var(--transition-fast);
  text-decoration: underline;
  text-decoration-color: var(--color-coral-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.breadcrumb a:hover {
  color: var(--color-coral);
  text-decoration: none;
}
.date {
  color: var(--color-text-secondary);
  text-transform: uppercase;
  font-size: var(--font-size-sm);
}
.excerpt {
  font-style: italic;
  padding-bottom: var(--spacing-lg);
}
figcaption {
  font-family: var(--font-family-tertiary);
  font-size: var(--font-size-sm) !important;
  color: var(--color-text-secondary);
  padding: var(--spacing-md);
}

/* Image setup */
.single-case-study-thumbnail {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.aspect-ratio-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 20 / 9;
  overflow: hidden;
}

.aspect-ratio-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.single-case-study-content {
  padding: var(--spacing-xl) 0 var(--spacing-5xl) 0;
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

.single-case-study-content-container {
  max-width: var(--container-md-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Refined offset for better positioning */
/* .single-case-study-content-container section {
  margin-bottom: var(--spacing-3xl);
  scroll-margin-top: calc(
    var(--header-height) + 140px
  );
} */

/* h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  padding: var(--spacing-md) 0 0 0;
  margin-bottom: var(--spacing-md);
} */

.link-document {
  border: 1px solid var(--color-coral);
  padding: var(--spacing-lg);
  font-family: var(--font-family-tertiary);
  font-size: var(--font-size-base);
  margin: 0 0 var(--spacing-2xl) 0;
}

.link-document a {
  display: block;
}
.link-document a::before {
  content: "file_open";
  font-family: "Material Symbols Outlined";
  font-size: 1.2rem;
  color: var(--color-coral);
  padding: 0 6px 0 0;
  text-decoration: none;
  display: inline-block;
}
/* ==========================================================================
   Progressive Enhancement for Larger Screens
   ========================================================================== */

/* Tablet Styles - Progressive Enhancement */
@media (min-width: 769px) {
  :root {
    --header-height: 80px; /* Larger header on desktop */
    --sidebar-width: 280px; /* TOC sidebar width */
  }

  .back-to-top {
    display: none;
  }

  .nav-container {
    padding: 0 var(--spacing-lg); /* Larger padding on desktop */
  }

  .menu-toggle {
    display: none; /* Hide hamburger on desktop */
  }

  .nav-menu {
    position: static;
    background-color: transparent;
    border-bottom: none;
    flex-direction: row;
    padding: 0;
    gap: var(--spacing-2xl);
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    z-index: 60; /* Above teaching TOC (z-index: 50) but behind header (z-index: 100) */
  }

  /* Desktop Layout Container - Flexbox for TOC and Content */
  .teaching-layout-container {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
  }

  /* Desktop TOC - Positioned as content aside */
  .teaching-toc {
    position: sticky;
    top: calc(var(--header-height) + var(--spacing-md));
    width: 280px;
    flex-shrink: 0;
    background-color: var(--color-background);
    /* padding: var(--spacing-lg); */
    max-height: calc(100vh - var(--header-height) - var(--spacing-xl));
    margin-top: var(--spacing-lg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30;
    border: 0;
  }

  .teaching-toc-container {
    padding: 0;
    max-width: none;
    margin: 0 0 80px 0;
    position: relative;
  }

  /* Progress indicator */
  .teaching-toc-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    background-color: var(--color-border);
    border-radius: 2px;
    height: 100%;
    z-index: 1;
  }

  .teaching-toc-progress-bar {
    width: 100%;
    background-color: var(--color-accent);
    background: linear-gradient(
      to bottom,
      var(--color-accent),
      var(--color-accent-dark)
    );
    border-radius: 2px;
    transition: height 0.3s ease-out;
    height: 0%;
    min-height: 8px;
  }

  .teaching-toc-header {
    margin-bottom: var(--spacing-lg);
    /* position: relative; */
  }

  .teaching-toc-list {
    display: block;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
    max-height: none;
    /* opacity: 1;
    overflow: visible;
    padding-left: var(--spacing-md); */
    position: relative;
  }

  /* .teaching-toc-list ul {
    margin-left: var(--spacing-md);
    margin-top: var(--spacing-xs);
  } */

  .teaching-toc-link {
    display: block;
    width: 100%;
    /* font-size: var(--font-size-sm); */

    white-space: normal;
    line-height: var(--line-height-normal);
    border-radius: 4px;
    transition: all var(--transition-fast);
    position: relative;
    padding: var(--spacing-xs) var(--spacing-md);
  }

  /* Enhanced active state with position indicator */

  .teaching-toc-link.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--color-coral);
  }

  .mobile-toc-toggle {
    display: none; /* Hide mobile toggle on desktop */
  }

  /* Remove sidebar margins - content flows naturally */
  .page-hero {
    margin-left: 0;
  }

  .page-teaching-content {
    margin-left: 0;
    padding: var(--spacing-3xl) 0 var(--spacing-5xl) 0;
    flex: 1;
    min-width: 0;
  }

  .page-teaching-content-container {
    max-width: 800px; /* Set main content width to 800px as requested */
    margin: 0;
    padding: 0;
  }

  .text-heading-2 {
    font-size: var(--font-size-5xl); /* Larger headings on desktop */
  }

  .text-heading-3 {
    font-size: var(--font-size-2xl);
  }

  .brand-name {
    font-size: var(--font-size-3xl);
  }
  .brand-tagline {
    font-size: var(--font-size-sm);
  }

  .text-heading-1 {
    font-size: var(--font-size-5xl);
  }

  .hero {
    justify-content: flex-start;
    /* flex-direction: row; */
    gap: 0;
    padding: 80px var(--spacing-lg) 240px;
  }

  /* Desktop responsive typography overrides */
  .hero-text {
    font-size: var(--font-size-4xl); /* Larger on desktop */
    text-align: left;
    margin: 0;
  }

  /* Remove line break processing on desktop */
  .hero-intro {
    white-space: normal;
  }

  .hero-video {
    min-height: 60%; /* Slightly more coverage on desktop */
  }

  /* Desktop scratch positioning */
  .scratch-svg-container {
    transform: translateY(-50%) translateY(10px);
  }

  .handwritten-svg-container {
    width: 450px;
    transform: translateX(-25%) translateY(-30px);
  }

  .handwritten-svg {
    width: 450px;
    max-width: 450px;
  }

  .replay-btn {
    position: absolute;
    bottom: var(--spacing-4xl);
    right: 0;
    margin: 0;
  }

  .replay-btn:hover {
    cursor: pointer;
    border-color: var(--color-coral);
    border-style: solid;
    color: var(--color-coral);
  }

  .mission-content {
    padding: var(--spacing-5xl) var(--spacing-lg);
    grid-template-columns: 1fr 1fr; /* Two columns on desktop */
    gap: var(--spacing-4xl);
    max-width: var(--container-max-width);
  }

  .mission-tags {
    justify-content: center;
  }

  .teaching,
  .design {
    padding: var(--spacing-5xl) var(--spacing-lg);
  }

  .teaching-grid {
    grid-template-columns: 1fr 1fr; /* Two columns on desktop */
    gap: var(--spacing-xl);
  }

  .cta-container {
    flex-direction: row; /* Side by side on desktop */
    align-items: center;
    text-align: left;
  }

  .cta-container .text-heading-3 {
    padding: 0;
  }

  .footer-container {
    flex-direction: row; /* Side by side on desktop */
    gap: var(--spacing-lg);
  }

  /* Single Case study larger screen */

  .single-case-study-hero h1 {
    /* max-width: 500px; */
    font-size: 3.4rem;
    line-height: 3.8rem;
    margin-bottom: var(--spacing-lg);
  }
}

/* default page template */

.page-hero {
  background: #b9dfdf;
  padding: var(--spacing-3xl) 0 var(--spacing-2xl) 0;
  margin: var(--header-height) 0 0 0;
}

.page-hero-container {
  max-width: var(--container-md-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.page-content {
  padding: var(--spacing-xl) 0 var(--spacing-5xl) 0;

  line-height: var(--line-height-relaxed);
}

.page-content-container {
  max-width: var(--container-md-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}
.font-secondary {
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-lg);
  padding-bottom: var(--spacing-xl);
}

/* About */

.about-hero {
  background: #b9dfdf;
  background: linear-gradient(
    to bottom,
    #b9dfdf,
    #b9dfdf 60%,
    #ffffff 40%,
    #ffffff
  );
  padding: var(--spacing-3xl) 0 0 0;
  margin: var(--header-height) 0 0 0;
}

.about-hero-container {
  max-width: var(--container-md-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.about-hero-video-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  background: #b9dfdf;
  background-image: url("../../public/forest-walk-poster.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-top: 250px;
}

.about-hero video {
  display: none;
}
.about-hero .video-caption {
  display: none;
}

@media only screen and (min-width: 768px) {
  .about-hero-video-container {
    padding: 0;
    aspect-ratio: 16 / 5;
  }
  .about-hero video {
    width: 100%;
    cursor: pointer;
    display: block;
  }

  .about-hero video.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .about-hero video.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
  }
  .about-hero .video-caption {
    display: block;
    color: #555;
    font-family: var(--font-family-tertiary);
    font-size: var(--font-size-sm) !important;
    text-align: center;
    margin: 0;
    padding: var(--spacing-md);
  }
}

/* ==========================================================================
   Accessibility and Motion Preferences
   ========================================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-cursor {
    animation: none;
  }

  .handwritten-svg-container {
    animation: none;
    opacity: 1;
  }

  .handwritten-path {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    /* Show immediately when motion is reduced */
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-background: #ffffff;
    --color-text-primary: #000000;
    --color-accent: #0066cc;
    --color-border: #666666;
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
*:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Remove outline for mouse users, keep for keyboard users */
.js-focus-visible *:focus:not(.focus-visible) {
  outline: none;
}

/* Disable transitions during viewport resize to prevent glitches */
.disable-transitions * {
  transition: none !important;
}
