@font-face {
  font-family: "zen-old-mincho";
  src: url("/assets/fonts/ZenOldMincho-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "zen-old-mincho";
  src: url("/assets/fonts/ZenOldMincho-SemiBold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  background-color: #f5f3ef;
  color: #403333;
  font-family: zen-old-mincho, serif; 
  line-height: 1.5; /* improve readability */

  margin: 0px;
  overflow: hidden;   /* prevents body from scrolling */
  height: 100vh;      /* full viewport height */
}
h1, h2, h3 { 
  font-size: 20px; 
  margin: 0; 
}
h3 {
  font-weight: normal;
}
p {
  font-size: 16px;
}
a {
  color: #403333;
}
a:hover {
  text-decoration: underline;
}
ul {
  list-style: none;
  padding: 0px;
  margin: 0;
}
/* ---------------------
   Grid / Layout
--------------------- */
.mobile-site-header {
  display: none;
}
.site-title {
  text-decoration: none;
  color: #403333;
  font-size: 20px;
}
.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
}
nav {
  grid-column: 1;
}
main {
  grid-column: 2;
  position: relative;        /* ensure positioning works */
  width: 100vw;              /* full viewport width */
  height: 100vh;             /* full viewport height */
  overflow-y: auto;          /* allow vertical scroll */
  overflow-x: hidden;        /* prevent horizontal scroll */
}
/* Make all images inside blog post content scale to the column width */
main img {
  max-width: 100%;   /* image won’t overflow the container */
  height: auto;      /* keep aspect ratio */
  display: block;    /* removes extra space below images */
  margin: 1em 0;     /* optional vertical spacing */
}
.spacer {
  margin: 72px;
}
/* ---------------------
   Navigation bar
--------------------- */
nav ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 24px;
}

nav ul li:first-child {
  margin-top: 72px;
  margin-bottom: 24px;
}

nav ul li:first-child a {
  font-size: 20px;
}

nav a {
  text-decoration: none;
  color: #403333;
  font-size: 16px;
}

.main-nav {
  margin-left: 12px;
}
/* Hamburger button hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #403333;
}

.nav-social {
  display: flex;
  gap: 10px; /* space between icons */
  margin: 12px 0; /* spacing from contact above and newsletter below */
  align-items: center;
}

.nav-social img {
  filter: invert(19%) sepia(3%) saturate(3516%) hue-rotate(314deg) brightness(88%) contrast(86%);
  /* adjust these numbers to match #403333 as closely as possible */
}
.Instagram {
width: 16px;
}
.Youtube {
width: 18px;
}
nav .newsletter {
  margin-top: -8px;
}

nav .newsletter form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

nav .newsletter label {
  font-size: 16px;
  color: #403333;
  margin-bottom: -6px;
}
form label {
  margin-bottom: -4px;
}
nav .newsletter input[type="name"], input[type="email"] {
  background-color: #f5f3ef;
  padding: 2px 0;
  margin-right: 12px;
  border-top: none;
  border-left: none;
  border-right: none;
  border-width: thin;
  margin-bottom: -2px;
}

input,
textarea, 
button {
  color: #403333; /* your site text color */
  font-family: zen-old-mincho, serif;
  font-size: 16px;
}

input::placeholder,
textarea::placeholder {
  color: #403333; /* lighter gray for placeholders */
  opacity: .5;      /* ensures color shows consistently across browsers */
}

input:focus,
textarea:focus,
button:focus {
  outline: none;       /* removes the default focus ring */
  box-shadow: none;    /* remove any browser-added shadow */
}
nav .newsletter button {
  background-color: #f5f3ef;
  color: #403333;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-right: 12px;
  text-align: left;
}

nav .newsletter button:hover {
  text-decoration: underline;
}

/* ---------------------
   Projects
--------------------- */
.projects-column {
  overflow-y: visible;
  height: auto;
  box-sizing: border-box;
  grid-column: 1 / 6;
  /* Hide scrollbar by default */
  scrollbar-width: thin;        /* Firefox: make it thin */
  scrollbar-color: transparent transparent; /* Firefox: invisible */
  margin-top: 134px;
}

/* Instagram-style grid inside archive */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.projects-item img,
.projects-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  background-color: #d3d3d3; /* light gray for placeholders */
  color: #403333;
  text-align: center;
  margin: 0;
}

/* ---------------------
   Blog
--------------------- */
.blog-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: start;
  margin-top: 0;         /* remove extra top margin */
  height: auto;           /* allow natural height for scrolling */
}
.post-column {
  overflow-y: auto;   /* vertical scroll */
  height: 100%;       /* fills the height of the grid container */
  box-sizing: border-box;
  grid-column: 1 / 6;
  /* Hide scrollbar by default */
  scrollbar-width: thin;        /* Firefox: make it thin */
  scrollbar-color: transparent transparent; /* Firefox: invisible */
  margin-top: 134px;
}
/* WebKit browsers (Chrome, Safari, Edge) */
.post-column::-webkit-scrollbar {
  width: 8px;
  background: transparent;      /* hide track */
  opacity: 0;                   /* hide scrollbar */
  transition: opacity 0.3s;
}

/* Scrollbar thumb */
.post-column::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
  transition: background 0.3s;
}

/* Show scrollbar on hover */
.post-column:hover::-webkit-scrollbar {
  opacity: 1;
}

.post-column:hover::-webkit-scrollbar-thumb {
  background-color: #555;
}

/* Firefox: change color on hover */
.post-column:hover {
  scrollbar-color: #555 transparent;
}
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-item a {
  text-decoration: none;
}
.post-preview-image-wrapper {
  width: 100%;
  height: 500px;         /* fixed height for uniform horizontal crop */
  overflow: hidden;      /* crop overflow */
  position: relative;
  display: block;
  margin-bottom: 1rem;
}

/* The image itself */
.post-preview-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* crop to fill wrapper */
  object-position: center; /* crop from center */
  display: block;
}
.post-excerpt p {
  margin: 0;
}
.pagination {
  display: flex;
  justify-content: center; /* center the numbers */
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pagination a,
.pagination span {
  padding: 6px 10px;
  text-decoration: none;
  color: #403333;
  font-size: 14px;
}
.pagination a:hover {
  text-decoration: underline;
}
.pagination span.current {
  font-weight: bold;
  background-color: #d3d3d3; /* highlight current page */
  pointer-events: none; /* not clickable */
}
.pagination-nav {
  margin-bottom: 72px;
}
.post-header {
  display: flex;
  align-items: baseline; /* aligns text along their baselines */
  gap: 1rem; /* space between title and date */
}
.post-header p {
  margin: 0;
}
.post-title {
  margin: 0;
}
.post-date {
  margin: 0;
  color: #7a6f6f;
  font-size: 15px;
}
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}
.post-nav a {
  text-decoration: none;
  max-width: 50%; /* ensures no link stretches past half container */
}
.back-to-all {
  flex: 1;
}
.next-post, .prev-post {
  flex: 2;
}
.next-post p, .prev-post p {
  margin: 0;
}
.post-tags a {
  text-decoration: none;
}

.post-tags a:hover {
  text-decoration: underline;
}
/* ---------------------
   Blog archive
--------------------- */
.archive-header {
  display: flex;
  align-items: baseline;          /* align button with heading baseline */
  margin-bottom: 1rem;
  color: #403333; /* normal color */
}

/* When archive is hidden */
.hidden-archive .archive-header {
  color: #7a6f6f;
}
.hidden-archive #visibility-toggle {
  color: #7a6f6f;
}

#archive-toggle, #visibility-toggle {
  font-size: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;  /* match text line height */
}
.post-list-header {
  display: none;
}
.post-archive {
  /* optional styling */
  grid-column: 7 / 10;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  margin-top: 134px;
}
.post-archive::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}

.post-archive::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}

.post-archive:hover::-webkit-scrollbar-thumb {
  background-color: #555;
}

/* Instagram-style grid inside archive */
.archive-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 16px;
}
.archive-item img,
.archive-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1; /* square images */
  display: block;
  object-fit: cover;
  background-color: #d3d3d3; /* light gray for placeholders */
  color: #403333;
  text-align: center;
  margin: 0;
}
.post-archive-text {
  display: block;
}
.post-archive-text details a {
  text-decoration: none;
}
.archive-year, .archive-month, .archive-tags-list  {
  font-size: 15px;
}
.archive-month, .archive-posts {
  margin-left: 16px;
}
.archive-tags-list {
  margin-left: 32px;
}
.archive-posts li, .archive-tags-list li {
  margin-bottom: 4px;
}
.post-archive-text .current-post a {
  text-decoration: underline;
}
.post-archive-text summary {
  list-style: none;
  cursor: pointer;
}
.post-archive-text summary::-webkit-details-marker {
  display: none; /* Chrome / Safari */
}
.post-archive-text summary::before {
  content: "/ ";
}
/* ---------------------
   Mobile styles
--------------------- */
@media (max-width: 1024px) {
  .projects-column {
    grid-column: 1 / 9;
  }
  .post-column {
    grid-column: 1 / 8;
  }
  .post-archive {
    grid-column: 9 / 13; /* start at column 3, end before column 5 */
  }
}
@media (max-width: 768px) {
  html, body, main,
  .post-column,
  .post-archive {
    overflow-y: visible;   /* allow main page to scroll naturally */
    height: auto;          /* no fixed height */
  }
  /* Hide scrollbars for WebKit browsers */
  html::-webkit-scrollbar, body::-webkit-scrollbar, main::-webkit-scrollbar,
  .blog-layout::-webkit-scrollbar,
  .post-column::-webkit-scrollbar,
  .post-archive::-webkit-scrollbar {
    display: none;
  }

  /* Hide scrollbars in Firefox */
  html, body, main,
  .blog-layout,
  .post-column,
  .post-archive {
    scrollbar-width: none;  /* Firefox */
  }

  /* Hide scrollbars in IE/Edge */
  html, body, main,
  .blog-layout,
  .post-column,
  .post-archive {
    -ms-overflow-style: none; /* IE/Edge */
  }

  .mobile-site-header {
    display: flex;
    align-items: baseline;
    padding: 24px 12px 4px 12px;
  }
  .page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .blog-layout {
    margin-top: 0;
  }
  nav {
    grid-column: 1 / -1;
    margin: 0;
  }
  .main-nav {
    margin: 0;
  }
  main {
    grid-column: 1 / -1;
    margin: 0;
    min-height: 100vh;
  }
  .home-nav {
    display: none;
  }
  nav ul {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-left: 12px;
  }
  nav ul li {
    margin: 0;
  }
  .nav-toggle {
    display: inline-block;
    margin-left: auto;
  }
  /* Show menu when nav-open is toggled */
  body.nav-open nav ul {
    display: flex;
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
  }
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .post-header {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .post-list {
    grid-column: 1 / -1;
  }
  /* Ensure post-column and post-archive have horizontal padding for text */
  .post-column {
    margin: -24px 0 0 0 ;
  }
  .post-column,
  .post-archive {
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box; /* padding won't break width */
  }

 .post-preview-image-wrapper {
  width: 100%;        /* full width of the parent container */
  display: block;
  height: 400px;      /* keep your crop height */
  overflow: hidden;
  position: relative; /* for object-fit cropping */
}

.post-preview-image-wrapper img {
  width: 100%;        /* fill wrapper */
  height: 100%;
  object-fit: cover;
  display: block;
}
  /* Optional: make post headers & text wrap nicely */
  .post-header,
  .post-excerpt,
  .post-tags {
    width: 100%;
  }

  .archive-header {
    margin: 0 12px;
  }
  .post-archive {
    grid-column: 1 / -1;
    order: -1;              /* move archive to top */
    width: 100vw;           /* full viewport width */
    position: relative;      /* ensure z-index positioning works if needed */
    left: 50%;               /* start from center */
    right: 50%;
    margin: 0 -50vw 36px -50vw;
    padding: 0;              /* remove padding if you want full edge-to-edge */
  }

  .archive-grid {
    width: 100%;             /* grid fills its parent */
    max-width: 100%;     /* prevent overflow */ 
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 12px;
  }

  .archive-item img,
  .archive-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  .post-nav {
    margin: 0 0 36px 0;
  } 
  .post-archive-text {
    margin: 12px;
  }
  .post-archive-text {
    display: none;
  }
}