/* Gradenza Blog — shared styles for /blog index + post pages */

:root {
  --bg-navy: #081a35;
  --bg-navy-2: #061229;
  --bg-paper: #f7f4ee;
  --bg-paper-2: #fffdf7;
  --text-ink: #121826;
  --text-muted: #465065;
  --text-on-navy: #f5f7fb;
  --border: #e7e0d5;
  --border-2: #d9d1c4;
  --accent-gold: #c3a15b;
  --accent-teal: #2a7b78;
  --shadow: 0 10px 30px rgba(8, 18, 41, 0.08);
  --radius: 18px;
  --max: 1120px;
  --reading: 720px;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text-ink);
  background: linear-gradient(180deg, var(--bg-navy) 0, var(--bg-navy) 340px, var(--bg-paper) 340px);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 3px solid rgba(195, 161, 91, 0.6);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--bg-paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transform: translateY(-140%);
  transition: transform 180ms ease;
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: rgba(8, 18, 53, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(245, 247, 251, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 0;
  gap: 16px;
}

.logo {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-on-navy);
  text-decoration: none;
  font-size: 20px;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.nav-link {
  color: rgba(245, 247, 251, 0.82);
  font-weight: 500;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
}

.nav-link:hover {
  background: rgba(245, 247, 251, 0.08);
  color: var(--text-on-navy);
}

.nav-link.is-active {
  background: rgba(195, 161, 91, 0.18);
  color: var(--text-on-navy);
}

.nav-cta {
  display: flex;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent-gold);
  color: #1a1305;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 24px rgba(195, 161, 91, 0.2);
}

.btn--primary:hover {
  filter: brightness(1.02);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-ink);
}

.btn--ghost:hover {
  border-color: var(--border-2);
  background: rgba(18, 24, 38, 0.03);
}

.page {
  padding-bottom: 56px;
}

.hero {
  padding: 44px 0 26px;
  color: var(--text-on-navy);
}

.hero__eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(245, 247, 251, 0.72);
}

.hero__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.03em;
  font-weight: 700;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
}

.hero__subtitle {
  margin: 14px 0 0;
  max-width: 72ch;
  font-size: 18px;
  color: rgba(245, 247, 251, 0.84);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tab {
  border: 1px solid rgba(245, 247, 251, 0.18);
  background: rgba(245, 247, 251, 0.06);
  color: rgba(245, 247, 251, 0.9);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab:hover {
  background: rgba(245, 247, 251, 0.1);
}

.tab.is-active {
  background: rgba(195, 161, 91, 0.22);
  border-color: rgba(195, 161, 91, 0.42);
  color: var(--text-on-navy);
}

.noscript-note {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(245, 247, 251, 0.74);
}

.layout-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 26px;
}

.section-title {
  margin: 0 0 14px;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  font-size: 22px;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.post-card {
  background: var(--bg-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(8, 18, 41, 0.12);
}

.post-card__link {
  display: grid;
  grid-template-rows: auto 1fr;
  text-decoration: none;
  height: 100%;
}

.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(8, 26, 53, 0.12), rgba(195, 161, 91, 0.12));
}

.post-card__body {
  padding: 16px 16px 14px;
  display: grid;
  gap: 10px;
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 38, 0.02);
}

.badge--grading {
  border-color: rgba(195, 161, 91, 0.45);
  background: rgba(195, 161, 91, 0.14);
}

.badge--analytics {
  border-color: rgba(42, 123, 120, 0.45);
  background: rgba(42, 123, 120, 0.12);
}

.badge--exam-prep {
  border-color: rgba(70, 80, 101, 0.5);
  background: rgba(70, 80, 101, 0.08);
}

.badge--tutorial {
  border-color: rgba(8, 26, 53, 0.5);
  background: rgba(8, 26, 53, 0.06);
}

.badge--platform-updates {
  border-color: rgba(195, 161, 91, 0.35);
  background: rgba(8, 26, 53, 0.04);
}

.post-card__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-size: 20px;
}

.post-card__excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.author__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 38, 0.03);
}

.author__name {
  font-weight: 600;
  color: var(--text-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18ch;
}

.post-card__date {
  white-space: nowrap;
}

.post-card__meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.post-card__readtime {
  font-size: 12px;
  font-weight: 700;
  color: rgba(70, 80, 101, 0.95);
}

.sidebar {
  display: none;
}

.sidebar-card {
  background: var(--bg-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  margin: 0 0 12px;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  font-size: 18px;
}

.featured__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.featured__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  font-size: 18px;
  line-height: 1.2;
}

.featured__excerpt {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.featured__link {
  text-decoration: none;
  display: block;
}

.tag-cloud {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 38, 0.02);
  color: var(--text-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.tag:hover {
  border-color: var(--border-2);
  background: rgba(18, 24, 38, 0.03);
}

.sidebar-note {
  margin: -6px 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.subscribe {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  font: inherit;
}

.field input:focus-visible {
  outline-offset: 2px;
}

.form-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.site-footer {
  padding: 30px 0;
  background: var(--bg-paper);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--text-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-gold);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* Post template layout */
.breadcrumb {
  margin: 20px 0 10px;
}

.breadcrumb a {
  color: rgba(245, 247, 251, 0.92);
  text-decoration: none;
  font-weight: 700;
}

.breadcrumb a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-gold);
}

.post-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 18px;
}

.post-card--single {
  padding: 0;
}

.post {
  background: var(--bg-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-header {
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.post-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.post-title {
  margin: 10px 0 8px;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-size: clamp(30px, 3.8vw, 44px);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-2);
  display: inline-block;
}

.post-hero {
  border-top: 1px solid var(--border);
}

.post-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(8, 26, 53, 0.12), rgba(195, 161, 91, 0.12));
}

.post-body {
  padding: 22px;
  max-width: var(--reading);
}

.post-body h2,
.post-body h3 {
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post-body h2 {
  margin: 26px 0 10px;
  font-size: 24px;
}

.post-body h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.post-body p {
  margin: 0 0 14px;
}

.post-body > p:first-of-type::first-letter {
  float: left;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  font-size: 54px;
  line-height: 0.9;
  padding: 6px 10px 0 0;
  color: var(--bg-navy);
}

.post-body a {
  color: var(--bg-navy);
  font-weight: 700;
  text-decoration-color: rgba(195, 161, 91, 0.6);
}

.post-body a:hover {
  text-decoration-color: var(--accent-gold);
}

.post-body ul,
.post-body ol {
  margin: 0 0 14px;
  padding-left: 20px;
}

.post-body li {
  margin: 6px 0;
}

.post-body blockquote {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent-gold);
  background: rgba(195, 161, 91, 0.08);
  border-radius: 12px;
  color: #1a2436;
  font-weight: 600;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
}

.post-body th,
.post-body td {
  border: 1px solid var(--border);
  padding: 10px 10px;
  vertical-align: top;
}

.post-body th {
  background: rgba(8, 26, 53, 0.04);
  text-align: left;
  font-weight: 800;
}

.tldr {
  margin: 14px 0 18px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(42, 123, 120, 0.35);
  background: rgba(42, 123, 120, 0.08);
}

.tldr h2,
.tldr h3 {
  margin-top: 0;
}

.post-footer {
  border-top: 1px solid var(--border);
  padding: 18px 22px 22px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
}

.author-bio {
  border: 1px solid var(--border);
  background: rgba(18, 24, 38, 0.02);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 8px;
}

.author-bio__avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.author-bio__name {
  margin: 0;
  font-weight: 800;
}

.author-bio__text {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.helpful {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.helpful__prompt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 700;
}

.icon-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(18, 24, 38, 0.03);
  border-color: var(--border-2);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.share-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.share-link:hover {
  border-color: var(--border-2);
  background: rgba(18, 24, 38, 0.03);
}

.toc {
  display: none;
}

.toc.is-empty {
  display: none;
}

.toc__title {
  margin: 0 0 12px;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  font-size: 18px;
}

.toc ol {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
}

.toc a {
  color: inherit;
  text-decoration: none;
}

.toc a[aria-current="true"] {
  color: var(--text-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-gold);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.post-nav a {
  text-decoration: none;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  font-weight: 800;
}

.post-nav a:hover {
  border-color: var(--border-2);
  background: rgba(18, 24, 38, 0.03);
}

.related {
  margin-top: 28px;
}

.related h2 {
  margin: 0 0 14px;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.02em;
  font-size: 20px;
}

@media (min-width: 720px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1020px) {
  .layout-index {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }

  .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar {
    display: grid;
    gap: 18px;
    align-self: start;
  }

  .post-shell {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .toc {
    display: block;
    position: sticky;
    top: 92px;
    background: var(--bg-paper-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    height: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .post-card {
    transition: none;
  }

  .skip-link {
    transition: none;
  }
}
