/* Base Styles */
:root {
  --primary: #c0d8b6;
  --primary-dark: #c0d8b6;
  --secondary: #333333;
  --accent: #ff6b35;
  --text: #333333;
  --text-light: #666666;
  --light: #f5f5f5;
  --lighter: #f9f9f9;
  --white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}
:root {
  --primary: #c0d8b6;
  --primary-dark: #c0d8b6;
  --secondary: #333333;
  --text: #333333;
  --text-light: #666666;
  --light: #f5f5f5;
  --white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color: var(--color--foreground, #111);
  background-color: var(--color--background, #f6f3e9);
}

body {
  font-family: var(--font--body, inherit);
  line-height: 1.6;
  color: var(--color--foreground, #111);
  background-color: var(--color--background, #f6f3e9);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

p {
  margin-bottom: 1rem;
}

/* Responsive typography tuning */
@media (min-width: 1200px) {
  html { font-size: 18px; } /* bump base size on desktop */
  .page-header h1 { font-size: 3rem; }
  .page-header p { font-size: 1.125rem; }
  /* News list typography (scoped for stronger specificity) */
  .news-page .news-item-title { font-size: 2.125rem; line-height: 1.3; }
  .news-page .news-item-excerpt { font-size: 1.125rem; line-height: 1.8; }
  .news-page .post-meta { font-size: 1rem; }
  .news-page .news-item { gap: 2.5rem; padding-bottom: 2.25rem; }
}

@media (max-width: 480px) {
  html { font-size: 16px; } /* ensure comfortable mobile base */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .news-item-title { font-size: 1.25rem; }
  .news-item-excerpt { font-size: 1rem; }
}

/* Extra-large desktop tuning */
@media (min-width: 1400px) {
  html { font-size: 19px; }
  .news-page .news-item-title { font-size: 2.25rem; }
  .news-page .news-item-excerpt { font-size: 1.1875rem; }
}

/* Buttons */
.button {
  display: inline-block;
  background-color: var(--primary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background-color: var(--primary-dark);
  color: var(--white);
}

/* Header */
.site-header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover:after,
.nav-links a.active:after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Blog logo size (used by simple-header.njk) */
.blog-logo img {
  height: 28px;        /* default desired logo height */
  max-height: 32px;    /* prevent oversizing on larger screens */
  width: auto;         /* keep aspect ratio */
  display: block;      /* remove inline-gap baseline */
}

/* Blog header tweaks: background + left spacing */
.blog-header {
  background: var(--color--background, #f6f3e9); /* restore blog header background */
}

.blog-header-inner {
  padding-left: 1.5rem; /* add a bit more left spacing */
}

@media (min-width: 992px) {
  .blog-header-inner { padding-left: 2rem; }
}

/* Footer */
.site-footer {
  background-color: var(--secondary);
  color: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo img {
  height: 40px;
  margin-bottom: 1rem;
}

.footer-section h3 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #999999;
}

.footer-legal {
  margin-top: 1rem;
}

.footer-legal a {
  color: #999999;
  margin: 0 0.5rem;
}

/* Homepage Styles */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 120px 0 80px;
  text-align: center;
  margin-top: 80px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero .lead {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.button.primary {
  background-color: var(--accent);
  border: 2px solid var(--accent);
}

.button.primary:hover {
  background-color: transparent;
  color: var(--white);
}

.button.secondary {
  background-color: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.button.secondary:hover {
  background-color: var(--white);
  color: var(--primary);
}

.featured-news {
  padding: 5rem 0;
  background-color: var(--lighter);
}

.featured-news h2 {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.featured-news h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--accent);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.news-card-image {
  height: 200px;
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

.news-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.news-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-card-title a:hover {
  color: var(--primary);
}

.news-card-excerpt {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  flex: 1;
}

.about-preview {
  padding: 5rem 0;
  background-color: var(--white);
  text-align: center;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.about-content h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--accent);
}

.about-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.text-center {
  text-align: center;
}

/* Post layout */
.post {
  padding-top: 2rem;
}
.post-header {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.post-hero {
  margin: 0 0 1.25rem;
}
.post-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 8px;
}
.post-title {
  font-family: var(--font--heading, inherit);
  font-size: clamp(1.75rem, 1.1rem + 1.5vw, 2.25rem);
  line-height: 1.25;
  margin: 0 0 .5rem;
}
.post-meta {
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  margin-bottom: .75rem;
}
.post-excerpt {
  color: var(--text-light);
  font-size: 1.05rem;
  margin: .25rem 0 1rem;
}
.post-content {
  padding-bottom: 4rem;
}
.post-content p {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.8;
}
.post-content h2 {
  margin: 2rem 0 1rem;
  font-size: 1.5rem;
}
.post-content h3 {
  margin: 1.75rem 0 .75rem;
  font-size: 1.25rem;
}
.post-content a {
  color: var(--primary);
  text-decoration: underline;
}
.post-content ul, .post-content ol {
  margin: 0 0 1.25rem 1.25rem;
}
.post-content blockquote {
  margin: 1.5rem 0;
  padding: .75rem 1rem;
  background: var(--lighter);
  border-left: 4px solid var(--primary);
  color: var(--text);
}
.post-content img {
  border-radius: 8px;
}
.post-content code {
  background: #f2f2f2;
  padding: .15rem .35rem;
  border-radius: 4px;
}
.post-content pre code {
  display: block;
  padding: 1rem;
  overflow-x: auto;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: .5rem .75rem;
  text-align: left;
}
.post-tags { display: inline-flex; gap: .5rem; }
.post-tags .tag { background: var(--light); color: var(--text); border-radius: 20px; padding: .25rem .75rem; font-size: .75rem; }

/* Post body layout with TOC */
.post-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}
@media (max-width: 1000px) {
  .post-body { grid-template-columns: 1fr; }
  .post-toc { order: 2; }
}

/* Table of contents */
.post-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}
.post-toc-title {
  font-weight: 700;
  margin-bottom: .75rem;
}
.post-toc-list ul { list-style: none; padding-left: 0; margin: 0; }
.post-toc-list > ul > li { margin: .75rem 0; }
.post-toc-list ul ul { margin-left: 1rem; }
.post-toc-list ul ul li { margin: .5rem 0; }
.post-toc-list a { color: var(--text); text-decoration: none; display: block; padding: .2rem 0; line-height: 1.5; }
.post-toc-list a:hover { text-decoration: underline; }

/* Heading anchors */
.heading-anchor {
  margin-left: .4rem;
  opacity: 0;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 700;
}
.post-content h2:hover .heading-anchor,
.post-content h3:hover .heading-anchor { opacity: 1; }

/* Pull quotes */
.pullquote {
  font-size: 1.25rem;
  line-height: 1.6;
  font-style: italic;
  background: var(--lighter);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  margin: 1.5rem 0;
}
.pullquote-right { border-left: none; border-right: 4px solid var(--primary); }
.pullquote-center { text-align: center; }

/* Figures with captions */
.post-figure { margin: 1.5rem 0; text-align: center; }
.post-figure img { max-width: 100%; border-radius: 8px; }
.post-figure figcaption { color: var(--text-light); font-size: .95rem; margin-top: .5rem; }

/* Prev/Next navigation */
.post-nav { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem 0; }
.post-nav-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.post-nav-link:hover { text-decoration: underline; }


/* 404 Page */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
  text-align: center;
}

.error-content h1 {
  font-size: 8rem;
  font-weight: 900;
  margin: 0;
  line-height: 1;
  color: var(--primary);
  opacity: 0.2;
  position: relative;
  z-index: 1;
}

.error-content h2 {
  font-size: 2.5rem;
  margin: 0.5rem 0 1.5rem;
  color: var(--text);
}

.error-content p {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* News List */
.news-page {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.page-header {
  text-align: left;
  margin-bottom: 2rem;
  padding: 1rem 0;
  background: none;
}

.news-list {
  margin-bottom: 3rem;
}

.news-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
}

.news-item-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-item:hover .news-item-image img {
  transform: scale(1.03);
}

.news-item-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background-color: var(--light);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag:hover {
  background-color: var(--primary);
  color: var(--white);
}

.news-item-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.news-item-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-item-title a:hover {
  color: var(--primary);
}

.news-item-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.read-more {
  display: inline-block;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  position: relative;
  align-self: flex-start;
}

.read-more:after {
  content: '→';
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
  display: inline-block;
}

.read-more:hover:after {
  transform: translateX(5px);
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 999;
  }
  
  .nav-links.active {
    transform: translateY(0);
  }
  
  .nav-links li {
    padding: 0.5rem 1.5rem;
  }
  
  .news-item {
    grid-template-columns: 1fr;
  }
  
  .news-item-image {
    height: 250px;
  }
  
  .news-item-image img {
    height: 100%;
  }
}

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

.news-item {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.2s; }
.news-item:nth-child(3) { animation-delay: 0.3s; }
.news-item:nth-child(4) { animation-delay: 0.4s; }

/* Website-style Footer (to match main site) */
footer.footer-dark { 
  background: #18181b; 
  color: var(--white);
}
.footer-wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding: 3rem 24px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .footer-wrap { max-width: 1920px; }
}
@media (max-width: 900px) {
  .footer-wrap { grid-template-columns: 1fr; padding: 2.25rem 24px; }
}
.foot-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.foot-card {
  background-color: var(--primary);
  background-image: url('/images/PRINT3D_Logomark_06.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-radius: 10px;
  padding: 1.25rem;
  min-height: 260px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
}
.foot-left .logo {
  width: 140px;
  height: 32px;
  background-color: transparent;
  background-image: url('/images/PRINT3D_Wordmark_06.png');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  border: none;
  align-self: flex-start;
}
.foot-card h4 { 
  margin: 0; 
  color: var(--text, #231f20); 
  letter-spacing: .04em; 
  font-family: var(--font--heading, inherit); 
}
.foot-card a.btn-link {
  align-self: end;
  justify-self: start;
  display: inline-block;
  padding: .6rem 1rem;
  background: var(--text, #231f20);
  color: var(--white);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  grid-row: 3;
}
.foot-nav { display: block; }
.foot-title { 
  margin: 0 0 .75rem; 
  font-size: 1.4rem; 
  letter-spacing: .04em; 
  font-family: var(--font--heading, inherit); 
}
.foot-list { 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  border-top: 1px solid rgba(255,255,255,.08); 
}
.foot-item { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 1rem; 
  border-bottom: 1px solid rgba(255,255,255,.08); 
}
.foot-item a { 
  display: block; 
  width: 100%; 
  color: var(--white); 
  text-decoration: none; 
  padding: 1rem 0; 
  letter-spacing: .02em; 
  font-size: 2rem; 
}
.foot-item a:hover { text-decoration: underline; }
.foot-meta { 
  color: #c3b7aa; 
  font-size: .9rem; 
  padding: 1rem 24px 2rem; 
  max-width: 1180px; 
  margin: 0 auto; 
}
@media (min-width: 1024px) {
  .foot-meta { max-width: 1920px; }
}

/* Header (website-style, adapted) */
header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: var(--color--background, #f6f3e9);
}
.nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.5rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand__logo { display: block; height: 28px; width: auto; }
.menu { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.menu a { font-size: .92rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: .9; color: var(--color--foreground, #111); text-decoration: none; }
.menu a:hover { text-decoration: underline; }
.cta { display: inline-flex; }
.btn { padding: .6rem 1rem; border-radius: 6px; border: 1px solid var(--primary); background: var(--primary); color: var(--color--foreground, #111); font-weight: 600; font-size: .9rem; }
.btn:hover { color: var(--white); }
.menu-toggle { display: none; align-items: center; justify-content: center; gap: .5rem; height: 40px; padding: 0 .75rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.08); background: var(--white); color: var(--color--foreground, #111); font-weight: 600; }
.menu-toggle .bars { display: inline-block; width: 18px; height: 12px; position: relative; }
.menu-toggle .bars::before, .menu-toggle .bars::after, .menu-toggle .bars span { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; }
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars span { top: 5px; }
.menu-toggle .bars::after { bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 942px) {
  .brand__logo { height: 21px; }
  .menu-toggle { display: inline-flex; background: #18181b; color: var(--white); border-color: #2a2a2a; }
  .menu { display: none; }
  .menu.is-open { display: flex; }
  .brand { order: 1; }
  .menu-toggle { order: 2; margin-left: auto; }
  .cta { order: 3; }
  .menu { order: 4; }
  .nav { position: relative; }
  .menu { position: absolute; top: calc(76px + 6px); left: 24px; right: 24px; z-index: 1000; flex-direction: column; align-items: stretch; background: #18181b; border: 1px solid #2a2a2a; border-radius: 12px; padding: .25rem .75rem; margin: 0; }
  .menu a { display: block; width: 100%; padding: .75rem .25rem; color: var(--white); opacity: 1; font-size: 2rem; border-bottom: 1px solid #2a2a2a; }
  .menu a:last-child { border-bottom: none; }
  .cta { display: none; }
}
