@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/Inter-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/Inter-600.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/Inter-700.ttf') format('truetype');
}

@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/NotoNaskh-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/NotoNaskh-600.ttf') format('truetype');
}

:root {
  --color-brand-green: #1b7f57;
  --color-brand-blue: #1f3e5a;
  --color-brand-gold: #c1a35c;
  --color-bg: #f7f7f5;
  --color-bg-alt: #eef1f3;
  --color-surface: #ffffff;
  --color-text: #2c2c2c;
  --color-text-muted: #5b5b5b;
  --color-border: #e0e0e0;
  --shadow-soft: 0 18px 40px rgba(31, 62, 90, 0.12);
  --shadow-card: 0 12px 32px rgba(27, 127, 87, 0.1);
  --font-latin: 'Inter', 'Nunito Sans', 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-arabic: 'Noto Naskh Arabic', 'Amiri', serif;
  --container: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  text-rendering: optimizeLegibility;
}

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

a:hover,
a:focus {
  color: var(--color-brand-blue);
  text-decoration: underline;
  text-decoration-color: var(--color-brand-gold);
  text-decoration-thickness: 2px;
}

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

picture img {
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.page-wrapper {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.section-alt {
  background: var(--color-bg-alt);
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 0.6s ease forwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  width: 0;
  background: var(--color-brand-green);
  z-index: 1000;
  transition: width 0.2s ease-out;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(31, 62, 90, 0.08);
}

.site-header .nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-brand-blue);
}

.brand img {
  width: 44px;
  height: 44px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-brand-blue);
  position: relative;
  transition: transform 0.2s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -7px;
}

.nav-toggle span::after {
  top: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.nav-links a {
  font-weight: 500;
  color: var(--color-text);
  padding: 0.35rem 0.2rem;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--color-brand-blue);
  border-bottom-color: var(--color-brand-gold);
}

.nav-group {
  position: relative;
}

.nav-group > button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.nav-group > button::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text);
  border-bottom: 2px solid var(--color-text);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-group > button[aria-expanded='true']::after {
  transform: rotate(-135deg) translateY(2px);
  border-color: var(--color-brand-blue);
}

.nav-panel {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 0;
  min-width: 540px;
  background: #ffffff;
  padding: 1.6rem 2rem;
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(31, 62, 90, 0.18);
  display: none;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.nav-panel.is-open {
  display: grid;
}

.nav-panel h3 {
  margin: 0 0 0.65rem;
  color: var(--color-brand-blue);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.nav-panel a {
  color: var(--color-text);
  font-weight: 600;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  background: var(--color-brand-green);
  color: #ffffff;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(27, 127, 87, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(27, 127, 87, 0.28);
  background: #166646;
}

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4.8rem 1.5rem 3.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: center;
  background: linear-gradient(180deg, #f7f7f5 0%, #eef1f3 100%);
}

.hero h1 {
  font-size: clamp(2.4rem, 3.8vw, 3.2rem);
  line-height: 1.15;
  color: var(--color-brand-blue);
  margin: 0 0 1.1rem;
  font-weight: 700;
}

.hero p {
  margin: 0 0 1.4rem;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.section-divider {
  width: 120px;
  height: 2px;
  background: var(--color-brand-gold);
  margin: 0 auto 2.5rem;
}

.page-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.page-section h2 {
  color: var(--color-brand-blue);
  font-size: 2.2rem;
  margin-bottom: 0.9rem;
  font-weight: 700;
}

.page-section p {
  margin: 0 auto 2rem;
  max-width: 760px;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.link-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.link-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid rgba(31, 62, 90, 0.06);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.2rem;
  border-radius: 16px;
  font-weight: 600;
  color: var(--color-brand-blue);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-grid a:hover,
.link-grid a:focus {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(31, 62, 90, 0.14);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
  margin-top: 2.5rem;
}

.catalog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 1.9rem 1.8rem;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.catalog-card:hover,
.catalog-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(27, 127, 87, 0.14);
}

.catalog-card h3 {
  margin-top: 0;
  color: var(--color-brand-blue);
  font-size: 1.35rem;
}

.catalog-card p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.catalog-list a {
  color: var(--color-text);
  font-weight: 600;
}

.cta-band {
  max-width: 880px;
  margin: 4rem auto 0;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(27, 127, 87, 0.08), rgba(193, 163, 92, 0.12));
  border-radius: 28px;
  text-align: center;
  box-shadow: 0 20px 44px rgba(31, 62, 90, 0.16);
}

.cta-band h2 {
  color: var(--color-brand-blue);
  margin-top: 0;
  font-size: 2.15rem;
}

.cta-band p {
  color: var(--color-text);
  font-size: 1.05rem;
  margin-bottom: 1.8rem;
}

.site-footer {
  background: var(--color-brand-blue);
  color: rgba(247, 247, 245, 0.94);
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(193, 163, 92, 0.12), transparent 60%), radial-gradient(circle at 80% 80%, rgba(27, 127, 87, 0.12), transparent 55%);
  opacity: 0.85;
  pointer-events: none;
}

.site-footer .footer-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: inherit;
  font-weight: 500;
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--color-brand-gold);
}

.table-wrapper {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(31, 62, 90, 0.12);
}

table.ejemplos {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.98rem;
}

table.ejemplos thead {
  background: var(--color-bg-alt);
  color: var(--color-brand-blue);
}

table.ejemplos th,
table.ejemplos td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(31, 62, 90, 0.08);
  text-align: left;
}

table.ejemplos tbody tr:nth-child(every) {
  background: #fafafa;
}

table.ejemplos td[lang='ar'] {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  text-align: right;
}

.article-layout {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.article-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: center;
  background: linear-gradient(180deg, #f7f7f5 0%, #eef1f3 100%);
}

.article-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.3rem, 4vw, 3rem);
  color: var(--color-brand-blue);
}

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
}

.article-content {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 2.8rem 2.2rem;
  box-shadow: var(--shadow-soft);
}

.article-content h2 {
  color: var(--color-brand-blue);
  font-size: 1.9rem;
  margin-top: 2.8rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  color: var(--color-brand-blue);
  margin-top: 2rem;
  font-size: 1.4rem;
}

.article-content p {
  color: var(--color-text);
  margin-bottom: 1.1rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.4rem;
  color: var(--color-text);
}

.article-content blockquote {
  margin: 1.8rem 0;
  padding: 1.2rem 1.6rem;
  border-left: 4px solid var(--color-brand-gold);
  background: rgba(27, 127, 87, 0.06);
  font-style: italic;
  color: var(--color-brand-blue);
}

.article-errors,
.article-faq {
  background: var(--color-bg-alt);
  border-radius: 18px;
  padding: 2rem;
  margin: 2.5rem 0;
  box-shadow: 0 12px 28px rgba(31, 62, 90, 0.1);
}

.article-errors h2,
.article-faq h2 {
  margin-top: 0;
}

.article-errors li {
  margin-bottom: 0.6rem;
}

.faq-list {
  margin: 0;
  padding: 0;
}

.faq-list dt {
  font-weight: 600;
  color: var(--color-brand-blue);
  margin-top: 1.2rem;
}

.faq-list dd {
  margin: 0.4rem 0 0;
  color: var(--color-text);
}

.article-cta {
  text-align: center;
  margin: 3rem 0 1rem;
}

.article-cta p {
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
  color: var(--color-text-muted);
}

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

.blog-controls {
  max-width: var(--container);
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.blog-controls .search-field {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 62, 90, 0.12);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  font-size: 1rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.filter-chips button {
  border: 1px solid rgba(27, 127, 87, 0.24);
  background: #ffffff;
  color: var(--color-text);
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-chips button.is-active,
.filter-chips button:hover,
.filter-chips button:focus {
  border-color: var(--color-brand-green);
  background: rgba(27, 127, 87, 0.12);
  color: var(--color-brand-blue);
}

.blog-count {
  max-width: var(--container);
  margin: 0 auto 1.6rem;
  padding: 0 1.5rem;
  color: var(--color-text-muted);
}

.blog-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
}

.blog-card {
  background: var(--color-surface);
  border-radius: 18px;
  border: 1px solid rgba(31, 62, 90, 0.08);
  padding: 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover,
.blog-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(31, 62, 90, 0.16);
}

.blog-card h3 {
  margin: 0;
  color: var(--color-brand-blue);
  font-size: 1.35rem;
}

.blog-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

.blog-card .chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
}

.blog-card .chip-list span {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(31, 62, 90, 0.08);
  color: var(--color-brand-blue);
  font-weight: 600;
  font-size: 0.85rem;
}

.blog-card a:last-child {
  margin-top: auto;
  color: var(--color-brand-green);
  font-weight: 600;
}

.blog-empty {
  max-width: 600px;
  margin: 0 auto 3rem;
  text-align: center;
  color: var(--color-text-muted);
  padding: 2.4rem 1.8rem;
  background: rgba(31, 62, 90, 0.06);
  border-radius: 20px;
  border: 1px solid rgba(31, 62, 90, 0.08);
  box-shadow: inset 0 0 0 1px rgba(31, 62, 90, 0.08);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 2.5rem 0 0;
}

.pagination button {
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(31, 62, 90, 0.15);
  background: #ffffff;
  color: var(--color-text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination button.is-active,
.pagination button:hover,
.pagination button:focus {
  background: var(--color-brand-green);
  border-color: var(--color-brand-green);
  color: #ffffff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: rgba(193, 163, 92, 0.12);
  border-radius: 999px;
  color: var(--color-brand-blue);
  font-weight: 600;
  font-size: 0.85rem;
}

.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;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    right: 16px;
    background: #ffffff;
    border-radius: 18px;
    padding: 1.4rem 1.6rem;
    box-shadow: 0 24px 48px rgba(31, 62, 90, 0.18);
    width: min(320px, calc(100vw - 32px));
    flex-direction: column;
    align-items: flex-start;
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a,
  .nav-group > button {
    width: 100%;
    justify-content: space-between;
  }

  .nav-panel {
    position: static;
    min-width: unset;
    width: 100%;
    margin-top: 0.8rem;
    padding: 1rem 1.3rem;
    box-shadow: none;
    border: 1px solid rgba(31, 62, 90, 0.1);
    border-radius: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 3.6rem 1.25rem;
  }

  .page-section {
    padding: 3.6rem 1.25rem;
  }

  .blog-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .cta-band {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

@media (max-width: 600px) {
  #scroll-progress {
    height: 3px;
  }

  .site-header .nav-inner {
    padding: 0.8rem 1.1rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .btn-primary {
    width: 100%;
  }

  .article-content {
    padding: 2rem 1.4rem;
  }
}
