/* Font declarations */
:root {
  /* --- Palette --- */
  --color-background: #232533;
  --color-surface: #2a2d3d; /* For cards, notes, etc. */
  --color-text-primary: #d6dbe7;
  --color-text-secondary: #bdc3d8;
  --color-border: #2e3142;
  --color-border-strong: #44475a;
  --color-code-background: #272822;

  /* --- Links --- */
  --color-link: #ffb86c;
  --color-link-hover: #ffd7a8;

  /* --- Accents --- */
  --color-accent-purple: #ae81ff;
  --color-accent-blue: #66d9ef;
  --color-accent-pink: #f92672;
  --color-accent-green: #a6e22e;

  /* --- Review Mode --- */
  --color-review-prefix-bg: #FFEB3B;
  --color-review-prefix-text: #333;
  --color-review-number-bg: #f44336;
  --color-review-border: #FF9800;

  /* --- Table Number Colors --- */
  --color-number-1: rgba(255, 204, 204, 0.5); /* Soft red */
  --color-number-2: rgba(255, 255, 204, 0.5); /* Soft yellow */
  --color-number-3: rgba(204, 255, 204, 0.5); /* Soft green */

  /* --- General --- */
  --color-white: #fff;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-shadow-hover: rgba(0, 0, 0, 0.15);
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Global styles */
* {
    box-sizing: border-box;
  }
  
  body {
    background: var(--color-background);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
  }
  
  h1, h2, h3 {
    margin-top: 0;
    font-weight: bold;
  }
  
  a {
    text-decoration: none;
    color: var(--color-link);
    transition: color 0.2s ease;
  }

  p > a {
  font-weight: 600;
  position: relative;
}

p > a[href^="http"]:not(.github-button),
a[href^="https"]:not(.github-button) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffb86c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2em center;
  background-size: 0.8em;
  padding-right: 1.1em;
}

.video-thumbnail-column a {
  background-image: none !important;
  padding-right: 0 !important;
}

p > a[href^="/"],
p > a[href^="./"],
p > a[href^="../"],
p > a[href^="#"] {
  padding-right: 0;
  background-image: none;
}

  a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
  }
  
  /* Header styles */
  .site-header {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
  }
  
  .header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .site-title {
    margin: 0;
  }
  
  .site-title a {
    color: var(--color-link);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
  }
  
  .site-subtitle {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-secondary);
    font-style: italic;
    font-weight: 400;
    line-height: 1.2;
  }
  
  .main-nav ul {
    display: flex;
    gap: 24px;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  
  .main-nav li {
    margin: 0;
    padding: 0;
  }
  
  .main-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    position: relative;
  }
  
  .main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--color-link);
    transition: width 0.3s ease;
  }
  
  .main-nav a:hover::after,
  .main-nav a.active::after {
    width: 100%;
  }
  
  .main-nav a.active {
    color: var(--color-link);
  }
  
  .site-header nav a:hover {
    color: var(--color-white);
  }
  
  /* Responsive navigation for mobile */
  @media (max-width: 768px) {
    .header-container {
      flex-direction: column;
      gap: 16px;
      text-align: center;
    }
    
    .site-branding {
      justify-content: center;
      gap: 10px;
    }
    
    .site-subtitle {
      font-size: 11px;
      text-align: left;
    }
    
    .main-nav ul {
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px 24px;
    }
  }
  
  /* Content styles */
  .site-content {
    max-width: 800px;
    margin: 48px auto 0 auto;
    padding: 0 20px;
  }

  /* --- Wide Content Layout for Blog Posts --- */
  .post-content {
    display: grid;
    grid-template-columns: 1fr minmax(auto, 65ch) 1fr;
    grid-column-gap: 1.5em;
  }

  /* Default for all direct children: place in the narrow center column */
  .post-content > * {
    grid-column: 2;
  }

  /* Class to make an element span the full width */
  .post-content > .is-wide {
    grid-column: 1 / -1; /* Span from the first to the last grid line */
    width: 100%;
    max-width: 100%;
  }

@media (max-width: 900px) {
  .post-content {
    display: block;
  }

  /* Default for DIRECT CHILDREN on mobile: constrained and centered */
  .post-content > *:not(.is-wide) {
    grid-column: 1;      /* All go into the single column */
    /* max-width: 65ch;     <<<< KEY CHANGE: Constrain their width */
    margin-left: auto;   /* Center them within the 1fr column */
    margin-right: auto;  /* Center them */
    /* Ensure box-sizing is consistent if you add padding/border here */
    box-sizing: border-box;
  }

  /* WIDE elements on mobile: still full width */
  .post-content > .is-wide {
    grid-column: 1;
    width: 100%;         /* Ensure it tries to fill the 1fr column */
    max-width: 100%;     /* Explicitly allow full width */
    box-sizing: border-box;
  }

  /* All IMAGES inside post-content remain responsive to their IMMEDIATE PARENT */
  /* This rule is generally good and can often stay as is. */
  .post-content img {
    max-width: 100%;
    height: auto; /* Already present, good */
    /* box-sizing: border-box; is good if images themselves have border/padding */
  }
}

.post-content > ul,
.post-content > ol {
  padding-top: 0;
  margin-top: 0;
  padding-left: 1em; /* Reduced from default 2.5em */
}

  .home-content.site-content {
    max-width: 600px;
  }

  .site-content h3{
    margin-bottom: 0.1em;
  }

  .article-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .article-list li {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
  }
  
  .article-list li:last-child {
    border-bottom: none;
  }
  
  .post-meta {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
  }
  
  .post-tags {
    display: inline-block;
    font-size: 12px;
    color: var(--color-accent-purple);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-right: 10px;
  }
  
  .post-public {
    display: inline-block;
    font-size: 12px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
  }
  
  .article-list a h2 {
    color: var(--color-white);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
    transition: color 0.2s;
  }
  
  .article-list a:hover h2 {
    color: var(--color-link);
  }
  
  .article-list a p {
    color: var(--color-text-secondary);
    font-size: 16px;
    margin: 0 0 0 0;
    line-height: 1.5;
  }

  .article-list p {
    margin-top: 0;
    margin-bottom: 0;
  }

  .post-content h2{
    margin-bottom: 0;
  }

  .post-content p{
    margin-top: 0;
  }
  
  /* Footer styles */
  .site-footer {
    background: var(--color-background);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    font-size: 0.95em;
  }

  /* Personal navigation styles */
  .personal-nav {
    margin-bottom: 5px;
    /* padding-bottom: 20px; */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .personal-nav h3 {
    color: var(--color-text-secondary);
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
  }

  .personal-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .personal-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
    background: var(--color-surface);
  }

  .personal-links a:hover {
    color: var(--color-link);
    border-color: var(--color-link);
    background: rgba(255, 184, 108, 0.1);
    text-decoration: none;
  }

  .personal-links a.active {
    color: var(--color-link);
    border-color: var(--color-link);
    background: rgba(255, 184, 108, 0.15);
  }

  /* Mobile styles for personal nav */
  @media (max-width: 768px) {
    .personal-nav {
      flex-direction: column;
      gap: 15px;
    }
    
    .personal-nav h3 {
      margin-bottom: 0;
    }
    
    .personal-links {
      gap: 15px;
    }
    
    .personal-links a {
      font-size: 0.85em;
      padding: 6px 12px;
    }
  }

  /* No Stress Policy page styles */
  .policy-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.4;
  }

  .policy-content h1 {
    text-align: center;
    margin-bottom: 1em;
    color: var(--color-accent-blue);
    font-size: 2.2em;
  }

  .policy-content h2 {
    color: var(--color-text-primary);
    font-size: 1.3em;
    margin: 1.2em 0 0.2em 0;
    font-weight: 700;
  }

  .policy-preamble {
    margin-bottom: 0.8em;
    text-indent: 2em;
    text-align: justify;
  }

  .policy-content ol {
    margin: 0.5em 0;
    padding-left: 2em;
  }

  .policy-content ol li {
    margin-bottom: 0.4em;
    text-align: justify;
  }

  .policy-signature {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid var(--color-border);
    text-align: center;
  }

  .signature-line {
    margin-top: 1em;
    font-style: italic;
    color: var(--color-text-secondary);
  }

  .policy-content strong {
    color: var(--color-accent-blue);
    font-weight: 700;
  }
  
  .site-footer p {
    margin: 10px 0;
    line-height: 1.6;
  }
  
  .site-footer .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
  }
  
  .site-footer a {
    color: var(--color-link);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 5px 10px;
    border-radius: 4px;
    position: relative;
  }
  
  .site-footer a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--color-link-hover);
    transition: all 0.3s ease;
    transform: translateX(-50%);
  }
  
  .site-footer a:hover:after {
    width: 100%;
  }
  
  .site-footer a:visited {
    color: var(--color-link);
  }
  
  .site-footer a:hover {
    color: var(--color-link-hover);
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.05);
  }

.site-title {
    text-align: center;
    color: var(--color-white);
    font-size: 1.8em;
}

/* Blog post content styles */
.site-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Screenshot styling for blog posts only */
.post-content img {
    box-shadow: var(--color-shadow);
    border: 1px solid var(--color-border-strong);
    border-radius: 6px;
    margin: 1.5em auto;
}

/* Exclude video thumbnails from screenshot styling */
.post-content .video-thumbnail-img {
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

/* Optional: Add a subtle hover effect for screenshots */
.post-content img:hover {
    box-shadow: var(--color-shadow-hover);
    transition: all 0.3s ease;
}

/* Exclude video thumbnails from hover effects */
.post-content .video-thumbnail-img:hover {
    box-shadow: none;
    transform: none;
}

/* Image block wrapper */
.image-block-wrapper {
    margin-top: 1em;
    margin-bottom: 2em;
}

.image-block-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    transition: opacity 0.2s ease;
}

.image-block-wrapper a {
    display: block;
    cursor: pointer;
}

.image-block-wrapper a:hover img {
    opacity: 0.9;
}

.image-caption,
.collage-caption,
.two-column-caption {
    color: var(--color-text-secondary);
    font-size: 0.9em;
    font-style: italic;
    margin-top: 0.8em;
}

/* Error page styles */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 2.5em;
    color: var(--color-link);
    margin-bottom: 20px;
}

.error-page p {
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

.error-page ul {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.error-page ul li {
    margin: 15px 0;
}

.error-page ul li a {
    font-size: 1.1em;
    padding: 10px 20px;
    border: 1px solid var(--color-link);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.error-page ul li a:hover {
    background: var(--color-link);
    color: var(--color-background);
    text-decoration: none;
}

/* Table styles */
.post-content > table {
    /* Break out of parent container and center */
    grid-column: 1 / -1;
    width: 100%;
    max-width: 760px;
    margin: 1rem auto;
    border: 1px solid var(--color-border-strong);
    border-radius: 4px;
    font-size: 0.85em;
    table-layout: fixed;
    word-wrap: break-word;
    overflow-x: hidden;
}

.site-content table {
    /* Break out of parent container and center */
    grid-column: 1 / -1;
    width: 100%;
    max-width: 760px;
    margin: 1rem auto;
    border-collapse: collapse;
    border: 1px solid var(--color-border-strong);
    font-size: 0.85em;
    table-layout: fixed;
    word-wrap: break-word;
}

.site-content table th,
.site-content table td {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--color-border-strong);
    text-align: center;
    line-height: 1.5;
}

/* Center all columns except the first one */
.site-content table th:not(:first-child),
.site-content table td:not(:first-child) {
    border-left: 1px solid var(--color-border-strong);
    width: auto;
}

/* First column styling */
.site-content table th:first-child,
.site-content table td:first-child {
    width: 20%;
    text-align: left;
    padding-left: 0.5rem;
    white-space: normal;
}

/* Other columns */
.site-content table th:not(:first-child),
.site-content table td:not(:first-child) {
    width: 7%;
    min-width: 40px;
    text-align: center;
    padding: 0.25rem 0.1rem;
}

/* Responsive adjustments */
@media screen and (max-width: 800px) {
  .two-column-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
  }
    .post-content > table,
    .site-content table {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
        margin: 1rem 0;
        font-size: 0.8em;
    }
    
    .site-content table th:first-child,
    .site-content table td:first-child {
        width: 25%;
        padding-left: 1rem;
    }
    
    .site-content table th:not(:first-child),
    .site-content table td:not(:first-child) {
        width: 8%;
        min-width: 30px;
    }
}

/* Style for cells containing numbers */
.site-content table td:not(:first-child)[data-number="1"] {
    background-color: var(--color-number-1);
}

.site-content table td:not(:first-child)[data-number="2"] {
    background-color: var(--color-number-2);
}

.site-content table td:not(:first-child)[data-number="3"] {
    background-color: var(--color-number-3);
}

/* Smooth transition for color changes */
.site-content table td:not(:first-child) {
    transition: background-color 0.3s ease;
}

.site-content table th {
    background: var(--color-border);
    color: var(--color-text-primary);
    font-weight: 600;
}

.site-content table tr:nth-child(even) {
    background: var(--color-surface);
}

.site-content table tr:hover {
    background: var(--color-border);
}

/* Ensure tables in wide containers don't get too wide */
table {
    max-width: 100%;
    table-layout: auto;
    width: 100%;
}

/* Responsive table container */
.table-container {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 1.5em 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.research-section {
  margin-bottom: 2em;
}

.publication-list, .presentation-list {
  list-style: none;
  padding: 0;
}

.publication-list li, .presentation-list li {
  margin-bottom: 1.5em;
}

.authors {
  margin-bottom: 0.5em;
}

.publication-details, .presentation-details {
  color: var(--color-text-primary);
}

/* GitHub Button Styles */
.github-button {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background-color: #1a73e8;  /* Brighter blue for better visibility */
  color: white !important;  /* Force white text */
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1em;
  margin: 10px 0;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-button:hover {
  background-color: #1557b0;  /* Slightly darker blue on hover */
  color: white !important;  /* Ensure text stays white on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.github-button i {
  font-size: 1.3em;
  color: white;
}

.github-button-wrapper {
  text-align: center;
  margin: 20px 0;
}

/* Note box styles */
.note-box {
    background: var(--color-surface);
    border-left: 4px solid var(--color-link);
    margin: 1.5em 0;
    padding: 1em;
    border-radius: 4px;
}

.note-header {
    color: var(--color-link);
    font-weight: 600;
    margin-bottom: 0.5em;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-content {
    color: var(--color-text-primary);
}

.note-content p:last-child {
    margin-bottom: 0;
}

/* Toolbox styles */
.toolbox {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.toolbox .intro {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
}

.tool-category {
    margin-bottom: 2rem;
}

.tool-category h2 {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--color-border-strong);
}

.tool-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
}

.tool-card h3 a {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 600;
}

.tool-card h3 a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.tool-card p {
    margin: 0 0 1rem 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.tool-link {
    display: inline-block;
    color: var(--color-link);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tool-link:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Inline code style */
:not(pre) > code {
  background: var(--color-surface);
  color: var(--color-accent-blue);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--color-border-strong);
  font-size: 0.9em;
  font-family: 'IBM Plex Mono', monospace, monospace;
  /* white-space: nowrap; */
}

/* Info note style */
.note-info {
    border-left-color: var(--color-accent-blue);
}

.note-info .note-header {
    color: var(--color-accent-blue);
}

/* Warning note style */
.note-warning {
    border-left-color: var(--color-accent-pink);
}

.note-warning .note-header {
    color: var(--color-accent-pink);
}

/* Tip note style */
.note-tip {
    border-left-color: var(--color-accent-green);
}

.note-tip .note-header {
    color: var(--color-accent-green);
}

/* Video note style */
.note-video {
    border-left-color: var(--color-accent-purple);
}

.note-video .note-header {
    color: var(--color-accent-purple);
}

/* Review note style */
.note-review {
    border-left-color: var(--color-review-border);
    background: var(--color-surface);
    border: 2px solid var(--color-review-border);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.note-review .note-header {
    color: var(--color-review-border);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.note-review .note-content {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* Video note content layout */
.video-note-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.video-thumbnail {
    flex-shrink: 0;
    width: 200px;
    position: relative;
}

.video-thumbnail-column {
    flex: 0 0 33.333%; /* Take up 1/3 of the row */
    max-width: 200px; /* Cap the maximum width */
    flex-shrink: 0;
    position: relative;
}

.video-text-column {
    flex: 1; /* Take up the remaining 2/3 of the row */
    min-width: 0;
}

.video-thumbnail-link {
    display: block;
    text-decoration: none;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.video-thumbnail-link:hover {
    transform: scale(1.02);
}

.video-thumbnail-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-thumbnail-link:hover .video-play-overlay {
    opacity: 1;
}

.video-play-icon {
    color: var(--color-white);
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1.2;
}

.video-title a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.video-title a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.video-description {
    color: var(--color-text-primary);
    line-height: 1.5;
    margin: 0;
}

/* Responsive design for video notes */
@media (max-width: 768px) {
    .video-note-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .video-thumbnail-column {
        flex: none;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .video-thumbnail-img {
        height: 180px;
    }
}

.post-overview {
  background: var(--color-surface);
  padding: 1em;
  margin: 1.5em 0;
  border-radius: 4px;
  border-left: 4px solid var(--color-link);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1em;
  margin: 1.5em 0;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.gallery-item img:hover {
  transform: scale(1.02);
}

.post-gallery h3 {
  margin: 1.5em 0 1em 0;
  color: var(--color-link);
}

.travel-year {
  margin-top: 2em;
  margin-bottom: 2em;
}

.travel-year h2 {
  margin-bottom: 0;
  font-size: xx-large;
}

.travel-year h3 {
  color: var(--color-link);
  margin-bottom: 1em;
  font-size: 1.5em;
}

.travel-year ul li{
  margin-bottom: 1em;
}

.travel-year:last-child {
  margin-bottom: 0;
}

/* Image Collage Styles */
.image-collage-wrapper {
    margin: 2em 0;
}

.image-collage {
    display: grid;
    gap: 8px;
    margin-bottom: 0.5em;
}

/* 1 image */
.image-collage:has(.collage-image:nth-child(1):last-child) {
    grid-template-columns: 1fr;
}

/* 2 images */
.image-collage:has(.collage-image:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 images */
.image-collage:has(.collage-image:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

/* 4 images */
.image-collage:has(.collage-image:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

.collage-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
}

.collage-image a {
    display: flex;
    width: 100%;
}

.collage-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0;
}

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

.collage-caption {
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: 0.9em;
    margin-top: 0.8em;
}

/* Heading Anchor Styles */
.heading-anchor {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.heading-anchor:hover {
    text-decoration: none;
}

.heading-anchor::before {
    content: '#';
    position: absolute;
    left: -1em;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--color-text-secondary);
}

h2:hover .heading-anchor::before,
h3:hover .heading-anchor::before {
    opacity: 1;
}

/* Print styles */
@page {
    size: auto;
    margin: 1.5cm;
}

@media print {
    /* Reset default print margins */
    @page :first {
        margin-top: 1.5cm;
    }
    
    /* Firefox-specific print fixes */
    @-moz-document url-prefix() {
        html, body {
            width: 100% !important;
            height: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
        }
        
        .image-wrapper,
        .collage-wrapper,
        figure {
            page-break-before: avoid !important;
            page-break-after: avoid !important;
            page-break-inside: avoid !important;
            break-inside: avoid !important;
        }
        
        img {
            max-height: 90vh !important;
            max-width: 100% !important;
            height: auto !important;
            width: auto !important;
        }
    }
    
    /* Prevent images and their containers from breaking across pages */
    .image-wrapper,
    .image-caption,
    .collage-wrapper,
    .collage-caption,
    .collage-grid,
    .collage-item,
    figure,
    .image-container {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
        page-break-before: auto !important;
        break-before: auto !important;
        display: block !important;
        position: relative;
        margin: 0.5cm 0 !important;
        padding: 0 !important;
    }

    /* Ensure images don't overflow page width and maintain aspect ratio */
    .image-wrapper img,
    .collage-wrapper img,
    .collage-grid img,
    figure img {
        max-width: 100% !important;
        max-height: 90vh !important;
        width: auto !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        break-before: avoid !important;
        break-after: avoid !important;
    }

    /* Adjust margins and padding for better print layout */
    .image-wrapper,
    .collage-wrapper,
    .collage-grid,
    figure {
        margin: 1cm auto !important;
        padding: 0 !important;
        display: block !important;
        page-break-inside: avoid !important;
    }

    /* Ensure captions stay with their images */
    .image-caption,
    .collage-caption,
    figcaption {
        margin: 0.5cm 0 1cm 0 !important;
        text-align: center !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }

    /* Force each image section to be treated as a block */
    .image-wrapper,
    .collage-wrapper,
    figure {
        display: block !important;
        clear: both !important;
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
    }
    
    /* Force Firefox to respect page breaks for large elements */
    @-moz-document url-prefix() {
        .image-wrapper,
        .collage-wrapper,
        figure {
            display: block !important;
            position: relative;
            overflow: hidden;
        }
        
        /* Add extra space before elements that should start on a new page */
        .image-wrapper:not(:first-child),
        .collage-wrapper:not(:first-child),
        figure:not(:first-child) {
            margin-top: 1.5cm !important;
            page-break-before: always !important;
        }
    }
}

/* Year divider in travel index */
.year-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
    opacity: 0.5;
}

.two-column-wrapper {
  /* Break out of parent container and center */
  grid-column: 1 / -1;
  width: 100%;
  max-width: 760px;
  margin: 1rem auto 2rem auto;
  /* border: 1px solid #eee; /* Optional: for visual separation */
  /* padding: 15px; /* Optional: for visual separation */
}

.two-column-columns { /* This is now the flex container */
  display: flex;
  gap: 20px; /* Adjust spacing between columns */
}

.two-column-left {
  flex: 1; /* Each column takes equal space */
  /* Or use percentages e.g., flex-basis: 48%; */
}

.two-column-right {
  flex: 1;
  /* Or use percentages e.g., flex-basis: 48%; */
}

/* Travel Pages */
.travel-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 20px;
}

/* Wider container for travel post content */
.travel-post .post-content {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: block;
  grid-template-columns: 1fr;
}

/* Override the default grid layout for travel posts */
.travel-post .post-content > * {
  grid-column: 1;
  max-width: 100%;
  width: 100%;
}

/* Make images in travel posts use full width */
.travel-post .post-content img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

/* Ensure the collage uses full width */
.travel-post .image-collage {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}

.travel-year-row {
  display: flex;
  margin-bottom: 1rem;
}

.year-column {
  flex: 0 0 100px;
  padding-right: 2rem;
  text-align: right;
}

.year-heading {
  color: #666;
  font-size: 1.5rem;
  font-weight: 300;
  margin: 0;
}

.trips-column {
  flex: 1;
}

.trip-item {
  margin-bottom: 1.5rem;
  list-style: none;
}

.trip-title {
  margin: 0.1rem 0 0.3rem 0;
  font-size: 1.25rem;
}

.trip-link {
  text-decoration: none;
  color: inherit;
}

.trip-link:hover .trip-title {
  color: var(--color-link);
  text-decoration: underline;
}

.trip-overview {
  margin: 0.5rem 0 0;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.year-divider {
  border: 0;
  height: 1px;
  background-color: var(--color-border);
  margin: 1rem 0 1rem 100px;
}

@media (max-width: 768px) {
  .travel-year-row {
    flex-direction: column;
  }
  
  .year-column {
    text-align: left;
    padding: 0 0 1rem 0;
    flex: 0 0 auto;
  }
  
  .year-divider {
    margin-left: 0;
  }
}

li.trip-item {
  margin-bottom: 0;
  padding-bottom: 8px;
}

.two-column-caption {
  margin-top: 0.8em;
  color: var(--color-text-secondary);
  font-size: 0.9em;
  font-style: italic;
}

/* Optional: For responsive behavior on smaller screens */
@media (max-width: 768px) {
  .two-column-columns {
      flex-direction: column; /* Stack columns vertically */
      gap: 15px; /* Adjust gap for stacked layout */
  }
  .two-column-left,
  .two-column-right {
      flex-basis: auto; /* Reset flex-basis for stacked layout */
  }
}

.two-column-wrapper .image-block-wrapper {
  margin: 0;
}

.two-column-wrapper pre {
  margin: 0;
}

/* Table of Contents */
.table-of-contents {
    background-color: var(--color-surface);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5em;
    margin-bottom: 1.5em;
    border: 1px solid var(--color-border);
    max-width: fit-content;
    min-width: 200px;
}

@media (max-width: 900px) {
    .post-content >.table-of-contents {
        margin-left: unset;
    }
}

.table-of-contents h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 0;
    font-size: 0.95rem;
}

.toc-list a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
    padding: 0.2rem 0;
}

.toc-list a:hover {
    color: var(--color-link);
}

.toc-list ul {
    list-style: none;
    padding-left: 1.2rem;
    margin: 0.3rem 0;
    border-left: 1px solid var(--color-border);
}

.toc-list ul li {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Inline review highlighting */
/* .review-highlight {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    border: 1px solid #f57f17;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.review-highlight:hover {
    background-color: #fff176;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
} */

.review-prefix {
  background-color: var(--color-review-prefix-bg); /* Bright yellow */

  padding: 0.1em 0.4em; /* Small padding */
  border-radius: 4px;
  font-weight: bold;
  color: var(--color-review-prefix-text); /* Dark text for readability on yellow */
  margin-right: 0.5em; /* Space between prefix and content */
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.review-number {
  background-color: var(--color-review-number-bg); /* Red background */
  color: var(--color-white);
  border-radius: 50%; /* Make it circular */
  width: 1.2em;
  height: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
  line-height: 1;
  min-width: 1.2em;
}

.review-text {
  font-weight: bold;
}

/* Styling for the sentence/content being reviewed */
.review-content {
  /* Remove background color and other styling */
  color: inherit; /* Use the same color as surrounding text */
}

/* Overall container for a review item (prefix + content) */
.review-item {
    line-height: 1.6;
    border-radius: 4px;
    display: inline;
    border-bottom: 2px solid var(--color-review-border);
}

/* --- Blockquote Styling --- */
.post-body > blockquote {
    position: relative;
    padding-left: 2.5em;
    margin: 2em 0;
    font-size: 1.1em;
    font-style: italic;
    color: var(--color-text-secondary);
    border: none;
}

.post-body > blockquote::before {
    content: "“";
    position: absolute;
    left: 0;
    top: -0.1em;
    font-size: 4em;
    line-height: 1;
    color: var(--color-border-strong);
    z-index: 1;
}

.post-body > blockquote p {
    margin: 0;
}

/* Research Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.button {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background-color: var(--color-link);
  color: var(--color-background);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

/* Toolbox Page Styles - Dictionary Format */
.toolbox h1 {
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.toolbox > p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    max-width: 70ch;
    line-height: 1.4;
}

.tool-category {
    margin-bottom: 1.25rem;
}

.tool-category h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.25rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

.category-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 0;
    margin-bottom: 0.75rem;
    max-width: 80ch;
    line-height: 1.3;
    font-style: italic;
}

.tools-list {
    margin-left: 0;
}

.tool-item {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.tool-name {
    font-size: 1rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.tool-name a {
    color: var(--color-link);
    text-decoration: none;
}

.tool-name a:hover {
    text-decoration: underline;
    color: var(--color-link-hover);
}

.tool-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* Print styles for toolbox */
@media print {
    .toolbox {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .toolbox h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .toolbox > p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }
    
    .table-of-contents {
        margin-bottom: 1rem;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .tool-category {
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    .tool-category h3 {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
        padding-bottom: 0.15rem;
    }
    
    .category-description {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .tool-item {
        margin-bottom: 0.3rem;
        page-break-inside: avoid;
        line-height: 1.3;
    }
    
    .tool-name {
        font-size: 0.95rem;
        margin-right: 0.4rem;
    }
    
    .tool-description {
        font-size: 0.85rem;
    }
    
    /* Hide interactive elements in print */
    .heading-anchor::before {
        display: none !important;
    }
}

.button:hover {
  background-color: var(--color-link-hover);
  color: var(--color-background);
  text-decoration: none;
}

/* Restaurant Directory Styles - Compact Phone Book Style with Sidebar */
.restaurants-directory {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 2em;
}

/* Sidebar Styles */
.sidebar {
  flex: 0 0 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5em;
  max-height: calc(100vh - 4em);
  overflow-y: auto;
  position: sticky;
  top: 2em;
}

.sidebar h3 {
  color: var(--color-text-primary);
  font-size: 1.1em;
  margin: 0 0 0.5em 0;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.reviewer-filters {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.reviewer-filter {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.3em 0.5em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  gap: 0.6em;
}

.reviewer-filter:hover {
  background: var(--color-background);
  border-color: var(--color-border);
}

.reviewer-filter.active {
  background: var(--color-link);
  color: var(--color-background);
  border-color: var(--color-link);
}

.photo-container {
  position: relative;
  display: inline-block;
}

.filter-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.reviewer-filter.active .filter-photo {
  border-color: var(--color-background);
}



.filter-icon {
  font-size: 1.5em;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-border);
}

.reviewer-name {
  font-size: 0.9em;
  font-weight: 500;
  color: var(--color-text);
}

.reviewer-filter.active .reviewer-name {
  color: var(--color-background);
}

.emoji-legend {
  margin: 1em 0;
  padding: 0.8em;
  background: var(--color-surface);
  border-radius: 6px;
  border: 1px solid var(--color-border);
  font-size: 0.85em;
  color: var(--color-text-secondary);
}

.emoji-legend div {
  margin-bottom: 0.3em;
}

.emoji-legend div:last-child {
  margin-bottom: 0;
}

/* Type Filters */
.sidebar h3:nth-of-type(2) {
  margin-top: 2em;
}

.type-filters {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.taxonomy-header {
  color: var(--color-text-secondary);
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 1.2em 0 0.5em 0;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--color-border);
}

.taxonomy-header:first-of-type {
  margin-top: 0.8em;
}

.type-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4em 0.6em;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.8em;
  font-weight: 500;
  text-transform: capitalize;
  margin-left: 0.5em;
}

.type-filter:first-of-type {
  margin-left: 0;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  padding: 0.6em 0.8em;
  justify-content: center;
  margin-bottom: 0.5em;
}

.type-filter:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.type-filter.active {
  background: var(--color-accent-blue);
  color: var(--color-background);
  border-color: var(--color-accent-blue);
}

.type-filter:first-of-type.active {
  background: var(--color-accent-blue);
  color: var(--color-background);
  border-color: var(--color-accent-blue);
}

.filter-count {
  background: var(--color-border);
  color: var(--color-text-primary);
  padding: 0.1em 0.4em;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 0.5em;
  min-width: 1.5em;
  text-align: center;
  display: inline-block;
  flex-shrink: 0;
}

/* Sort Controls */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1.5em;
  padding: 1em 0 0.5em 0;
}

.sort-controls label {
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 0.5em;
}

.sort-btn {
  padding: 0.4em 0.8em;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85em;
  font-weight: 500;
}

.sort-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-accent-blue);
}

.sort-btn.active {
  background: var(--color-accent-blue);
  color: var(--color-background);
  border-color: var(--color-accent-blue);
}

.sort-arrow {
  margin-left: 0.3em;
  font-size: 0.9em;
  opacity: 0.8;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  gap: 0.5em;
  margin-bottom: 0.5em;
  justify-content: flex-start;
}

.action-btn {
  padding: 0.4em 0.8em;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85em;
  font-weight: 500;
}

.action-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-accent-blue);
}

.reset-btn:hover {
  border-color: var(--color-accent-orange, #f97316);
}

.share-btn:hover {
  border-color: var(--color-accent-blue);
}

/* Restaurant Links */
.restaurant-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.restaurant-link:hover .restaurant-entry {
  background-color: var(--color-surface);
}

.restaurant-entry {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Restaurant Detail Page */
.restaurant-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5em 1em;
}

.breadcrumb {
  margin-bottom: 1.2em;
}

.breadcrumb a {
  color: var(--color-link);
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--color-text-primary);
}

.restaurant-header {
  text-align: center;
  margin-bottom: 3em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--color-border);
}

.restaurant-header h1 {
  margin: 0 0 1em 0;
  color: var(--color-text-primary);
  font-size: 2.5em;
}

.restaurant-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5em;
}

.restaurant-tags .tag {
  background: var(--color-accent-blue);
  color: var(--color-background);
  padding: 0.4em 0.8em;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  text-transform: capitalize;
}

.reviews-section h2 {
  color: var(--color-text-primary);
  margin-bottom: 1em;
  text-align: left;
  font-size: 1.3em;
}

.review {
  margin-bottom: 3em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--color-border);
}

.review:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.review-header {
  margin-bottom: 1.5em;
}

.reviewer-profile {
  display: flex;
  align-items: center;
  gap: 1em;
}

.reviewer-profile .photo-container {
  position: relative;
}

.reviewer-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
}

.reviewer-info h3 {
  margin: 0 0 0.5em 0;
  color: var(--color-text-primary);
  font-size: 1.3em;
}

.reviewer-info .reviewer-bio {
  margin: 0;
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: 1.4;
}

.review-content {
  margin-left: calc(80px + 1em);
}

.review-content blockquote {
  margin: 0;
  padding: 1.5em;
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent-blue);
  border-radius: 0 8px 8px 0;
  font-size: 1.1em;
  line-height: 1.6;
  color: var(--color-text-primary);
}

.review-content blockquote:before {
  content: none;
}

.review-content blockquote:after {
  content: none;
}

/* Compact Restaurant Detail Layout */
.restaurant-header-compact {
  text-align: left;
  margin-bottom: 2em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--color-border);
}

.restaurant-header-compact h1 {
  margin: 0 0 0.5em 0;
  color: var(--color-text-primary);
  font-size: 2.2em;
  line-height: 1.2;
}

.restaurant-address {
  color: var(--color-text-secondary);
  font-size: 1.1em;
  margin-bottom: 0.8em;
  font-style: italic;
}

.restaurant-header-compact .restaurant-tags {
  justify-content: flex-start;
  margin-top: 0.8em;
}

/* Card Layout Reviews */
.reviews-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-top: 1em;
}

.review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.8em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0.6em;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.review-horizontal-layout {
  display: flex;
  gap: 0.8em;
  align-items: flex-start;
}

.review-content-wrapper {
  flex: 1;
  min-width: 0;
}

.review-header-row {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.reviewer-name-card {
  font-weight: 600;
  font-size: 0.95em;
}

.reviewer-indicators-card {
  display: flex;
  gap: 0.3em;
}

.review-date {
  font-size: 0.85em;
  color: var(--color-text-secondary);
  margin-left: auto;
}

.review-text-card {
  color: var(--color-text-primary);
  line-height: 1.6;
  font-size: 1em;
  margin: 0;
}




.reviewer-photo-card {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}




.review-card-images {
  display: flex;
  gap: 0.6em;
  flex-wrap: wrap;
  margin-top: 0.8em;
  padding-top: 0.8em;
  border-top: 1px solid var(--color-border-light);
}

.review-image-link {
  display: inline-block;
  text-decoration: none;
  border: none;
  outline: none;
}

.review-card-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

.review-image-link:hover .review-card-image {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .restaurant-detail {
    padding: 1em 0.5em;
  }
  
  .restaurant-header h1 {
    font-size: 2em;
  }
  
  .reviewer-profile {
    flex-direction: column;
    text-align: center;
    gap: 1em;
  }
  
  .review-content {
    margin-left: 0;
    margin-top: 1em;
  }
  
  .reviewer-photo {
    width: 100px;
    height: 100px;
  }
  
  /* Card layout mobile styles */
  .restaurant-header-compact h1 {
    font-size: 1.8em;
  }
  
  .reviews-grid {
    gap: 0.6em;
  }
  
  .review-card {
    padding: 0.6em;
  }
  
  .reviewer-photo-card {
    width: 42px;
    height: 42px;
  }
  
  .review-horizontal-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6em;
  }
  
  .review-header-row {
    flex-wrap: wrap;
    gap: 0.5em;
  }
  
  .review-date {
    margin-left: 0;
  }
  
  .review-card-image {
    max-height: 150px;
  }
}

.type-filter.active .filter-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-background);
}

/* Main Content */
.main-content {
  flex: 1;
  min-width: 0;
}

.main-content h1 {
  text-align: left;
  color: var(--color-text-primary);
  font-size: 2.2em;
  margin-bottom: 0.3em;
}

.directory-intro {
  text-align: left;
  color: var(--color-text-secondary);
  font-size: 1em;
  margin-bottom: 2em;
}

.restaurant-listing {
  border-top: 1px solid var(--color-border);
}

.restaurant-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8em 0;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

.restaurant-entry:hover {
  background-color: var(--color-surface);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.restaurant-info {
  flex: 1;
  min-width: 0;
}

.restaurant-header-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.3em;
}

.restaurant-name {
  color: var(--color-text-primary);
  font-size: 1.1em;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.photo-indicator-inline {
  display: flex;
  align-items: center;
  gap: 0.2em;
  color: var(--color-text-secondary);
  font-size: 0.8em;
  flex-shrink: 0;
}

.photo-icon {
  width: 0.9em;
  height: 0.9em;
  fill: currentColor;
}

.restaurant-tags-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}


.tag-compact {
  background: var(--color-border);
  color: var(--color-text-secondary);
  padding: 0.15em 0.5em;
  border-radius: 10px;
  font-size: 0.7em;
  font-weight: 500;
  text-transform: lowercase;
  transition: all 0.2s ease;
}

.tag-compact.highlighted {
  background: var(--color-accent-blue);
  color: var(--color-background);
  transform: scale(1.05);
}

.recommenders {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
  margin-left: 1em;
  flex-shrink: 0;
  justify-content: flex-start;
}

.recommender-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.recommender-photo:hover {
  border-color: var(--color-link);
  transform: scale(1.1);
}

.recommender-photo.highlighted {
  border-color: var(--color-link);
  box-shadow: 0 0 0 2px rgba(255, 184, 108, 0.3);
  transform: scale(1.05);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .restaurants-directory {
    flex-direction: column;
    padding: 0 15px;
    gap: 1.5em;
  }
  
  .sidebar {
    flex: none;
    position: static;
    order: 2;
    padding: 1em;
    max-height: none;
    overflow-y: visible;
  }
  
  .sidebar h3 {
    font-size: 1em;
    margin-bottom: 0.8em;
  }
  
  .reviewer-filters {
    gap: 0.2em;
  }
  
  .reviewer-filter {
    padding: 0.2em 0.4em;
    justify-content: flex-start;
    gap: 0.5em;
  }
  
  .filter-photo {
    width: 35px;
    height: 35px;
  }
  
  .filter-icon {
    width: 35px;
    height: 35px;
    font-size: 1.2em;
  }
  
  .sidebar h3:nth-of-type(2) {
    margin-top: 1.5em;
  }
  
  .type-filters {
    gap: 0.2em;
  }
  
  .taxonomy-header {
    font-size: 0.8em;
    margin: 1em 0 0.4em 0;
  }
  
  .type-filter {
    padding: 0.35em 0.5em;
    font-size: 0.75em;
    margin-left: 0.3em;
  }
  
  .type-filter:first-of-type {
    padding: 0.5em 0.6em;
    font-size: 0.8em;
    margin-bottom: 0.4em;
  }
  
  .filter-count {
    font-size: 0.65em;
    padding: 0.08em 0.3em;
    margin-right: 0.4em;
    min-width: 1.2em;
  }
  
  .main-content h1 {
    font-size: 1.8em;
  }
  
  .restaurant-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
    padding: 1em 0;
  }
  
  .restaurant-entry:hover {
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .restaurant-info {
    width: 100%;
  }
  
  .recommenders {
    margin-left: 0;
    justify-content: flex-start;
    gap: 0.1em;
  }
  
  .recommender-photo {
    width: 24px;
    height: 24px;
  }
}