:root {
  --ui-font: "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  --page: #f5f6f2;
  --paper: #ffffff;
  --ink: #23313f;
  --ink-strong: #142333;
  --muted: #798289;
  --line: #dedfd8;
  --line-soft: #e9eae4;
  --navy: #1d3b5d;
  --navy-deep: #142d4a;
  --blue: #2f80d5;
  --band: #eef0e9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-width: 320px;
}

button,
input,
select {
  font-family: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.library-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e5e6e0;
  backdrop-filter: blur(10px);
}

.ielts-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #173b66;
}

.ielts-wordmark {
  font-size: 34px;
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #173b66;
}

.ielts-tagline {
  border-left: 1px solid #d6d8d2;
  padding-left: 10px;
  color: #83887f;
  font-size: 8px;
  line-height: 1.3;
  letter-spacing: 1.25px;
  font-weight: 700;
}

.ielts-brand:hover .ielts-wordmark {
  color: #0b2848;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 26px;
}

.header-note {
  color: #8a918d;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid #cdd1c9;
  border-radius: 4px;
  background: #ffffff;
  color: #2b3a48;
  font-size: 12.5px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.header-cta svg {
  width: 15px;
  height: 15px;
}

.header-cta:hover {
  border-color: #818a82;
  background: #fafbf8;
}

.library-main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 44px 50px;
}

.library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 50px;
  padding: 56px 0 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #4478a8;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.hero-copy h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -1.7px;
}

.hero-subtitle {
  max-width: 590px;
  margin: 20px 0 0;
  color: #707a80;
  font-size: 15px;
  line-height: 1.65;
}

.hero-stats {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 30px;
  padding-bottom: 4px;
}

.hero-stat {
  min-width: 72px;
  padding-left: 15px;
  border-left: 1px solid #d7dad3;
}

.hero-stat strong {
  display: block;
  color: #1d3b5d;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.hero-stat span {
  display: block;
  margin-top: 5px;
  color: #8a918c;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.library-controls {
  position: sticky;
  top: 72px;
  z-index: 20;
  padding: 14px 0 15px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 242, 0.95);
  backdrop-filter: blur(10px);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tab {
  height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #59636a;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-tab span {
  display: inline-block;
  margin-left: 5px;
  color: #8a9190;
  font-size: 11px;
}

.filter-tab:hover {
  border-color: #d5d8d1;
  background: #fafbf8;
}

.filter-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.filter-tab.is-active span {
  color: rgba(255, 255, 255, 0.66);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(390px, 100%);
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d5d8d1;
  border-radius: 4px;
  background: #ffffff;
  color: #8c938c;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
  border-color: #8aa6bf;
  box-shadow: 0 0 0 3px rgba(63, 113, 158, 0.08);
}

.search-box svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #26323d;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #9ba19a;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #8a908b;
  font-size: 12px;
}

.sort-control select {
  height: 34px;
  padding: 0 29px 0 10px;
  border: 1px solid #d5d8d1;
  border-radius: 4px;
  outline: none;
  background: #ffffff;
  color: #3c484f;
  font-size: 12.5px;
  cursor: pointer;
}

.library-results {
  padding-top: 28px;
}

.results-heading {
  display: flex;
  align-items: baseline;
  gap: 13px;
  margin-bottom: 17px;
}

.results-heading h2 {
  margin: 0;
  color: #26343f;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.results-heading span {
  color: #949b95;
  font-size: 12px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.article-card {
  position: relative;
  min-height: 222px;
  display: flex;
  flex-direction: column;
  padding: 18px 19px 16px;
  border: 1px solid #e1e2dc;
  border-radius: 6px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: #c6ccc5;
  box-shadow: 0 12px 28px rgba(38, 52, 44, 0.1);
}

.article-card:focus-visible {
  outline: 2px solid #5d96c8;
  outline-offset: 2px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.part-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 3px;
  background: #eaf1f8;
  color: #356b9c;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.part-chip.part-2 {
  background: #ebf2e8;
  color: #4d794f;
}

.part-chip.part-3 {
  background: #f2ecf3;
  color: #77567f;
}

.card-page {
  color: #9ba19a;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.article-card h3 {
  margin: 14px 0 8px;
  color: #25333f;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  margin: 0;
  color: #858c87;
  font-size: 11.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom {
  margin-top: auto;
  padding-top: 14px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #878e88;
  font-size: 10.5px;
  letter-spacing: 0.01em;
}

.card-meta + .card-meta {
  margin-top: 5px;
}

.card-meta .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #c1c6bf;
}

.card-meta .progress-label {
  color: #6d7c74;
}

.progress-track {
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: #eceee8;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #5c8bb3;
  transition: width 0.2s ease;
}

.is-complete .progress-fill {
  background: #6fa179;
}

.article-card.is-featured {
  grid-column: span 2;
  min-height: 222px;
  justify-content: space-between;
  background:
    radial-gradient(circle at 95% 0%, rgba(122, 167, 201, 0.28), transparent 46%),
    linear-gradient(122deg, #1b3654 0%, #173049 62%, #1c3b52 100%);
  border-color: #1b3654;
  color: #ffffff;
}

.article-card.is-featured::after {
  content: "21";
  position: absolute;
  right: -8px;
  bottom: -39px;
  color: rgba(255, 255, 255, 0.045);
  font-size: 160px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -12px;
  pointer-events: none;
}

.article-card.is-featured .card-page {
  color: rgba(255, 255, 255, 0.56);
}

.article-card.is-featured .part-chip {
  background: rgba(255, 255, 255, 0.14);
  color: #f0e7c7;
}

.article-card.is-featured h3 {
  max-width: 480px;
  margin-top: 17px;
  color: #ffffff;
  font-size: 25px;
  letter-spacing: -0.5px;
  -webkit-line-clamp: 2;
}

.article-card.is-featured .card-excerpt {
  max-width: 500px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  -webkit-line-clamp: 2;
}

.featured-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10.5px;
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

.featured-cta svg {
  width: 14px;
  height: 14px;
}

.featured-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e8dab1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.featured-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e0c985;
}

.empty-state {
  padding: 70px 24px;
  border: 1px dashed #d7dad3;
  border-radius: 6px;
  text-align: center;
  background: #fafbf8;
}

.empty-mark {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  border: 1px solid #c9cec6;
  border-radius: 50%;
  color: #7c8b81;
  font-size: 21px;
  line-height: 38px;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: #34453b;
  font-size: 17px;
}

.empty-state p {
  margin: 0 0 18px;
  color: #8a918a;
  font-size: 13px;
}

.empty-state button {
  height: 32px;
  padding: 0 13px;
  border: 1px solid #c8cec6;
  border-radius: 4px;
  background: #ffffff;
  color: #3e4c43;
  font-size: 12px;
  cursor: pointer;
}

.library-footer {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #9aa19a;
  font-size: 11px;
  line-height: 1.7;
}

.library-footer p {
  margin: 0 0 2px;
}

.library-footer em {
  font-style: normal;
  color: #7f877f;
}

@media (max-width: 1180px) {
  .library-header {
    padding: 0 28px;
  }

  .library-main {
    padding: 0 28px 44px;
  }

  .hero-stats {
    gap: 18px;
  }

  .hero-stat {
    padding-left: 12px;
  }

  .hero-stat strong {
    font-size: 24px;
  }
}

@media (max-width: 920px) {
  .library-hero {
    display: block;
    padding-top: 38px;
  }

  .hero-stats {
    margin-top: 27px;
  }

  .hero-stat:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .library-controls {
    position: static;
  }

  .header-note {
    display: none;
  }

  .article-card.is-featured {
    grid-column: span 1;
  }

  .article-card.is-featured h3 {
    font-size: 21px;
  }

  .featured-cta span {
    display: none;
  }
}

@media (max-width: 620px) {
  .library-header {
    height: 62px;
    padding: 0 18px;
  }

  .ielts-wordmark {
    font-size: 28px;
  }

  .ielts-tagline {
    font-size: 7px;
  }

  .header-cta {
    padding: 0 9px;
    height: 30px;
    font-size: 11px;
  }

  .library-main {
    padding: 0 18px 34px;
  }

  .hero-copy h1 {
    font-size: 38px;
    letter-spacing: -1.3px;
  }

  .hero-subtitle {
    font-size: 13.5px;
  }

  .hero-stats {
    gap: 15px;
  }

  .hero-stat strong {
    font-size: 21px;
  }

  .hero-stat span {
    font-size: 9px;
  }

  .control-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }

  .sort-control {
    margin-left: 0;
    justify-content: space-between;
  }

  .sort-control select {
    flex: 1;
  }

  .filter-tab {
    padding: 0 10px;
    font-size: 12px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    min-height: 200px;
  }

  .featured-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
}

.library-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 34px;
  margin-right: auto;
  padding: 3px;
  border: 1px solid #e1e3dc;
  border-radius: 5px;
  background: #f4f5f1;
}

.library-nav a {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 13px;
  border-radius: 3px;
  color: #7b837c;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.library-nav a:hover {
  color: #2c3b47;
}

.library-nav a.is-active {
  background: #ffffff;
  color: #1c3b5c;
  box-shadow: 0 1px 3px rgba(28, 52, 44, 0.08);
}

@media (max-width: 920px) {
  .library-nav {
    margin-left: 16px;
  }

  .library-nav a {
    padding: 0 9px;
    font-size: 11px;
  }
}

@media (max-width: 700px) {
  .library-nav {
    margin-left: 10px;
  }
}

@media (max-width: 620px) {
  .library-nav {
    order: 3;
    margin: 0 0 0 auto;
  }

  .header-right {
    gap: 10px;
  }

  .header-cta {
    display: none;
  }
}

/* Full-test entry */
.full-test-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 0 26px;
  padding: 24px 26px;
  border: 1px solid #d8d1c1;
  border-radius: 10px;
  background: #1e3b4d;
  color: #ffffff;
}

.full-test-strip .full-test-eyebrow {
  margin: 0 0 8px;
  color: #a8c1c8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.full-test-strip h2 {
  margin: 0 0 7px;
  font-size: 24px;
  letter-spacing: -0.4px;
}

.full-test-strip p {
  max-width: 710px;
  margin: 0;
  color: #c1d1d6;
  font-size: 12px;
  line-height: 1.55;
}

.full-test-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.full-test-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.full-test-link span {
  font-size: 17px;
}

@media (max-width: 900px) {
  .full-test-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}
