/* TBI Life - Main Stylesheet */

:root {
  --bg-color: #fafafa;
  --text-color: #333;
  --text-muted: #666;
  --text-light: #888;
  --heading-color: #222;
  --link-color: #2c5aa0;
  --border-color: #e0e0e0;
  --card-bg: #fff;
  --header-bg: #fff;
  --shadow: rgba(0,0,0,0.08);
  --shadow-hover: rgba(0,0,0,0.12);
}

body.dark-mode {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --text-muted: #b0b0b0;
  --text-light: #909090;
  --heading-color: #f0f0f0;
  --link-color: #6b9fff;
  --border-color: #333;
  --card-bg: #242442;
  --header-bg: #16162a;
  --shadow: rgba(0,0,0,0.3);
  --shadow-hover: rgba(0,0,0,0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Georgia', serif;
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.8rem;
  font-weight: normal;
  letter-spacing: 2px;
}

.site-title a {
  color: var(--heading-color);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-transform: lowercase;
}

nav a:hover {
  color: var(--text-color);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  border-color: var(--link-color);
}

.dark-mode-toggle .moon-icon {
  display: none;
}

body.dark-mode .dark-mode-toggle .sun-icon {
  display: none;
}

body.dark-mode .dark-mode-toggle .moon-icon {
  display: inline;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--header-bg) 0%, var(--bg-color) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: normal;
  color: var(--heading-color);
  margin-bottom: 1rem;
  font-style: italic;
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Main Content */
main {
  max-width: 750px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

main.homepage {
  max-width: 1200px;
  padding: 0;
}

/* Article Styles */
article {
  background: var(--card-bg);
  padding: 3rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background-color 0.3s ease;
}

.article-hero {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  margin-bottom: 2rem;
  border-radius: 8px;
}

.article-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.article-gallery img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
}

article h1 {
  font-size: 2.2rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
  color: var(--heading-color);
  line-height: 1.3;
}

article h2 {
  font-size: 1.6rem;
  font-weight: normal;
  margin: 2.5rem 0 1.2rem;
  color: var(--heading-color);
}

article h3 {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 2rem 0 1rem;
  color: var(--heading-color);
}

.article-date {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  font-style: italic;
}

article p {
  margin-bottom: 1.8rem;
  letter-spacing: 0.01em;
}

article img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
}

article blockquote {
  border-left: 4px solid var(--link-color);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-muted);
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
}

article ul, article ol {
  margin: 1.2rem 0 2rem 1.5rem;
}

article li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

/* Homepage Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  list-style: none;
  padding: 8px;
}

.image-grid li {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
}

.image-grid a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.image-grid .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: 12px;
}

.image-grid li:hover .card-image {
  transform: scale(1.05);
}

.image-grid .card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 12px;
}

.image-grid .title {
  color: #fff;
  font-family: 'Georgia', serif;
  font-size: 1.4rem;
  font-style: italic;
  font-weight: normal;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  line-height: 1.4;
}

/* Old Article List (keep for fallback) */
.article-list {
  list-style: none;
}

.article-list li {
  background: var(--card-bg);
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.2s, background-color 0.3s ease;
}

.article-list li:hover {
  box-shadow: 0 4px 16px var(--shadow-hover);
}

.article-list a {
  display: block;
  padding: 1.5rem 2rem;
  color: var(--text-color);
}

.article-list .title {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 0.3rem;
}

.article-list .date {
  font-size: 0.85rem;
  color: var(--text-light);
}

.article-list .excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Category Sections */
.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* About Page */
.about-content {
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background-color 0.3s ease;
}

.about-content h1 {
  font-size: 2.2rem;
  font-weight: normal;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0;
  background: var(--header-bg);
  transition: background-color 0.3s ease;
}

/* Responsive */
@media (max-width: 900px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .image-grid .title {
    font-size: 1.2rem;
  }

  .hero h2 {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    gap: 1rem;
  }

  .hero {
    padding: 2.5rem 1.5rem;
  }

  .hero h2 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 1rem;
  }

  article {
    padding: 1.5rem;
    border-radius: 8px;
  }

  article h1 {
    font-size: 1.7rem;
  }

  article h2 {
    font-size: 1.4rem;
  }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 6px;
  }

  .image-grid li {
    border-radius: 8px;
  }

  .image-grid .card-image,
  .image-grid .card-overlay {
    border-radius: 8px;
  }

  .image-grid .title {
    font-size: 1rem;
    padding: 0.75rem;
  }
}
