:root {
  --cream: #fdf8f2;
  --cream-dark: #f3e9dc;
  --ink: #2e2620;
  --ink-soft: #6b5f54;
  --rust: #4bb36e;
  --rust-dark: #44a366;
  --sage: #4bb36e;
  --card-shadow: 0 10px 30px rgba(46, 38, 32, 0.08);
  --radius: 18px;
  font-size: 16px;
}

* { box-sizing: border-box; }

.top-accent-bar {
  height: 20px;
  width: 100%;
  background: var(--rust);
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.brand span { color: var(--rust); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 20px;
}
.nav-links a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

.btn {
  display: inline-block;
  background: var(--rust);
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--rust-dark); text-decoration: none; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--rust);
  border: 2px solid var(--rust);
  padding: 10px 24px;
}
.btn-outline:hover { background: var(--rust); color: #fff; }

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}
.hero h1 {
  font-size: 2.6rem;
  max-width: 720px;
  margin: 0 auto 16px;
}
.hero p {
  max-width: 560px;
  margin: 0 auto 28px;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* Course cards */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  padding: 20px 0 70px;
}

.course-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(46, 38, 32, 0.14);
}

.course-card .thumb {
  height: 200px;
  background-size: cover;
  background-position: center;
}

.course-card .body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-card h3 { font-size: 1.4rem; }
.course-card p { color: var(--ink-soft); flex: 1; }

.badge {
  display: inline-block;
  background: var(--cream-dark);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  width: fit-content;
}
.badge.owned { background: var(--sage); color: #fff; }

/* Login */
.auth-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}
.auth-card h2 { text-align: center; margin-bottom: 6px; }
.auth-card .subtitle { text-align: center; color: var(--ink-soft); margin-bottom: 28px; font-size: 0.95rem; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e4d9cb;
  border-radius: 10px;
  font-size: 1rem;
  background: var(--cream);
}
.field input:focus { outline: none; border-color: var(--rust); }

.error-box {
  background: #fbe4de;
  color: #a13a1f;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.hint-box {
  background: #eef1e9;
  color: #4d5a41;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-top: 20px;
}

/* Dashboard */
.page-head {
  padding: 40px 0 10px;
}
.page-head h1 { font-size: 2rem; }
.page-head .muted { color: var(--ink-soft); }

/* Course detail */
.course-hero {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin: 24px 0 40px;
  background-size: cover;
  background-position: center;
  height: 260px;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.course-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(46,38,32,0.75), rgba(46,38,32,0));
}
.course-hero h1 {
  position: relative;
  color: #fff;
  padding: 30px;
  margin: 0;
  font-size: 2.2rem;
}

.section-title {
  font-size: 1.3rem;
  margin: 40px 0 18px;
  border-bottom: 2px solid var(--cream-dark);
  padding-bottom: 10px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}
.video-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.video-card video { width: 100%; display: block; background: #000; }
.video-card .label {
  padding: 14px 18px;
  font-weight: 600;
}

.pdf-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.pdf-list li {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.pdf-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 600;
}
.pdf-list a:hover { color: var(--rust); text-decoration: none; }
.pdf-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--rust);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
  flex-shrink: 0;
}

.footer {
  text-align: center;
  padding: 40px 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* Blog category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding: 20px 0 70px;
}
.cat-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
  transition: transform 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); text-decoration: none; }
.cat-card h3 { font-size: 1.1rem; margin: 0; }
.cat-count { color: var(--rust); font-weight: 700; font-size: 0.85rem; }

/* Article listing grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  padding: 10px 0 70px;
}
.article-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}
.article-card:hover { transform: translateY(-3px); text-decoration: none; }
.article-card .thumb { height: 160px; background-size: cover; background-position: center; background-color: var(--cream-dark); }
.article-card .thumb-empty { background: var(--cream-dark); }
.article-card .body { padding: 16px 18px 20px; flex: 1; }
.article-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.article-card p { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }
.cookidoo-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--rust);
}

/* Single article body (rendered Joomla HTML) */
.article-body {
  max-width: 760px;
  padding-bottom: 70px;
}
.article-body img { max-width: 100%; height: auto; border-radius: 10px; }
.article-body h1 { font-size: 1.6rem; }
.article-body iframe { max-width: 100%; }
.article-body ul.star { padding-left: 20px; }
.article-body a { word-break: break-word; }

@media (max-width: 900px) {
  .nav-links { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 14px; }
  .nav-links { justify-content: center; }
  .hero h1 { font-size: 2rem; }
}
