body {
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
}

/* Logo styling fixes */
.masthead .logo {
  display: block;
  float: left;
}

.masthead .logo img {
  max-height: 60px;
  width: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
}

a.tag:hover {
  background-color: #8dc53f;
  border: 1px solid #6ba41c;
  box-shadow: inset 0 1px 0 #b0e369;
  -webkit-box-shadow: inset 0 1px 0 #b0e369;
}

.masthead,
.homepage .module-search .module-content {
  background: #2e3191 none;
}

body,
.site-footer,
.homepage .module-search .tags {
  background: #333333 none;
}

[role="main"],
.main {
  background: white none;
}

.hero {
  background-color: #eeeeee;
  padding-bottom: 30px;
}

/* Section spacing and separation */
[role="main"]:not(.hero) {
  padding-top: 20px;
  padding-bottom: 20px;
}

[role="main"]:last-of-type {
  border-bottom: none;
  padding-bottom: 50px;
}

/* Organization section styling (now outside hero) */
.module-image {
  display: inline-block;
  margin: 10px 15px 10px 0;
  vertical-align: top;
}

.module-image img {
  max-height: 60px;
  width: auto;
  border: 2px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box,
.wrapper,
.well {
  border-radius: 0;
  box-shadow: none;
}

.box h2:first-child {
  margin-top: 0;
}

.media-grid {
  padding-bottom: 15px;
}

.media-item,
.media-view {
  border-radius: 0;
}

.media-heading,
.context-info h1.heading {
  hyphens: none;
  word-break: normal;
}

.homepage .module-search .module-content,
.homepage .module-search .tags {
  border-radius: 0;
}

/* Fix browse sections alignment */
[role="main"] .row {
  margin-left: 0;
  margin-right: 0;
}

.homepage .row .span6,
.homepage .row .span9 {
  margin-left: 0;
}

/* Ensure proper container spacing */
.container {
  padding-left: 15px;
  padding-right: 15px;
}

/* Topic/Group boxes responsive grid styling */
.media-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: static !important;
  height: auto !important;
  list-style: none;
  padding: 0;
  margin: 0;
}

.media-grid .media-item {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column;
  min-height: 200px;
  box-sizing: border-box;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .media-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 items per row */
  }
}

@media (max-width: 768px) {
  .media-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 items per row */
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .media-grid {
    grid-template-columns: 1fr; /* 1 item per row on mobile */
    gap: 10px;
  }
}

/* Ensure boxes have consistent styling */
.media-item .media-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  flex-shrink: 0;
}

.media-item .media-heading {
  flex-grow: 1;
  margin: 10px 0;
}

.media-item .count {
  margin-bottom: 10px;
  display: block;
}

.media-item .media-view {
  margin-top: auto;
}
