/* ==========================================================================
   Michael Georgala Enterprises — shared stylesheet
   Palette derived from the company letterhead (navy blue + red rule)
   ========================================================================== */

:root {
  --color-primary: #1a4d8f;      /* letterhead blue */
  --color-primary-dark: #0f3363;
  --color-primary-light: #e9f0f9;
  --color-accent: #c0392b;       /* letterhead red rule */
  --color-accent-dark: #96271c;
  --color-ink: #1f2937;
  --color-muted: #5b6675;
  --color-border: #dfe4ea;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --radius: 6px;
  --shadow: 0 2px 10px rgba(15, 51, 99, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 51, 99, 0.14);
  --max-width: 1140px;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Georgia", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-accent); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------- Header ------------------------------- */
.site-header {
  background: #ffffff;
  border-bottom: 3px solid var(--color-accent);
  box-shadow: var(--shadow);
}

.brand-block {
  text-align: center;
  padding: 24px 16px 14px;
}

.brand-logo {
  display: block;
  margin: 0 auto 10px;
  height: 96px;
  width: auto;
  max-width: 100%;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: 0.12em;
  color: var(--color-primary);
  text-transform: uppercase;
  margin: 0;
}

.brand-rule {
  width: 220px;
  max-width: 60%;
  height: 2px;
  background: var(--color-accent);
  margin: 12px auto;
  border: none;
}

.brand-tagline {
  letter-spacing: 0.18em;
  font-size: clamp(0.65rem, 1.6vw, 0.85rem);
  text-transform: uppercase;
  color: var(--color-primary-dark);
  margin: 0;
}

.brand-tagline .dot {
  color: var(--color-accent);
  margin: 0 10px;
}

/* ------------------------------- Navigation ------------------------------ */
.site-nav {
  background: var(--color-primary);
}

.site-nav .container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 14px 18px;
  color: #eef3fa;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--color-primary-dark);
  color: #ffffff;
}

.nav-toggle {
  display: none;
}

/* --------------------------------- Hero ---------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 64px 0;
}

.hero .container {
  display: grid;
  gap: 24px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 12px;
}

.hero p {
  font-size: 1.05rem;
  max-width: 60ch;
  color: #e4ecf7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.page-hero {
  background: var(--color-primary-light);
  border-bottom: 1px solid var(--color-border);
  padding: 44px 0;
}

.page-hero h1 {
  font-family: var(--font-head);
  color: var(--color-primary-dark);
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
}

.page-hero p {
  color: var(--color-muted);
  max-width: 68ch;
  margin: 0;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 10px;
}

/* -------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-dark); color: #fff; }

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }

.btn-outline-dark {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline-dark:hover { background: var(--color-primary); color: #fff; }

/* -------------------------------- Sections -------------------------------- */
section { padding: 56px 0; }
.section-alt { background: var(--color-bg-alt); }

h2.section-title {
  font-family: var(--font-head);
  color: var(--color-primary-dark);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 8px;
}

.section-intro {
  color: var(--color-muted);
  max-width: 72ch;
  margin: 0 0 32px;
}

/* ------------------------------- Article prose ----------------------------- */
.article-back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.article-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 28px;
}

.article-meta .project-tag {
  margin-right: 8px;
  vertical-align: middle;
}

/* Read counter badge (hits.sh) — a free, no-signup hit counter service.
   Sized to sit inline with the rest of the meta line; onerror on the <img>
   itself hides it gracefully if the badge service is ever unreachable,
   rather than showing a broken-image icon. */
.read-counter {
  display: inline-block;
  height: 18px;
  width: auto;
  vertical-align: middle;
  margin-left: 8px;
}

.article-body {
  max-width: 72ch;
}

.article-body h2 {
  font-family: var(--font-head);
  color: var(--color-primary-dark);
  font-size: 1.3rem;
  margin: 34px 0 12px;
}

.article-body p {
  margin: 0 0 18px;
  color: var(--color-ink);
  line-height: 1.75;
}

.article-cta {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}

.chart-figure {
  margin: 8px 0 30px;
  padding: 20px;
  background: var(--color-primary-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.chart-title {
  display: block;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 12px;
  font-size: 1rem;
}

.data-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-source {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* --------------------------------- Grids ---------------------------------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 10px 0 8px;
  color: var(--color-primary-dark);
  font-size: 1.1rem;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover { color: var(--color-accent); }

.card p { color: var(--color-muted); margin: 0; font-size: 0.95rem; }
.card p + p { margin-top: 10px; }

.read-more {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}
.read-more:hover { text-decoration: underline; }

.icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-badge svg { width: 24px; height: 24px; }

/* ------------------------------- Discipline tabs strip -------------------- */
.discipline-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.discipline-card {
  border-radius: var(--radius);
  padding: 30px 24px;
  color: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.discipline-card.qs { background: linear-gradient(135deg,#1a4d8f,#123b70); }
.discipline-card.pv { background: linear-gradient(135deg,#245aa8,#173f7d); }
.discipline-card.adj { background: linear-gradient(135deg,#c0392b,#8f2a20); }

/* ------------------------------- Discipline theming -----------------------
   Applied via a disc-qs / disc-pv / disc-adj class on an ancestor of each
   discipline's own page content (the <body> on the multi-page site; the
   .page section wrapper on the single-file build), so the same colour
   coding used for the homepage discipline cards and project tags carries
   through to that page's hero banner and service icon badges. */
.disc-qs .page-hero { background: var(--color-primary-light); }
.disc-qs .page-hero h1 { color: var(--color-primary-dark); }
.disc-qs .page-hero .eyebrow { color: var(--color-primary); }
.disc-qs .icon-badge { background: var(--color-primary-light); color: var(--color-primary); }

.disc-pv .page-hero { background: #e6edfb; }
.disc-pv .page-hero h1 { color: #173f7d; }
.disc-pv .page-hero .eyebrow { color: #245aa8; }
.disc-pv .icon-badge { background: #e6edfb; color: #173f7d; }

.disc-adj .page-hero { background: #fbe9e7; }
.disc-adj .page-hero h1 { color: var(--color-accent-dark); }
.disc-adj .page-hero .eyebrow { color: var(--color-accent); }
.disc-adj .icon-badge { background: #fbe9e7; color: var(--color-accent-dark); }

.discipline-card h3 { margin: 0; font-size: 1.15rem; }
.discipline-card p { margin: 0; opacity: 0.92; font-size: 0.92rem; }
.discipline-card a { color: #fff; font-weight: 700; text-decoration: underline; }

/* --------------------------------- Lists ---------------------------------- */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 10px;
  color: var(--color-ink);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* Bulleted remainder list on Past Projects — older/lower-profile projects
   that don't get a full card, just a title, discipline tag and meta line. */
.project-list-remainder {
  list-style: none;
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--color-border);
}

.project-list-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
  color: var(--color-ink);
}

.project-list-item::before {
  content: "\2022";
  color: var(--color-accent);
  font-weight: 700;
  margin-right: 2px;
}

.project-list-item .project-tag {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* ------------------------------ Project cards ------------------------------ */
.project-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-btn {
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
}
.filter-btn.active,
.filter-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.filter-btn[data-filter="qs"].active,
.filter-btn[data-filter="qs"]:hover {
  background: #1a4d8f;
  border-color: #1a4d8f;
}
.filter-btn[data-filter="pv"].active,
.filter-btn[data-filter="pv"]:hover {
  background: #245aa8;
  border-color: #245aa8;
}
.filter-btn[data-filter="adj"].active,
.filter-btn[data-filter="adj"]:hover {
  background: #c0392b;
  border-color: #c0392b;
}

.project-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.project-thumb {
  position: relative;
  height: 150px;
  background: linear-gradient(135deg, var(--color-primary-light), #d9e5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  overflow: hidden;
}

/* Discipline-coloured banners — same palette as the homepage discipline
   cards, so QS/Valuation/Adjudication read consistently across the site
   (QS a darker navy, Valuation a slightly brighter blue, Adjudication red). */
.project-thumb.qs { background: linear-gradient(135deg, #1a4d8f, #123b70); }
.project-thumb.pv { background: linear-gradient(135deg, #245aa8, #173f7d); }
.project-thumb.adj { background: linear-gradient(135deg, #c0392b, #8f2a20); }

.project-thumb.has-photo {
  padding: 0;
}

.project-thumb.has-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Sits behind the photo/carousel; only visible if the image fails to load
   (e.g. a placeholder filename that hasn't been replaced with a real photo yet). */
.project-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
  z-index: 0;
}

.carousel {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.carousel-prev:hover,
.carousel-next:hover { background: rgba(15, 23, 42, 0.75); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

.carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
.carousel-dot.active { background: #fff; }

/* Click-to-enlarge affordance on project photos */
.project-photo {
  cursor: zoom-in;
}

.project-thumb.has-photo::after {
  content: "\26F6";
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.project-thumb.has-photo:hover::after {
  opacity: 1;
}

.project-body { padding: 18px 20px; }

.project-detail {
  font-size: 0.85rem;
  color: var(--color-ink);
  margin-top: 8px;
}

.project-detail span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.project-tag.qs { background:#e9f0f9; color: var(--color-primary); }
.project-tag.pv { background:#e6edfb; color:#173f7d; }
.project-tag.adj { background:#fbe9e7; color: var(--color-accent-dark); }

.project-meta {
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-top: 10px;
}

/* --------------------------------- Forms ----------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
}
@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-primary-dark);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 120px; }

/* Honeypot field for the contact form — invisible and unreachable by
   keyboard/screen reader for real visitors, but present in the markup for
   spam bots that auto-fill every field to find. */
.field-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
}
.form-status-success {
  background: #e6f4ea;
  color: #1e7a3d;
}
.form-status-error {
  background: #fbe9e7;
  color: var(--color-accent-dark);
}

.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.info-list .label {
  font-weight: 700;
  color: var(--color-primary-dark);
  min-width: 110px;
}

/* --------------------------------- Footer ----------------------------------- */
.site-footer {
  background: var(--color-primary-dark);
  color: #cfdbee;
  padding: 40px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-bottom: 24px;
}

.footer-grid h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.9rem; }
.footer-grid a { color: #cfdbee; }
.footer-grid a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  font-size: 0.8rem;
  text-align: center;
  color: #9fb3d1;
}

/* ---------------------------------- Utility ---------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------------------------------- Responsive nav ---------------------------------- */
@media (max-width: 720px) {
  .site-nav ul { flex-direction: column; width: 100%; }
  .site-nav a { text-align: center; padding: 12px; }
  .contact-grid { gap: 28px; }
}

/* ---------------------------------- Photo lightbox ---------------------------------- */
body.lightbox-locked { overflow: hidden; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(15, 23, 42, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

@media (max-width: 520px) {
  .lightbox-overlay { padding: 16px; }
  .lightbox-close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 22px; }
}
