/* Inheriting theme variables from previous CSS */
:root {
  /* Primary colors */
  --primary-color: #ffffff;
  --secondary-color: #1c1c1e;
  --tertiary-color: #f2f2f7;

  /* Accent colors */
  --accent-yellow: #ffd60a;
  --accent-yellow-text: #856900;
  --accent-yellow-hover: #ffe55c;
  --accent-gray: #e5e5ea;
  --accent-gray-hover: #d1d1d6;

  /* Text colors */
  --text-primary: #1c1c1e;
  --text-secondary: #6e6e73;

  /* Border colors */
  --border-color: #e5e5ea;
}

/* Dark theme colors */
[data-theme="dark"] {
  /* Primary colors */
  --primary-color: #1c1c1e;
  --secondary-color: #ffffff;
  --tertiary-color: #2c2c2e;

  /* Accent colors */
  --accent-yellow: #ffd60a;
  --accent-yellow-text: #ffd60a;
  --accent-yellow-hover: #ffc60a;
  --accent-gray: #3a3a3c;
  --accent-gray-hover: #48484a;

  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: #ebebf0;

  /* Border colors */
  --border-color: #3a3a3c;
}

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

body {
  font-family: "Arial", sans-serif;
  background-color: var(--tertiary-color);
  color: var(--text-primary);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  line-height: 1.6;
}

header {
  background-color: var(--primary-color);
  color: var(--text-primary);
  text-align: center;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
}

.logo img {
  height: 32px;
  width: auto;
}

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

nav ul li {
  margin: 0;
}

nav ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav ul li a:hover,
nav ul li a[aria-current="page"] {
  color: var(--accent-yellow);
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  cursor: pointer;
}

.theme-toggle:hover {
  background-color: var(--accent-gray);
  transform: none;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-toggle .dark-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .light-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .dark-icon {
  display: block;
}

/* Individual Blog Page Styles */
.main-article {
  background-color: var(--primary-color);
  color: var(--text-primary);
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.article-title {
  color: var(--text-primary);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.main-article__figure {
  background-color: var(--tertiary-color);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.main-article__figure img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.main-article__figure--portrait {
  background-color: var(--tertiary-color);
}

.main-article__figure--portrait img {
  max-height: 760px;
  object-fit: contain;
  object-position: center;
}

.main-article__figure:hover img {
  transform: scale(1.02);
}

.main-article__figure figcaption {
  color: var(--text-secondary);
  padding: 1rem;
  text-align: center;
  background-color: var(--accent-gray);
}

/* Dark mode image adjustments */
[data-theme="dark"] .main-article__figure img {
  filter: brightness(0.8) contrast(1.2);
}

/* List Styling */
.main-article ul,
.main-article ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Content Images Styling - Only applies to images in the blog body, not the featured image */
.main-article p img,
.image-grid img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 2.5rem auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.main-article p img:hover,
.image-grid img:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
  align-items: start;
}

.image-grid img {
  margin: 0 auto;
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: cover;
}

/* Specific styling for portrait images in grids */
.image-grid .portrait {
  object-fit: contain;
  background-color: var(--tertiary-color);
}

.main-article li {
  margin-bottom: 0.5rem;
}

.main-article ul li::marker {
  color: var(--accent-yellow-text);
}

.main-article ol li::marker {
  color: var(--accent-yellow-text);
  font-weight: bold;
}

/* Flow class for potential content styling */
.flow > * + * {
  margin-top: 1.5rem;
}

/*blockquote*/
blockquote {
  background-color: var(--accent-gray);
  border-left: 4px solid var(--accent-yellow);
  padding: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* links */
a.link {
  color: var(--accent-yellow-text);
  text-decoration: underline;
}

/* Portrait video styling */
.video-portrait {
  max-height: 500px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

footer {
  background-color: var(--primary-color);
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
  position: relative;
  bottom: 0;
  width: 100%;
  border-top: 1px solid var(--border-color);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
}

/* Blog Navigation */
.blog-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem;
}

.blog-nav__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-primary);
  flex: 1;
  padding: 1rem;
  border-radius: 8px;
  background-color: var(--accent-gray);
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.blog-nav__link:hover {
  background-color: var(--accent-gray-hover);
  transform: translateY(-2px);
}

.blog-nav__link--prev {
  text-align: left;
}

.blog-nav__link--next {
  text-align: right;
}

.blog-nav__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.blog-nav__title {
  font-weight: bold;
  font-size: 1rem;
  color: var(--accent-yellow-text);
}
