/* Category page (e.g. Photo Logs gallery) */

/* Breadcrumb trail (same pattern as case studies) */
.breadcrumbs {
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  color: #8b8b8b;
  font-size: 0.875rem;
}

.breadcrumbs__link {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.breadcrumbs__current {
  color: rgba(255, 255, 255, 0.75);
}

body.light-mode .breadcrumbs__list {
  color: #666666;
}

body.light-mode .breadcrumbs__current {
  color: rgba(0, 0, 0, 0.7);
}

/* Contained width: content centered with side margins */
.category-page__inner {
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.category-title {
  margin: 0 0 0.5rem 0;
  color: var(--color-heading);
  font-size: 1.5rem;
  font-weight: 600;
}

body.light-mode .category-title {
  color: var(--color-heading-light);
}

.category-intro {
  margin: 0 0 2rem 0;
  color: var(--color-subheading);
  font-size: 1rem;
  font-weight: 400;
}

body.light-mode .category-intro {
  color: var(--color-subheading-light);
}

.category-intro:empty {
  display: none;
}

/* Behind the Scenes: description under heading */
#btsHeading {
  margin-bottom: 0;
}

.bts-heading-desc {
  margin: 0 0 1.25rem 0;
  color: var(--color-subheading);
  font-size: 1rem;
  font-weight: 400;
}

body.light-mode .bts-heading-desc {
  color: var(--color-subheading-light);
}

/* Behind the Scenes: justify paragraph text, same size */
.bts-description,
.bts-intro {
  font-size: 0.875rem;
  text-align: justify;
}

/* Behind the Scenes: intro same size as other paragraphs */
.bts-intro.category-intro {
  font-size: 0.875rem;
}

/* Behind the Scenes: hero image before introduction */
.bts-hero {
  margin-bottom: 1.25rem;
}

.bts-hero-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}

/* Behind the Scenes: tech stack section */
.bts-techstack {
  margin-top: 2.5rem;
}

.bts-techstack__subheading {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-heading);
}

body.light-mode .bts-techstack__subheading {
  color: var(--color-heading-light);
}

.bts-techstack-table {
  width: 100%;
  max-width: 28rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.bts-techstack-table__th,
.bts-techstack-table__td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-subheading);
  font-weight: 600;
}

.bts-techstack-table__th {
  font-weight: 700;
  color: var(--color-heading);
  background: rgba(255, 255, 255, 0.05);
}

.bts-techstack-table__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.bts-techstack-table__link:hover {
  opacity: 0.85;
}

.bts-techstack-table__cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bts-techstack-table__cell-inner + .bts-techstack-table__cell-inner {
  margin-left: 0.25rem;
}

.bts-techstack-table__logo {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

body.light-mode .bts-techstack-table__th,
body.light-mode .bts-techstack-table__td {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--color-subheading-light);
}

body.light-mode .bts-techstack-table__th {
  color: var(--color-heading-light);
  background: rgba(0, 0, 0, 0.04);
}

/* Behind the Scenes: Choices section */
.bts-choices {
  margin-top: 2.5rem;
}

.bts-choices__title {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-heading);
}

body.light-mode .bts-choices__title {
  color: var(--color-heading-light);
}

.bts-choices__subheading {
  margin: 0 0 0.75rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-heading);
}

body.light-mode .bts-choices__subheading {
  color: var(--color-heading-light);
}

.bts-choices__content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-subheading);
  text-align: justify;
}

body.light-mode .bts-choices__content {
  color: var(--color-subheading-light);
}

.bts-choices__img-wrap {
  margin-top: 1.25rem;
}

.bts-choices__img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}

.bts-choices__block {
  margin-top: 2rem;
}

/* Behind the Scenes: Why Cursor gallery – 2 photos per row */
.bts-cursor-gallery {
  margin-top: 1.5rem;
}

.bts-cursor-gallery__divider {
  margin: 0 0 1.25rem 0;
  border: none;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.2);
}

body.light-mode .bts-cursor-gallery__divider {
  border-top-color: rgba(0, 0, 0, 0.15);
}

.bts-cursor-gallery__divider--bottom {
  margin-top: 1.5rem;
}

.bts-cursor-gallery__title {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-heading);
}

body.light-mode .bts-cursor-gallery__title {
  color: var(--color-heading-light);
}

.bts-cursor-gallery__acknowledgements {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-heading);
}

body.light-mode .bts-cursor-gallery__acknowledgements {
  color: var(--color-heading-light);
}

.bts-cursor-gallery__acknowledgements-list {
  margin: 1rem 0 0 0;
  padding-left: 1.25rem;
  list-style-type: disc;
  text-align: left;
}

.bts-cursor-gallery__acknowledgements-content {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--color-subheading);
  text-align: left;
}

.bts-cursor-gallery__acknowledgements-content:last-child {
  margin-bottom: 0;
}

body.light-mode .bts-cursor-gallery__acknowledgements-content {
  color: var(--color-subheading-light);
}

.bts-cursor-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bts-cursor-gallery__item {
  margin: 0;
}

.bts-cursor-gallery__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}

/* Behind the Scenes: Inspirations section */
.bts-inspirations {
  margin-top: 2.5rem;
}

.bts-inspirations__title {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-heading);
}

body.light-mode .bts-inspirations__title {
  color: var(--color-heading-light);
}

.bts-inspirations__list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.bts-inspiration-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bts-inspiration-text {
  margin: 0;
  color: var(--color-subheading);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: justify;
}

body.light-mode .bts-inspiration-text {
  color: var(--color-subheading-light);
}

.bts-inspiration-media-wrap {
  max-width: 100%;
}

.bts-inspiration-video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  background: #000;
}

.bts-inspiration-caption {
  margin: 0.35rem 0 0 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-subheading);
}

body.light-mode .bts-inspiration-caption {
  color: var(--color-subheading-light);
}

/* Behind the Scenes: content links (old portfolio, jonhowell.com) – same style */
.bts-content-link {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.bts-content-link:hover {
  opacity: 0.85;
}

body.light-mode .bts-content-link {
  color: var(--color-heading-light);
}

/* About Me page: sections from Supabase (description_1, hero image, paragraph_2) */
.about-me__section {
  margin-bottom: 1rem;
}
.about-me__section:last-child {
  margin-bottom: 0;
}
.about-me__description1,
.about-me__paragraph2,
.about-me__paragraph3,
.about-me__paragraph4,
.about-me__paragraph5 {
  text-align: justify;
}

.about-me__tldr {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-heading);
  background: rgba(255, 255, 255, 0.06);
  border: 0.0625rem solid rgba(255, 255, 255, 0.25);
  border-radius: 0.375rem;
}

body.light-mode .about-me__tldr {
  color: var(--color-heading-light);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.18);
}

.about-me__subheading {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-heading);
}
body.light-mode .about-me__subheading {
  color: var(--color-heading-light);
}
.about-me__hero-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}

/* About Me: horizontal scrolling slideshow (img1–img6) */
.about-me__slideshow-wrap {
  margin-bottom: 1rem;
}
.about-me__slideshow {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 0.75rem;
}
.about-me__slideshow--auto {
  overflow: hidden;
}
.about-me__slideshow--auto .about-me__slideshow-track {
  animation: about-me-slide 40s linear infinite;
  width: max-content;
}
.about-me__slideshow--auto:hover .about-me__slideshow-track {
  animation-play-state: paused;
}
@keyframes about-me-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.about-me__slideshow::-webkit-scrollbar {
  display: none;
}
.about-me__slideshow-track {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.25rem;
}
.about-me__slide {
  flex-shrink: 0;
  width: 280px;
}
.about-me__slide-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
.about-me__slideshow-caption {
  margin: 0 0 0.75rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-heading);
}
body.light-mode .about-me__slideshow-caption {
  color: var(--color-heading-light);
}

/* Video Logs: vertical list — title, description, then embedded video per entry */
.video-logs-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-log-entry {
  margin: 0;
  padding: 0;
}

.video-log-entry__title {
  margin: 1rem 0 0.5rem 0;
  color: var(--color-heading);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}

body.light-mode .video-log-entry__title {
  color: var(--color-heading-light);
}

.video-log-entry__description {
  margin: 0 0 1.25rem 0;
  color: var(--color-subheading);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

body.light-mode .video-log-entry__description {
  color: var(--color-subheading-light);
}

.video-log-entry__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.video-log-entry__video iframe {
  width: 100%;
  height: 100%;
  display: block;
}

body.light-mode .video-log-entry__video {
  background: rgba(0, 0, 0, 0.06);
}

/* Gallery grid: 6 columns; landscape span 3 (2 per row), portrait span 2 (3 per row) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Toolbar: filter tabs + column switcher (desktop) */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.gallery-toolbar .writings-filters {
  margin: 0;
}

/* Column switcher: fixed width so it never shifts in the toolbar when toggling 2/3 */
.gallery-column-switcher {
  display: none;
  align-items: center;
  justify-content: flex-end;
  width: 4.5rem;
  min-width: 4.5rem;
  flex-shrink: 0;
  padding: 0;
}

/* Outer container: fixed-size pill */
.gallery-column-switcher__buttons {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  height: 2.25rem;
  padding: 0.25rem;
  border-radius: 2rem;
  background: rgba(50, 50, 50, 0.95);
  border: none;
  box-sizing: border-box;
}

body.light-mode .gallery-column-switcher__buttons {
  background: rgba(180, 180, 180, 0.6);
}

/* Each segment: exactly half the pill so layout never shifts */
.gallery-column-switcher__btn {
  flex: 0 0 50%;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(200, 200, 200, 0.9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 0.2s ease;
  box-sizing: border-box;
}

.gallery-column-switcher__btn:hover {
  color: rgba(230, 230, 230, 0.95);
}

/* Active: circle sized to fit icon (2x2 or 2x3 grid) with comfortable padding */
.gallery-column-switcher__btn.is-active::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(70, 70, 70, 0.98);
  z-index: 0;
}

.gallery-column-switcher__btn.is-active {
  color: #e8e8e8;
}

.gallery-column-switcher__btn.is-active .gallery-column-switcher__icon {
  position: relative;
  z-index: 1;
}

body.light-mode .gallery-column-switcher__btn {
  background: transparent;
  color: rgba(80, 80, 80, 0.95);
}

body.light-mode .gallery-column-switcher__btn:hover {
  color: rgba(50, 50, 50, 1);
}

body.light-mode .gallery-column-switcher__btn.is-active::before {
  background: rgba(220, 220, 220, 0.95);
}

body.light-mode .gallery-column-switcher__btn.is-active {
  color: #333;
}

.gallery-column-switcher__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}

.gallery-column-switcher__icon svg {
  display: block;
  margin: 0 auto;
}

@media (min-width: 1281px) {
  .gallery-toolbar .gallery-column-switcher {
    display: flex;
  }
}

/* Graphic Design: poster = 1 column, full image no bars; others = 1 column × 1 row */
.gallery-grid--graphic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(14rem, auto);
  gap: 1.5rem;
  grid-auto-flow: dense;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-grid--graphic.gallery-grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-grid--graphic.gallery-grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Poster: full image visible, no cropping — row height follows image */
.gallery-grid--graphic .gallery-item[data-type="Poster"],
.gallery-grid--graphic .gallery-item[data-type="Posters"],
.gallery-grid--graphic .gallery-item[data-type="poster"],
.gallery-grid--graphic .gallery-item[data-type="posters"] {
  grid-column: span 1;
  grid-row: span 1;
  display: block;
  align-self: start;
}

.gallery-grid--graphic .gallery-item[data-type="Poster"] .gallery-item__link,
.gallery-grid--graphic .gallery-item[data-type="Posters"] .gallery-item__link,
.gallery-grid--graphic .gallery-item[data-type="poster"] .gallery-item__link,
.gallery-grid--graphic .gallery-item[data-type="posters"] .gallery-item__link {
  display: block;
  overflow: visible;
}

.gallery-grid--graphic .gallery-item[data-type="Poster"] .gallery-item__image-wrap,
.gallery-grid--graphic .gallery-item[data-type="Posters"] .gallery-item__image-wrap,
.gallery-grid--graphic .gallery-item[data-type="poster"] .gallery-item__image-wrap,
.gallery-grid--graphic .gallery-item[data-type="posters"] .gallery-item__image-wrap {
  display: block;
  aspect-ratio: unset;
  background: transparent;
  overflow: hidden;
  line-height: 0;
}

.gallery-grid--graphic .gallery-item[data-type="Poster"] .gallery-item__image,
.gallery-grid--graphic .gallery-item[data-type="Posters"] .gallery-item__image,
.gallery-grid--graphic .gallery-item[data-type="poster"] .gallery-item__image,
.gallery-grid--graphic .gallery-item[data-type="posters"] .gallery-item__image {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  vertical-align: middle;
  object-fit: contain;
}

/* IG Post: fixed 1:1 box so all IG Posts are the same size */
.gallery-grid--graphic .gallery-item[data-type="IG Post"],
.gallery-grid--graphic .gallery-item[data-type="IG post"] {
  grid-column: span 1;
  grid-row: span 1;
}

.gallery-grid--graphic .gallery-item[data-type="IG Post"] .gallery-item__link,
.gallery-grid--graphic .gallery-item[data-type="IG post"] .gallery-item__link {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.gallery-grid--graphic .gallery-item[data-type="IG Post"] .gallery-item__image-wrap,
.gallery-grid--graphic .gallery-item[data-type="IG post"] .gallery-item__image-wrap {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.gallery-grid--graphic .gallery-item[data-type="IG Post"] .gallery-item__image,
.gallery-grid--graphic .gallery-item[data-type="IG post"] .gallery-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Logo and other non-poster: 1 column × 1 row (4:3 from base styles) */
.gallery-grid--graphic .gallery-item:not([data-type="Poster"]):not([data-type="Posters"]):not([data-type="poster"]):not([data-type="posters"]):not([data-type="IG Post"]):not([data-type="IG post"]) {
  grid-column: span 1;
  grid-row: span 1;
}

.gallery-item {
  margin: 0;
  padding: 0;
}

.gallery-item--landscape {
  grid-column: span 3;
}

.gallery-item--portrait {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
}

.gallery-item--portrait .gallery-item__link {
  flex: 0 0 20rem;
  height: 20rem;
}

.gallery-item--portrait .gallery-item__image-wrap {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.gallery-item__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 0.375rem;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.gallery-item__link:hover {
  transform: translateY(-2px);
}

.gallery-item__image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-subheading);
  overflow: hidden;
}

.gallery-item--landscape .gallery-item__image-wrap {
  aspect-ratio: 4 / 3;
}

body.light-mode .gallery-item__image-wrap {
  background: var(--color-subheading-light);
}

.gallery-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item__image--placeholder {
  background: var(--color-nav-link);
  opacity: 0.2;
}

body.light-mode .gallery-item__image--placeholder {
  opacity: 0.15;
}

/* Overlay: title bottom-left, year bottom-right, visible on hover */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem 0.875rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-item__link:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__title {
  position: absolute;
  left: 0.875rem;
  bottom: 0.75rem;
  right: 4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.gallery-item__year {
  position: absolute;
  right: 0.875rem;
  bottom: 0.75rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Caption below image: hidden on desktop, shown on mobile */
.gallery-item__caption {
  display: none;
  margin: 0.375rem 0 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subheading);
  line-height: 1.3;
}

body.light-mode .gallery-item__caption {
  color: var(--color-subheading-light);
}

body.light-mode .gallery-item__overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.35) 40%, transparent 100%);
}

/* Writings view: filter tabs + cards with cover image, name, type */
.writings-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.writings-filters__tab {
  background: none;
  border: none;
  padding: 0.375rem 0.75rem;
  color: var(--color-subheading);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.writings-filters__tab:hover {
  color: var(--color-heading);
}

.writings-filters__tab.is-active {
  color: var(--color-heading);
  font-weight: 600;
}

body.light-mode .writings-filters__tab {
  color: var(--color-subheading-light);
}

body.light-mode .writings-filters__tab:hover,
body.light-mode .writings-filters__tab.is-active {
  color: var(--color-heading-light);
}

.writings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.writings-card {
  margin: 0;
  padding: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.writings-card:hover {
  opacity: 0.9;
}

.writings-card__cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.375rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.75rem;
}

.writings-card__cover-wrap--placeholder {
  background: rgba(255, 255, 255, 0.1);
}

body.light-mode .writings-card__cover-wrap {
  background: rgba(0, 0, 0, 0.06);
}

body.light-mode .writings-card__cover-wrap--placeholder {
  background: rgba(0, 0, 0, 0.08);
}

.writings-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.writings-card__name {
  margin: 0 0 0.25rem 0;
  color: var(--color-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

body.light-mode .writings-card__name {
  color: var(--color-heading-light);
}

.writings-card__type {
  margin: 0;
  color: var(--color-subheading);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
}

body.light-mode .writings-card__type {
  color: var(--color-subheading-light);
}

.category-loading,
.category-empty {
  color: var(--color-subheading);
  font-size: 0.9375rem;
  margin: 0;
}

body.light-mode .category-loading,
body.light-mode .category-empty {
  color: var(--color-subheading-light);
}

/* Back to top button (same as case studies) */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.18);
  background: rgba(30, 30, 30, 0.92);
  backdrop-filter: blur(2rem) saturate(180%);
  -webkit-backdrop-filter: blur(2rem) saturate(180%);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3), inset 0 0.0625rem 0 rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(30, 30, 30, 0.98);
  border-color: rgba(255, 255, 255, 0.24);
}

.back-to-top:focus-visible {
  outline: 0.125rem solid rgba(255, 255, 255, 0.9);
  outline-offset: 0.1875rem;
}

body.light-mode .back-to-top {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2rem) saturate(180%);
  -webkit-backdrop-filter: blur(2rem) saturate(180%);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1), inset 0 0.0625rem 0 rgba(255, 255, 255, 0.5);
  color: #1a1a1a;
}

body.light-mode .back-to-top:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.24);
}

body.light-mode .back-to-top:focus-visible {
  outline-color: rgba(0, 0, 0, 0.85);
}

@media (max-width: 1280px) {
  .breadcrumbs {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .category-page__inner {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .category-title {
    font-size: 1.25rem;
  }

  .bts-cursor-gallery__grid {
    grid-template-columns: 1fr;
  }

  .video-log-entry__title {
    font-size: 1.25rem;
  }

  .video-log-entry__video {
    border-radius: 0.5rem;
  }

  .writings-filters {
    margin-bottom: 1.25rem;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 0.5rem;
  }

  .writings-filters::-webkit-scrollbar {
    display: none;
  }

  .writings-filters__tab {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
  }

  .writings-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .category-intro {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .about-me__tldr {
    font-size: 0.875rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem;
  }

  .gallery-item--landscape,
  .gallery-item--portrait {
    grid-column: span 1;
  }

  .gallery-item__image-wrap {
    aspect-ratio: 4 / 3;
  }

  .gallery-item__caption {
    display: block;
  }

  .gallery-item__overlay {
    display: none;
  }

  /* Graphic Design on mobile: same grid as Photo Logs; posters show full image (no crop) */
  .gallery-grid--graphic.gallery-grid--cols-2,
  .gallery-grid--graphic.gallery-grid--cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem;
  }

  /* On mobile, posters still show full image (aspect-ratio unset, object-fit contain) */
  .gallery-grid--graphic .gallery-item[data-type="Poster"] .gallery-item__image-wrap,
  .gallery-grid--graphic .gallery-item[data-type="Posters"] .gallery-item__image-wrap,
  .gallery-grid--graphic .gallery-item[data-type="poster"] .gallery-item__image-wrap,
  .gallery-grid--graphic .gallery-item[data-type="posters"] .gallery-item__image-wrap {
    aspect-ratio: unset;
    background: transparent;
  }

  .gallery-grid--graphic .gallery-item[data-type="Poster"] .gallery-item__image,
  .gallery-grid--graphic .gallery-item[data-type="Posters"] .gallery-item__image,
  .gallery-grid--graphic .gallery-item[data-type="poster"] .gallery-item__image,
  .gallery-grid--graphic .gallery-item[data-type="posters"] .gallery-item__image {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .back-to-top {
    bottom: 6.5rem;
  }
}

/* Image expand modal (same behavior as case studies) */
.category-image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.category-image-modal--active {
  display: flex;
}

.category-image-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.category-image-modal__content {
  position: relative;
  z-index: 10000;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.category-image-modal__img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.5);
  position: relative;
}

.category-image-modal__title {
  margin: 0;
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

body.light-mode .category-image-modal__title {
  color: rgba(0, 0, 0, 0.9);
}

.category-image-modal__close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(128, 128, 128, 0.8);
  border: 0.125rem solid rgba(128, 128, 128, 0.9);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 10001;
}

.category-image-modal__prev,
.category-image-modal__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10001;
  background: rgba(128, 128, 128, 0.8);
  border: 0.125rem solid rgba(128, 128, 128, 0.9);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.category-image-modal__prev {
  left: 2rem;
}

.category-image-modal__next {
  right: 2rem;
}

.category-image-modal__close:hover {
  background: rgba(128, 128, 128, 0.95);
  border-color: rgba(128, 128, 128, 1);
}

.category-image-modal__prev:hover,
.category-image-modal__next:hover {
  background: rgba(128, 128, 128, 0.95);
  border-color: rgba(128, 128, 128, 1);
}

.category-image-modal__close:focus-visible,
.category-image-modal__prev:focus-visible,
.category-image-modal__next:focus-visible {
  outline: 0.125rem solid rgba(255, 255, 255, 0.9);
  outline-offset: 0.125rem;
}

body.light-mode .category-image-modal__overlay {
  background: rgba(0, 0, 0, 0.95);
}

body.light-mode .category-image-modal__close,
body.light-mode .category-image-modal__prev,
body.light-mode .category-image-modal__next {
  background: rgba(128, 128, 128, 0.8);
  border-color: rgba(128, 128, 128, 0.9);
  color: #ffffff;
}

body.light-mode .category-image-modal__close:hover,
body.light-mode .category-image-modal__prev:hover,
body.light-mode .category-image-modal__next:hover {
  background: rgba(128, 128, 128, 0.95);
  border-color: rgba(128, 128, 128, 1);
}
