/* ============================================
   Custom styles for Shrikrishna Bhat K website
   Litera / Darkly theme — Academic palette
   ============================================ */

/* --- Color variables (refined amber + muted teal accent) --- */
:root {
  --primary: #9C6B1F;
  --primary-light: #FFF9F2;
  --primary-dark: #6b470e;
  --accent: #C08A1A;
  --teal: #2F6F73;
  --text-heading: #2B1F14;
  --text-muted: #7a6a5a;
  --border-color: #E6DDD0;
  --card-bg: #ffffff;
  --card-shadow: rgba(100, 70, 30, 0.08);
}

/* --- Dark mode variable overrides --- */
[data-bs-theme="dark"] {
  --primary: #D4A54A;
  --primary-light: #262015;
  --primary-dark: #C08A1A;
  --accent: #E0B75A;
  --teal: #6DB7BD;
  --text-heading: #F1E7DA;
  --text-muted: #a89880;
  --border-color: #3B2F22;
  --card-bg: #262015;
  --card-shadow: rgba(0, 0, 0, 0.3);
}

/* --- Profile image styling --- */
.profile-img {
  border-radius: 50%;
  width: 160px;
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  border: 3px solid var(--border-color);
}

[data-bs-theme="dark"] .profile-img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* --- Card grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}

/* --- Card styling --- */
.card {
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  box-shadow: 0 6px 20px var(--card-shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  color: var(--teal);
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* --- Callout enhancements --- */
.callout {
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* --- Timeline styling --- */
.timeline {
  border-left: 3px solid var(--primary);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #fff;
}

.timeline-item h3 {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--text-heading);
}

[data-bs-theme="dark"] .timeline-item::before {
  border-color: #1C1710;
}

/* --- Contact table --- */
.contact-table table {
  width: 100%;
  border-collapse: collapse;
}

.contact-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.contact-table td:first-child {
  font-weight: 600;
  width: 140px;
  color: var(--teal);
}

[data-bs-theme="dark"] .contact-table td {
  border-bottom-color: #3B2F22;
}

/* --- Section dividers --- */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* --- Accordion-like details styling --- */
details {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: #fafbfc;
  transition: background 0.2s;
}

details[open] {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
  padding: 0.25rem 0;
}

details summary:hover {
  color: var(--accent);
}

[data-bs-theme="dark"] details {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] details[open] {
  background: #302618;
}

[data-bs-theme="dark"] details summary {
  color: var(--teal);
}

/* --- Badge styling --- */
.badge {
  display: inline-block;
  padding: 0.25em 0.65em;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .card-grid-2 {
    grid-template-columns: 1fr;
  }
  .profile-img {
    float: none;
    display: block;
    margin: 0 auto 1rem;
  }
}

/* --- Smooth scrolling --- */
html {
  scroll-behavior: smooth;
}

/* --- Research output table --- */
.research-output table {
  width: 100%;
}

.research-output td:last-child {
  text-align: center;
  font-weight: 700;
  color: var(--primary);
}

[data-bs-theme="dark"] .research-output td:last-child {
  color: var(--accent);
}

/* --- Auto-generated content note --- */
.callout-note.collapse details summary {
  font-size: 0.88rem;
}

/* --- Publication abstract callout --- */
details .callout {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
}

details .callout-note {
  border-left-color: var(--primary);
}

/* --- Download / certificate button --- */
.btn-outline-primary {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* --- Software section spacing --- */
.card-grid-2 + p {
  margin-top: 0.5rem;
}

/* --- Auto-generation info callout --- */
.callout-note[collapse] {
  font-size: 0.9rem;
}


/* ============================================
   CV PDF Viewer — Toggle + Download buttons
   ============================================ */

/* Button row */
.cv-buttons-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  flex-wrap: wrap;
}

/* Shared button base */
.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.8rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  border: 2px solid var(--primary);
  line-height: 1.4;
}
.cv-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(156, 107, 31, 0.2);
}
.cv-btn-icon {
  font-size: 1.1rem;
}

/* Primary (View Resume) */
.cv-btn-primary {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.cv-btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.cv-btn-primary.cv-btn-active {
  background: #B44D3E;
  border-color: #B44D3E;
}
.cv-btn-primary.cv-btn-active:hover {
  background: #943E32;
  border-color: #943E32;
}

/* Outline (Download PDF) */
.cv-btn-outline {
  background: transparent;
  color: var(--primary) !important;
  border-color: var(--primary);
}
.cv-btn-outline:hover {
  background: var(--primary);
  color: #fff !important;
}

/* PDF viewer wrapper */
.cv-pdf-wrapper {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* PDF iframe */
.cv-pdf-viewer {
  width: 100%;
  height: 700px;
  border: none;
  display: block;
  background: #f8f9fa;
}

/* Dark theme CV buttons */
[data-bs-theme="dark"] .cv-btn {
  border-color: var(--primary);
}
[data-bs-theme="dark"] .cv-btn-primary {
  background: #9C6B1F;
  border-color: #9C6B1F;
}
[data-bs-theme="dark"] .cv-btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
[data-bs-theme="dark"] .cv-btn-primary.cv-btn-active {
  background: #B44D3E;
  border-color: #B44D3E;
}
[data-bs-theme="dark"] .cv-btn-outline {
  color: var(--teal) !important;
  border-color: var(--teal);
}
[data-bs-theme="dark"] .cv-btn-outline:hover {
  background: #2F6F73;
  color: #fff !important;
  border-color: #2F6F73;
}
[data-bs-theme="dark"] .cv-pdf-wrapper {
  border-color: var(--border-color);
}
[data-bs-theme="dark"] .cv-pdf-viewer {
  background: #151009;
}

/* Responsive CV */
@media (max-width: 768px) {
  .cv-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }
  .cv-pdf-viewer {
    height: 450px;
  }
}

/* ============================================
   Blog Listing Styles
   ============================================ */

/* Blog listing cards */
.quarto-listing {
  margin-top: 1rem;
}

#listing-listing .listing-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  background: var(--card-bg);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

#listing-listing .listing-item:hover {
  box-shadow: 0 6px 20px var(--card-shadow);
  transform: translateY(-2px);
}

/* Blog post title */
.listing-title {
  color: var(--teal) !important;
  font-weight: 700;
  font-size: 1.15rem;
}

.listing-title:hover {
  color: var(--primary) !important;
}

/* Blog post description */
.listing-description {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Blog date */
.listing-date {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Blog categories */
.listing-category .listing-btn-group .btn {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  padding: 0.15em 0.6em;
  border-radius: 12px;
  font-weight: 600;
}

.listing-category .listing-btn-group .btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Category sidebar */
.quarto-listing-category .category-item {
  color: var(--teal);
  font-weight: 500;
}

.quarto-listing-category .category-item:hover {
  color: var(--primary);
}

.quarto-listing-category .category-item .category-listing-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Blog image thumbnails */
.listing-item .thumbnail img {
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* No-posts message */
.listing-no-matching {
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
  text-align: center;
}

/* Dark theme blog overrides */
[data-bs-theme="dark"] #listing-listing .listing-item {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .listing-title {
  color: var(--teal) !important;
}

[data-bs-theme="dark"] .listing-title:hover {
  color: var(--accent) !important;
}

[data-bs-theme="dark"] .listing-category .listing-btn-group .btn {
  background: #302618;
  color: var(--primary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .listing-category .listing-btn-group .btn:hover {
  background: var(--primary);
  color: #1C1710;
}

/* ============================================
   Notes Page Styles
   ============================================ */

/* Notes card hover — teal left border accent */
.card-grid-2 .card {
  border-left: 3px solid transparent;
  transition: border-left-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.card-grid-2 .card:hover {
  border-left-color: var(--teal);
}

[data-bs-theme="dark"] .card-grid-2 .card:hover {
  border-left-color: var(--teal);
}

/* Notes format tag */
.card-grid-2 .card p:last-child {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
