/* ===========================================
   Base Styles & CSS Reset
   =========================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===========================================
   Theme: Base (dark default)
   =========================================== */
.theme-base {
  --bg: #0b0b0b;
  --bg-secondary: #151515;
  --text: #ffffff;
  --text-muted: #888888;
  --accent: #a0a0a0;
  --card-bg: rgba(30, 30, 30, 0.95);
  --card-border: rgba(255, 255, 255, 0.1);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===========================================
   Theme: Mind (Garden of Earthly Delights)
   =========================================== */
.theme-mind {
  --bg: #0b0b0b;
  --bg-image: url('/assets/images/garden-of-earthly-delights.jpg');
  --text: #f5f0e8;
  --text-muted: #c4b8a8;
  --accent: #8b7355;
  --card-bg: rgba(45, 40, 35, 0.92);
  --card-border: rgba(139, 115, 85, 0.3);
  --font: Georgia, 'Times New Roman', serif;

  background-image: var(--bg-image);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* ===========================================
   Theme: Body (Patagonia Glacier)
   =========================================== */
.theme-body {
  --bg: #0b0b0b;
  --bg-image: url('/assets/images/patagonia-torre.jpg');
  --text: #f0f4f8;
  --text-muted: #a8b8c8;
  --accent: #6b8cae;
  --card-bg: rgba(35, 40, 50, 0.92);
  --card-border: rgba(100, 130, 160, 0.3);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  background-image: var(--bg-image);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* ===========================================
   Article List Layout
   =========================================== */
.list-container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.list-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.list-header h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
}

.list-header .back-link {
  color: var(--text);
  font-size: 1.25rem;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===========================================
   Article Card Component
   =========================================== */
.article-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(8px);
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.card-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-content h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive: stack card on small screens */
@media (max-width: 500px) {
  .article-card {
    flex-direction: column;
  }

  .card-thumb {
    width: 100%;
    height: 160px;
  }
}

/* ===========================================
   Article Content Styling (Medium-inspired)
   =========================================== */
.article-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.article-header {
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

.article-header .meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-header .back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.article-content {
  font-size: 1.125rem;
  line-height: 1.75;
}

.article-content h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-size: 1.375rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  margin: 0 0 1.5rem 0;
}

.article-content img {
  width: 100%;
  border-radius: 8px;
  margin: 2rem 0;
}

/* Image captions */
.article-content img + em,
.article-content figcaption {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
  font-style: italic;
}

/* Blockquotes */
.article-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Code blocks */
.article-content pre {
  background: var(--bg-secondary, #151515);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.9em;
}

/* Lists */
.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

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

/* ===========================================
   Video Embed (YouTube)
   =========================================== */
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===========================================
   About Page
   =========================================== */
.about-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.about-container h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.about-container .back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--text-muted);
}
