/* ============================================================
   La Nube CMS — clean lookalike of the original Bartik site
   ============================================================ */
@font-face {
  font-family: 'Kyrial Display';
  src: url('fonts/kyrial-display-bold-italic.woff2') format('woff2'),
       url('fonts/kyrial-display-bold-italic.woff') format('woff');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Display face for headings/branding. The webfont only ships Bold Italic, so
   any element using it should request weight 700 + italic. */
.font-display {
  font-family: 'Kyrial Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: italic;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: #3b3b3b;
  background: #fff;
  line-height: 1.5;
}
a { color: #0071b3; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.cms-wrap { max-width: 1024px; margin: 0 auto; padding: 0 16px; }

/* Header */
.cms-header {
  background: #4a4a4a;
  color: #fff;
  border-bottom: 5px solid #2b2b2b;
}
.cms-header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 22px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cms-logo { height: 54px; width: auto; flex-shrink: 0; }
.cms-header-titles { flex: 1; min-width: 0; }

/* Search icon + bar */
.cms-search-toggle {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cms-search-toggle:hover, .cms-search-toggle.active { background: rgba(255,255,255,0.28); }

.cms-search-bar { background: #3a3a3a; border-top: 1px solid rgba(255,255,255,0.1); }
.cms-search-inner {
  max-width: 1024px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.cms-search-input {
  flex: 1; font-size: 16px; padding: 10px 14px;
  border: none; border-radius: 8px; outline: none;
  font-family: Arial, Helvetica, sans-serif;
}
.cms-search-close {
  flex-shrink: 0; width: 36px; height: 36px; border: none; border-radius: 8px;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 16px; cursor: pointer;
}
.cms-search-close:hover { background: rgba(255,255,255,0.3); }

.cms-search-results { max-width: 1024px; margin: 0 auto; padding: 0 16px; }
.cms-search-hint, .cms-search-more { color: #cfcfcf; font-size: 14px; padding: 10px 2px 16px; }
.cms-search-list { list-style: none; margin: 0; padding: 0 0 14px; }
.cms-search-item a {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: #fff; text-decoration: none; transition: background 0.12s;
}
.cms-search-item a:hover { background: rgba(255,255,255,0.1); }
.cms-search-title { display: block; font-weight: 700; font-size: 15px; }
.cms-search-path { display: block; font-size: 12px; color: #a9c7d6; margin-top: 2px; }
.cms-site-name {
  font-family: 'Kyrial Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: italic;
  font-size: 30px;
  color: #fff;
  letter-spacing: 0.5px;
}
.cms-site-name a { color: #fff; }
.cms-slogan { font-size: 14px; color: #cfcfcf; font-style: italic; }

/* Breadcrumb */
.cms-breadcrumb {
  padding: 12px 0 0;
  font-size: 13px;
  color: #777;
}
.cms-breadcrumb a { color: #0071b3; }
.cms-breadcrumb span.sep { color: #bbb; margin: 0 6px; }

/* Page title */
.cms-page-title {
  font-family: 'Kyrial Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: italic;
  font-size: 28px;
  color: #2b2b2b;
  margin: 14px 0 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

/* Category grid (home) — mirrors the original materiadest tiles */
.cms-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 8px 0 32px;
}
.cms-category-tile {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  color: #fff;
}
.cms-category-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  text-decoration: none;
}
.cms-category-img { width: 100%; height: 170px; object-fit: cover; background: #ddd; }
.cms-category-label {
  font-family: 'Kyrial Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: italic;
  padding: 14px 16px;
  font-size: 21px;
  color: #fff;
}

/* Hero / header image (recovered from original site) */
.cms-hero {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin: 14px 0 6px;
  text-align: center;
}
.cms-hero img { width: 100%; height: auto; display: block; }

/* Description / resumen block */
.cms-description {
  color: #fff;
  background: #555;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.55;
  margin: 10px 0 22px;
}

/* Child card grid (collections) — mirrors the original cursoenmateria tiles */
.cms-child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  padding: 8px 0 32px;
}
.cms-child-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.cms-child-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.24);
  text-decoration: none;
}
.cms-child-thumb { width: 100%; height: 160px; object-fit: cover; background: #e9e9e9; }
.cms-child-label {
  background: #555;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.cms-child-title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.cms-child-desc { font-size: 13px; opacity: 0.9; line-height: 1.4; }
.cms-child-meta { margin-top: 2px; }
.cms-child-card.no-thumb .cms-child-label { min-height: 70px; justify-content: center; }
/* Badges inside colored labels need light styling */
.cms-child-label .cms-badge { background: rgba(255,255,255,0.22); color: #fff; }

/* Collection list (children of a non-leaf node) — legacy, kept for fallback */
.cms-list { list-style: none; padding: 8px 0 32px; }
.cms-list-item {
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  margin-bottom: 10px;
  transition: background 0.12s, border-color 0.12s;
}
.cms-list-item:hover { background: #f6fbff; border-color: #bdddf0; }
.cms-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: #2b2b2b;
}
.cms-list-link:hover { text-decoration: none; }
.cms-list-title { font-size: 17px; font-weight: 600; }
.cms-list-meta { font-size: 13px; color: #888; display: flex; gap: 10px; align-items: center; }
.cms-badge {
  font-size: 12px;
  background: #eef4f8;
  color: #0071b3;
  border-radius: 12px;
  padding: 2px 10px;
  font-family: Arial, sans-serif;
}
.cms-chev { color: #bbb; font-size: 18px; }

/* Leaf page — media */
.cms-media-block { padding: 8px 0 36px; }
.cms-media-item {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  background: #fafafa;
}
.cms-media-kind {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  font-family: Arial, sans-serif;
  margin-bottom: 10px;
}
.cms-media-item audio { width: 100%; }
.cms-video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.cms-video-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.cms-doc-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: #0071b3; color: #fff; border-radius: 6px;
  font-family: Arial, sans-serif; font-size: 14px;
}
.cms-doc-link:hover { background: #005a8f; text-decoration: none; }
.cms-body-text { font-size: 16px; line-height: 1.7; margin: 10px 0 24px; color: #333; }
.cms-empty { color: #888; font-style: italic; padding: 20px 0; }

/* Footer */
.cms-footer {
  background: #2b2b2b;
  color: #cfcfcf;
  margin-top: 30px;
  padding: 26px 16px;
  text-align: center;
  font-size: 13px;
}
.cms-powered { margin-top: 6px; font-size: 12px; color: #9a9a9a; }
.cms-powered a { color: #7fc4ec; }
.cms-powered a:hover { color: #a9d8f2; }

/* Loading / error */
.cms-loading, .cms-error { text-align: center; padding: 50px 0; color: #888; }
.cms-error { color: #b71c1c; }

/* Mobile */
@media (max-width: 768px) {
  .cms-category-grid { grid-template-columns: 1fr; }
  .cms-site-name { font-size: 22px; }
  .cms-logo { height: 42px; }
  .cms-header-inner { padding: 16px; }
}
