/* ==========================================================================
   MIT Thinking Theme - Made In Tandem Blog
   ========================================================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --dark-indigo: #001129;
  --medium-indigo: #0A2C49;
  --brash-burgundy: #8D134D;
  --sharpie-black: #191819;
  --website-white: #FBFBF5;
  --fog-grey: #F2F2F3;
  --french-grey: #E3DCD9;
  --parchment: #FFF4E6;
  --graceful-olive: #6F7347;
  --cold-indigo: #96BCBC;
  --growing-green: #80998C;
  --forest-green: #2D3F23;
  --rebellious-red: #F06553;
  --ripened-red: #962F1E;
  --lively-lavender: #F0E4EB;
  --original-ochre: #D3AD44;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --content-width: 720px;
  --wide-width: 1100px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--sharpie-black);
  background: var(--website-white);
}

a {
  color: var(--brash-burgundy);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--ripened-red);
}

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

/* ---------- Layout ---------- */
.page-wrap {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

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

/* ---------- Site Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--website-white);
  border-bottom: 1px solid var(--french-grey);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.site-logo img {
  height: 36px;
  width: auto;
}

.site-logo-divider {
  width: 1px;
  height: 22px;
  background: var(--french-grey);
}

.site-logo-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--graceful-olive);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--medium-indigo);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--brash-burgundy);
}

.header-cta {
  display: inline-block;
  background: var(--brash-burgundy);
  color: #fff !important;
  padding: 0.55rem 1.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.2s;
}

.header-cta:hover {
  background: var(--ripened-red);
  color: #fff !important;
}

/* ---------- Section Label ---------- */
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--graceful-olive);
}

.section-label-lined {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.section-label-lined::before,
.section-label-lined::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--french-grey);
}

/* ---------- Blog Index ---------- */
.blog-hero {
  padding: clamp(3rem, 7vw, 5rem) 0;
  border-bottom: 1px solid var(--french-grey);
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--dark-indigo);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.blog-hero p {
  font-size: 17px;
  color: rgba(25, 24, 25, 0.65);
  max-width: 540px;
  line-height: 1.65;
}

/* Post cards grid */
.post-feed {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  list-style: none;
}

/* Individual post card */
.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-image-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--fog-grey);
  aspect-ratio: 16 / 10;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.03);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brash-burgundy);
  text-decoration: none;
}

.post-card-tag:hover {
  color: var(--ripened-red);
}

.post-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(25, 24, 25, 0.4);
}

.post-card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--french-grey);
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark-indigo);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--brash-burgundy);
}

.post-card-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(25, 24, 25, 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Featured post (first on index) ---------- */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--french-grey);
  margin-bottom: 0.5rem;
}

.post-card.featured .post-card-image-link {
  margin-bottom: 0;
  aspect-ratio: 3 / 2;
}

.post-card.featured .post-card-title {
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
}

.post-card.featured .post-card-excerpt {
  -webkit-line-clamp: 4;
}

/* ---------- Single Post ---------- */
.post-header {
  padding: clamp(3rem, 7vw, 5rem) 0 2rem;
  text-align: center;
}

.post-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.post-header .post-card-tag {
  font-size: 12px;
}

.post-header .post-card-date {
  font-size: 12px;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  color: var(--dark-indigo);
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 780px;
  margin: 0 auto 1.25rem;
}

.post-excerpt {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(25, 24, 25, 0.6);
  max-width: 600px;
  margin: 0 auto;
}

.post-feature-image {
  margin: 2rem auto 0;
  max-width: 960px;
  border-radius: 8px;
  overflow: hidden;
}

.post-feature-image img {
  width: 100%;
}

/* ---------- Post Content ---------- */
.post-content {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.gh-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--sharpie-black);
}

.gh-content > * {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}

.gh-content > * + * {
  margin-top: 1.5em;
}

/* Headings */
.gh-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dark-indigo);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 2.5em;
}

.gh-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-indigo);
  line-height: 1.3;
  margin-top: 2em;
}

.gh-content h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--medium-indigo);
  line-height: 1.35;
  margin-top: 1.75em;
}

/* Links in content */
.gh-content a {
  color: var(--brash-burgundy);
  text-decoration: underline;
  text-decoration-color: rgba(141, 19, 77, 0.25);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}

.gh-content a:hover {
  text-decoration-color: var(--brash-burgundy);
}

/* Blockquotes */
.gh-content blockquote {
  border-left: 3px solid var(--graceful-olive);
  padding: 0.25em 0 0.25em 1.5em;
  font-style: italic;
  color: rgba(25, 24, 25, 0.75);
}

.gh-content blockquote p {
  margin: 0;
}

/* Code */
.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--fog-grey);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--medium-indigo);
}

.gh-content pre {
  background: var(--dark-indigo);
  color: var(--cold-indigo);
  padding: 1.5em;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.gh-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* Lists */
.gh-content ul,
.gh-content ol {
  padding-left: 1.5em;
}

.gh-content li + li {
  margin-top: 0.5em;
}

/* Images */
.gh-content .kg-image-card,
.gh-content .kg-gallery-card {
  margin-top: 2em;
  margin-bottom: 2em;
}

.gh-content .kg-image-card.kg-width-wide,
.gh-content .kg-gallery-card.kg-width-wide {
  max-width: 960px;
}

.gh-content .kg-image-card.kg-width-full,
.gh-content .kg-gallery-card.kg-width-full {
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.gh-content .kg-image {
  border-radius: 6px;
}

.gh-content figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  color: rgba(25, 24, 25, 0.45);
  letter-spacing: 0.02em;
  margin-top: 0.75rem;
}

/* Bookmark cards */
.gh-content .kg-bookmark-card {
  border: 1px solid var(--french-grey);
  border-radius: 6px;
  overflow: hidden;
}

.gh-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.gh-content .kg-bookmark-content {
  padding: 1.25rem;
  flex: 1;
}

.gh-content .kg-bookmark-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--dark-indigo);
  line-height: 1.35;
}

.gh-content .kg-bookmark-description {
  font-size: 13px;
  color: rgba(25, 24, 25, 0.55);
  margin-top: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-content .kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 12px;
  color: rgba(25, 24, 25, 0.45);
}

.gh-content .kg-bookmark-icon {
  width: 16px;
  height: 16px;
}

.gh-content .kg-bookmark-thumbnail {
  width: 180px;
  min-height: 100%;
}

.gh-content .kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Horizontal rule */
.gh-content hr {
  border: none;
  border-top: 1px solid var(--french-grey);
  margin: 3em auto;
}

/* Tables */
.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.gh-content th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--graceful-olive);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--french-grey);
}

.gh-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--fog-grey);
}

/* ---------- Post Footer ---------- */
.post-footer {
  border-top: 1px solid var(--french-grey);
  padding: 2.5rem 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.post-tags a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--graceful-olive);
  background: var(--fog-grey);
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.post-tags a:hover {
  background: var(--parchment);
  color: var(--brash-burgundy);
}

/* Author box */
.post-author-box {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--fog-grey);
}

.post-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post-author-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-indigo);
  margin-bottom: 0.25rem;
}

.post-author-name a {
  color: inherit;
  text-decoration: none;
}

.post-author-bio {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(25, 24, 25, 0.55);
}

/* ---------- Read More ---------- */
.read-more {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  background: var(--fog-grey);
}

.read-more-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark-indigo);
  margin-bottom: 2rem;
}

/* ---------- Tag & Author Archive ---------- */
.archive-header {
  padding: clamp(3rem, 7vw, 4.5rem) 0;
  border-bottom: 1px solid var(--french-grey);
}

.archive-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--graceful-olive);
  margin-bottom: 0.5rem;
}

.archive-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--dark-indigo);
  letter-spacing: -0.015em;
}

.archive-description {
  font-size: 16px;
  color: rgba(25, 24, 25, 0.6);
  margin-top: 0.75rem;
  max-width: 540px;
}

.archive-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(25, 24, 25, 0.4);
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem 0 clamp(3rem, 6vw, 4.5rem);
}

.pagination a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--medium-indigo);
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--french-grey);
  border-radius: 3px;
  transition: all 0.15s;
}

.pagination a:hover {
  border-color: var(--brash-burgundy);
  color: var(--brash-burgundy);
}

.pagination .page-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(25, 24, 25, 0.4);
  letter-spacing: 0.04em;
}

/* ---------- Site Footer ---------- */
.site-footer {
  background: var(--forest-green);
  border-top: 3px solid var(--graceful-olive);
}

.site-footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-logo img {
  height: 32px;
  width: auto;
  opacity: 0.5;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--growing-green);
  letter-spacing: 0.03em;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(251, 251, 245, 0.55);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: #fff;
}

/* ---------- Error Page ---------- */
.error-page {
  text-align: center;
  padding: clamp(5rem, 12vw, 9rem) 0;
}

.error-code {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--french-grey);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 18px;
  color: rgba(25, 24, 25, 0.5);
  margin-bottom: 2rem;
}

.error-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brash-burgundy);
}

/* ---------- Ghost Member Elements ---------- */
.gh-portal-close {
  display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .page-wrap,
  .site-header-inner,
  .site-footer-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card.featured {
    grid-template-columns: 1fr;
  }

  .post-card.featured .post-card-image-link {
    aspect-ratio: 16 / 10;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .gh-content .kg-bookmark-container {
    flex-direction: column;
  }

  .gh-content .kg-bookmark-thumbnail {
    width: 100%;
    height: 180px;
    order: -1;
  }
}

@media (max-width: 480px) {
  .header-nav .nav-link-desktop {
    display: none;
  }

  .post-author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
