/* Global Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Font Families */
  --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-serif: "Georgia", "Times New Roman", serif;
  --font-family-monospace: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Colors - Modern Palette (Example: Cool Blues & Grays) */
  --color-primary: #1C5239; /* New Green for accents */
  --color-primary-dark: #133728; /* Darker shade of new Green */
  --color-secondary: #6c757d; /* Neutral Gray */
  --color-light: #f8f9fa;    /* Light background */
  --color-dark: #343a40;     /* Dark text */
  --color-white: #ffffff;
  --color-border: #dee2e6;
  --color-link-hover: #0056b3; /* For specific strong tag styling */

  /* Spacing System (based on 0.25rem increments) */
  --space-xs: 0.25rem; /* 4px */
  --space-sm: 0.5rem;  /* 8px */
  --space-md: 1rem;    /* 16px */
  --space-lg: 1.5rem;  /* 24px */
  --space-xl: 2rem;    /* 32px */
  --space-xxl: 3rem;   /* 48px */

  /* Typography */
  --font-size-base: 1rem; /* Typically 16px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-lg: 1.25rem; /* 20px */
  --font-size-xl: 1.75rem; /* 28px */
  --font-size-xxl: 2.25rem; /* 36px */

  --line-height-base: 1.6;
  --line-height-heading: 1.2;

  /* Borders & Shadows */
  --border-radius: 0.3rem; /* Softer edges */
  --box-shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
  --box-shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-serif); /* Serif for readability */
  line-height: var(--line-height-base);
  color: var(--color-dark);
  background-color: var(--color-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-family-sans-serif); /* Sans-serif for headings */
  font-weight: 600;
  line-height: var(--line-height-heading);
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--color-primary-dark);
}

h1, .h1 { font-size: var(--font-size-xxl); }
h2, .h2 { font-size: var(--font-size-xl); }
h3, .h3 { font-size: var(--font-size-lg); }
h4, .h4 { font-size: var(--font-size-base); } /* Adjusted for balance */
h5, .h5 { font-size: var(--font-size-sm); }
h6, .h6 { font-size: var(--font-size-sm); font-weight: 400; }

/* Paragraphs & Links */
p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out, text-decoration 0.15s ease-in-out;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block; /* Remove bottom space */
  border-radius: var(--border-radius);
}

/* Utility Classes (optional, but can be helpful) */
.text-center { text-align: center; }
.container {
  width: 100%;
  padding-right: var(--space-md);
  padding-left: var(--space-md);
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }

/* Header */
.header-title-area {
  text-align: center;
  padding: var(--space-lg) var(--space-md) var(--space-md); /* Generous top padding, medium bottom */
  background-color: var(--color-dark); /* Matches overall header bg */
}

.header-title-area h1 {
  font-size: var(--font-size-xxl); /* Default for mobile, overridden for desktop */
  color: var(--color-white);
  margin-top: 0;
  margin-bottom: 0; /* Spacing controlled by padding on parent */
}

header {
  background-color: var(--color-dark); /* This might be redundant if children cover it */
  color: var(--color-light);
  padding: 0; /* Remove header padding, let sections inside control it */
  box-shadow: var(--box-shadow-sm); /* Keep this for the overall header block */
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/* Navigation */
nav.site-navigation {
  background-color: var(--color-primary); /* Primary color for nav bar background */
  padding: var(--space-sm) 0; /* Vertical padding for the nav bar itself */
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Optional: a subtle shadow */
}

nav.site-navigation ul { /* Ensure this targets UL within .site-navigation .container */
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center; /* Center nav items */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: var(--space-sm); /* Default gap, overridden for desktop */
}

nav.site-navigation li {
  position: relative; /* For dropdown positioning */
}

nav.site-navigation a,
nav.site-navigation a:visited { /* Added :visited for consistency */
  display: block;
  padding: var(--space-sm) var(--space-md); /* Existing padding */
  color: var(--color-white); /* White links on primary background */
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease, color 0.2s ease;
}

nav.site-navigation a:hover,
nav.site-navigation a:focus,
nav.site-navigation li.submenu-active > a {
  background-color: var(--color-primary-dark); /* Darken on hover/focus */
  color: var(--color-white);
  text-decoration: none;
}

/* Dropdown Menus */
nav.site-navigation ul ul {
  display: none; /* Hidden by default */
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-primary-dark); /* Darker primary for dropdown BG */
  min-width: 200px; /* Wider dropdowns */
  z-index: 1000;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: var(--box-shadow-md);
  padding: var(--space-sm) 0; /* Padding inside dropdown */
}

nav.site-navigation ul ul li a,
nav.site-navigation ul ul li a:visited {
  padding: var(--space-sm) var(--space-md);
  white-space: nowrap;
  color: var(--color-white); /* White links in dropdown */
  border-radius: 0; /* No radius for items inside dropdown */
}

nav.site-navigation ul ul li a:hover,
nav.site-navigation ul ul li a:focus {
  background-color: var(--color-primary); /* Lighter primary for hover in dropdown */
  color: var(--color-white); /* Ensure text remains white */
}

/* Second Level Dropdown */
nav.site-navigation ul ul ul {
  top: 0; /* Align with parent item */
  left: 100%; /* Position to the side */
  border-radius: var(--border-radius); /* Radius for nested dropdown */
  background-color: var(--color-primary); /* Even lighter or same as hover */
}

/* Show dropdowns on hover/focus (CSS only for hover, JS for click/focus) */
nav.site-navigation li:hover > ul,
nav.site-navigation li.focus-within-parent > ul, /* For keyboard nav from main.js */
nav.site-navigation li.submenu-active > ul { /* For click nav from main.js */
  display: block;
}


/* Main Content */
main {
  padding: 0 0 var(--space-xl); /* Use container for side padding */
}

/* Styling for the container of articles on index.html */
main > .container { /* This assumes index.html uses main > div.container for articles */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--space-lg);
  /* It inherits max-width, margin: auto, and LR padding from the generic .container rule */
}

/* Articles on index.html (Card-like style) */
main > .container > article { /* This rule is primarily for the cards on index.html */
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  padding: var(--space-lg);
  transition: box-shadow 0.2s ease-in-out;
  /* Flex item properties */
  flex: 0 1 100%; /* flex-grow: 0, flex-shrink: 1, flex-basis: 100% */
  margin-bottom: 0;  /* Remove margin-bottom as gap property from parent now handles it */
  text-align: center; /* Center inline content and text */
}

main > .container > article:hover {
  box-shadow: var(--box-shadow-md);
}

main > .container > article img {
  margin-left: auto; /* Center block-level image */
  margin-right: auto; /* Center block-level image */
  margin-bottom: var(--space-md);
  border-radius: var(--border-radius) var(--border-radius) 0 0; /* Top radius if image is flush */
}

main > .container > article h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

main > .container > article p {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-md);
  color: var(--color-secondary);
}

main > .container > article a.read-more {
  display: inline-block;
  font-family: var(--font-family-sans-serif);
  font-weight: 600;
  background-color: var(--color-primary);
  color: var(--color-white) !important; /* Ensure text color overrides any generic link color */
  padding: var(--space-md) var(--space-lg); /* Increased padding */
  border-radius: var(--border-radius);
  text-decoration: none !important; /* Ensure no underline */
  margin-top: var(--space-md); /* Increased top margin */
  box-shadow: var(--box-shadow-sm);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  text-align: center;
  cursor: pointer; /* Indicate it's clickable */
}

main > .container > article a.read-more:hover,
main > .container > article a.read-more:focus {
  background-color: var(--color-primary-dark);
  color: var(--color-white) !important; /* Ensure text color overrides */
  text-decoration: none !important; /* Ensure no underline */
  box-shadow: var(--box-shadow-md);
  transform: translateY(-1px);
}

main > .container > article a.read-more:active {
  transform: translateY(0px); /* Remove lift effect on click */
  box-shadow: var(--box-shadow-sm); /* Revert shadow to base */
  background-color: var(--color-primary-dark); /* Keep it dark during click */
}

/* Content Pages (e.g., about.html, drill pages) */
.about-page-main, /* Specific class from about.html */
main section, /* Generic section styling for drill pages etc. */
main .content-wrapper /* A new generic class if needed */
{
  background-color: var(--color-white);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: var(--space-xl); /* Space between sections */
}

/* Adjustments for images within content pages */
main section img,
.about-page-main img {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* Collapsible Content Styling */
.collapsible-content.hidden {
  display: none;
}

/* Footer */
footer {
  background-color: var(--color-dark);
  color: var(--color-light);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  margin-top: var(--space-xxl); /* More space before footer */
  font-size: var(--font-size-sm);
}

footer p {
  margin-bottom: 0;
  color: var(--color-secondary);
}

/* Toggle Route Tree Button Styling */
#toggleRouteTreeButton {
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: var(--space-md) var(--space-lg); /* Updated padding */
  border-radius: var(--border-radius);
  cursor: pointer;
  margin-bottom: var(--space-md);
  font-family: var(--font-family-sans-serif);
  font-weight: 600;
  box-shadow: var(--box-shadow-sm); /* Added box shadow */
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease; /* Added transition */
}

#toggleRouteTreeButton:hover,
#toggleRouteTreeButton:focus {
  background-color: var(--color-primary-dark);
  box-shadow: var(--box-shadow-md); /* Added hover/focus box shadow */
  transform: translateY(-1px); /* Added hover/focus transform */
}

#toggleRouteTreeButton:active {
  transform: translateY(0px); /* Active state transform */
  box-shadow: var(--box-shadow-sm); /* Active state box shadow */
}

/* Responsive Adjustments */

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  nav.site-navigation ul { /* Target specific nav */
    gap: var(--space-md); /* More space for nav items on larger screens */
  }

  /* --- New styles for desktop --- */
  .header-title-area h1 {
    font-size: var(--font-size-xxl); /* Ensure title is large on desktop */
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767.98px) {
  /* --- Styles for .header-title-area on mobile --- */
  .header-title-area {
    padding: var(--space-xs) var(--space-md); /* Reduce padding */
  }

  .header-title-area h1 {
    font-size: var(--font-size-lg); /* Slightly smaller title on mobile */
    /* Vertical margins are effectively 0 from desktop .header-title-area h1 rule */
    flex-shrink: 1;
    min-width: 0;
  }

  .logo-title-wrapper { /* Mobile specific override */
    flex-wrap: nowrap; /* Prevent stacking */
    /* align-items: center; and justify-content: center; inherited from global rule */
  }

  .site-logo { /* Mobile specific override */
    height: 40px; /* Reduce logo height */
    margin-bottom: 0; /* Remove bottom margin */
    margin-right: var(--space-sm); /* Add right margin for spacing */
    flex-shrink: 0;
  }

  /* --- Styles for nav.site-navigation on mobile --- */
  nav.site-navigation ul { /* This is the main ul inside .container */
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--space-sm) * 0.5); /* Remove gap when stacked, li will handle width */
    align-items: center; /* Keep this if you want items centered vertically if they wrap to multiple lines and have different heights */
  }
  nav.site-navigation li {
    width: auto;
  }
  nav.site-navigation a { /* Main links */
    text-align: center;
    font-size: 0.8rem;
    padding: var(--space-xs) calc(var(--space-sm) * 0.5); /* Adjusted from plan for slightly more vertical padding */
    /* border-bottom: 1px solid var(--color-primary-dark); */ /* Removed as per plan */
  }

  nav.site-navigation li:last-child a {
    /* border-bottom: none; */ /* Removed as per plan */
  }

  /* Mobile dropdowns adjustments */
  nav.site-navigation ul ul { /* First-level dropdowns */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%; /* This will be 100% of the parent li */
    background-color: var(--color-primary-dark);
    z-index: 1000;
    box-shadow: none; /* Keep as per mobile existing style */
    border-radius: 0; /* Keep as per mobile existing style */
    /* padding-left: var(--space-md); Removed */
  }

  nav.site-navigation ul ul ul { /* Second-level dropdowns */
    position: absolute;
    top: 100%; /* Drop down from parent li in first-level dropdown */
    left: 0;
    width: 100%; /* This will be 100% of its parent li */
    background-color: var(--color-primary); /* Differentiate from first-level */
    z-index: 1010; /* Above first-level dropdown */
    box-shadow: none; /* Keep as per mobile existing style */
    border-radius: 0; /* Keep as per mobile existing style */
    /* padding-left: var(--space-md); Removed or adjust if was part of combined rule */
  }

  /* Specific rule for last main nav item's dropdown on mobile */
  nav.site-navigation > .container > ul > li:last-child > ul {
    left: auto;
    right: 0;
  }

  nav.site-navigation ul ul li a { /* Ensure links are visible in all dropdowns */
    color: var(--color-white);
    border-bottom: 1px solid var(--color-primary); /* Separator for dropdown items */
  }
  nav.site-navigation ul ul li:last-child a {
     border-bottom: none;
  }
  nav.site-navigation ul ul li a:hover,
  nav.site-navigation ul ul li a:focus {
    background-color: var(--color-primary); /* Lighter shade for hover */
  }

  main {
    padding: 0 0 var(--space-xl); /* Adjusted top padding for mobile - REVERTED to original desktop padding as dropdowns now overlay */
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
  h1, .h1 { font-size: calc(var(--font-size-xl) * 0.9); } /* Slightly smaller headings */
  h2, .h2 { font-size: calc(var(--font-size-lg) * 0.9); }

  main > article {
    padding: var(--space-md);
  }
  .container {
    padding-right: var(--space-sm);
    padding-left: var(--space-sm);
  }
}

/* Specific Element Styling from original CSS (to be integrated/reviewed) */
.wr-route-tree {
  width: 100%;
  max-width: 700px; /* Adjusted max-width */
  height: auto;
  display: block;
  margin: var(--space-lg) auto; /* Use CSS vars for spacing */
  box-shadow: var(--box-shadow-sm);
}

.day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center; /* Center buttons */
  background: var(--color-light);
  padding: var(--space-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border);
}

.day-nav a {
  font-family: var(--font-family-sans-serif);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-white);
  border: 1px solid var(--color-primary);
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.day-nav a:hover,
.day-nav a:focus {
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

/* Instagram Embed Fix - Keep as is, or adjust margins with variables */
.instagram-media {
  width: 100% !important; /* Important might be needed due to external styles */
  max-width: 540px; /* Standard Instagram embed width */
  margin: var(--space-lg) auto !important; /* Center and space */
  box-shadow: var(--box-shadow-md);
  border-radius: var(--border-radius);
}

/* Video container spacing */
.video-container, .video-wrapper {
  margin-bottom: var(--space-lg);
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
}

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

/* Ensure JavaScript-toggled dropdowns for accessibility still work */
/* Classes 'focus-within-parent' and 'submenu-active' are handled above */

.site-logo {
  height: 90px;                /* 50% larger than the original 60px */
  width: auto;
  display: inline-block;       /* Use inline-block to align with text */
  margin-bottom: var(--space-sm);
}


.logo-title-wrapper {
  display: flex;
  align-items: center;         /* Vertically center the image and text */
  justify-content: center;     /* Horizontally center the whole thing */
  gap: var(--space-md);        /* Add space between image and title */
  flex-wrap: wrap;             /* Allows stacking on small screens */
}

/* Styles for page title and author info block */
.page-header {
  /* The margin-bottom is applied inline on the div itself */
}

.page-header h1 {
  display: block;
  width: 100%;
  text-align: center; /* Center the page title */
  margin-bottom: var(--space-sm); /* Add a small margin below the title */
}

.page-header p {
  display: block;
  width: 100%;
  /* text-align: center; is already in the inline style of the <p> tag */
  /* The <p> tag also has an inline style for text-align, which is fine. */
  /* margin-bottom for the whole block is on the .page-header div's inline style */
}

.youtube-thumbnail {
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  display: block;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.youtube-thumbnail:hover {
  transform: scale(1.02);
  box-shadow: var(--box-shadow-md);
}

/* Workout Program Styling */
.workout-program {
  background-color: var(--color-white);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: var(--space-xl);
}

.workout-program h2 {
  color: var(--color-primary-dark);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.workout-program h3 {
  color: var(--color-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-sm);
}

.workout-program p {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-base);
}

.workout-program ul {
  list-style-type: disc;
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.workout-program ul li {
  margin-bottom: var(--space-sm);
}

/* Workout Table Styling */
.workout-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--box-shadow-sm);
}

.workout-table th,
.workout-table td {
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  vertical-align: top;
}

.workout-table th {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  font-weight: 600;
}

.workout-table tr:nth-child(even) {
  background-color: var(--color-light);
}

.workout-table tr:hover {
  background-color: #e9ecef; /* A slightly different shade for hover on rows */
}

.workout-table td:first-child { /* Exercise name column */
  font-weight: 500;
  color: var(--color-primary);
}
/* Tab Navigation Styles */
.workout-tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg) 0; /* Margin below the tabs */
  display: flex;
  flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
  border-bottom: 2px solid var(--color-border); /* A line separating tabs from content */
}

.workout-tabs li {
  margin-right: var(--space-xs); /* Small space between tabs */
  margin-bottom: -2px; /* Align with the bottom border of the container for active tab effect */
}

.workout-tabs li a {
  display: block;
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  font-family: var(--font-family-sans-serif);
  font-weight: 600;
  color: var(--color-secondary); /* Default tab text color */
  background-color: var(--color-light); /* Default tab background */
  border: 2px solid transparent;
  border-bottom: none; /* Handled by parent's border or active state */
  border-radius: var(--border-radius) var(--border-radius) 0 0; /* Rounded top corners */
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
  bottom: -2px; /* Pulls tab slightly down to sit on the border line */
}

.workout-tabs li a:hover,
.workout-tabs li a:focus {
  color: var(--color-primary);
  background-color: #e9ecef; /* Slightly different background on hover */
  text-decoration: none;
}

.workout-tabs li.active a,
.workout-tabs li.active a:hover,
.workout-tabs li.active a:focus {
  color: var(--color-primary-dark);
  background-color: var(--color-white); /* Active tab background */
  border-color: var(--color-border) var(--color-border) var(--color-white); /* Border connects with content area */
  border-bottom-color: var(--color-white); /* Active tab's bottom border makes it look connected */
  /* bottom: -2px; Already set */
  z-index: 1; /* Ensure active tab is above the container's border */
}

/* Tab Panel Styles */
.workout-tab-panel {
  display: none; /* Hidden by default */
  padding: var(--space-lg);
  background-color: var(--color-white);
  border: 2px solid var(--color-border);
  border-top: none; /* Top border is handled by the .workout-tabs container or active tab */
  border-radius: 0 0 var(--border-radius) var(--border-radius); /* Rounded bottom corners */
  box-shadow: var(--box-shadow-sm);
  margin-bottom: var(--space-xl); /* Space below each panel block if multiple tab sets were on a page */
}

.workout-tab-panel.active {
  display: block; /* Show active panel */
}

.workout-tab-panel h3 {
  font-size: var(--font-size-xl); /* Existing variable, or choose another appropriate one */
  color: var(--color-primary-dark);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

/* Responsive adjustments for tabs if needed */
@media (max-width: 767.98px) {
  .workout-tabs {
    flex-direction: column; /* Stack tabs vertically on small screens */
    border-bottom: none; /* Remove bottom border for vertical tabs */
  }

  .workout-tabs li {
    margin-right: 0;
    margin-bottom: var(--space-xs); /* Space between vertical tabs */
  }

  .workout-tabs li a {
    border: 2px solid var(--color-border); /* Full border for all tabs */
    border-radius: var(--border-radius); /* Rounded corners all around */
    bottom: 0; /* Reset bottom positioning */
    text-align: center;
  }

  .workout-tabs li.active a,
  .workout-tabs li.active a:hover,
  .workout-tabs li.active a:focus {
    background-color: var(--color-primary); /* Active tab background */
    color: var(--color-white);
    border-color: var(--color-primary-dark);
  }

  .workout-tab-panel {
    border-top: 2px solid var(--color-border); /* Add top border back for panels when tabs are stacked */
    border-radius: var(--border-radius); /* Consistent rounding */
  }

  /* Workout Table Mobile Styles */
  .workout-table thead {
    display: none; /* Hide table headers on mobile */
  }
  .workout-table tr,
  .workout-table td {
    display: block;
    width: 100%;
  }
  .workout-table td {
    border-bottom: 1px solid var(--color-border); /* Add a separator for stacked cells */
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
  }
  .workout-table tr:last-child td:last-child {
    border-bottom: none; /* Remove border from the very last cell in the table */
  }
  /* Add a label for each cell using the data-label attribute */
  .workout-table td:before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
  }
  .centered-text {
    max-width: 600px;
    margin: 0 auto;
    text-align: left; /* change to center if you prefer full center-aligned text */
    padding: 1rem 0;
  }
}

/* Route Card Styles */
.route-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
  gap: var(--space-lg);
  padding-top: var(--space-lg); /* Add some space above the grid */
}

.route-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg); /* This will apply if not a direct grid item, or can be removed if gap is sufficient */
  transition: box-shadow 0.2s ease-in-out;
}

.route-card:hover {
  box-shadow: var(--box-shadow-md);
}

.route-card h3 {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.route-card p {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
}

.route-card p strong { /* For "Setup:", "Directions:", "Tips:" labels */
  color: var(--color-primary-dark);
  margin-right: var(--space-xs);
}

/* Scheme Card Styles */
.scheme-card {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.scheme-card h3 {
  font-size: 1.5em; /* Approx 24px if base is 16px */
  color: #333;
  margin-bottom: 10px;
}

.scheme-card h4 {
  font-size: 1.2em; /* Approx 19.2px */
  color: #555;
  margin-top: 15px;
  margin-bottom: 5px;
}

.scheme-card blockquote {
  border-left: 4px solid #007bff; /* Blue accent for quote */
  padding-left: 15px;
  margin-left: 0; /* Reset any default margin */
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  font-style: italic;
  color: #444;
}

.scheme-card ul {
  list-style-position: outside;
  padding-left: 20px; /* Standard indent for bullets */
  margin-bottom: var(--space-md);
}

.scheme-card ul li {
  margin-bottom: var(--space-sm); /* Space between list items */
}

/* Styling for strong tags not part of h4, making them distinct */
.scheme-card p strong,
.scheme-card li strong {
  font-weight: bold; /* Ensure it's bold */
  color: var(--color-link-hover); /* Using a defined blue color */
}
/* Ensure h4 strong tags are not overridden by the above if not desired, but usually h4 itself has priority or specific color */
.scheme-card h4 strong {
    color: inherit; /* Inherit color from h4 if specific color for h4 > strong is not needed */
}


/* Table styling within scheme-card (for Cheat Code section) */
.scheme-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.scheme-card th,
.scheme-card td {
  border: 1px solid #ccc;
  padding: var(--space-sm) var(--space-md); /* 8px 16px */
  text-align: left;
  vertical-align: top;
}

.scheme-card th {
  background-color: #e9ecef; /* Light grey for table headers */
  font-weight: 600; /* Make headers bold */
  color: #333;
}

.scheme-card td strong { /* For emphasizing text within table cells, like scheme names */
    color: var(--color-primary-dark); /* Dark green for emphasis */
}

/* Responsive Table Wrapper */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}


/* Image styling for the chart image */
.img-responsive-chart {
  max-width: 100%;
  height: auto;
  margin: var(--space-md) auto; /* Centered with margin */
  display: block; /* Ensure it's a block for centering */
  border-radius: var(--border-radius); /* Consistent border radius */
  box-shadow: var(--box-shadow-sm); /* Subtle shadow */
}


/* Responsive Design for Scheme Cards */
@media (max-width: 768px) { /* Tablets and below */
  .scheme-card {
    padding: 15px;
    margin-bottom: 15px;
  }
  .scheme-card h3 {
    font-size: 1.3em; /* Slightly smaller */
  }
  .scheme-card h4 {
    font-size: 1.1em; /* Slightly smaller */
  }
  .container { /* Ensure container padding is adequate */
    padding-right: var(--space-sm);
    padding-left: var(--space-sm);
  }
}

@media (max-width: 480px) { /* Mobile phones */
  .scheme-card {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px; /* Slightly smaller radius */
  }
  .scheme-card h3 {
    font-size: 1.2em; /* Further adjust for mobile */
  }
  .scheme-card h4 {
    font-size: 1.0em; /* Further adjust for mobile */
  }
  .scheme-card blockquote {
    padding-left: 10px;
  }
  .scheme-card ul {
    padding-left: 15px; /* Reduce indent slightly */
  }
  .scheme-card th,
  .scheme-card td {
    padding: var(--space-xs) var(--space-sm); /* Reduce padding in table cells */
  }
}

/* Passing Concept Card Styles */
.passing-concepts-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg, 20px); /* Use variable or fallback */
  justify-content: center; /* Center cards if they don't fill the row */
  padding: var(--space-lg, 20px) 0; /* Add some padding around the container */
}

.passing-concept-card {
  border: 1px solid #ccc;
  padding: var(--space-md, 16px); /* Use variable or fallback */
  margin-bottom: var(--space-lg, 20px); /* Use variable or fallback */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  background-color: var(--color-white, #fff); /* Use variable or fallback */
  border-radius: var(--border-radius, 0.3rem); /* Use variable or fallback */
  /* Flex item properties for the container */
  flex: 0 1 calc(50% - var(--space-lg, 20px)); /* Default for 2 cards per row */
  max-width: calc(50% - var(--space-lg, 20px)); /* Ensure it doesn't exceed 50% */
}

/* New Run Concept Styling (Full-width image and text) */
.run-concepts-container {
  /* Container doesn't need flex for this layout, just normal block flow */
  padding: var(--space-lg) 0; /* Add some vertical padding if desired */
}

.run-concept-card {
  /* Each card is a block containing one concept (image + text) */
  margin-bottom: var(--space-xxl); /* Generous space between each concept (this will be space AFTER the border) */
  background-color: transparent; /* Ensure no card-like background */
  border: none; /* Ensure no card-like border */ /* This will be overridden for border-bottom */
  box-shadow: none; /* Ensure no card-like shadow */
  padding: 0; /* Reset padding if any was inherited or previously set */
  padding-bottom: var(--space-lg); /* Space between content and the bottom border */
  border-bottom: 1px solid var(--color-border); /* Horizontal line separator */
}

/* Remove border and adjust padding for the last concept card */
.run-concepts-container > .run-concept-card:last-child {
  border-bottom: none;
  padding-bottom: 0; /* No extra padding needed if there's no border. The margin-bottom will provide space. */
}

.run-concept-card .concept-diagram-placeholder {
  margin-bottom: var(--space-lg); /* Space between image and the title/description */
  text-align: center; /* Center the image if it has a max-width */
}

.run-concept-card .concept-diagram-placeholder img {
  width: 100%; /* Make image responsive */
  max-width: 800px; /* Max width for large images on desktop, adjust as needed */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Remove extra space below image and allow margin auto to work */
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--border-radius); /* Keep rounded corners */
  cursor: pointer; /* Assuming lightbox is still desired */
  transition: opacity 0.3s ease;
}

.run-concept-card .concept-diagram-placeholder img:hover {
  opacity: 0.7; /* Keep hover effect for lightbox */
}

.run-concept-card h3 { /* Title of the concept */
  font-size: var(--font-size-xl); /* Make title prominent */
  color: var(--color-primary-dark);
  text-align: center; /* Center the title */
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.run-concept-card .concept-description {
  /* The description text block */
  max-width: 800px; /* Optional: constrain text width for readability, matching image max-width */
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md); /* Add some padding if text is edge-to-edge with container */
  padding-right: var(--space-md);
}

.run-concept-card .concept-description p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-dark);
  margin-bottom: var(--space-md); /* Standard paragraph spacing */
  text-align: left;
}

.run-concept-card .concept-description p:last-child {
  margin-bottom: 0;
}

.run-concept-card .concept-description strong {
  color: var(--color-primary-dark); /* Keep emphasis for labels */
  font-weight: 600; /* Ensure it's visually distinct */
}
/* End of New Run Concept Styling */

.passing-concept-card h3 {
  color: var(--color-primary-dark, #133728); /* Use variable or fallback */
  margin-bottom: var(--space-md, 10px); /* Use variable or fallback */
  margin-top: var(--space-sm); /* Add space between image and title */
}

.concept-description {
  width: 100%; /* Ensure it uses the full width within the card */
  margin-bottom: var(--space-md, 10px); /* Use variable or fallback */
  font-size: var(--font-size-base, 1rem); /* Use variable or fallback */
  line-height: var(--line-height-base, 1.6); /* Use variable or fallback */
  color: var(--color-dark, #343a40); /* Use variable or fallback */
  flex-grow: 1; /* Allows description to take available space */
}

.concept-diagram-placeholder {
  /* border: 1px dashed #aaa; */ /* Removed */
  /* padding: var(--space-lg, 20px); */ /* Removed */
  /* text-align: center; */ /* Removed as image is block and 100% width */
  margin-bottom: var(--space-md, 10px); /* Use variable or fallback */
  /* background-color: #f8f9fa; */ /* Removed */
  /* color: #6c757d; */ /* Removed */
  /* min-height: 150px; */ /* Removed */
  display: block; /* Changed from flex to block */
  /* align-items: center; */ /* Removed as it's for flex */
  /* justify-content: center; */ /* Removed as it's for flex */
  border-radius: var(--border-radius, 0.3rem); /* Keep radius for the image if image itself doesn't have it */
}

/* Responsive design for passing concept cards */
/* Default is now 2 cards per row, so the 991.98px media query for this specific case is no longer needed. */
/* @media (max-width: 991.98px) { */ /* Medium screens, e.g. tablets, for 2 cards per row */
  /* .passing-concept-card { */
    /* flex: 0 1 calc(50% - var(--space-lg, 20px)); */ /* 2 cards per row */
    /* max-width: calc(50% - var(--space-lg, 20px)); */
  /* } */
/* } */

@media (max-width: 767.98px) { /* Small screens, e.g. mobile phones, for 1 card per row */
  .passing-concepts-container {
    padding: var(--space-md, 16px) var(--space-sm, 8px); /* Reduce padding on smaller screens */
  }
  .passing-concept-card {
    flex: 0 1 100%; /* Cards take full width and stack vertically */
    max-width: 100%;
    margin-bottom: var(--space-md, 16px); /* Adjust margin for stacked cards */
  }
}

/* Lightbox Modal styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
  padding-top: 60px; /* Location of the box */
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  border-radius: 8px;
}

/* Add Animation */
.modal-content {
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)}
  to {transform:scale(1)}
}

.close-button {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close-button:hover,
.close-button:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Modify existing image placeholder to indicate interactivity */
.concept-diagram-placeholder img {
  width: 100%; /* Ensure image takes full width of the placeholder */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Already global, but good for specificity */
  border-radius: var(--border-radius); /* Ensure image itself has the radius */
  cursor: pointer;
  transition: 0.3s;
}

.concept-diagram-placeholder img:hover {
  opacity: 0.7;
}
