/* =========================================================
   library-item.css
   Single library resource detail page
   ========================================================= */


/* ============ Intro back-link (alias to unit-intro) ============ */
.li-intro { padding: 24px 0 0; }


/* ============ HERO ============ */
.li-hero {
  padding: 28px 0 64px;
  background: var(--paper);
}

@media (max-width: 767.98px) {
  .li-hero { padding: 20px 0 48px; }
}

.li-hero__inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 880px) {
  .li-hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    justify-items: center;
    text-align: left;
  }
  .li-hero__body { width: 100%; }
}

/* ---- Book cover (stylized CSS-rendered) ---- */
.li-hero__cover {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  aspect-ratio: 3 / 4;
  width: 100%;
  box-shadow:
    0 1px 0 rgba(20, 20, 20, .06),
    0 24px 48px -16px rgba(20, 20, 20, .25);
  border-radius: 2px;
  overflow: hidden;
  transition: transform var(--dur, .35s) var(--ease, cubic-bezier(.22,.61,.36,1));
}

@media (max-width: 880px) {
  .li-hero__cover { max-width: 240px; }
}

.li-hero__cover:hover {
  transform: translateY(-3px);
}

.li-hero__cover-spine {
  background: linear-gradient(90deg, #b4101f, var(--red, #e11932));
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
}

.li-hero__cover-face {
  background: linear-gradient(135deg, var(--red, #e11932), #b80f1c);
  color: var(--white, #fff);
  padding: 28px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.li-hero__cover-face::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  pointer-events: none;
}

.li-hero__cover-eyebrow {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: .85;
  margin-bottom: auto;
  position: relative;
  z-index: 1;
}

.li-hero__cover-title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.li-hero__cover-subtitle {
  font-size: 11px;
  font-weight: 500;
  opacity: .8;
  font-style: italic;
  position: relative;
  z-index: 1;
}

.li-hero__cover-author {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: .75;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}


/* ---- Hero body ---- */
.li-hero__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
}

.li-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.li-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink, #141414);
  background: var(--white, #fff);
  border: 1px solid rgba(20, 20, 20, .12);
  border-radius: 999px;
}

.li-hero__tag--type {
  background: var(--ink, #141414);
  color: var(--white, #fff);
  border-color: var(--ink, #141414);
}

.li-hero__tag--status {
  background: var(--white, #fff);
  border-color: rgba(20, 20, 20, .12);
}

.li-hero__tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2bb673;
  box-shadow: 0 0 0 0 rgba(43, 182, 115, .45);
  animation: li-pulse 2.2s ease-out infinite;
}

@keyframes li-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, .45); }
  50%      { box-shadow: 0 0 0 6px rgba(43, 182, 115, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .li-hero__tag-dot { animation: none; }
}

.li-hero__title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: clamp(24px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink, #141414);
  margin: 4px 0 0;
  overflow-wrap: break-word;
}

.li-hero__author {
  font-size: 15px;
  font-weight: 500;
  color: rgba(20, 20, 20, .65);
  margin: 0;
}

.li-hero__lede {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(20, 20, 20, .82);
  margin: 8px 0 0;
  max-width: 56ch;
}

.li-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.li-hero__btn-ghost {
  background: var(--white, #fff);
  color: var(--ink, #141414);
  border: 1px solid rgba(20, 20, 20, .14);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 48px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .01em;
  border-radius: 0;
  transition: border-color var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1)),
              background var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1));
}

.li-hero__btn-ghost:hover {
  border-color: var(--ink, #141414);
  background: var(--paper, #f5f3ef);
}

.li-hero__btn-ghost svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.li-hero__actions .btn svg {
  width: 16px;
  height: 16px;
}


/* ============ BODY (content + sticky aside) ============ */
.li-body {
  padding: 80px 0 96px;
  background: var(--white, #fff);
}

@media (max-width: 980px) {
  .li-body { padding: 56px 0 64px; }
}

@media (max-width: 575.98px) {
  .li-body { padding: 40px 0 48px; }
}

.li-body__inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  align-items: start;
}

@media (max-width: 980px) {
  .li-body__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}


/* ---- Content sections ---- */
.li-content {
  display: flex;
  flex-direction: column;
  gap: 56px;
  min-width: 0;
}

@media (max-width: 575.98px) {
  .li-content { gap: 40px; }
}

.li-section { }

.li-section__title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink, #141414);
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(20, 20, 20, .08);
}

.li-section__lead {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink, #141414);
  margin: 0 0 16px;
}

.li-section__text {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(20, 20, 20, .78);
  margin: 0 0 14px;
}

.li-section__text:last-child { margin-bottom: 0; }


/* ---- Table of contents ---- */
.li-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(20, 20, 20, .08);
  border: 1px solid rgba(20, 20, 20, .08);
}

.li-toc__item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 18px 20px;
  background: var(--white, #fff);
  transition: background var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1));
}

@media (max-width: 479.98px) {
  .li-toc__item {
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 16px 16px;
  }
}

.li-toc__item:hover {
  background: var(--paper, #f5f3ef);
}

.li-toc__num {
  font-family: "Inter", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--red, #e11932);
  padding-top: 2px;
}

.li-toc__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.li-toc__title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink, #141414);
  margin: 0;
}

.li-toc__pages {
  font-size: 12px;
  font-weight: 500;
  color: rgba(20, 20, 20, .55);
  letter-spacing: .02em;
}


/* ---- Quote / excerpt ---- */
.li-section--quote {
  background: var(--paper, #f5f3ef);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 3px solid var(--red, #e11932);
}

@media (max-width: 600px) {
  .li-section--quote { padding: 28px 22px; }
}

@media (max-width: 379.98px) {
  .li-section--quote { padding: 22px 18px; }
}

.li-section--quote .li-section__title {
  display: none;
}

.li-quote__eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red, #e11932);
}

.li-quote__text {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -.005em;
  color: var(--ink, #141414);
  margin: 0;
  font-style: italic;
}

.li-quote__source {
  font-size: 13px;
  font-weight: 500;
  color: rgba(20, 20, 20, .6);
}


/* ---- Used in courses ---- */
.li-courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: rgba(20, 20, 20, .08);
  border: 1px solid rgba(20, 20, 20, .08);
  margin-top: 4px;
}

.li-course {
  background: var(--white, #fff);
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: background var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1));
}

.li-course:hover {
  background: var(--paper, #f5f3ef);
}

.li-course__pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink, #141414);
  background: var(--paper, #f5f3ef);
  border: 1px solid rgba(20, 20, 20, .12);
  border-radius: 999px;
}

.li-course:hover .li-course__pill {
  background: var(--white, #fff);
}

.li-course__pill--required {
  background: var(--red, #e11932);
  color: var(--white, #fff);
  border-color: var(--red, #e11932);
}

.li-course:hover .li-course__pill--required {
  background: var(--red, #e11932);
  color: var(--white, #fff);
}

.li-course__title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink, #141414);
  margin: 4px 0 0;
}

.li-course__meta {
  font-size: 12px;
  font-weight: 500;
  color: rgba(20, 20, 20, .58);
  margin-top: auto;
  padding-top: 6px;
}


/* ============ STICKY ASIDE ============ */
.li-aside {
  position: sticky;
  top: calc(var(--header-h, 72px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 980px) {
  .li-aside {
    position: static;
    top: auto;
  }
}

.li-aside__card {
  background: var(--paper, #f5f3ef);
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.li-aside__card--actions {
  background: var(--ink, #141414);
  color: var(--white, #fff);
}

.li-aside__card--available { }

.li-aside__btn {
  width: 100%;
  justify-content: center;
}

.li-aside__btn-ghost {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--white, #fff);
  border: 1px solid rgba(255, 255, 255, .25);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  text-decoration: none;
  transition: border-color var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1)),
              background var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1));
}

.li-aside__btn-ghost:hover {
  border-color: var(--white, #fff);
  background: rgba(255, 255, 255, .06);
}

.li-aside__btn-ghost svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.li-aside__eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(20, 20, 20, .55);
}

.li-aside__card--actions .li-aside__eyebrow {
  color: rgba(255, 255, 255, .6);
}

.li-aside__facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.li-aside__facts li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(20, 20, 20, .08);
  font-size: 13px;
  align-items: baseline;
}

@media (max-width: 379.98px) {
  .li-aside__facts li {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 0;
  }
}

.li-aside__facts li:last-child { border-bottom: 0; }

.li-aside__fact-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(20, 20, 20, .55);
}

.li-aside__fact-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #141414);
  line-height: 1.4;
}


/* ---- Availability widget ---- */
.li-aside__avail {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 2px;
}

.li-aside__avail-num {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--red, #e11932);
}

.li-aside__avail-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(20, 20, 20, .75);
}

.li-aside__avail-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(20, 20, 20, .55);
  padding-top: 8px;
  border-top: 1px solid rgba(20, 20, 20, .08);
  margin-top: 4px;
}

.li-aside__avail-hint svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}


/* ============ RELATED ITEMS ============ */
.li-related {
  background: var(--paper, #f5f3ef);
  padding: 80px 0 96px;
  border-top: 1px solid rgba(20, 20, 20, .06);
}

@media (max-width: 767.98px) {
  .li-related { padding: 56px 0 64px; }
}

@media (max-width: 479.98px) {
  .li-related { padding: 40px 0 48px; }
}

.li-related__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 32px;
}

.li-related__eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red, #e11932);
}

.li-related__title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink, #141414);
  margin: 0;
}

.li-related__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(20, 20, 20, .08);
  border: 1px solid rgba(20, 20, 20, .08);
}

@media (max-width: 980px) {
  .li-related__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .li-related__grid { grid-template-columns: 1fr; }
}

.li-related-card {
  background: var(--white, #fff);
  padding: 24px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-height: 180px;
  transition: background var(--dur, .25s) var(--ease, cubic-bezier(.22,.61,.36,1));
}

.li-related-card:hover {
  background: var(--paper, #f5f3ef);
}

.li-related-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.li-related-card__type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink, #141414);
  background: var(--paper, #f5f3ef);
  border: 1px solid rgba(20, 20, 20, .12);
  border-radius: 999px;
}

.li-related-card:hover .li-related-card__type {
  background: var(--white, #fff);
}

.li-related-card__year {
  font-family: "Inter", monospace;
  font-size: 12px;
  font-weight: 600;
  color: rgba(20, 20, 20, .55);
  letter-spacing: .02em;
}

.li-related-card__title {
  font-family: "Inter", "Noto Sans Georgian", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink, #141414);
  margin: 4px 0 0;
}

.li-related-card__author {
  font-size: 12px;
  font-weight: 500;
  color: rgba(20, 20, 20, .58);
  margin: auto 0 0;
  padding-top: 6px;
}

.li-related__foot {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
