/* CSS Variables for the color palette */
:root {
  --sun-purple: #4E387E; /* Official-ish Sun Purple */
  --sun-grey-dark: #aaaaaa; /* Dark grey for text and backgrounds */
  --text-grey-dark: #4A4A4A; /* Dark grey for text and backgrounds */
  --sun-grey-medium: #d6d6d6; /* Medium grey for sections */
  --sun-grey-light: #EEEEEE; /* Light grey for background */
  --text-color: var(--text-grey-dark);
  --link-color: var(--sun-purple);
}

/* Basic Body Styling */
body {
  font-family: 'Roboto Mono', monospace; /* Monospace font for a retro terminal feel */
  font-size: 0.8em;
  line-height: 1.6;
  margin: 0;
  background-color: var(--sun-grey-light); /* Light grey background */
  color: var(--text-color);
  padding-top: 70px; /* Add padding to the top to prevent content from being hidden by the fixed header */
}

/* Container for centering content */
.container {
  width: 90%;
  max-width: 1024px; /* Optional: set a max width */
  margin: auto;
  overflow: hidden;
  /*  padding: 0.8rem; /* Add some padding on the sides */
}

/* Header Styling */
header {
  background: var(--sun-grey-dark); /* Dark grey header background */
  color: #ffffff; /* White text for header */
  padding-top: 10px;
  min-height: 60px; /* Reduced header height */
  border-bottom: var(--sun-purple) 5px solid; /* Purple border at the bottom */
  position: fixed; /* Keep header fixed at the top */
  width: 100%; /* Full width header */
  top: 0;
  left: 0;
  z-index: 1000; /* Ensure header is on top of other content */
}

header h1 {
  text-align: center;
  margin: 0;
  color: var(--sun-purple); /* Purple for the site title */
  font-family: 'Press Start 2P', cursive; /* Arcade-style font for the title */
  font-size: 24px; /* Adjust title font size */
}

header a {
  color: #ffffff; /* White links in header */
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px; /* Adjust link font size */
  transition: color 0.3s ease; /* Smooth color transition on hover */
}

header a:hover {
  color: var(--sun-purple); /* Purple color on hover */
}

header ul {
  padding: 0;
  list-style: none;
  text-align: center;
  margin-top: 5px; /* Adjust margin */
}

header li {
  display: inline-block; /* Display list items inline */
  padding: 0 15px; /* Adjust padding between links */
}

header nav {
  text-align: center;
  margin-top: 5px; /* Adjust margin */
}

header .active {
  color: var(--sun-purple); /* Purple for the active link */
  font-weight: bold;
}

/* Main Content Sections */
main {
  padding: 20px 0; /* Padding for the main content area */
}

section {
  margin-bottom: 20px; /* Margin between sections */
  padding: 20px;
  /* background: #ffffff;  White background for content sections */
  border: 1px solid var(--sun-grey-medium); /* Medium grey border */
  border-radius: 8px; /* Rounded corners for sections */
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Hero Section Styling */
.hero {
  background: var(--sun-grey-medium); /* Medium grey background for hero */
  color: var(--sun-grey-dark);
  text-align: center;
  padding: 50px 20px;
  margin-bottom: 20px;
  border: none; /* No border for hero section */
  border-radius: 0; /* No rounded corners for hero */
  box-shadow: none; /* No shadow for hero */
}

.hero h2 {
  color: var(--sun-purple); /* Purple heading in hero */
  margin-top: 0;
  font-family: 'Orbitron', sans-serif; /* Different font for hero heading */
}

/* Button Styling */
.btn {
  display: inline-block;
  color: #ffffff;
  background: var(--sun-purple); /* Purple button background */
  padding: 10px 20px;
  text-decoration: none;
  margin-top: 20px;
  border-radius: 5px;
  transition: background 0.3s ease; /* Smooth background transition on hover */
  font-family: 'Press Start 2P', cursive; /* Retro font for buttons */
  font-size: 14px;
}

.btn:hover {
  background: #6a4ea2; /* Slightly darker purple on hover */
}

/* Section Heading Styling */
section h3 {
  color: var(--sun-purple); /* Purple for section headings */
  border-bottom: 2px solid var(--sun-grey-light); /* Light grey underline */
  padding-bottom: 10px;
  margin-bottom: 15px;
}

/* Featured Machines List Styling */
.machine-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */
  gap: 20px; /* Gap between grid items */
}

.machine-item {
  border: 1px solid var(--sun-grey-medium);
  padding: 15px;
  border-radius: 5px;
  background-color: var(--sun-grey-light); /* Light grey background for items */
  position: relative; /* Needed for absolute positioning of image */
  overflow: hidden; /* Hide parts of the image that go outside */
  /* Ensure text content is above the image */
  z-index: 0;
}

.machine-item h4 {
  margin-top: 0;
  /* Change color to sun-purple and make it more prominent */
  color: var(--sun-purple);
  font-size: 1.2em; /* Increase font size */
  z-index: 1; /* Ensure text is above the image */
  position: relative; /* Needed for z-index to work with positioned parent */
}

.machine-item .image-gallery {
    /* Style the container for the image within the machine item */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place the image behind the text */
    display: flex; /* Use flexbox to center the image within its container */
    justify-content: center;
    align-items: center;
}

.machine-item .image-gallery img {
  display: block; /* Remove extra space below images */
  width: 100%; /* Make image cover the container width */
  height: 100%; /* Make image cover the container height */
  object-fit: cover; /* Crop image to fit the dimensions without distortion */
  opacity: 0.2; /* Make the image subdued */
  filter: grayscale(50%); /* Optional: Add a grayscale filter */
  transition: opacity 0.3s ease, filter 0.3s ease; /* Smooth transition for hover */
}

.machine-item:hover .image-gallery img {
    opacity: 0.4; /* Slightly less subdued on hover */
    filter: grayscale(0%); /* Remove grayscale on hover */
}


.machine-item a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  z-index: 1; /* Ensure links are above the image */
  position: relative; /* Needed for z-index to work with positioned parent */
}

.machine-item a:hover {
  text-decoration: underline;
}


/* Footer Styling */
footer {
  background: var(--sun-grey-dark); /* Dark grey footer background */
  color: #ffffff; /* White text for footer */
  text-align: center;
  padding: 20px 0;
  margin-top: 30px;
}

/* Basic Responsive adjustments */
@media (max-width: 768px) {
  header .container {
      text-align: center;
      padding-bottom: 10px;
  }

  header nav ul {
      padding-top: 10px;
  }

  header li {
      display: block;
      margin-bottom: 5px;
  }

  .hero {
      padding: 30px 10px;
  }

  section {
      padding: 15px;
  }
}
/* Blog Overview Styling */
.blog-overview  {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--sun-grey-medium);
    border-radius: 5px;
    background-color: #ffffff; /* White background for summaries */
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05); /* Lighter shadow */
}

.blog-overview  h4 {
    margin-top: 0;
    color: var(--sun-purple); /* Purple for post titles */
    margin-bottom: 5px;
}

.blog-overview ry p {
    margin-bottom: 10px;
}

/* Small button for "Read More" */
.btn-small {
    display: inline-block;
    color: #ffffff;
    background: var(--sun-purple);
    padding: 5px 10px; /* Smaller padding */
    text-decoration: none;
    border-radius: 3px; /* Smaller border radius */
    transition: background 0.3s ease;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px; /* Smaller font size */
}

.btn-small:hover {
    background: #6a4ea2;
}


/* Blog Post Styling */
.blog-post .post-meta {
    font-size: 0.9em;
    color: var(--text-grey-dark);
    margin-top: -10px; /* Adjust spacing */
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--sun-grey-medium); /* Dashed line under meta */
    padding-bottom: 10px;
}

.blog-post .post-content {
    /* Add styling for the main content area of the post */
    margin-bottom: 20px;
}

.blog-post .post-content h4 {
     color: var(--sun-purple); /* Purple for subheadings in post */
     margin-top: 20px;
     margin-bottom: 10px;
}

.blog-post .post-content p {
    margin-bottom: 15px;
}

.blog-post .post-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.blog-post .post-content li {
    margin-bottom: 5px;
}

/* Style for the "Back to Blog Overview" link */
.blog-post .container > p {
    margin-top: 20px;
    border-top: 1px dashed var(--sun-grey-medium); /* Dashed line above back link */
    padding-top: 10px;
}

/* Styling for About and Resources pages (basic section styling is already in place) */
.about-sparc p,
.resources p,
.resources ul {
    margin-bottom: 15px;
}

.resources ul {
    list-style: disc;
    margin-left: 20px;
}

.resources li a {
    color: var(--link-color);
    text-decoration: none;
}

.resources li a:hover {
    text-decoration: underline;
}

/* Styling for the Collection page categories */
.collection .machine-category {
    margin-bottom: 30px; /* Space between categories */
    padding-top: 15px; /* Add some padding above the category heading */
    border-top: 2px solid var(--sun-grey-light); /* Separator line between categories */
}

.collection .machine-category:first-child {
    border-top: none; /* No top border for the first category */
    padding-top: 0;
}


.collection .machine-category h4 {
    color: var(--sun-purple); /* Purple for category headings */
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--sun-grey-medium); /* Dashed line under category heading */
    padding-bottom: 5px;
}

.collection .machine-category .machine-list {
    /* Reusing the existing machine-list grid layout */
    gap: 20px; /* Ensure gap is consistent */
}

.collection .machine-item h5 {
    margin-top: 0;
    color: var(--sun-grey-dark); /* Dark grey for machine titles */
    margin-bottom: 5px;
}
/* Styling for the Collection Item Detail Page */
.collection-item-detail h3 {
    /* Keep the existing section heading style */
    color: var(--sun-purple);
    border-bottom: 2px solid var(--sun-grey-light);
    padding-bottom: 10px;
    margin-bottom: 20px; /* Increase margin below the main title */
}

.system-overview {
    display: flex; /* Use flexbox for side-by-side layout */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 30px; /* Space between imagery and tech data */
    margin-bottom: 30px; /* Space below the overview section */
}

.system-overview .imagery {
    flex: 1; /* Allow imagery to grow */
    min-width: 300px; /* Minimum width before wrapping */
}

.system-overview .tech-data {
    flex: 1; /* Allow tech data to grow */
    min-width: 300px; /* Minimum width before wrapping */
    background-color: var(--sun-grey-light); /* Light grey background for tech data */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--sun-grey-medium);
}

.imagery h4,
.tech-data h4,
.history h4,
.refurb-history h4 {
    color: var(--sun-grey-dark); /* Dark grey for subheadings */
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--sun-grey-medium); /* Dashed line under subheadings */
    padding-bottom: 5px;
}

/* Specific styling for the image gallery within collection item detail */
.collection-item-detail .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive grid for images */
    gap: 10px; /* Space between images */
    margin-bottom: 10px;
}

.collection-item-detail .image-gallery img {
    display: block; /* Remove extra space below images */
    width: 100%; /* Make images fill their grid container */
    height: auto; /* Maintain aspect ratio */
    border: 1px solid var(--sun-grey-medium);
    border-radius: 5px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease; /* Smooth transition for hover effect */
}

.collection-item-detail .image-gallery img:hover {
    transform: scale(1.03); /* Slightly enlarge image on hover */
}


.image-caption {
    font-size: 0.9em;
    text-align: center;
    color: var(--text-grey-dark);
    margin-top: 5px;
}

.tech-data table {
    width: 100%;
    border-collapse: collapse; /* Remove space between table borders */
}

.tech-data th,
.tech-data td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--sun-grey-medium); /* Separator line for rows */
}

.tech-data th {
    color: var(--sun-purple); /* Purple for table headers */
    font-weight: bold;
    width: 30%; /* Give headers a fixed width */
}

.tech-data td {
    color: var(--text-color);
}

/* Style for the history and refurb history sections */
.history,
.refurb-history {
    margin-bottom: 20px; /* Space between sections */
    padding-top: 15px; /* Add some padding above the heading */
    border-top: 2px solid var(--sun-grey-light); /* Separator line */
}

.history:first-of-type {
     border-top: none; /* No top border for the first history section */
     padding-top: 0;
}


.history p,
.refurb-history p {
    margin-bottom: 15px;
}

/* Style for the "Back to Collection" link */
.collection-item-detail .container > p {
    margin-top: 20px;
    border-top: 1px dashed var(--sun-grey-medium); /* Dashed line above back link */
    padding-top: 10px;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .system-overview {
        flex-direction: column; /* Stack imagery and tech data vertically */
        gap: 20px; /* Adjust gap */
    }

    .system-overview .imagery,
    .system-overview .tech-data {
        min-width: auto; /* Remove minimum width constraint */
        flex: none; /* Prevent flex items from growing */
        width: 100%; /* Make them take full width */
    }

    .collection-item-detail .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Adjust image grid for smaller screens */
    }
}


.blog-post-summary {
  display: flex; /* Arrange direct children (img and .text-content) in a row */
  align-items: start; /* Align items to the top */
  margin-bottom: 20px; /* Add space between blog entries */
  border-bottom: 1px solid #eee; /* Optional: Add a separator */
  padding-bottom: 20px; /* Optional: Add padding below the content */
}

.blog-post-summary img {
  /* Target the image directly within the container */
  width: 150px; /* Set a fixed width for the image */
  height: auto; /* Maintain aspect ratio */
  margin-right: 20px; /* Add space to the right of the image */
  /* Remove or adjust .card-img-top and .rounded styles if they conflict */
  /* .card-img-top might add unwanted width/height properties */
  /* .rounded is likely fine for rounded corners */
}

.blog-post-summary .text-content {
  /* Target the text content container */
  flex-grow: 1; /* Allow the text content to take up the remaining space */
  /* Ensure no fixed width is set that would prevent it from flexing */
}

.blog-post-summary .text-content p {
    margin-top: 0; /* Adjust margin for paragraphs within text-content if needed */
}

.blog-post-summary .text-content h4 {
    margin-top: 0; /* Remove top margin for the heading */
}

/* Styling for figure and image within figure */

figure {
    margin: 0 auto; /* Center the figure horizontally */
    padding: 0; /* Remove default padding from figure */
    text-align: center; /* Center the image and caption */
    margin-bottom: 20px; /* Add some space below the figure */
    max-width: 800px; /* Example: set a max width for the figure itself */
    /* You might want to adjust this max-width based on your layout needs */
}

figure img {
    max-width: 100%; /* Make the image responsive, not exceeding its container */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Ensures image takes up its own line and respects max-width */
    margin: 0 auto; /* Center the image if it's smaller than its container */
    border: 1px solid var(--sun-grey-medium); /* Add a subtle border */
    border-radius: 5px; /* Slightly rounded corners */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

figcaption {
    font-size: 0.9em;
    color: var(--text-grey-dark);
    margin-top: 10px; /* Space between image and caption */
}



/* Enhanced Table Display */

/* General Table Styling */
table {
    width: 100%; /* Ensure tables take full width of their container */
    border-collapse: collapse; /* Remove space between cell borders */
    margin-bottom: 20px; /* Add space below tables */
    background-color: #dddddd; /* White background for table content */
    border: 1px solid var(--sun-grey-medium); /* Subtle border around the whole table */
    border-radius: 8px; /* Rounded corners for the table container */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05); /* Lighter shadow for tables */
    overflow: hidden; /* Ensures border-radius applies to contained elements */
}

/* Table Header Styling */
th {
    /*  background-color: var(--sun-purple); /* Purple background for headers */
    color: #cccccc; /* White text for headers */
    padding: 12px 15px; /* More padding for headers */
    text-align: left; /* Align header text to the left */
    font-weight: bold; /* Bold text for headers */
    /*  text-transform: uppercase; /* Uppercase header text */
    font-size: 0.9em; /* Slightly smaller font size for headers */
    letter-spacing: 0.05em; /* Add a little letter spacing */
}

/* Table Cell Styling */
td {
    padding: 5px 10px; /* Padding for table cells */
    border-bottom: 1px solid var(--sun-grey-light); /* Lighter border between rows */
    color: var(--text-color); /* Use general text color */
    vertical-align: bottom;
    text-align: left;
     font-size: 0.9em; /* Slightly smaller font size for headers */
}

/* Alternating Row Colors for Readability */
tr:nth-child(even) {
    background-color: var(--sun-grey-light); /* Light grey background for even rows */
}

/* Hover effect on Table Rows */
tr:hover {
    background-color: #f0f0f0; /* Slightly lighter background on hover */
    transition: background-color 0.2s ease; /* Smooth transition */
}

/* Style for the last row's cells to remove bottom border if desired,
   or ensure it's consistent if the whole table has a border */
tr:last-child td {
    border-bottom: none;
}

/* Table Caption Styling (if you use <caption> for table titles) */
caption {
    font-family: 'Press Start 2P', cursive;
    color: var(--sun-purple);
    font-size: 1.2em;
    margin-bottom: 10px;
    text-align: center;
    padding-top: 10px;
}

/* Responsive Table Wrapper (for horizontal scrolling on small screens) */
/* Wrap your tables in a div with this class: <div class="table-responsive"><table>...</table></div> */
.table-responsive {
    overflow-x: auto; /* Allows horizontal scrolling for tables that overflow */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Specific adjustments for .tech-data table to integrate with new general styles */
.tech-data table {
    /* No need to re-declare width, border-collapse, background-color, border, border-radius, box-shadow */
    /* These properties are now handled by the general `table` rule */
}

.tech-data th {
    /* Keep width for technical data tables if needed, otherwise general `th` applies */
    width: 30%; /* You can keep this specific width for tech data headers if desired */
}


/* Basic Responsive adjustments */
@media (max-width: 768px) {

     body {
    padding-top: 140px; /* Increased padding-top for small screens to clear the taller header */
  }

  header .container {
      text-align: center;
      padding-bottom: 10px;
  }

  header nav ul {
      padding-top: 10px;
      display: flex; /* Use flexbox for the menu items */
      flex-wrap: wrap; /* Allow items to wrap to the next line */
      justify-content: center; /* Center the items horizontally */
  }

  header li {
      flex: 1 1 20%; /* Each item takes roughly half the width, allows wrapping */
      max-width: 20%; /* Ensure no item gets too wide */
      margin-bottom: 5px;
      padding: 0 2px; /* Adjust padding for smaller screens */
  }

  .hero {
      padding: 30px 10px;
  }

  section {
      padding: 15px;
  }
}
/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .system-overview {
        flex-direction: column; /* Stack imagery and tech data vertically */
        gap: 20px; /* Adjust gap */
    }

    .system-overview .imagery,
    .system-overview .tech-data {
        min-width: auto; /* Remove minimum width constraint */
        flex: none; /* Prevent flex items from growing */
        width: 100%; /* Make them take full width */
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Adjust image grid for smaller screens */
    }
}