/* House Styles */
h1, h2 {
  text-shadow: 2px 2px 0px #333; /* 2px horizontal, 2px vertical, 0 blur, dark gray color */
}

/* Base styles for better readability */
:root {
  --card-base-size: 150px;
}

body {
  line-height: 1.6;
}

/* Improved card styling */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: var(--card-base-size);
  width: var(--card-base-size);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Improved image display */
.figure-img {
  transition: transform 0.3s ease;
}

.figure-img:hover {
  transform: scale(1.02);
}

.btn,
.button {
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
  transition: box-shadow 0.3s ease-in-out;
}

.btn:hover,
.button:hover {
  box-shadow: 0 8px 16px rgba(13, 110, 253, 0.2);
}

.card-header {
  font-size: 0.8rem;
}

.mt-n1 {
  margin-top: -0.1rem !important; /* Example for negative top margin */
}

ol.card-group-list > li.card,
ul.card-group-list > li.card {
  min-width: 30vw;
  margin: 4px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.hide-scrollbar::-webkit-scrollbar,
section > article.card > .card-body::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.hide-scrollbar,
section > article.card > .card-body {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.grid-container > article.card > figure,
.grid-container > article.card > figure > img,
section:not(.grid-container) > article.card > figure,
section:not(.grid-container) > article.card > figure > img {
  width: 100%;
  height: 100%;
}

/* Grid Layout Container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  width: 100%;
}

/* Responsive grid adjustments */
@media (min-width: 576px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  }
}

@media (min-width: 992px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  }
}

/* Card Size Classes */
.card-1x1 {
  grid-column: span 1;
  grid-row: span 1;
  aspect-ratio: 1/1;
  /* Base size - already set in .card */
}

.card-2x1 {
  grid-column: span 2;
  grid-row: span 1;
  width: calc(var(--card-base-size) * 2 + 1rem); /* Account for gap */
}

.card-1x2 {
  grid-column: span 1;
  grid-row: span 2;
  height: calc(var(--card-base-size) * 2 + 1rem); /* Account for gap */
}

.card-2x2 {
  grid-column: span 2;
  grid-row: span 2;
  width: calc(var(--card-base-size) * 2 + 1rem); /* Account for gap */
  height: calc(var(--card-base-size) * 2 + 1rem); /* Account for gap */
}

/* Box Cards */
/* Scope card styles to grid container to avoid breaking other layouts */
.grid-container > article.card {
  overflow: hidden;
  width: 100% !important;
  height: 100% !important;
  flex-shrink: 0;
}

/* Preserve original card styles for non-grid layouts */
section:not(.grid-container) > article.card {
  overflow: hidden;
  flex-shrink: 0;
  /* Base size matches 1x1 card */
  height: var(--card-base-size);
  width: var(--card-base-size);
}

.grid-container > article.card > .card-body,
section:not(.grid-container) > article.card > .card-body {
  overflow-y: scroll;
}

.grid-container > article.card.button > a,
section:not(.grid-container) > article.card.button > a,
.bullseye {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}


.grid-container > article.card.card-h1,
.grid-container > article.card.card-featured-img {
  width: 100% !important;
}

/* Special card types outside grid */
section:not(.grid-container) > article.card.card-h1,
section:not(.grid-container) > article.card.card-featured-img {
  width: calc(var(--card-base-size) * 2) !important;
}

/* Allow horizontal scrolling sections to have proper card sizing */
section.d-flex.flex-row > article.card {
  flex: 0 0 var(--card-base-size);
  min-width: var(--card-base-size);
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) { 
  :root {
    --card-base-size: 180px;
  }
  
  .card-header {
    font-size: 1rem;
  }
  ol.card-group-list > li.card,
  ul.card-group-list > li.card {
    max-width: 30vw;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) { 
  :root {
    --card-base-size: 196px;
  }
  
  ol.card-group-list > li.card,
  ul.card-group-list > li.card {
    max-width: 30vw;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) { 
  :root {
    --card-base-size: 256px;
  }
  
  ol.card-group-list > li.card,
  ul.card-group-list > li.card {
    max-width: 40vw;
  }
  .grid-container > article.card.card-h1,
  .grid-container > article.card.card-featured-img {
    width: 100% !important;
    grid-column: span 2;
  }
  
  section:not(.grid-container) > article.card.card-h1,
  section:not(.grid-container) > article.card.card-featured-img {
    width: 100% !important;
  }
}
/* end Box Cards */

.grid-container > article.card > figure > img,
section:not(.grid-container) > article.card > figure > img {
  width: 100%;
  height: 100%;
  object-position: top;
}

/* Additional Responsive Improvements */

/* Better typography for mobile */
@media (max-width: 576px) {
  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  .lead {
    font-size: 1.1rem;
  }
  .card-body {
    padding: 1rem;
  }
}

/* Improved spacing for case study content */
.card-body h3, .card-body h4, .card-body h5 {
  margin-top: 1.5rem;
}

.card-body h3:first-child, .card-body h4:first-child, .card-body h5:first-child {
  margin-top: 0;
}

/* Better image display on mobile */
@media (max-width: 768px) {
  .figure {
    margin-bottom: 1.5rem;
  }
  
  .row.g-4 {
    row-gap: 1rem !important;
  }
}

/* Improved blockquote styling */
blockquote {
  font-style: italic;
  color: #555;
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}
