/* Book-themed dark mode for Notable and Projects pages */
:root {
  /* Book-themed dark mode (matches timeline) */
  --bg-book-dark: #2a2419;
  --panel-book-dark: #342d23;
  --text-book-dark: #e8dcc4;
  --muted-book-dark: #a89a84;
  --accent-book-dark: #d4956f;
  --border-book-dark: #4a3f32;
  --card-bg-book-dark: #3a3228;
}

/* Override dark theme for Notable and Projects pages to use book theme */
body[data-theme="dark"] {
  --bg: var(--bg-book-dark);
  --text: var(--text-book-dark);
  --muted: var(--muted-book-dark);
  --accent: var(--accent-book-dark);
  --border: var(--border-book-dark);
  --card-bg: var(--card-bg-book-dark);
}

/* Notable page specific styles */
.notable-main {
  max-width: 800px;
  width: 100%;
  padding: 0 1rem;
}

.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumb-separator {
  margin: 0 0.5rem;
  color: var(--muted);
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

.notable-header {
  text-align: center;
  margin-bottom: 3rem;
}

.notable-header h1 {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.notable-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.notable-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.notable-section {
  width: 100%;
  margin-bottom: 2rem;
}

/* Base section title styles (applies to all pages) */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Collapsible section title styles (only for notable page with collapsible structure) */
.section-title:has(.section-title-text) {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  background: var(--card-bg);
  margin: 0;
  padding-bottom: 1rem;
  border-bottom: none;
}

.section-title:has(.section-title-text):hover {
  background: var(--card-bg);
  border-color: var(--accent);
}

.section-title-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title-toggle {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  color: var(--muted);
}

.notable-section.collapsed .section-title-toggle {
  transform: rotate(-90deg);
}

.section-title-count {
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 2rem;
  text-align: center;
}

.section-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
  grid-auto-rows: 1fr;
  margin-top: 1rem;
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  opacity: 1;
}

.notable-section.collapsed .section-content {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
}


.notable-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  /* Space between content and button, stretches to fill grid cell */
  justify-content: space-between;
  /* Removed align-self: start to allow stretching to equal height */
  height: 100%;
}

/* Grid layout for tiles - now defined above */

/* Responsive grid - 3 columns on desktop, 2 on tablet, 1 on mobile */
@media (min-width: 1200px) {
  .section-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1199px) and (min-width: 768px) {
  .section-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .section-content {
    grid-template-columns: 1fr;
  }
}

.notable-item:hover {
  background: var(--card-bg);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Light theme specific hover effect */
body.light-theme .notable-item:hover {
  box-shadow: 0 4px 16px rgba(62, 39, 35, 0.1);
}

.item-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.item-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-content {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.item-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.item-author,
.item-category {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}

.item-description {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem 0;
  line-height: 1.4;
  flex-grow: 1;
}

.item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.item-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  color: var(--accent);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.item-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Light theme specific link hover */
body.light-theme .item-link:hover {
  box-shadow: 0 2px 8px rgba(62, 39, 35, 0.1);
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  display: inline-block;
  margin-bottom: 1rem;
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
  .notable-main {
    padding: 0 0.5rem;
  }

  .notable-header h1 {
    font-size: 2rem;
  }

  .notable-subtitle {
    font-size: 1rem;
  }

  .notable-item {
    padding: 1.2rem;
  }

  .item-logo {
    width: 48px;
    height: 48px;
  }

  .item-link {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .notable-header h1 {
    font-size: 1.8rem;
  }

  .notable-subtitle {
    font-size: 0.95rem;
  }

  .notable-item {
    padding: 1rem;
  }

  .item-logo {
    width: 40px;
    height: 40px;
  }

  .item-title {
    font-size: 1.1rem;
  }

  .item-description {
    font-size: 0.9rem;
  }
}