*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-color: #ffffff;
  --card-bg: #e1e1e1;
  --subtle-text: #808080;
  --text-color: #333333;
  --accent-color: #d81466;
  --accent-color-translucent: #d81466c9;
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-height: 54px;
}

[data-theme="dark"] {
  --card-bg: #000000;
  --subtle-text: #c2c2c2;
  --bg-color: #1a1a1a;
  --text-color: #f4f4f4;
  --header-bg: rgba(26, 26, 26, 0.8);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  font-family: "Inter", sans-serif;
}

[data-include="partials/header.html"] {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.main-header {
  display: flex;
  justify-content: space-between;
  height: var(--header-height);
  align-items: center;
  padding: 1rem;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-left-icon {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 8px;
  border: var(--accent-color) 2px solid;
  margin-right: 1rem;
}

.header-left img {
  margin-right: 4px;
}

.accent-subtle {
  color: var(--accent-color);
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.accent {
  color: var(--accent-color);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0px;
}

/* Nav Links */
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-right a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.1rem;
  transition: opacity 0.2s;
}

.header-right a:hover {
  opacity: 0.7;
}

.white-icon {
  filter: invert(1) brightness(2);
}

/* The Toggle Switch */
.theme-switch {
  display: inline-block;
  height: 26px;
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: 0.4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 5px;
}

.slider i {
  font-size: 10px;
  color: white;
}

.slider:before {
  background-color: #fff;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  position: absolute;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Ensure main content doesn't jump under sticky header */
.container {
  margin-top: 2rem;
}

.article-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.article-image {
  height: 180px;
  background-size: cover;
  background-position: center;
}

.article-page {
  max-width: 720px;
  width: 100%;
  margin: 1rem auto;
  padding: 1.25rem;
  border-radius: 24px;
  background-color: var(--card-bg);
}

@media (max-width: 640px) {
  .article-page {
    width: 100%;
  }
}

.article-content {
  padding: 1rem;
}
.article-date {
  opacity: 0.7;
  font-size: 0.85rem;
  margin: 0 0 0.25rem 0;
}
.article-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

/* article page */
.article-root .article-date {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.article-root {
  max-width: 65ch; /* ideal reading width */
  margin: auto;
}

.article-root h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-top: 2rem;
}

.article-root h2 {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  margin-top: 2rem;
}
.featured-img {
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
  background: pink;
}

.featured-img img {
  height: 200px;
  width: auto;
  object-fit: contain;
  display: block;
}

.article-root p {
  line-height: 1.7;
  margin: 0.2rem 0;
}

.article-root pre {
  background: #0b0b0b;
  padding: 1rem;
  overflow: auto;
  border-radius: 8px;
}
[data-theme="light"] .article-root pre {
  background: #f5f5f5;
  color: #111;
}

/* Profile links (Resume, LinkedIn, GitHub) */
.profile-links {
  margin-top: 4rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-links a i,
.profile-links a img.white-icon {
  font-size: 24px;
  width: 24px;
  height: 24px;
  color: var(--accent-color);
  fill: var(--accent-color);
}

.profile-links a img.white-icon {
  display: inline-block;
}

.profile-links .btn:hover {
  transform: translateY(-3px);
  opacity: 0.95;
}

.week-row {
  width: 100%;
  margin-bottom: 4rem;
}

.week-sticky-header {
  position: -webkit-sticky;
  position: sticky;
  top: var(--header-height);
  z-index: 900;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.week-sticky-header h3 {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--text-color);
  text-transform: uppercase;
  background-color: var(--accent-color-translucent);
  border-radius: 4px;
}

.week-grid {
  display: grid;
  margin: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.definition {
  background-color: var(--bg-color);
  border-left: 4px solid var(--accent-color);
  padding: 0.5em;
  margin: 1em 0;
  border-radius: 6px;
  font-style: italic;
}
