/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Montserrat', sans-serif;
  background: #fafafa;
  color: #222;
}

/* Header */
#header {
  padding: 20px;
}
#header .header-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
#header .logo {
  max-height: 50px;
  width: auto;
}
#header .tagline {
  font-size: 1rem;
  font-weight: 500;
  color: #222;
  min-height: 1.5em;
  flex: 1 1 100%;
  word-wrap: break-word;
}

/* Main grid */
#main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  padding: 20px;
}
.column-split {
  display: grid;
  grid-template-rows: 70% 30%;
  gap: 20px;
  height: 100%;
}

/* Cards */
.card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}
.card .image {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.card:hover img {
  transform: scale(1.08);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.4) 100%);
  z-index: 1;
  transition: background 0.4s ease;
}
.card:hover::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0.0) 20%, rgba(0,0,0,0.1) 100%);
}
.card h2, .card p {
  position: absolute;
  left: 50%;
  text-align: center;
  color: #fff;
  z-index: 2;
  width: 80%;
}
.card h2 {
  top: 45%;
  font-size: 2em;
  font-weight: 700;
  transform: translate(-50%, -50%);
}
.card p {
  top: 60%;
  font-size: 1.05em;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: all 0.6s ease;
}
.card:hover p {
  opacity: 1;
  transform: translate(-50%, 0);
}
.card.large {
  height: 70vh;
}
.card.small {
  height: 28.3vh;
}

/* Responsive */
@media screen and (max-width: 768px) {
  #main {
    grid-template-columns: 1fr;
  }
  .column-split {
    grid-template-rows: auto auto;
  }
  .card.large {
    height: 50vh;
  }
  .card.small {
    height: 40vh;
  }
  .card h2 {
    font-size: 1.6em;
  }
  .card p {
    font-size: 1em;
  }
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  z-index: 1000;
  padding: 40px 20px;
}
.overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}
.overlay-content {
  background: #fff;
  color: #333;
  max-width: 800px;
  width: 100%;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  position: relative;
  animation: slideUp 0.4s ease;
}
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.8rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #333;
}

/* Animations */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
@keyframes slideUp {
  from {transform: translateY(40px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}
