@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/PlayfairDisplay-SemiBold-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/PlayfairDisplay-SemiBold-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/CormorantGaramond-homepage.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/NotoNaskhArabic-homepage.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/NotoNaskhArabic-homepage.woff2") format("woff2");
}

@font-face {
  font-family: "ZCOOL XiaoWei";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ZCOOLXiaoWei-homepage.woff2") format("woff2");
}

@font-face {
  font-family: "ZCOOL XiaoWei";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ZCOOLXiaoWei-homepage.woff2") format("woff2");
}

/* Root tokens */
:root {
  --font-family-base: system-ui, -apple-system, Arial, sans-serif;
  --font-family-brand: "Playfair Display", "Times New Roman", serif;
  --hero-heading-font-weight: 600;
  --hero-heading-text-transform: uppercase;
  --hero-heading-letter-spacing: 0.012em;
  --color-accent: #b35400;
  --color-accent-dark: #8a3600;
  --color-surface: #fff;
  --color-surface-muted: #f9fafb;
  --color-surface-alt: #f8fafc;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #6b7280;
  --color-text-strong: #1f2937;
  --color-border: #e5e7eb;
  --color-border-subtle: #e2e8f0;
  --color-border-muted: #f0f0f0;
  --color-tooltip-bg: #111827;
  --shadow-soft: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Base elements */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--color-surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.nav-menu-open {
  overflow: hidden;
}

html[lang="es"],
html[lang="pl"] {
  --font-family-brand: "Playfair Display", "Times New Roman", serif;
}

html[lang="zh"] {
  --font-family-brand: "ZCOOL XiaoWei", "Songti SC", "STSong", "SimSun", serif;
  --hero-heading-font-weight: 500;
  --hero-heading-text-transform: none;
  --hero-heading-letter-spacing: 0;
}

html[lang="ar"] {
  --font-family-brand: "Noto Naskh Arabic", "Amiri", "Scheherazade New", serif;
  --hero-heading-text-transform: none;
  --hero-heading-letter-spacing: 0;
}

p {
  margin-bottom: 1em;
}

h1 {
  font-size: 35px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-family-brand);
  font-weight: var(--hero-heading-font-weight, 600);
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1;
  color: #1f2a37;
  text-transform: var(--hero-heading-text-transform, uppercase);
  letter-spacing: var(--hero-heading-letter-spacing, 0.012em);
  line-height: 1.1;
  margin-bottom: 0.6rem;
  font-size: clamp(28px, 4.2vw, 48px);
}

.hero .intro {
  max-width: 62ch;
  line-height: 1.55;
}

.hero .intro p + p {
  margin-top: 0.5rem;
}

html[lang="zh"] .hero h1,
html[lang="ar"] .hero h1 {
  font-synthesis: none;
}

@media (min-width: 1200px) {
  .hero h1 {
    font-size: 44px;
  }
}

.highlight-yellow {
  background: 0 0;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.2em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--color-surface);
  padding: 0 20px 20px;
  max-width: 800px;
  margin: auto;
  text-align: center;
  box-shadow: none;
  border: none;
}

footer {
  background-color: var(--color-surface);
  text-align: center;
  padding: 32px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  width: 100%;
  margin-top: auto;
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

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

footer a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
}

footer p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-newsletter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  justify-content: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle);
}

.footer-newsletter__label {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-right: 4px;
}

.footer-newsletter input[type="email"] {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  min-width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--color-surface);
}

.footer-newsletter input[type="email"]:hover {
  border-color: var(--color-accent);
}

.footer-newsletter input[type="email"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(179, 84, 0, 0.1);
}

.footer-newsletter button {
  border: none;
  border-radius: 6px;
  background-color: var(--color-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.footer-newsletter button:hover {
  background-color: var(--color-accent-dark);
  box-shadow: 0 2px 8px rgba(179, 84, 0, 0.2);
}

.footer-newsletter button:focus-visible {
  background-color: var(--color-accent-dark);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.footer-newsletter button:active {
  transform: translateY(1px);
}

.footer-newsletter button:disabled {
  background-color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.newsletter-success {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 4px;
}

.newsletter-success__message {
  color: #166534;
  font-size: 14px;
  font-weight: 500;
}

/* Newsletter Hero Section (Updates Page) */
.page-section--newsletter {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  padding: 32px 24px;
  margin-bottom: 32px;
}

.newsletter-hero {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.newsletter-hero__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.newsletter-hero__description {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.newsletter-hero__form {
  margin-bottom: 12px;
}

.newsletter-hero__form-group {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-hero__form-group input[type="email"] {
  flex: 1;
  border: 2px solid var(--color-border-muted);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: #ffffff;
}

.newsletter-hero__form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.newsletter-hero__form-group button {
  border: none;
  border-radius: 6px;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.newsletter-hero__form-group button:hover {
  background-color: var(--color-accent-dark);
}

.newsletter-hero__form-group button:active {
  transform: scale(0.98);
}

.newsletter-hero__form-group button:disabled {
  background-color: var(--color-text-muted);
  cursor: not-allowed;
}

.newsletter-hero__privacy {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

/* Responsive adjustments for newsletter hero */
@media (max-width: 768px) {
  .page-section--newsletter {
    padding: 24px 16px;
    margin-bottom: 24px;
  }

  .newsletter-hero__title {
    font-size: 22px;
  }

  .newsletter-hero__description {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .newsletter-hero__form-group {
    flex-direction: column;
    gap: 10px;
  }

  .newsletter-hero__form-group input[type="email"],
  .newsletter-hero__form-group button {
    width: 100%;
    box-sizing: border-box;
  }
}

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

a:hover {
  text-decoration: underline;
}

a.hidden {
  display: none;
}

table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

td,
th {
  padding: 10px;
  border: none;
  font-size: 16px;
}

.back-to-home-icon,
.pdf-icon {
  width: 19px;
  height: 19px;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
  top: -2px;
  pointer-events: none;
}

.back-to-home-icon {
  margin-left: 0;
  margin-right: 9px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--color-surface);
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 36px 10px 20px;
  font-size: 14px;
  font-family: var(--font-family-base);
  cursor: pointer;
  width: 180px;
  max-width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  line-height: 1.5;
  text-indent: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

select option {
  white-space: normal;
}

select:focus {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(246, 149, 32, 0.15);
}

select:hover {
  border-color: #a0aec0;
}

/* Header & navigation */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-surface);
}

.custom-header {
  border-bottom: 1px solid var(--color-border-muted);
  padding: 20px;
  justify-content: space-between;
  margin-bottom: 0;
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  flex-wrap: wrap;
  gap: 30px;
}

.custom-nav,
.header-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  height: 70px;
  width: 70px;
  aspect-ratio: 1 / 1;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.custom-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-family-base);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.language-selector {
  position: relative;
}

.language-selector__control {
  width: auto;
  min-width: 0;
  padding: 7px 36px 7px 40px;
  font-size: 13px;
  border-radius: 12px;
  border-color: var(--color-accent);
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  background-image: url("/globe-icon.svg");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 18px;
}

.language-selector__control:focus {
  border-color: var(--color-accent);
}

.language-selector__control:hover {
  border-color: var(--color-accent-dark);
}

html[dir="rtl"] .language-selector__control {
  padding: 7px 40px 7px 36px;
  background-position: right 14px center;
}

.custom-nav a {
  text-decoration: none;
  color: #000;
  font-size: 14px;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.custom-nav a.active,
.nav-menu a.active {
  color: var(--color-accent);
}

.custom-nav a:hover {
  text-decoration: underline;
}

.header-search-button {
  background-color: var(--color-accent);
  color: var(--color-surface) !important;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-search-button:hover {
  background-color: var(--color-accent-dark);
  text-decoration: none;
}

.header-search-button__icon {
  width: 20px;
  height: 20px;
  aspect-ratio: 1 / 1;
}

.header-search-button__label {
  line-height: 1;
}

.mobile-only header .navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  background-color: var(--color-surface);
}

.mobile-only .header-content {
  border-bottom: 1px solid var(--color-border-muted);
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 12px;
  flex-wrap: nowrap;
}

.mobile-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex: 1;
  justify-content: flex-end;
}

.mobile-only .header-logo {
  margin: 0;
}

.mobile-only .header-logo:first-child {
  margin-right: auto;
}

.mobile-only .header-search-button {
  margin: 0;
  padding: 6px 12px;
  font-size: 11px;
  gap: 6px;
}

.mobile-only .header-search-button__icon {
  width: 18px;
  height: 18px;
  aspect-ratio: 1 / 1;
}

.hamburger-menu {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  transition: all 0.3s ease-in-out;
  margin-left: 8px;
  width: auto;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 6px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  align-items: center;
}

.hamburger-menu:focus-visible,
.hamburger-menu:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.hamburger-menu:hover {
  background-color: transparent;
}

.bar {
  width: 24px;
  height: 2px;
  margin: 3px auto;
  transition: all 0.3s ease-in-out;
  background-color: #101010;
}

.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .bar:first-child {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  position: fixed;
  top: -100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
  height: 100%;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  padding: 0.2rem;
  opacity: 0;
}

.nav-menu.active {
  top: 0;
  opacity: 1;
}

.nav-menu ul {
  list-style: none;
  padding: 0.5rem;
  margin-top: 4rem;
}

.nav-menu ul li {
  margin: 0.8rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.nav-menu.active ul li {
  opacity: 1;
  transform: translateY(0);
}

.nav-menu ul li:first-child {
  transition-delay: 0.1s;
}

.nav-menu ul li:nth-child(2) {
  transition-delay: 0.2s;
}

.nav-menu ul li:nth-child(3) {
  transition-delay: 0.3s;
}

.nav-menu ul li:nth-child(4) {
  transition-delay: 0.4s;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-size: 1.8rem;
  padding: 0 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 600;
}

.nav-menu a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transform: translateX(5px);
}

@media (hover:hover) and (pointer:fine) {
  .hamburger-menu:hover {
    background-color: transparent;
  }
}

@media (hover:none) and (pointer:coarse) {
  .hamburger-menu:hover {
    background-color: transparent;
  }

  .nav-menu a:hover {
    background-color: transparent;
  }
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* Primary actions */
#download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-family: var(--font-family-base);
  padding: 10px 16px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background-color: var(--color-surface);
  box-sizing: border-box;
  min-height: 44px;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.homepage-downloads .download-link {
  font-size: 14px;
  min-width: 180px;
  justify-content: center;
}

.homepage-downloads .download-link:not(.disabled):hover {
  border-color: #cbd5f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

#download-link.download-link-active,
.download-link.download-link-active {
  background-color: var(--color-accent);
  border-radius: 6px;
  border-color: var(--color-accent);
  color: var(--color-surface);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

#download-link.disabled,
.download-link.disabled {
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
  border-color: var(--color-border-subtle);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

#download-link.disabled .pdf-icon,
.download-link.disabled .pdf-icon {
  filter: grayscale(1);
  opacity: 0.6;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.download-link:hover {
  text-decoration: underline;
}

.download-link i {
  font-size: 14px;
}

/* Search & catalog */
.search-content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  display: flex;
  align-items: center;
}

#catalog-search {
  width: 100%;
  padding: 12px 40px 12px 15px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

#catalog-search:focus {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: 0 0 5px rgba(246, 149, 32, 0.3);
}

.search-icon {
  position: absolute;
  right: 15px;
  color: #666;
  pointer-events: none;
}

.search-container:hover #catalog-search {
  border-color: #bbb;
}

.catalog-card {
  border: 1px solid var(--color-border-muted);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.catalog-card h3 {
  margin-top: 10px;
}

.catalog-card p {
  margin-bottom: 10px;
}

.catalog-card--lazy {
  min-height: 140px;
}

.card-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: cardSkeletonPulse 1.6s ease-in-out infinite;
}

.card-skeleton__title,
.card-skeleton__line,
.card-skeleton__pill {
  border-radius: 999px;
  background-color: var(--color-border-muted);
  height: 14px;
}

.card-skeleton__title {
  width: 70%;
  height: 20px;
}

.card-skeleton__line {
  width: 100%;
}

.card-skeleton__line--short {
  width: 55%;
}

.card-skeleton__pill {
  width: 90px;
  height: 16px;
}

@keyframes cardSkeletonPulse {
  0% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-skeleton {
    animation: none;
  }
}

.card-title-link {
  color: var(--color-accent);
  text-decoration: none;
}

.card-title-link:focus,
.card-title-link:hover {
  text-decoration: underline;
}

.link-with-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-weight: 600;
  color: var(--color-accent);
}

.card-detail-link::after,
.link-with-arrow::after {
  content: '\2192';
  font-size: 16px;
  transition: transform 0.2s ease;
}

.card-detail-link:hover::after,
.link-with-arrow:not(.disabled):hover::after {
  transform: translateX(3px);
}

html[dir="rtl"] .card-detail-link::after,
html[dir="rtl"] .link-with-arrow::after {
  content: '\2190';
}

html[dir="rtl"] .card-detail-link:hover::after,
html[dir="rtl"] .link-with-arrow:not(.disabled):hover::after {
  transform: translateX(-3px);
}

/* Book & content blocks */
.book-container {
  justify-content: flex-start;
  text-align: left;
  gap: 24px;
  padding-top: 40px;
}

.textbook-detail-page .book-container,
.static-page .book-container {
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--color-text-strong);
}

.textbook-detail-page .book-container h1,
.static-page .book-container h1 {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.textbook-panel {
  border-top: 1px solid var(--color-border);
  padding-top: 22px;
  margin-bottom: 12px;
}

.textbook-panel--about {
  margin-top: -28px;
}

.textbook-panel-title,
.language-availability__title {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.textbook-panel-body {
  color: var(--color-text-secondary);
  font-size: 15px;
}

.textbook-panel-body p {
  margin: 0 0 1rem;
}

.textbook-panel-body p:last-child {
  margin-bottom: 0;
}

.textbook-panel ol,
.textbook-panel ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
}

.textbook-panel li {
  margin-bottom: 10px;
  line-height: 1.7;
}

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

.textbook-panel a:hover {
  text-decoration: underline;
}

.page-section {
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  margin-bottom: 32px;
}

.page-section--intro {
  margin-top: -8px;
}

.page-section-title {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.page-section-body {
  color: var(--color-text-secondary);
  font-size: 15px;
}

.page-section-body p {
  margin: 0 0 1rem;
}

.page-section-body p:last-child {
  margin-bottom: 0;
}

.page-section ol,
.page-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
}

.page-section li {
  margin-bottom: 10px;
  line-height: 1.7;
}

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

.page-section a:hover {
  text-decoration: underline;
}

.no-match-message {
  color: #b91c1c;
  font-weight: 600;
}

.textbook-specs {
  border-top: 1px solid var(--color-border);
  padding: 25px 0;
}

.textbook-specs-table {
  width: 100%;
  border-collapse: collapse;
}

.textbook-specs-table td,
.textbook-specs-table th {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.textbook-specs-table th {
  width: 32%;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-tooltip-bg);
}

.textbook-specs-table td {
  font-size: 15px;
  color: var(--color-text-strong);
}

.textbook-specs-table tr:last-child td,
.textbook-specs-table tr:last-child th {
  border-bottom: none;
}

.textbook-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-surface) !important;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  gap: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.textbook-download:hover {
  background-color: var(--color-accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

.license-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  position: relative;
}

.license-tooltip__trigger {
  background: 0 0;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
}

.license-tooltip__trigger:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.license-tooltip__icon {
  width: 26px;
  height: 26px;
}

.license-tooltip__content {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, -4px);
  background-color: var(--color-tooltip-bg);
  color: var(--color-surface);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  width: 280px;
  max-width: 80vw;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.license-tooltip__content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-width: 8px;
  border-style: solid;
  border-color: var(--color-tooltip-bg) transparent transparent transparent;
}

.license-tooltip:focus-within .license-tooltip__content,
.license-tooltip:hover .license-tooltip__content {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -12px);
  pointer-events: auto;
}

.license-tooltip__content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.license-tooltip__content a:hover {
  color: var(--color-accent-dark);
}

.language-dropdown {
  align-self: flex-end;
  margin-bottom: 28px;
  position: relative;
  z-index: 5;
}

.language-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 12px 22px;
  cursor: pointer;
  font: inherit;
  color: var(--color-text-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.language-dropdown__book-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}

.language-dropdown__book-icon svg {
  display: block;
}

.language-dropdown__toggle:hover,
.language-dropdown.is-open .language-dropdown__toggle {
  border-color: var(--color-text-muted);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.15);
}

.language-dropdown__toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.language-dropdown__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.language-dropdown__eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.language-dropdown__value {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-strong);
}

.language-dropdown__icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  margin-inline-start: auto;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.language-dropdown.is-open .language-dropdown__icon {
  transform: rotate(-135deg);
  border-color: var(--color-text-strong);
}

.language-dropdown__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 18px 20px;
  width: 280px;
  max-width: min(92vw, 320px);
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.18);
}

.language-dropdown__menu-title {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.language-dropdown__menu-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.language-dropdown__menu-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-dropdown__link {
  flex: 1;
  color: var(--color-text-strong);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.language-dropdown__link:hover {
  color: var(--color-accent);
}

.language-dropdown__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.language-dropdown__link--current {
  color: var(--color-text-muted);
  cursor: default;
}

.language-dropdown__current-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 2px 10px;
}

html[dir="rtl"] .language-dropdown__menu {
  right: auto;
  left: 0;
}

@media (max-width: 640px) {
  .language-dropdown {
    align-self: stretch;
    width: 100%;
  }

  .language-dropdown__toggle {
    width: 100%;
  }

  .language-dropdown__menu {
    position: static;
    width: 100%;
    margin-top: 12px;
  }
}

.language-availability {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.language-availability__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.language-availability__list li {
  font-size: 15px;
}

.language-availability__list a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.language-availability__list a:focus,
.language-availability__list a:hover {
  text-decoration: underline;
}

:is(.homepage, .search-page, .about-page, .updates-page, .terms-page, .privacy-page) .book-container h1,
:is(.homepage, .search-page, .about-page, .updates-page, .terms-page, .privacy-page) .textbook-panel-title,
:is(.homepage, .search-page, .about-page, .updates-page, .terms-page, .privacy-page) .page-section-title {
  text-align: center;
}

/* Homepage */
.homepage .book-container h1 {
  margin-top: 14px;
  margin-bottom: 14px;
}

.homepage .book-container p {
  margin-bottom: 14px;
  text-align: center;
}

.homepage .book-container p:last-of-type {
  margin-bottom: 8px;
}

.homepage .book-container {
  text-align: center;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.homepage-intro {
  max-width: 680px;
  margin: 0 auto 0;
  display: flex;
  flex-direction: column;
}

.homepage-intro p {
  margin: 0;
}

.homepage-intro p:last-of-type {
  margin-bottom: 0;
}

.homepage-downloads {
  max-width: 760px;
  margin: 0 auto 32px;
}

.homepage-downloads table {
  margin: 0 auto;
}

.homepage-downloads td,
.homepage-downloads th {
  text-align: center;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
}

/* Book highlight & extras */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-accent);
}

.book-tagline {
  font-size: 18px;
  color: #374151;
  margin-top: -10px;
}

.book-highlight {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--color-border-muted);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  background-color: var(--color-surface);
}

.book-meta {
  display: grid;
  gap: 8px;
  font-size: 16px;
  color: var(--color-text-strong);
}

.primary-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background-color: var(--color-accent);
  color: var(--color-surface);
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
}

.primary-download:hover {
  text-decoration: none;
  background-color: var(--color-accent-dark);
}

.book-section {
  text-align: left;
}

.book-section h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.book-section p {
  color: #374151;
}

.contents-list,
.format-list {
  list-style: disc;
  padding-left: 20px;
  text-align: left;
  color: #374151;
}

.contents-list li,
.format-list li {
  margin-bottom: 8px;
}

.back-to-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .book-highlight {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .book-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Filters & tables */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.search-page .filter-tags {
  justify-content: flex-start;
  margin-left: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #333;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.3s ease;
  user-select: none;
}

.tag:hover {
  background-color: #fde0c4;
}

.tag.active {
  background: var(--color-accent);
  color: var(--color-surface);
  border-color: var(--color-accent);
}

.tag-close {
  font-size: 16px;
  margin-left: 8px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  display: none;
}

.tag.active .tag-close {
  display: inline;
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  color: #1e293b;
}

.filter-group select {
  padding: 0.5rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  background-color: var(--color-surface);
  min-width: 200px;
  font-size: 0.9rem;
}

.filter-group select:focus {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(246, 149, 32, 0.1);
}

.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  background: var(--color-surface);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#catalog-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

#catalog-table td,
#catalog-table th {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

#catalog-table th {
  background-color: var(--color-surface-alt);
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
}

#catalog-table tr:hover {
  background-color: var(--color-surface-alt);
}

#catalog-table td {
  color: #334155;
}

/* FAQ & stats */
.faq-list {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 18px;
  text-align: left;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.faq-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-question.collapsible::after {
  content: '+';
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.faq-question.collapsible.active::after {
  content: '−';
  color: var(--color-text-secondary);
}

.faq-answer {
  display: none;
  padding-top: 12px;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.stat {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem 1.75rem;
  min-width: 140px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.stat h3 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat .counter {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-accent);
  display: inline-block;
  min-width: 2ch;
}

.stat p {
  margin: 0;
  line-height: 1.3;
}

.stat span {
  margin: 0 0.25rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.stat small {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Utilities */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: none;
  background: var(--color-accent);
  color: var(--color-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 8px, 0);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--color-tooltip-bg);
  outline-offset: 3px;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateZ(0);
}

.back-to-top .fa-arrow-up {
  font-size: 1rem;
}

/* Breakpoints */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .filter-container {
    flex-direction: column;
  }

  .filter-group select {
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  body {
    display: block;
  }

  .header-logo {
    position: relative;
  }

  .logo {
    height: 45px;
    width: 45px;
  }

  .header-search-button {
    font-size: 11.5px;
  }

  .language-selector__control {
    font-size: 12px;
    padding: 6px 32px 6px 36px;
    background-size: 16px;
    background-position: left 12px center;
  }

  html[dir="rtl"] .language-selector__control {
    padding: 6px 36px 6px 32px;
    background-position: right 12px center;
  }

  .mobile-right > * {
    flex-shrink: 0;
  }

  .container {
    justify-content: flex-start;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .download-section table,
  .download-section tbody,
  .download-section td,
  .download-section th,
  .download-section thead,
  .download-section tr {
    display: block;
  }

  .download-section thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .download-section td {
    border: none;
    position: relative;
    padding-left: 40%;
    padding-right: 10px;
    box-sizing: border-box;
    min-height: 44px;
    display: flex;
    align-items: center;
    word-break: break-word;
  }

  .download-section td:before {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    width: auto;
    font-weight: 500;
  }

  .download-section td select {
    width: 100%;
  }

  .download-section tr {
    margin-bottom: 15px;
  }

  .download-section td:first-of-type:before {
    content: "Language";
  }

  .download-section td:nth-of-type(2):before {
    content: "Learner Age";
  }

  .download-section td:nth-of-type(3):before {
    content: "Subject";
  }

  .download-section td:nth-of-type(4):before {
    content: "Download";
  }

  .homepage-downloads {
    margin: 0 0 40px;
    width: 100%;
  }

  .homepage-downloads table {
    width: 100%;
  }

  .homepage-downloads tr {
    margin-bottom: 24px;
  }

  .homepage-downloads td {
    padding-left: 0;
    padding-right: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: auto;
  }

  .homepage-downloads td:before {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
  }

  .homepage-downloads td a,
  .homepage-downloads td select {
    width: 100%;
  }

  .table-container {
    margin: 10px -20px;
    border-radius: 0;
  }

  #catalog-table {
    display: block;
  }

  #catalog-table thead {
    display: none;
  }

  #catalog-table tbody {
    display: block;
  }

  #catalog-table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    background: var(--color-surface);
  }

  #catalog-table td {
    display: block;
    text-align: right;
    padding: 8px 15px;
    border: none;
    position: relative;
  }

  #catalog-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #1e293b;
  }

  #catalog-table td:not(:last-child) {
    border-bottom: 1px solid var(--color-border-subtle);
  }
}

@media screen and (max-width: 480px) {
  .mobile-only .header-content {
    gap: 8px;
  }

  .mobile-right {
    gap: 8px;
  }

  .mobile-only .language-selector__control {
    font-size: 11px;
    padding: 5px 26px 5px 32px;
    background-size: 14px;
    background-position: left 10px center;
  }

  html[dir="rtl"] .mobile-only .language-selector__control {
    padding: 5px 32px 5px 26px;
    background-position: right 10px center;
  }
}

@media (max-width: 640px) {
  footer {
    padding: 32px 0 24px;
  }

  footer .footer-content {
    gap: 20px;
  }

  .footer-newsletter {
    width: 100%;
    max-width: 100%;
    padding: 16px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-sizing: border-box;
  }

  .footer-newsletter__label {
    text-align: center;
    margin-right: 0;
  }

  .footer-newsletter input[type="email"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-newsletter button {
    width: 100%;
    box-sizing: border-box;
  }

  .textbook-detail-page .book-container,
  .static-page .book-container {
    font-size: 14px;
    line-height: 1.65;
    padding-top: 32px;
  }

  .textbook-detail-page .book-container h1,
  .static-page .book-container h1 {
    font-size: 26px;
    letter-spacing: 0.025em;
    margin-bottom: 24px;
  }

  .textbook-panel {
    padding-top: 20px;
    margin-bottom: 24px;
  }

  .textbook-panel-title,
  .page-section-title {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .textbook-panel-body,
  .page-section-body {
    font-size: 14px;
  }

  .page-section {
    padding-top: 20px;
    margin-bottom: 24px;
  }

  .textbook-specs {
    padding: 12px 0;
  }

  .textbook-specs-table td,
  .textbook-specs-table th {
    padding: 10px 0;
  }

  .textbook-specs-table th {
    width: 38%;
    font-size: 11px;
    letter-spacing: 0.12em;
    padding-right: 12px;
  }

  .textbook-specs-table td {
    font-size: 14px;
  }

  .textbook-download {
    margin-top: 0;
  }
}
