/* Paul Graham style with LEFT SIDEBAR - GEC fonts and colors */
@import url("brand-colors.css");

/* Keep your fonts */
/* Self-hosted League Spartan to reduce FOUT */
@font-face {
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: url('/fonts/LeagueSpartan-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 700;
  font-display: fallback;
  src: url('/fonts/LeagueSpartan-Bold.ttf') format('truetype');
}

:root {
  /* Map shared brand colors into layout tokens */
  --gec-primary: var(--gec-color-chartreuse, #E4F577);
  --gec-secondary: var(--gec-color-slate, #363D46);
  --gec-accent: var(--gec-color-blue, #23648D);
  --gec-green: var(--gec-color-green, #2D6F31);
  --gec-white: var(--gec-color-cream, #FCFFFE);
  --gec-black: #000000;
  --gec-grey-light: var(--gec-color-gray, #DCDCDC);

  --text-color: var(--gec-secondary);
  --bg-color: var(--gec-grey-light);
  --border-color: var(--gec-green);
  --divider-color: #b3b4b7; /* blend of slate and brand grey */
  --muted-color: #666666;
  --sidebar-width: 150px;
  --content-max-width: 44rem;
  --font-primary: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
}

body {
  margin: 0;
  color: var(--text-color);
  background: var(--bg-color);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--gec-secondary);
}

/* Layout with LEFT sidebar */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* LEFT SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--divider-color); /* match body text tone */
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-content { flex: 1; display: flex; flex-direction: column; }

/* Logo styling - matches WordPress exactly */
.logo {
  margin-bottom: 2rem;
}

.logo a { color: inherit; text-decoration: none; display: inline-block; }

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 0.85;
}

.logo-game {
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--gec-green); /* Deep dark green */
  letter-spacing: -0.02em;
}

.logo-economist {
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--gec-secondary);
  letter-spacing: 0.15em;
}

.logo-consulting {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gec-secondary);
  letter-spacing: 0.03em;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0.5rem 0;
}

.sidebar-nav a {
  color: var(--text-color); /* Softer than pure black */
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase; /* All caps */
  display: block;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.sidebar-nav a:hover {
  color: var(--gec-green); /* Green on hover */
  text-decoration: none;
}

.sidebar-nav a.active {
  font-weight: 900;
  color: var(--text-color); /* Match body tone when active */
  text-decoration: underline; /* Underline when active */
}

/* Social links in sidebar */
.sidebar-connect {
  margin: 0.5rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--divider-color);
  display: flex;
  gap: 0.75rem;
  justify-content: center; /* center icons horizontally */
  align-items: center;
}

.sidebar-connect a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--gec-secondary);
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-connect a:hover {
  transform: scale(1.05);
  color: var(--gec-green);
}

.sidebar-connect svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width); /* Space for fixed sidebar */
  padding: 2rem;
}

/* Sidebar footer subscribe link */
.sidebar-footer { margin-top: auto; padding-top: 1rem; }
.sidebar-subscribe-link {
  display: inline-block;
  font-weight: 700;
  color: var(--gec-green);
  text-decoration: none;
}
.sidebar-subscribe-link:hover { text-decoration: underline; }

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Typography - your sizing */
h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 2.4rem 0 0.75rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.4;
}

p {
  margin: 0 0 1.2rem;
  line-height: 1.6;
}

/* Links */
a {
  color: #0000EE;
}

a:visited {
  color: #551A8B;
}

.sidebar-connect a,
.sidebar-connect a:visited {
  color: var(--gec-secondary);
}

/* HR elements */
hr {
  border: 0;
  border-top: 1px solid var(--divider-color);
  margin: 1.25rem 0;
}

/* Service blocks */
.service-block {
  margin: 2rem 0;
}

.service-block h3 {
  margin-top: 0;
}

/* Social links */
.social-links { margin: 2rem 0; }

.social-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1rem; }
.social-links a { margin-right: 0; display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; padding: 0.2rem 0; }
.social-links a:hover { text-decoration: underline; }
.social-links .social-icon { display: inline-flex; width: 28px; height: 28px; }
.social-links .social-icon img { display: block; width: 100%; height: auto; }

/* Post media alignment */
.content-wrapper article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
}

.content-wrapper article .wp-block-image,
.content-wrapper article figure,
.content-wrapper article .wp-caption {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.content-wrapper article figure img,
.content-wrapper article .wp-caption img,
.content-wrapper article p > img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.content-wrapper article figure.align-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.content-wrapper article figure.align-left {
  float: left;
  margin: 0 1.5rem 1rem 0;
  text-align: left;
}

.content-wrapper article figure.align-right {
  float: right;
  margin: 0 0 1rem 1.5rem;
  text-align: right;
}

.content-wrapper article figure.align-left img,
.content-wrapper article figure.align-right img {
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 768px) {
  .content-wrapper article figure.align-left,
  .content-wrapper article figure.align-right {
    float: none;
    margin: 1.25rem auto;
    text-align: center;
  }
}

.content-wrapper article .wp-caption-text,
.content-wrapper article figcaption {
  text-align: center;
}

.content-wrapper article table {
  margin: 1.5rem auto;
}

/* Meta text */
.meta {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin: 0.5rem 0 2rem;
}

/* Page Headers - WordPress style */
.page-header {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  padding: 3rem 2rem;
  margin: -2rem -2rem 2rem -2rem;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  background-size: cover;
  background-position: center;
}

/* Different background images for each page */
body[data-page="home"] .page-header {
  /* Fallback for browsers without image-set support */
  background-image: url('/images/home-hero.png');
  background-image: image-set(
    url('/images/home-hero.webp') type('image/webp') 1x,
    url('/images/home-hero.png') type('image/png') 1x
  );
}

body[data-page="podcast"] .page-header {
  /* Fallback for browsers without image-set support */
  background-image: url('/images/podcast-header.png');
  background-image: image-set(
    url('/images/podcast-header.webp') type('image/webp') 1x,
    url('/images/podcast-header.png') type('image/png') 1x
  );
}

body[data-page="blog"] .page-header {
  /* Fallback for browsers without image-set support */
  background-image: url('/images/blog-header.png');
  background-image: image-set(
    url('/images/blog-header.webp') type('image/webp') 1x,
    url('/images/blog-header.png') type('image/png') 1x
  );
}

body[data-page="join"] .page-header {
  /* Fallback for browsers without image-set support */
  background-image: url('/images/join-header.png');
  background-image: image-set(
    url('/images/join-header.webp') type('image/webp') 1x,
    url('/images/join-header.png') type('image/png') 1x
  );
}

.page-header-content {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: 4rem;
  font-weight: 900;
  color: var(--gec-secondary);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 0.9;
  text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
}

.page-header-image {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  opacity: 0.3;
  z-index: 1;
}

/* Contact section dual columns */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 2rem 0;
}

/* Service images - bigger and centered */
.service-with-image {
  display: grid;
  grid-template-columns: 1fr 1fr; /* True two-column layout */
  gap: 2rem;
  align-items: center; /* Center vertically */
  margin: 1.25rem 0;
}

.service-with-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* default for non-home pages */
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.service-with-image.reverse {
  grid-template-columns: 1fr 1fr; /* Keep equal columns like normal layout */
}

.service-with-image.reverse > *:first-child {
  order: 2; /* Move first child (image) to second position */
}

.service-with-image.reverse > *:last-child {
  order: 1; /* Move last child (text) to first position */
}

.service-content {
  max-width: 100%; /* Prevent text from bleeding over */
}

/* Make text sizing consistent across all service sections */
.service-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem; /* tighter spacing under section heading */
  font-weight: 600;
}

.service-content h3,
.service-content p strong {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1rem 0 0.35rem; /* tighter spacing for consistency */
  line-height: 1.35;
  display: block;
}

.service-content p {
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

/* Remove default strong styling when used as heading */
.service-content p strong { font-weight: 600; }

/* Firm Types image: match width and crop behavior to other sections */
.service-with-image .firm-types-media { width: 100% !important; }

/* Home page: make images taller by ~40% (20% top + 20% bottom) */
body[data-page="home"] .service-with-image img,
body[data-page="home"] .service-with-image .firm-types-media {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* Hero intro text sizing */
.hero-intro p { font-size: 1.6rem; line-height: 1.35; }

/* Yellow highlight effect for key phrase */
.highlight-yellow {
  background: linear-gradient(180deg, rgba(255, 234, 0, 0) 60%, var(--gec-primary) 60%);
  padding: 0 0.1em;
}


/* Podcast embed */
.podcast-player { width: 100%; height: 100%; display: flex; align-items: stretch; }
.podcast-player iframe {
  width: 100%;
  height: 320px;
  max-height: 100%;
  border: none;
  border-radius: 8px;
  background: transparent;
}

.podcast-album {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin: 0;
}

@media (max-width: 768px) {
  .podcast-player { height: auto; }
  .podcast-player iframe { height: 360px; }
  .podcast-album { max-width: 260px; }
}

/* Blog table styling */

/* Podcast two column layout */
.podcast-two-col { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: stretch; }
.podcast-two-col > div { display: flex; align-items: stretch; }
.podcast-two-col > div:first-child { justify-content: center; }
.podcast-two-col picture { width: 100%; display: flex; }
.podcast-two-col picture img { flex: 1 1 auto; }

@media (min-width: 769px) {
  .podcast-two-col picture { height: 100%; }
  .podcast-two-col picture img { height: 100%; object-fit: cover; }
  .podcast-player iframe { height: 100%; min-height: 320px; }
}

@media (max-width: 768px) {
  .podcast-two-col { grid-template-columns: 1fr; }
  .podcast-two-col > div { justify-content: center; }
  .podcast-two-col picture { height: auto; }
  .podcast-two-col picture img { height: auto; }
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.blog-table th {
  background: var(--gec-green);
  color: white;
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
}

.blog-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--gec-grey-light);
  font-size: 0.9rem;
}

/* Compact date column to reduce row width */
.blog-table .col-date { white-space: nowrap; font-size: 0.75rem; }

.blog-table tr:hover {
  background: #f9f9f9;
}

.blog-table a {
  color: var(--gec-secondary);
  text-decoration: none;
  font-weight: 500;
}

.blog-table a:hover {
  color: var(--gec-green);
}

/* Mobile: Stack layout */
@media (max-width: 768px) {
  .layout-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--divider-color);
    padding: 1rem;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  /* Hide date column on small screens */
  .blog-table .col-date { display: none; }
}
.blog-table.compact td, .blog-table.compact th {
  line-height: 1.2;
}

/* Inline subscribe box under JOIN */
.sidebar-subscribe {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--divider-color);
}
.sidebar-subscribe label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.sidebar-subscribe form { display: flex; flex-direction: column; gap: 0.6rem; }
.sidebar-subscribe input[type="email"] { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid #d0d5db; border-radius: 4px; font-size: 0.9rem; }
.sidebar-subscribe input[type="email"]::placeholder { font-size: 0.64rem; color: rgba(47,58,68,0.75); }
.sidebar-subscribe-frequency { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem; border: 1px solid #dfe5da; border-radius: 4px; background: #f6f8f5; font-size: 0.85rem; color: #2f3a44; }
.sidebar-preference-option { display: flex; align-items: center; gap: 0.4rem; }
.sidebar-preference-option input { margin: 0; accent-color: var(--gec-green); }
.sidebar-subscribe-actions { display: flex; flex-direction: column; gap: 0.5rem; }
#sidebarSubscribeBtn { width: 100%; padding: 0.55rem 0.6rem; background: var(--gec-green); color: #fff; border: none; border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 0.9rem; letter-spacing: 0.03em; }
#sidebarSubscribeBtn:hover { opacity: 0.95; }
#sidebarSubscribeBtn:focus-visible { outline: 2px solid var(--gec-primary); outline-offset: 2px; }
.sidebar-subscribe .subscribe-status { margin-top: 0.35rem; font-size: 0.85rem; }
.sidebar-subscribe .subscribe-status.ok { color: #256320; }
.sidebar-subscribe .subscribe-status.err { color: #8b0000; }

.sidebar-overlay-trigger { display: none; }
body[data-page="home"] .sidebar-overlay-trigger {
  display: block;
  width: 100%;
  height: 24px;
  margin: auto 0 0;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}

body[data-page="home"] .sidebar-overlay-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: rgba(47,58,68,0.08);
  opacity: 0;
  transition: opacity 0.2s ease;
}

body[data-page="home"] .sidebar-overlay-trigger:hover::after,
body[data-page="home"] .sidebar-overlay-trigger:focus-visible::after {
  opacity: 0.18;
}

body[data-page="home"] .sidebar-overlay-trigger:focus-visible {
  outline: 2px solid var(--gec-primary);
  border-radius: 4px;
}

/* Mission banner */
.mission-banner {
  margin: 2.5rem 0 3rem;
}

.mission-banner picture { display: block; }
.mission-banner img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .mission-banner img { height: 120px; }
}
