:root {
  --brand: #336699;
  --text: #252525;
  --muted: #5b5b5b;
  --bg: #f3f5f7;
  --card: #ffffff;
  --border: rgba(51, 102, 153, 0.22);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
  --focus: rgba(51, 102, 153, 0.35);
}

* { box-sizing: border-box; }

body {
  font-family: Verdana, Geneva, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--brand);
  color: #fff;
  padding: 20px 0 24px;
}

.header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header h1 { margin: 0; }
.site-header h2 {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Nav: bold, white, 1.5rem; hover changes color only */
.site-header .site-nav a {
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
  display: inline-block;
  margin-left: 18px;
  transition: color 120ms ease, opacity 120ms ease, text-decoration-color 120ms ease;
}

.site-header .site-nav a:hover,
.site-header .site-nav a:focus {
  color: #dbe9ff;
  opacity: 1;
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.site-header .site-nav a:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Sections */
.content-section {
  padding: 24px 0;
}

.content-section > h2 {
  margin: 0 0 16px;
}

/* Grid */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Card (portfolio overview defaults) */
.card {
  height: 360px; /* overview cards: equal height */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-link:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Thumbnails: preserve ratio, keep consistent area */
.card img {
  width: 100%;
  height: 170px;
  object-fit: contain;      /* preserve ratio (no crop) */
  object-position: center;
  display: block;
  background: rgba(51, 102, 153, 0.06);
}

/* Body */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
}

.card-title {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 1.15rem;
}

.card-text {
  margin: 0;
  line-height: 1.5;
  overflow: hidden;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-meta {
  margin-top: auto;
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.muted { opacity: 0.85; }

/* Footer */
.site-footer {
  background: var(--brand);
  color: #fff;
  padding: 16px 0;
  margin-top: 24px;
}

/* =========================================================
   Case study page overrides
   - Bigger cards
   - No ellipses / no clamping
   - Add hero image under title
   ========================================================= */

body.case-study .content-section > h2 {
  margin-bottom: 10px;
}

/* Hero image under the case study title */
body.case-study .case-hero {
  width: 100%;
  max-width: 980px;
  height: auto;
  display: block;
  margin: 12px auto 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(51, 102, 153, 0.06);
  padding: 10px; /* gives the letterbox background a little breathing room */
}

/* Make the cards larger on case-study pages */
body.case-study .card-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (min-width: 980px) {
  body.case-study .card-grid {
    grid-template-columns: repeat(2, 1fr); /* avoids tiny 4-up cards */
  }
}

body.case-study .card {
  height: auto;          /* allow content to expand */
  min-height: 230px;
}

body.case-study .card-body {
  padding: 18px 18px 20px;
}

body.case-study .card-title {
  font-size: 1.25rem;
}

/* Remove ellipses/clamping on case-study pages */
body.case-study .card-text {
  overflow: visible;
  text-overflow: clip;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}
