/* Light theme colors (default) */
:root {
  /* Primary colors */
  --primary-color: #ffffff;
  --secondary-color: #1c1c1e;
  --tertiary-color: #f2f2f7;

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

  /* Text colors */
  --text-primary: #1c1c1e;
  --text-secondary: #8e8e93;
  /* Apple's secondary label color */

  /* Border colors */
  --border-color: #c6c6c8;
  /* Slightly darker for better visibility */

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Dark theme colors */
[data-theme="dark"] {
  /* Primary colors */
  --primary-color: #1c1c1e;
  --secondary-color: #ffffff;
  --tertiary-color: #000000;
  /* True black background for OLED feel */

  /* Accent colors */
  --accent-yellow: #ffd60a;
  --accent-yellow-hover: #ffc60a;
  --accent-gray: #2c2c2e;
  --accent-gray-hover: #3a3a3c;

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

  /* Border colors */
  --border-color: #38383a;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--tertiary-color);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

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 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);
}

/* 
   REVERTED COMPONENTS START 
   (Hero, Featured Articles, Cards)
*/

section.hero {
  padding: 2rem;
  margin: 2rem;
  display: flex;
  background-color: var(--primary-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.featured-article {
  padding: 2rem;
  margin: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  background-color: var(--primary-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-text {
  margin: 2rem;
  padding: 2rem;
  max-width: 60%;
}

.featured-article-text {
  padding: 2rem;
  flex: 1;
}

.featured-article-img {
  width: 400px;
  /* Fixed width for image container */
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.featured-article-img img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  /* Optional: adds nice rounded corners to images */
}

.hero-text p,
.featured-article-text p {
  color: var(--text-secondary);
  line-height: 1.6;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Buttons (Keeping Apple style for consistency, or revert if needed? User didn't explicitly ask for buttons, but they are part of cards often. I'll keep the Apple style buttons as they look better) */
button,
.btn {
  background-color: var(--accent-yellow);
  color: #000;
  margin: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.1s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
  background-color: var(--accent-yellow);
}

button:active,
.btn:active {
  transform: scale(0.98);
}

section.featured-articles {
  background-color: var(--tertiary-color);
  padding: 2rem 0;
  transition: background-color 0.3s ease;
}

.featured-articles-header {
  text-align: center;
  padding-top: 6rem;
}

.featured-articles-header p {
  color: var(--text-secondary);
  margin-top: 1rem;
}

.featured-article:hover {
  border-color: var(--accent-gray-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Blog List / Snippets - REVERTED */
.section.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

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

.articles__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  list-style: none;
}

.snippet {
  background-color: var(--primary-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.snippet:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-gray-hover);
}

.snippet__image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.snippet:hover .snippet__image {
  transform: scale(1.05);
}

.snippet__title {
  margin: 1rem;
}

.snippet__title a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: bold;
  transition: color 0.3s ease;
}

.snippet__title a:hover {
  color: var(--accent-yellow-hover);
}

.snippet__meta {
  margin: 0 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.snippet__meta span {
  margin-right: 0.5rem;
}

.snippet__body {
  margin: 1rem;
  color: var(--text-secondary);
  flex-grow: 1;
}

/* Footer */
footer {
  background-color: var(--tertiary-color);
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

/* 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;
}

.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;
}

/* About Page */
.about-hero {
  padding: 2rem;
  margin: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  background-color: var(--primary-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.about-hero-text {
  flex: 1;
  padding: 2rem;
}

.about-hero-text p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 1rem;
}

.about-hero-img {
  width: 300px;
  flex-shrink: 0;
}

.about-hero-img img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.about-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.about-section {
  margin-bottom: 3rem;
}

.about-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: 1rem;
}

.about-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.about-gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.about-cta {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 2rem;
  background-color: var(--primary-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.about-cta img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.about-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.about-social {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.about-social:hover {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  color: #000;
}


.about-apple-music {
  margin-top: 3rem;
  padding: 2.5rem;
  background-color: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.about-apple-music h2 {
  margin-bottom: 1rem;
}

.apple-music-intro {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 2rem;
}

.apple-music-note {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Playlists (recently played + Heavy Rotation) sit side by side */
.apple-music-playlists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: start;
}

.apple-music-playlist {
  min-width: 0;
}

.apple-music-playlist-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.apple-music-playlist-head h3 {
  margin: 0;
}

.apple-music-playlist-head p {
  margin: 0.2rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.apple-music-playlist-head p a {
  color: var(--text-primary);
  text-decoration: underline;
  white-space: nowrap;
}

.apple-music-playlist-head p a:hover {
  color: var(--accent-yellow-hover);
}

.apple-music-playlist-cover {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.apple-music-tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: track;
}

.apple-music-track {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.apple-music-track::before {
  counter-increment: track;
  content: counter(track);
  min-width: 1.25rem;
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.apple-music-track:hover {
  background-color: var(--tertiary-color);
}

.apple-music-track img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.apple-music-track-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.apple-music-track-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apple-music-track-artist {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

  /* Reverted Responsive Styles */
  section.hero {
    flex-direction: column;
    margin: 1rem;
  }

  .featured-article {
    flex-direction: column-reverse;
    margin: 1rem;
  }

  .hero-text,
  .featured-article-text {
    margin: 1rem;
    padding: 1rem;
    max-width: 100%;
  }

  .articles__list {
    grid-template-columns: 1fr;
  }

  img {
    width: 100%;
  }

  .featured-article-img {
    width: 100%;
  }

  .about-hero {
    flex-direction: column;
    margin: 1rem;
  }

  .about-hero-text {
    padding: 1rem;
    order: 2;
  }

  .about-hero-img {
    width: 100%;
    order: 1;
  }

  .about-gallery {
    grid-template-columns: 1fr;
  }

  .about-content {
    padding: 1rem;
  }

  .apple-music-playlist-head {
    align-items: flex-start;
  }
}
