/* =========================
   FORestore MOOC homepage
========================= */

:root {
  --gold: #94721c;
  --gold-dark: #6f5412;
  --blue: #083b66;
  --menu: #4f5d6d;
  --text: #2b2b2b;
  --muted: #626f7d;
  --bg: #fafafa;
  --soft: #f5f1e8;
  --white: #ffffff;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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

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

a:hover,
a:focus {
  color: var(--gold-dark);
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--blue);
  color: var(--white);
  padding: 10px 14px;
  z-index: 20;
}

.skip-link:focus {
  left: 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #ececec;
  backdrop-filter: blur(8px);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand img {
  width: 116px;
  height: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--menu);
  font-weight: 600;
  font-size: 0.98rem;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--gold);
}

.main-nav .nav-cta {
  color: var(--gold);
  border: 1px solid rgba(148, 114, 28, 0.35);
  border-radius: 999px;
  padding: 9px 16px;
}

.main-nav .nav-cta:hover,
.main-nav .nav-cta:focus {
  background: var(--gold);
  color: var(--white);
}

/* Hero carousel */

.hero {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  background: var(--blue);
}

.carousel,
.carousel-track,
.slide {
  position: absolute;
  inset: 0;
}

.slide {
  opacity: 0;
  transition: opacity 700ms ease;
}

.slide.is-active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 59, 102, 0.86) 0%, rgba(8, 59, 102, 0.64) 42%, rgba(8, 59, 102, 0.12) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.04));
  z-index: 1;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  min-height: 680px;
  display: flex;
  align-items: center;
}

.hero-content {
  color: var(--white);
  padding: 88px 0;
}

.eyebrow,
.section-kicker {
  color: var(--gold);
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin: 0 0 14px;
}

.hero h1 {
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(3.4rem, 8vw, 7rem);
  line-height: 0.94;
  margin: 0;
  letter-spacing: -0.05em;
}

.subtitle {
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 2.05rem);
  font-weight: 700;
  margin: 18px 0 16px;
  max-width: 780px;
}

.hero-text {
  font-size: 1.12rem;
  max-width: 650px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 28px;
}

.hero-actions,
.cta-box {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 700;
  font-family: "Montserrat", Arial, sans-serif;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--gold-dark);
  color: var(--white);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--white);
  color: var(--gold);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--blue);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-btn:hover,
.carousel-btn:focus {
  background: var(--white);
  color: var(--gold);
}

.carousel-btn.prev {
  left: 22px;
}

.carousel-btn.next {
  right: 22px;
}

.carousel-dots {
  position: absolute;
  z-index: 3;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.dot {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.dot.is-active {
  background: var(--gold);
}

/* Sections */

.section {
  padding: 86px 0;
}

.section-light {
  background: var(--white);
}

.section-soft {
  background: var(--soft);
}

.content-grid,
.topics-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}

h2 {
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--blue);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 18px;
}

h3 {
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--blue);
  margin: 0 0 10px;
  font-size: 1.15rem;
}

p {
  margin-top: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 32px;
}

.card {
  background: var(--white);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  border-top: 4px solid var(--gold);
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.topic-list li {
  background: var(--white);
  border-radius: 14px;
  padding: 16px 18px 16px 48px;
  position: relative;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.topic-list li::before {
  content: "➜";
  position: absolute;
  left: 18px;
  color: var(--gold);
}

.cta-section {
  background: var(--white);
}

.cta-box {
  justify-content: space-between;
  background: linear-gradient(135deg, #ffffff 0%, var(--soft) 100%);
  border-radius: 24px;
  padding: 42px;
  box-shadow: var(--shadow);
}

.cta-box p {
  max-width: 720px;
  margin-bottom: 0;
}

/* Footer */

.site-footer {
  background: var(--white);
  border-top: 4px solid var(--gold);
  padding: 48px 0 36px;
}

.footer-inner {
  text-align: center;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 38px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.footer-logo-project {
  max-height: 98px;
  width: auto;
}

.footer-logo-eu {
  max-height: 82px;
  width: auto;
}

.footer-logo-oer {
  max-height: 76px;
  width: auto;
}

.disclaimer {
  max-width: 940px;
  margin: 0 auto 22px;
  color: #555555;
  font-size: 0.92rem;
}

.footer-license img {
  max-height: 42px;
  width: auto;
  margin: 0 auto 18px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-weight: 700;
}

/* Responsive */

@media (max-width: 980px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .main-nav {
    gap: 16px;
  }

  .hero,
  .hero-overlay {
    min-height: 620px;
  }

  .content-grid,
  .topics-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .brand img {
    width: 96px;
  }

  .main-nav {
    font-size: 0.9rem;
  }

  .hero,
  .hero-overlay {
    min-height: 650px;
  }

  .hero-content {
    padding: 64px 0;
  }

  .carousel-btn {
    display: none;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 62px 0;
  }

  .cta-box {
    padding: 28px;
  }

  .footer-logo-project {
    max-height: 84px;
  }

  .footer-logo-eu,
  .footer-logo-oer {
    max-height: 68px;
  }
}

/* Language switcher */

.language-switcher {
  position: relative;
  flex: 0 0 auto;
}

.language-button {
  min-width: 158px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 12px;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
}

.language-button:hover,
.language-button:focus {
  border-color: var(--gold);
  outline: none;
}

.language-caret {
  color: var(--gold);
  font-size: 0.86rem;
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 168px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.14);
  display: none;
  z-index: 30;
}

.language-switcher.is-open .language-menu {
  display: block;
}

.language-menu button {
  position: relative;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 14px 8px 34px;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button:focus {
  background: var(--soft);
  color: var(--gold);
  outline: none;
}

.language-menu button.is-active::before {
  content: "✓";
  position: absolute;
  left: 14px;
  color: var(--blue);
  font-weight: 700;
}

.hero-small {
  max-width: 780px;
  margin: -4px 0 18px;
  color: rgba(255,255,255,0.86);
  font-size: 0.98rem;
}

/* RTL Arabic support */

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .header-inner,
html[dir="rtl"] .main-nav,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .cta-box,
html[dir="rtl"] .footer-links,
html[dir="rtl"] .footer-logos {
  direction: rtl;
}

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

html[dir="rtl"] .language-menu button {
  text-align: right;
  padding: 8px 34px 8px 14px;
}

html[dir="rtl"] .language-menu button.is-active::before {
  right: 14px;
  left: auto;
}

html[dir="rtl"] .topic-list li {
  padding-left: 0;
  padding-right: 28px;
}

html[dir="rtl"] .topic-list li::before {
  left: auto;
  right: 0;
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
  }

  .language-switcher {
    margin-left: auto;
  }

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