/*
 * Hub-typografia = sama skaala kuin artikkelisivuilla (esim. /keto-ruokavalio/)
 * ja Beaver-teeman skinissä:
 *   body 16px / 1.6
 *   h1 (artikkelin otsikko) 50px → 24px ≤768px
 *   h2 23px / 1.4
 *   leipäteksti 16px
 */

/* Header: haku poistettu, valikko käyttää vapautuneen tilan */
.fl-builder-content .fl-node-ka41jmyw5cdg {
  width: 84% !important;
}

.ro-hub {
  --ro-accent: #33a02b;
  --ro-accent-soft: #f3f5ed;
  --ro-ink: #292d35;
  --ro-heading: #1b1b1b;
  --ro-muted: #5c6570;
  --ro-card: #f8f7f2;
  --ro-max: 1100px;

  color: var(--ro-ink);
  font-family: 'Fira Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.ro-hub * {
  box-sizing: border-box;
}

.ro-hub-wrap {
  max-width: var(--ro-max);
  margin: 0 auto;
  padding: 0 20px 56px;
}

/* ---------- Hero (kuten artikkelin otsikkorivi) ---------- */

.ro-hub-hero {
  background:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url('/wp-content/uploads/2024/06/pexels-mastercowley-1153369-scaled.jpg') center / cover no-repeat;
  color: #fff;
  padding: 200px 24px;
  text-align: center;
}

.ro-hub-hero h1 {
  font-family: 'Fira Sans', sans-serif;
  font-weight: 700;
  font-size: 50px !important;
  line-height: 1.4 !important;
  letter-spacing: 0;
  margin: 0 0 16px;
  color: #fff !important;
}

.ro-hub-hero p {
  margin: 0 auto;
  max-width: 42em;
  font-size: 16px !important;
  font-weight: 400;
  line-height: 1.6 !important;
  color: #fff !important;
}

.ro-hub-search {
  margin: 28px auto 0;
  max-width: 28rem;
}

.ro-hub-search form {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
}

.ro-hub-search input[type='search'] {
  flex: 1;
  border: 0;
  border-radius: 999px;
  font-family: 'Fira Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 12px 16px;
  min-width: 0;
  color: var(--ro-ink);
}

.ro-hub-search input[type='search']:focus {
  outline: 2px solid var(--ro-accent);
  outline-offset: 1px;
}

.ro-hub-search button {
  border: 0;
  border-radius: 999px;
  background: var(--ro-accent);
  color: #fff;
  font-family: 'Fira Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 0.9;
  padding: 14px 20px;
  cursor: pointer;
}

/* ---------- Osio-otsikot = teeman h2 (23px) ---------- */

.ro-hub-section {
  margin-top: 48px;
}

.ro-hub-section h2 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 23px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  letter-spacing: 0;
  color: var(--ro-heading) !important;
  margin: 0 0 8px;
}

.ro-hub-section .ro-hub-lead {
  color: var(--ro-muted);
  margin: 0 0 24px;
  max-width: 42em;
  font-size: 16px !important;
  line-height: 1.6 !important;
}

/* ---------- Teemakortit ---------- */

.ro-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (min-width: 900px) {
  .ro-theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ro-theme-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 25px;
  border-radius: 30px;
  background: var(--ro-accent-soft);
  background-size: 120px auto;
  background-repeat: no-repeat;
  background-position: right -20px bottom -10px;
  text-decoration: none;
  color: var(--ro-ink);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ro-theme-card:hover {
  border-color: var(--ro-accent);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--ro-ink);
}

/* Kortin otsikko = arkiston artikkelin otsikko (h2, 23px) */
.ro-theme-card h3 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 23px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  letter-spacing: 0;
  color: var(--ro-heading) !important;
  margin: 0 0 8px;
}

.ro-theme-card p {
  margin: 0;
  color: var(--ro-muted);
  font-size: 14px !important;
  line-height: 1.5 !important;
  max-width: 17em;
}

.ro-theme-card .ro-count {
  margin-top: auto;
  padding-top: 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ro-accent);
}

/* ---------- Artikkelikortit (kuten fl-post-grid) ---------- */

.ro-post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

@media (min-width: 700px) {
  .ro-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .ro-post-grid.ro-post-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ro-post-card {
  background: var(--ro-card);
  border-radius: 30px;
  padding: 25px;
  text-decoration: none;
  color: var(--ro-ink);
  display: block;
  border: 1px solid transparent;
}

.ro-post-card:hover {
  border-color: #d7dec8;
  text-decoration: none;
  color: var(--ro-ink);
}

/* fl-post-grid-title oletus 20px; arkisto käyttää h2 → 23px */
.ro-post-card h3 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 23px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  letter-spacing: 0;
  color: var(--ro-heading) !important;
  margin: 0 0 10px;
  padding: 0;
}

.ro-post-card p {
  margin: 0;
  color: var(--ro-muted);
  font-size: 16px !important;
  line-height: 1.6 !important;
}

.ro-post-card .ro-more {
  display: inline-block;
  margin-top: 12px;
  color: var(--ro-accent);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}

.ro-hub-actions {
  margin-top: 28px;
  font-size: 16px;
  line-height: 1.6;
}

.ro-hub-actions a {
  color: var(--ro-accent);
  font-weight: 700;
}

/* ---------- Teemasivu ---------- */

.ro-theme-hero {
  padding: 48px 0 8px;
}

.ro-theme-hero h1 {
  font-family: 'Fira Sans', sans-serif;
  font-weight: 700;
  font-size: 50px !important;
  line-height: 1.4 !important;
  letter-spacing: 0;
  color: var(--ro-heading) !important;
  margin: 0 0 12px;
}

.ro-theme-hero p {
  margin: 0;
  color: var(--ro-muted);
  max-width: 42em;
  font-size: 16px !important;
  line-height: 1.6 !important;
}

.ro-theme-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
}

.ro-theme-nav a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ro-accent-soft);
  color: var(--ro-ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.ro-theme-nav a[aria-current='page'] {
  background: var(--ro-accent);
  color: #fff;
}

/* ---------- Lue myös ---------- */

.ro-related {
  margin: 40px 0 10px;
  padding: 28px 24px;
  background: var(--ro-card);
  border-radius: 30px;
}

.ro-related h2 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 23px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  color: var(--ro-heading) !important;
  margin: 0 0 14px;
}

.ro-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

@media (min-width: 800px) {
  .ro-related ul {
    grid-template-columns: 1fr 1fr;
  }
}

.ro-related a {
  color: var(--ro-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
}

.ro-related a:hover {
  color: var(--ro-accent);
  text-decoration: underline;
}

.ro-merge-note {
  margin-top: 28px;
  padding: 16px 18px;
  border-left: 4px solid var(--ro-accent);
  background: #fff;
  color: var(--ro-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- Salaattigeneraattori ---------- */

.ro-salad-hero {
  padding: 120px 0 72px;
}

.ro-salad-ai-tip {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-self: center;
  margin-left: 6px;
}

.ro-salad-ai-tip button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ro-muted);
  font-size: 16px;
  line-height: 1;
  cursor: help;
}

.ro-salad-ai-tip button:hover,
.ro-salad-ai-tip button:focus-visible {
  color: var(--ro-accent);
  outline: none;
}

.ro-salad-ai-tip [role='tooltip'] {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  z-index: 2;
  width: max-content;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1b1b1b;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

@media (max-width: 768px) {
  .ro-salad-ai-tip [role='tooltip'] {
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    white-space: normal;
    max-width: min(16rem, 70vw);
    transform: none;
  }
}

.ro-salad-ai-tip:hover [role='tooltip'],
.ro-salad-ai-tip:focus-within [role='tooltip'] {
  opacity: 1;
  visibility: visible;
}

.ro-salad-actions {
  margin: 0 0 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ro-salad-primary,
.ro-salad-secondary,
.ro-salad-icon-btn {
  font-family: 'Fira Sans', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  border: 0;
}

.ro-salad-primary {
  background: var(--ro-accent);
  color: #fff;
  font-size: 16px;
  padding: 14px 24px;
  line-height: 1;
}

.ro-salad-primary:hover {
  background: #79bf00;
}

.ro-salad-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

[data-pohja-cards] {
  display: contents;
}

@media (min-width: 700px) {
  .ro-salad-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ro-salad-card {
  background-color: #f8f7f2;
  background-size: 190px auto;
  background-repeat: no-repeat;
  background-position: right -22px bottom -42px;
  overflow: hidden;
  border-radius: 30px;
  padding: 24px 110px 24px 24px;
  border: 2px solid transparent;
  min-height: 210px;
  display: flex;
  flex-direction: column;
}

.ro-salad-card.is-locked {
  border-color: var(--ro-accent);
}

.ro-salad-card.is-locked [data-reroll] {
  display: none;
}

.ro-salad-label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ro-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ro-salad-name {
  font-family: 'Fira Sans', sans-serif;
  font-size: 23px !important;
  font-weight: 700;
  line-height: 1.3 !important;
  color: var(--ro-heading) !important;
  margin: 0 0 8px;
}

.ro-salad-tip {
  margin: 0;
  color: var(--ro-muted);
  font-size: 16px;
  line-height: 1.5;
  flex: 1;
}

.ro-salad-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.ro-salad-secondary {
  background: #fff;
  color: var(--ro-ink);
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid #d7dec8;
}

.ro-salad-icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ro-ink);
  font-size: 16px;
  line-height: 1;
  border: 1px solid #d7dec8;
}

.ro-salad-icon-btn:hover {
  border-color: var(--ro-accent);
  color: var(--ro-accent);
}

.ro-salad-lock[aria-pressed='true'] {
  background: var(--ro-accent);
  color: #fff;
  border-color: var(--ro-accent);
}

.ro-salad-summary {
  margin: 36px 0 28px;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid #e4e4e0;
  border-radius: 8px;
}

.ro-recipe {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 860px) {
  .ro-recipe {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }
}

.ro-recipe-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ro-accent);
}

.ro-salad-summary h2 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 28px !important;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ro-heading) !important;
  line-height: 1.2 !important;
}

.ro-recipe-main h3 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 16px !important;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--ro-heading) !important;
  border-bottom: 1px solid #e4e4e0;
  padding-bottom: 6px;
}

.ro-recipe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ro-recipe-toolbar .ro-salad-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ro-salad-print-brand {
  display: none;
}

.ro-recipe-servings {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}

.ro-recipe-servings strong {
  min-width: 1.5em;
  text-align: center;
  font-size: 22px;
}

.ro-recipe-ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ro-recipe-ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dotted #d7dec8;
  font-size: 16px;
}

.ro-recipe-ingredients li span:last-child {
  font-weight: 700;
  white-space: nowrap;
}

.ro-salad-note {
  margin: 0 0 12px;
  color: var(--ro-muted);
  font-size: 16px;
  line-height: 1.6;
}

.ro-recipe-steps {
  margin: 0;
  padding: 0 0 0 1.25em;
  color: var(--ro-ink);
  font-size: 16px;
  line-height: 1.6;
}

.ro-recipe-steps li {
  padding: 6px 0;
  border-bottom: 1px dotted #d7dec8;
}

.ro-recipe-steps li:last-child {
  border-bottom: 0;
}

.ro-nutrition {
  border: 3px solid #1b1b1b;
  padding: 12px 12px 14px;
  background: #fff;
  color: #1b1b1b;
}

.ro-nutrition-title {
  margin: 0;
  font-family: 'Fira Sans', sans-serif;
  font-size: 22px !important;
  font-weight: 800;
  line-height: 1.1;
  border-bottom: 8px solid #1b1b1b;
  padding-bottom: 6px;
}

.ro-nutrition-sub {
  margin: 8px 0 6px;
  font-size: 12px;
  color: #5c6570;
}

.ro-nutrition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ro-nutrition-table th,
.ro-nutrition-table td {
  padding: 5px 0;
  border-bottom: 1px solid #1b1b1b;
  text-align: right;
  font-weight: 600;
}

.ro-nutrition-table th:first-child,
.ro-nutrition-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.ro-nutrition-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ro-nutrition-table tr.is-energy th,
.ro-nutrition-table tr.is-energy td {
  border-bottom-width: 4px;
}

.ro-nutrition-macros {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.ro-salad-card.is-skip {
  display: none;
}

.ro-tool-card {
  display: block;
  padding: 28px;
  border-radius: 30px;
  background: var(--ro-accent-soft);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.ro-tool-card:hover {
  border-color: var(--ro-accent);
  text-decoration: none;
  color: inherit;
}

.ro-tool-card h3 {
  font-family: 'Fira Sans', sans-serif;
  font-size: 23px !important;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ro-heading) !important;
}

.ro-tool-card p {
  margin: 0;
  color: var(--ro-muted);
  font-size: 16px;
  line-height: 1.5;
}

.ro-tool-card .ro-count {
  display: inline-block;
  margin-top: 14px;
  color: var(--ro-accent);
  font-weight: 700;
}

/* ---------- Responsiivisuus kuten skin / keto-otsikko ---------- */

@media (max-width: 991px) {
  .ro-hub {
    font-size: 14px;
    line-height: 1.45;
  }

  .ro-hub-hero h1,
  .ro-theme-hero h1 {
    font-size: 36px !important;
  }

  .ro-hub-section h2,
  .ro-related h2,
  .ro-theme-card h3,
  .ro-post-card h3 {
    font-size: 30px !important;
  }

  .ro-hub-hero p,
  .ro-hub-section .ro-hub-lead,
  .ro-theme-hero p,
  .ro-post-card p,
  .ro-theme-nav a,
  .ro-related a,
  .ro-hub-search input[type='search'] {
    font-size: 14px !important;
  }

  .ro-theme-card p {
    font-size: 13px !important;
  }
}

@media (max-width: 768px) {
  .ro-hub-hero {
    padding: 120px 20px;
  }

  .ro-hub-hero h1,
  .ro-theme-hero h1 {
    font-size: 24px !important;
    line-height: 1.2 !important;
  }

  .ro-hub-section h2,
  .ro-related h2,
  .ro-theme-card h3,
  .ro-post-card h3 {
    font-size: 21px !important;
  }
}

@media (max-width: 767px) {
  .ro-hub {
    font-size: 14px;
    line-height: 1.65;
  }

  .ro-theme-card h3,
  .ro-post-card h3 {
    font-size: 16px !important;
  }
}

@media print {
  body:has(#salad-app) {
    background: #fff !important;
  }

  body:has(#salad-app) header,
  body:has(#salad-app) footer,
  body:has(#salad-app) .fl-builder-content[data-type='header'],
  body:has(#salad-app) .fl-builder-content[data-type='footer'],
  body:has(#salad-app) .ro-salad-hero,
  body:has(#salad-app) .ro-salad-actions,
  body:has(#salad-app) .ro-salad-grid,
  body:has(#salad-app) .ro-hub-actions,
  body:has(#salad-app) [data-print],
  body:has(#salad-app) .ro-recipe-servings button {
    display: none !important;
  }

  body:has(#salad-app) .ro-hub-wrap {
    max-width: none;
    padding: 0;
  }

  body:has(#salad-app) .ro-salad-summary {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  body:has(#salad-app) .ro-salad-print-brand {
    display: block;
    margin: 0 0 16px;
    color: #5c6570;
    font-size: 12px;
  }

  body:has(#salad-app) .ro-recipe {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    break-inside: avoid;
  }

  body:has(#salad-app) .ro-nutrition {
    break-inside: avoid;
  }
}
