/*
==========================================
PORTFOLIO STYLESHEET
==========================================
Single unified CSS file for the entire website.

Structure:
1. Font definitions
2. CSS custom properties (variables)
3. Base styles (body, typography)
4. Reusable components (panels, navigation, buttons)
5. Work page styles (work.html - project listing)
   - .year-cell for project years
6. Project page styles (project detail pages)
   - .content-cell for content sections
7. Typography (semantic classes for text)
8. Gallery and effects (rain, modal)
9. Responsive styles
==========================================
*/

@font-face {
  font-family: times_regular;
  src: url('../fonts/times-regular.woff') format('woff');
}
@font-face {
  font-family: times_b16;
  src: url('../fonts/times-b-16.woff') format('woff');
}
@font-face {
  font-family: times_b24;
  src: url('../fonts/times-b-24.woff') format('woff');
}
@font-face {
  font-family: times_b32;
  src: url('../fonts/times-b-32.woff') format('woff');
}

/* CSS Custom Properties */
:root {
  --retro-bg: #C0C0C0;
  --retro-button-bg: #d4d0c8;
  --retro-border-dark: #808080;
  --retro-border-light: #ffffff;
  --retro-text: #000000;
}

/* Basic styles */
body { 
  font-family: times_regular, serif;
  background-color: var(--retro-bg);
  margin: 0;
  padding: 20px;
  color: var(--retro-text);
}

h1 {
  font-family: times_b32, serif;
  text-align: center;
  margin-bottom: 10px;
}

h2, big {
  font-family: times_b24, serif;
}

b, strong {
  font-family: times_b16, serif;
  font-weight: bold;
}

i, em {
  font-family: times_regular, serif;
  font-style: italic;
}

.highlighted {
  background-color: #000080;
  color: #ffffff;
  padding: 2px 4px;
}

/* Layout containers */
.retro-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.retro-content {
  width: 80%;
  margin: 0 auto;
  text-align: left;
}

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

/* Retro 3D effects */
.retro-panel {
  border: 2px outset var(--retro-button-bg);
  background: var(--retro-bg);
  padding: 16px;
  margin: 20px 0;
}

.retro-icon {
  width: 48px;
  height: 48px;
  border: 2px solid var(--retro-text);
  display: inline-block;
}

/* Table-based navigation - always pressed look */
.retro-nav {
  border: 2px outset var(--retro-button-bg);
  background: var(--retro-bg);
  margin: 20px auto;
}

.nav-cell {
  border: 1px inset var(--retro-button-bg); /* Always pressed/inset look */
  background: var(--retro-bg);
  text-align: center;
  vertical-align: middle;
}

.nav-link {
  display: block;
  text-decoration: none;
  color: var(--retro-text);
  font-family: times_regular, serif;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border: 2px solid var(--retro-text);
}

/* News section */
.news-section {
  border: 2px inset var(--retro-button-bg);
  background: white;
  padding: 15px;
  margin: 20px 0;
  text-align: left;
}

.news-title {
  font-family: times_b16, serif;
  color: #000080;
  margin-bottom: 10px;
}

.news-item {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
}

.news-date {
  font-size: 12px;
  color: #666;
}

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

/* Introduction section */
.intro-text {
  font-size: 16px;
  line-height: 1.6;
  margin: 20px 0;
}

/* Footer */
footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #999;
}

/* Links - consistent styling */
a {
  color: #000;
  text-decoration: underline;
}

a:visited {
  color: #000;
}

a:hover {
  opacity: 0.7;
}

/* Links in body text - styled as inline buttons */
.body-text a,
.quote a {
  display: inline-block;
  padding: 4px 10px;
  background: var(--retro-button-bg);
  border: 2px outset var(--retro-button-bg);
  color: #000;
  text-decoration: none;
  font-family: times_b16, serif;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: baseline;
  cursor: pointer;
  transition: border-style 0.1s;
}

.body-text a:visited,
.quote a:visited {
  color: #000;
}

.body-text a:hover,
.quote a:hover {
  opacity: 1;
  border-style: inset;
}

.body-text a:active,
.quote a:active {
  border-style: inset;
}

/* Metadata Chips Container */
.metadata-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Metadata Chip - Base (non-clickable) */
.metadata-chip {
  display: inline-block;
  padding: 6px 12px;
  background: var(--retro-button-bg);
  border: 2px outset var(--retro-button-bg);
  color: #000;
  text-decoration: none;
  font-family: times_regular, serif;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal; /* Allow text wrapping for long content */
  word-wrap: break-word;
  max-width: 100%;
  vertical-align: middle;
}

/* Metadata Chip - Clickable (link) */
.metadata-chip-link {
  font-family: times_b16, serif;
  cursor: pointer;
  transition: border-style 0.1s;
}

/* Convert emojis to grayscale for retro aesthetic */
.emoji-icon {
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
}

.metadata-chip-link:visited {
  color: #000;
}

.metadata-chip-link:hover {
  opacity: 1;
  border-style: inset;
}

.metadata-chip-link:active {
  border-style: inset;
}

/* Mobile: Stack chips vertically on small screens */
@media (max-width: 768px) {
  .metadata-chips-container {
    gap: 6px;
  }
  
  .metadata-chip {
    font-size: 15px;
    padding: 5px 10px;
    white-space: normal; /* Allow wrapping on mobile */
  }
}

/* Retro Link/Button Component */
.retro-link {
  display: block;
  border: 1px inset var(--retro-button-bg);
  background: var(--retro-bg);
  padding: 10px 15px;
  text-decoration: none;
  color: #000;
  transition: background-color 0.2s;
}

.retro-link:visited {
  color: #000;
}

.retro-link:hover {
  background: #e8e5de;
}

/* Welcome page styles */
.welcome-container {
  border: 2px outset var(--retro-button-bg);
  background: var(--retro-bg);
  padding: 40px;
  max-width: 600px;
  margin: 20px;
}

.main-hook {
  font-family: times_b32, serif;
  font-size: 28px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.instructions {
  font-size: 14px;
  color: #666;
  margin-top: 30px;
}

.welcome-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  cursor: pointer;
}

/* Legacy styles */
a img {
  border: 2px solid;
}

/* Remove border from navigation gifs */
.nav-gif {
  border: none !important;
}

input[type="text"], textarea {
  border: 2px inset;
  font-family: monospace;
}

input[type="submit"] {
  font-family: times_regular;
  background: var(--retro-button-bg);
  border: 2px outset;
  padding: 4px 1rem;
} 

p {
  width: 80%;
}

/* ==== WORK PAGE SPECIFIC STYLES ==== */

/* Work page body override */
body.work-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

/* Year cell - used on work.html for displaying project years */
.year-cell {
  position: relative;
  background: var(--retro-bg);
  text-align: left;
  vertical-align: middle;
  padding: 4px 8px;
  font-family: times_b16, serif;
  color: #666;
  border: 1px inset var(--retro-button-bg);
  font-size: 13px;
  line-height: 1;
}

.year-rain-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  backdrop-filter: invert(1);
  -webkit-backdrop-filter: invert(1);
}

/* Navigation area */
.nav-area {
  background: transparent;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 800px;
  margin: 0 auto;
}

/* Desktop only */
@media (min-width: 769px) {
  .nav-area {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    margin: 0 auto 30px auto;
  }
}

.nav-table {
  border: 2px outset var(--retro-button-bg);
  background: var(--retro-bg);
  margin: 0;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
  width: auto;
  table-layout: auto;
}

.filter-table-wrapper {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-table .nav-cell {
  border: 1px inset var(--retro-button-bg);
  background: var(--retro-bg);
  text-align: center;
  vertical-align: middle;
  padding: 15px 25px;
  width: auto;
}

.nav-table .nav-link {
  display: block;
  text-decoration: none;
  position: relative;
}



.nav-gif {
  width: 40px;
  height: 30px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: none !important;
}

/* Larger first and third navigation gifs */
.nav-table .nav-cell:nth-child(1) .nav-gif,
.nav-table .nav-cell:nth-child(3) .nav-gif {
  transform: scale(1.1);
  position: relative;
}

/* Larger middle navigation gif */
.nav-table .nav-cell:nth-child(2) .nav-gif {
  width: 50px;
  height: 38px;
  transform: scale(1.4);
  z-index: 10;
  position: relative;
}

@media (max-width: 768px) {
  .nav-gif {
    width: 35px;
    height: 28px;
  }
  
  /* Larger first and third navigation gifs on mobile */
  .nav-table .nav-cell:nth-child(1) .nav-gif,
  .nav-table .nav-cell:nth-child(3) .nav-gif {
    transform: scale(1.1);
    position: relative;
  }
  
  /* Larger middle navigation gif on mobile */
  .nav-table .nav-cell:nth-child(2) .nav-gif {
    width: 44px;
    height: 35px;
    transform: scale(1.4);
    z-index: 10;
    position: relative;
  }
}

.nav-link:hover .nav-gif {
  filter: brightness(1.2) saturate(1.3);
}

/* Filter Menu - handled by mobile-first rules above */

.filter-table {
  border: 2px outset var(--retro-button-bg);
  background: var(--retro-bg);
  margin: 0;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
}

.filter-cell {
  border: 1px inset var(--retro-button-bg);
  background: var(--retro-bg);
  text-align: center;
  vertical-align: middle;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.filter-cell:hover {
  background: #e8e5de;
}

.filter-cell.active {
  border-style: inset;
  background: #e8e5de;
  font-weight: bold;
}

/* Projects table styles */
.projects-table {
  border: 2px outset var(--retro-button-bg);
  background: var(--retro-bg);
  margin: 0;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  border-spacing: 1px;
  border-collapse: separate;
  table-layout: fixed;
}

.project-cell {
  padding: 0;
  display: none;
}

.project-cell td {
  border: 1px inset var(--retro-button-bg);
  padding: 15px 15px 12px 15px;
  background: var(--retro-bg);
}

.project-cell.visible {
  display: table-row;
}

.project-content {
  display: flex;
  padding: 10px;
  background: var(--retro-bg);
  border: 1px solid var(--retro-border);
}

.project-preview {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin-top: 3px;
}

.project-preview img {
  max-width: 300px;
  width: 100%;
  height: auto;
  border: 1px solid var(--retro-button-bg);
}

/* Hover effect disabled */
/* .project-cell td:hover .project-preview {
  max-height: 200px;
} */

.project-header {
  margin-bottom: 10px;
}

.project-title-line {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
}

.project-symbol {
  width: 15px;
  margin-right: 5px;
  display: inline-block;
  line-height: 1;
  vertical-align: baseline;
}

.project-title-text {
  font-family: times_b16, serif;
  font-size: 16px;
  line-height: 1;
}

.project-meta {
  font-size: 14px;
  color: #666;
  margin-left: 20px;
}

.project-symbol.solo { color: #1a1a1a; }
.project-symbol.group { color: #666; }
.project-symbol.other { color: #999; }

.project-description {
  font-size: 13px;
  font-style: italic;
  font-family: times_regular, serif;
  color: #777;
  margin: 5px 0 0 0;
}

.project-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-link:visited {
  color: inherit;
}

/* Mobile Styles */
@media (max-width: 768px) {
  body.work-page {
    padding: 0;
    margin: 0;
  }

  .nav-area {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    z-index: 1000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease-out;
    will-change: transform;
  }
  
  .nav-area.hidden {
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .nav-table {
    width: 95%;
    max-width: none;
    margin: 0 auto;
    border-width: 2px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    background: var(--retro-bg);
  }
  
  .filter-table-wrapper {
    width: 95%;
    margin: 0 auto;
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  


  .nav-table .nav-cell {
    padding: 12px 16px;
    border-width: 2px;
    font-size: 18px;
    height: 52px;
    box-sizing: border-box;
  }

  .nav-gif {
    width: 35px;
    height: 28px;
  }

  /* Scroll arrows for mobile */
  .scroll-left,
  .scroll-right {
    position: fixed;
    width: 35px;
    height: 34px;
    z-index: 1003;
    display: none;
    pointer-events: none;
  }

  .scroll-left {
    left: 2.5%;
    background: linear-gradient(to right, var(--retro-bg) 60%, transparent);
    mix-blend-mode: multiply;
  }

  .scroll-right {
    right: 2.5%;
    background: linear-gradient(to left, var(--retro-bg) 60%, transparent);
    mix-blend-mode: multiply;
  }

  .filter-table {
    width: max-content;
    border-width: 2px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  }

  .filter-cell {
    padding: 6px 10px;
    border-width: 2px;
    font-size: 14px;
    height: 34px;
    box-sizing: border-box;
    white-space: nowrap;
    background: var(--retro-bg);
  }

  .filter-cell.active {
    border-style: inset;
    background: #e8e5de;
    font-weight: bold;
  }

  .projects-table {
    width: 100%;
    margin-bottom: 20px; /* Default smaller margin */
  }

  /* Last table needs space for navigation at bottom */
  .projects-table:last-of-type {
    margin-bottom: 220px;
  }

  .project-content {
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
  }

  .project-symbol {
    margin-top: 4px;
    font-size: 22px;
  }

  .project-cell {
    cursor: pointer;
  }

  .project-cell td {
    padding: 12px 15px;
  }

  .project-preview {
    max-height: none;
    overflow: visible;
    transition: none;
    margin-top: 10px;
  }

  .project-preview img {
    max-width: none;
    width: 100%;
    height: auto;
    border: 1px solid var(--retro-button-bg);
  }

  /* Hover effect disabled */
  /* .project-cell td:hover .project-preview {
    max-height: none;
  } */

  .project-title-line {
    display: flex;
    align-items: baseline;
  }

  .project-symbol {
    line-height: 1;
  }

  .project-title-text {
    line-height: 1;
  }

  .project-meta {
    margin-left: 20px;
  }
}

/* Responsive - keep tables but make them work on mobile */
@media (max-width: 768px) {
  .retro-nav td {
    display: block;
    width: 100%;
    height: auto;
  }
  
  .retro-nav {
    width: 100%;
  }
  
  .retro-nav .nav-cell {
    width: 100%;
    height: 60px;
  }
}

.metadata-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1px;
}

.metadata-label {
  width: 120px;
  padding: 8px;
  background: var(--retro-button-bg);
  color: #666;
  font-family: times_b16, serif;
}

.metadata-value {
  padding: 8px;
  background: var(--retro-bg);
  color: #000;
}

.content-cell {
  padding: 10px;
  background: var(--retro-bg);
  border: 1px solid var(--retro-border);
}

.section-title {
  font-family: times_b24, serif;
  font-size: 18px;
  margin-bottom: 20px;
  color: #000;
}

.curatorial-text {
  font-style: italic;
  font-family: times_regular, serif;
  margin-bottom: 20px;
  line-height: 1.6;
}

.text-author {
  text-align: right;
  margin-top: 10px;
  color: #666;
}

.project-description p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.audio-description {
  margin-bottom: 20px;
  line-height: 1.6;
}

.audio-player {
  width: 100%;
  margin-top: 20px;
}

.project-quotes blockquote {
  margin: 0 0 20px 0;
  padding: 20px;
  background: var(--retro-button-bg);
  border-left: 4px solid #666;
}

.project-quotes blockquote p {
  font-style: italic;
  font-family: times_regular, serif;
  line-height: 1.6;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-gallery img {
  width: 100%;
  height: auto;
  border: 1px solid var(--retro-border);
  padding: 5px;
  background: var(--retro-bg);
}


/* Image Cell - for table cells containing images */
.image-cell {
  padding: 0 1px 1px 0 !important;
}

/* Hero Image */
.hero-image {
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-image:hover {
  opacity: 0.9;
}

/* Gallery Images */
.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.gallery-image:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .hero-image {
    margin: 0;
  }
}

/* ==== COLLAPSIBLE SECTIONS ==== */
.collapsible-section {
  width: 100%;
}

.collapsible-section summary {
  display: inline-block;
  padding: 6px 12px;
  background: var(--retro-button-bg);
  border: 2px outset var(--retro-button-bg);
  color: #000;
  font-family: times_b16, serif;
  font-size: 16px;
  cursor: pointer;
  transition: border-style 0.1s;
  list-style: none;
  user-select: none;
}

.collapsible-section summary::-webkit-details-marker {
  display: none;
}

.collapsible-section summary:hover {
  border-style: inset;
}

.collapsible-section summary:active {
  border-style: inset;
}

/* Add arrow that changes based on state */
.collapsible-section[open] > summary::after {
  content: " ▲";
}

.collapsible-section:not([open]) > summary::after {
  content: " ▼";
}

.collapsible-section[open] summary {
  margin-bottom: 10px;
}

.collapsible-section .quote,
.collapsible-section .body-text {
  margin-top: 10px;
}

/* Section header with toggle button (for about page) */
.section-header-with-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.toggle-button {
  background: var(--retro-button-bg);
  border: 2px outset var(--retro-button-bg);
  color: #000;
  font-family: times_regular, serif;
  font-size: 16px;
  padding: 4px 12px;
  cursor: pointer;
  user-select: none;
  transition: border-style 0.1s;
  min-width: 40px;
}

.toggle-button:hover {
  border-style: inset;
}

.toggle-button:active {
  border-style: inset;
}

/* Read More - Tab at bottom edge */
.read-more-cell {
  position: relative;
  padding-bottom: 32px !important; /* Extra space for the tab */
}

.read-more-section {
  display: block;
}

.read-more-tab {
  position: absolute;
  bottom: 0;
  left: 90%;
  transform: translateX(-90%);
  padding: 5px 14px 3px 14px;
  background: var(--retro-button-bg);
  border: none;
  color: #000;
  font-family: times_b16, serif;
  font-size: 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
  clip-path: polygon(12% 0%, 88% 0%, 100% 100%, 0% 100%);
  min-width: 90px;
  text-align: center;
}

/* SVG borders */
.read-more-borders {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Change white stroke to retro grey in default state */
.read-more-borders line[stroke="white"] {
  stroke: #d4d0c8 !important;
}

/* Text wrapper */
.read-more-text {
  position: relative;
  z-index: 2;
}

.read-more-tab::-webkit-details-marker {
  display: none;
}

.read-more-tab:hover .read-more-borders line[x1="12"][y1="0"][x2="88"] {
  stroke: #808080 !important;
}

.read-more-tab:hover .read-more-borders line[x1="12"][y1="0"][x2="0"] {
  stroke: #808080 !important;
}

.read-more-tab:hover .read-more-borders line[x1="88"][y1="0"][x2="100"] {
  stroke: #d4d0c8 !important;
}

.read-more-tab:active .read-more-borders line[x1="12"][y1="0"][x2="88"] {
  stroke: #808080 !important;
}

.read-more-tab:active .read-more-borders line[x1="12"][y1="0"][x2="0"] {
  stroke: #808080 !important;
}

.read-more-tab:active .read-more-borders line[x1="88"][y1="0"][x2="100"] {
  stroke: #d4d0c8 !important;
}

/* Change text based on state - English */
html[lang="en"] .read-more-section:not([open]) > .read-more-tab .read-more-text::after {
  content: "Show more ▼";
}

html[lang="en"] .read-more-section[open] > .read-more-tab .read-more-text::after {
  content: "Show less ▲";
}

/* Change text based on state - Czech */
html[lang="cs"] .read-more-section:not([open]) > .read-more-tab .read-more-text::after {
  content: "Zobrazit více ▼";
}

html[lang="cs"] .read-more-section[open] > .read-more-tab .read-more-text::after {
  content: "Zobrazit méně ▲";
}

/* Hidden content */
.read-more-hidden {
  display: none;
  margin-top: 10px;
}

.read-more-section[open] .read-more-hidden {
  display: block;
}

/* Image Captions */
.image-caption {
  font-size: 14px;
  padding: 5px 10px;
  color: #1a1a1a;
  line-height: 1.4;
}

.image-caption a {
  color: #000;
  text-decoration: underline;
}

.image-caption a:visited {
  color: #000;
}

.image-caption a:hover {
  opacity: 0.7;
}

/* ==== PROJECT PAGE STYLES ==== */

/* Project Page Specific Overrides */
.project-page .filter-table-wrapper {
  display: none;
}

.project-page .projects-table tr {
  display: table-row !important;
}

/* Content cells - used on project detail pages for all content sections */
.content-cell {
  position: relative;
  display: table-cell !important;
  visibility: visible !important;
  background-color: #c8c8c8 !important;
  text-align: left;
  vertical-align: middle;
  padding: 4px 8px;
  border: 1px inset var(--retro-button-bg);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.content-cell:hover {
  background-color: #c8c8c8 !important;
}

.project-page .projects-table {
  background-color: #d0d0d0;
}

/* Related projects table - closer spacing */
.project-page .projects-table + .projects-table {
  margin-top: 20px;
}

/* Typography - Semantic Classes */

/* Reset h1 and h2 for semantic SEO markup on project pages */
.project-page h1.project-title,
.project-page h2.section-header {
  margin: 0;
  padding: 0;
  font-weight: normal;
  text-align: left;
}

.project-title {
  font-family: times_b16, serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
}

.project-metadata {
  font-family: times_b16, serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
}

.section-header {
  font-family: times_b16, serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
}

/* Add spacing after content when followed by spacer in markdown */
.content-cell.spacer-after {
  padding-bottom: 20px;
}

.body-text {
  font-family: times_regular, serif;
  font-size: 17px;
  line-height: 1.8;
  color: #1a1a1a;
}

.italic {
  font-family: times_regular, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.8;
  color: #1a1a1a;
}

.quote {
  font-family: times_regular, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.8;
  color: #1a1a1a;
  margin-left: 20px;
  margin-right: 20px;
  padding-left: 15px;
  position: relative;
}

.quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 0;
  border-left: 4px ridge var(--retro-button-bg);
}

/* Project Images - styles defined above in Hero Image section */

/* Related Projects */
.related-project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  text-decoration: none;
  color: #000;
}

.related-project .project-title::before {
  content: '▓ ';
}

.related-project:visited {
  color: #000;
}

.related-project:hover {
  background-color: transparent !important;
  color: #000 !important;
}

.related-project:hover .project-title,
.related-project:hover .project-year {
  background-color: transparent !important;
}

.related-project .project-title,
.related-project .project-year {
  background-color: transparent !important;
}

.related-project .project-title {
  font-size: 17px;
  line-height: 1.6;
  background-color: transparent !important;
}

.related-project .project-year {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  background-color: transparent !important;
}

/* Override any parent background on related project cells */
.content-cell:has(.related-project) {
  background-color: #c8c8c8 !important;
}

.content-cell:has(.related-project):hover {
  background-color: #c8c8c8 !important;
}

/* Gallery Modal */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.gallery-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  cursor: default;
}

.gallery-modal img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
  color: #000;
}

.gallery-nav:hover {
  background: rgba(255, 255, 255, 1);
}

.gallery-prev {
  left: 20px;
}

.gallery-next {
  right: 20px;
}

.gallery-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.gallery-close:hover {
  color: #ccc;
}

.gallery-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
}

/* Project Page Mobile Styles */
@media screen and (max-width: 768px) {
  .body-text {
    font-size: 22px;
  }
  
  .italic {
    font-size: 22px;
  }
  
  .quote {
    font-size: 22px;
    margin-left: 15px;
    margin-right: 10px;
    padding-left: 12px;
  }
  
  .project-metadata,
  .section-header {
    font-size: 20px;
  }
  
  .project-title {
    font-size: 20px;
  }
  
  .year-cell {
    font-size: 18px;
  }
  
  .project-meta {
    font-size: 16px;
  }
  
  .project-title-text {
    font-size: 18px;
  }
  
  .collapsible-section summary {
    font-size: 18px;
  }
  
  /* Mobile Gallery - Full width with touch support */
  .gallery-modal {
    padding: 0 !important;
  }
  
  .gallery-modal-content {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .gallery-modal img {
    width: 100% !important;
    height: auto !important;
    max-height: 100vh !important;
    object-fit: contain !important;
  }
  
  /* Hide navigation buttons on mobile - use swipe */
  .gallery-nav {
    display: none !important;
  }
  
  .gallery-close {
    font-size: 40px !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10000 !important;
  }
  
  .gallery-counter {
    font-size: 20px !important;
    bottom: 30px !important;
    padding: 8px 15px !important;
  }
  
  /* Better touch targets */
  .hero-image, .gallery-image {
    min-height: 44px !important;
  }
  
  /* Better iframe sizing for mobile */
  iframe {
    height: 150px !important;
  }
  
  /* Read More tab - larger on mobile */
  .read-more-tab {
    font-size: 16px;
    padding: 6px 18px 4px 18px;
  }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  .body-text {
    font-size: 20px;
  }
  
  .italic {
    font-size: 20px;
  }
  
  .quote {
    font-size: 20px;
    margin-left: 10px;
    margin-right: 5px;
    padding-left: 8px;
  }
  
  .project-metadata,
  .section-header {
    font-size: 18px;
  }
  
  .project-title {
    font-size: 18px;
  }
  
  .gallery-close {
    font-size: 35px !important;
    top: 15px !important;
    right: 15px !important;
  }
  
  .gallery-counter {
    font-size: 18px !important;
    bottom: 20px !important;
  }
}

/* ==== RAIN EFFECT ==== */

.rain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.raindrop {
  position: fixed;
  pointer-events: none;
  width: 2px;
  height: 20px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.7));
  animation: fall linear;
  will-change: transform;
}

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(15deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 20px)) rotate(15deg);
    opacity: 0;
  }
}
