/*
Theme Name: Caloryx
Theme URI: https://caloryx.club
Author: Caloryx
Description: Personal nutrition and weight-loss blog theme for a Russian-speaking audience.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.3
Text Domain: caloryx
*/

:root {
  --ink: #151e00;
  --muted: #717182;
  --line: #dfe5d6;
  --paper: #ffffff;
  --soft: #f2f8eb;
  --leaf: #9dd228;
  --leaf-dark: #151e00;
  --berry: #6750a4;
  --sun: #ffd56a;
  --sky: #e8f5ff;
  --lilac: #f3edff;
  --white: #ffffff;
  --shadow: 0 18px 46px rgba(21, 30, 0, .1);
  --radius: 8px;
  --content: 1160px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: #4f7208;
  text-decoration-color: rgba(79, 114, 8, .35);
  text-underline-offset: .18em;
}

a:hover {
  color: var(--ink);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.wrap {
  width: min(var(--content), calc(100% - 32px));
  margin: 0 auto;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 20px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink);
  background: var(--leaf);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(21, 30, 0, .12);
  font-size: 19px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #5f5f70;
  font-size: 15px;
  font-weight: 650;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--ink);
}

.main-nav .current-menu-item > a {
  color: var(--ink);
  font-weight: 800;
}

.button,
.wp-block-button__link,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  color: var(--ink);
  background: var(--leaf);
  border-color: var(--leaf);
}

.button:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover {
  color: var(--ink);
  background: var(--leaf);
  border-color: var(--leaf);
}

.hero {
  position: relative;
  min-height: min(590px, calc(100vh - 76px));
  display: grid;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background: url("hero-zulfiya-v2.jpg") center / cover no-repeat;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(244, 252, 235, .38);
}

.hero-content {
  max-width: 720px;
  padding: 64px 0 54px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  color: #4a6909;
  background: rgba(157, 210, 40, .16);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 16px;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(42px, 5vw, 58px);
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
}

h3 {
  font-size: 24px;
}

p {
  margin: 0 0 18px;
}

.lead {
  max-width: 620px;
  color: #4f5260;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.55;
}

.hero-actions,
.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero .hero-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, .86);
  border-color: rgba(21, 30, 0, .18);
}

.hero .hero-secondary:hover {
  background: var(--leaf);
  border-color: var(--leaf);
}

.section {
  padding: 80px 0;
}

.section.soft {
  background: #f6faef;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head p {
  max-width: 560px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 22px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.card,
.post-card,
.sidebar-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(21, 30, 0, .07);
}

.card {
  padding: 28px;
}

.card strong {
  color: var(--leaf-dark);
}

.tools-section {
  border-bottom: 1px solid var(--line);
}

.tools-grid {
  align-items: stretch;
}

.tool-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-card-bmi {
  background: #f5fbe8;
}

.tool-card-calories {
  background: var(--sky);
  border-color: #cce7f4;
}

.tool-card-bot {
  background: var(--lilac);
  border-color: #dfd3f4;
}

.tool-kicker {
  margin-bottom: 22px;
  color: #4f7208;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.tool-card-calories .tool-kicker {
  color: #176a8d;
}

.tool-card-bot .tool-kicker {
  color: #6750a4;
}

.tool-card h3 {
  font-size: 27px;
}

.tool-card > p:not(.tool-kicker) {
  color: #565b66;
}

.tool-link {
  margin-top: auto;
  color: var(--ink);
  font-weight: 800;
}

.principle-card {
  min-height: 270px;
}

.principle-card:nth-child(1) {
  background: #f5fbe8;
}

.principle-card:nth-child(2) {
  background: var(--sky);
}

.principle-card:nth-child(3) {
  background: var(--lilac);
}

.author-home {
  border-bottom: 1px solid var(--line);
}

.author-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.author-home-media {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
}

.author-home-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 68% center;
}

.author-home-copy h2 {
  max-width: 620px;
}

.author-home-lead {
  max-width: 620px;
  color: #4f5260;
  font-size: 20px;
}

.author-home-facts {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.author-home-facts li {
  position: relative;
  padding-left: 28px;
}

.author-home-facts li::before {
  position: absolute;
  top: .66em;
  left: 0;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--leaf);
  border-radius: 50%;
  transform: translateY(-50%);
}

.author-home-note {
  max-width: 620px;
  color: var(--muted);
  font-size: 14px;
}

.principle-number {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 30px;
  place-items: center;
  color: var(--ink);
  background: var(--leaf);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 850;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}

.post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.post-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--soft);
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.post-card:hover .post-card-media img {
  transform: scale(1.025);
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}

.post-card-meta,
.entry-meta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.post-card-category {
  padding: 2px 7px;
  color: #4a6909;
  background: rgba(157, 210, 40, .18);
  border-radius: 4px;
  font-weight: 800;
  text-decoration: none;
}

.post-card h3 a,
.entry-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-card-excerpt {
  color: var(--muted);
}

.post-card .read-more {
  margin-top: auto;
}

.blog-page {
  padding: 64px 0 88px;
}

.blog-header {
  max-width: 860px;
  margin-bottom: 56px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.blog-intro {
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
}

.blog-intro > :last-child {
  margin-bottom: 0;
}

.blog-posts {
  grid-template-columns: minmax(0, 1fr);
  max-width: 672px;
}

.blog-posts .post-card-body {
  padding: clamp(24px, 3.5vw, 34px);
}

.blog-posts .post-card h3 {
  max-width: 574px;
  font-size: clamp(28px, 3.5vw, 34px);
}

.blog-posts .post-card-excerpt {
  max-width: 574px;
  font-size: 17px;
}

.blog-feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 672px) minmax(260px, 320px);
  gap: 36px;
  align-items: start;
}

.blog-sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 10px;
}

.blog-sidebar-panel {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.blog-sidebar-panel-body {
  padding: 16px;
}

.blog-sidebar-panel h3 {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.2;
}

.blog-sidebar-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.blog-sidebar-panel .sidebar-kicker {
  margin-bottom: 5px;
  color: #4f7208;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.author-panel {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
}

.author-panel-photo {
  width: 100%;
  height: 100%;
  min-height: 152px;
  object-fit: cover;
  object-position: 82% center;
}

.sidebar-link {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.bot-panel {
  background: var(--sky);
  border-color: #cce7f4;
}

.bot-panel .sidebar-kicker {
  color: #176a8d;
}

.bot-button {
  width: 100%;
  min-height: 38px;
  padding: 7px 12px;
  font-size: 14px;
}

.guide-panel {
  background: var(--lilac);
  border-color: #dfd3f4;
}

.sidebar-category-list,
.sidebar-popular-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-popular-list li + li {
  border-top: 1px solid var(--line);
}

.sidebar-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sidebar-category-list a {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--soft);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-category-list a span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sidebar-popular-list {
  counter-reset: popular-post;
}

.sidebar-popular-list li {
  counter-increment: popular-post;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  padding: 7px 0;
}

.sidebar-popular-list li::before {
  content: counter(popular-post, decimal-leading-zero);
  color: #6c9620;
  font-size: 12px;
  font-weight: 850;
}

.sidebar-popular-list a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
}

@media (max-height: 820px) and (min-width: 881px) {
  .blog-sidebar {
    position: static;
  }
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
  padding: 56px 0 80px;
}

.entry {
  min-width: 0;
}

.entry-header {
  max-width: 780px;
  margin-bottom: 34px;
}

.entry-title {
  max-width: 760px;
  font-size: 48px;
  line-height: 1.08;
  text-wrap: balance;
}

.entry-content {
  max-width: 780px;
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1.72;
  padding: 0;
}

.entry-content > .cxp {
  width: 100%;
}

.entry-content .lead {
  max-width: none;
  margin-bottom: 28px;
  color: #555867;
  font-size: 20px;
  font-weight: 450;
  line-height: 1.55;
}

.entry-featured-image {
  margin: 0 0 38px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.entry-featured-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.entry-content h2 {
  margin: 52px 0 18px;
  font-size: 34px;
  line-height: 1.16;
  text-wrap: balance;
}

.entry-content h3 {
  margin: 34px 0 12px;
  font-size: 23px;
  line-height: 1.25;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.25em;
}

.entry-content li {
  margin-bottom: 8px;
}

.entry-content .callout,
.entry-content .warnbox,
.entry-content .also {
  margin: 30px 0;
  padding: 22px 24px;
  border-radius: var(--radius);
}

.entry-content .callout {
  background: var(--soft);
  border-left: 4px solid var(--leaf);
}

.entry-content .warnbox {
  background: #fff8df;
  border-left: 4px solid var(--sun);
}

.entry-content .also {
  background: #f8faf5;
  border: 1px solid var(--line);
}

.entry-content .also.sources {
  background: #fafafa;
}

.entry-content .callout .k,
.entry-content .warnbox .k,
.entry-content .also .k {
  margin-bottom: 8px;
  color: #52770a;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.entry-content .callout > :last-child,
.entry-content .warnbox > :last-child,
.entry-content .also > :last-child {
  margin-bottom: 0;
}

.entry-content .faq {
  margin: 18px 0 36px;
  border-bottom: 1px solid var(--line);
}

.entry-content .faq h3 {
  margin: 0;
  padding: 22px 0 8px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.entry-content .faq p {
  margin-bottom: 22px;
  color: #4f5260;
}

.entry-content .botcta {
  position: relative;
  min-height: 116px;
  margin: 40px 0;
  overflow: hidden;
  padding: 24px 26px 24px 94px;
  background: var(--sky);
  border: 1px solid #b9def4;
  border-radius: var(--radius);
}

.entry-content .botcta::before {
  position: absolute;
  top: 24px;
  left: 24px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  content: "C";
  color: var(--ink);
  background: var(--leaf);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(21, 30, 0, .12);
  font-size: 24px;
  font-weight: 900;
}

.entry-content .botcta p {
  margin-bottom: 12px;
}

.entry-content .botcta p:last-child {
  margin-bottom: 0;
}

.entry-content .botcta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.entry-content .botcta a:hover {
  color: var(--ink);
  background: var(--leaf);
  border-color: var(--leaf);
}

.entry-content .tw {
  width: 100%;
  margin: 26px 0 12px;
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(21, 30, 0, .08);
  -webkit-overflow-scrolling: touch;
}

.entry-content .tw table {
  width: 100%;
  min-width: 640px;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}

.entry-content .tw caption {
  padding: 16px 18px;
  color: var(--ink);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 800;
  text-align: left;
}

.entry-content .tw th,
.entry-content .tw td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}

.entry-content .tw thead th {
  color: var(--white);
  background: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.entry-content .tw thead th:first-child {
  width: 30%;
}

.entry-content .tw tbody td {
  border-top: 1px solid var(--line);
}

.entry-content .tw tbody tr:first-child td {
  border-top: 0;
}

.entry-content .tw tbody tr:nth-child(even) {
  background: var(--soft);
}

.entry-content .tw tbody tr:hover {
  background: #edf7dc;
}

.entry-content .tw tbody td:first-child {
  font-weight: 800;
}

.entry-content .tw tbody td:not(:first-child) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry-content .tw + p {
  margin-top: 0;
  padding-left: 14px;
  color: var(--muted);
  border-left: 3px solid var(--leaf);
  font-size: 14px;
  line-height: 1.55;
}

.entry-content .tw + p em {
  font-style: normal;
}

.cta-band {
  color: var(--ink);
  background: var(--leaf);
  padding: 58px 0;
}

.cta-band h2,
.cta-band p {
  color: var(--ink);
}

.cta-band p {
  max-width: 720px;
  opacity: .78;
}

.cta-band .eyebrow {
  color: var(--ink);
  background: rgba(255, 255, 255, .45);
}

.cta-inner {
  position: relative;
}

.cta-band .button {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.sidebar {
  display: grid;
  gap: 18px;
}

.sidebar-box {
  padding: 22px;
}

.sidebar-box h3 {
  font-size: 18px;
}

.site-footer {
  color: #e9eddf;
  background: var(--ink);
  padding: 36px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer a {
  color: #ffffff;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form label {
  flex: 1;
}

.search-field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.page-numbers {
  display: inline-grid;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}

.page-numbers.current {
  color: var(--ink);
  background: var(--leaf);
  border-color: var(--leaf);
}

@media (max-width: 880px) {
  .entry-title {
    font-size: 44px;
  }

  .blog-posts {
    max-width: 100%;
  }

  .blog-feed-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    min-height: auto;
  }

  .hero::after {
    background: rgba(244, 252, 235, .7);
  }

  .hero::before {
    background-position: 76% center;
  }

  .hero-content {
    padding: 60px 0 50px;
  }

  .grid.cols-3,
  .grid.cols-2,
  .content-layout,
  .author-home-grid {
    grid-template-columns: 1fr;
  }

  .author-home-grid {
    gap: 34px;
  }

  .author-home-media {
    max-width: 620px;
  }

  .author-home-media img {
    aspect-ratio: 16 / 10;
    object-position: 68% 28%;
  }

  .section-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .content-layout {
    padding-top: 38px;
  }

  .entry-header {
    margin-bottom: 26px;
  }

  .entry-title {
    font-size: 34px;
    line-height: 1.1;
  }

  .entry-content {
    font-size: 17px;
    line-height: 1.68;
  }

  .entry-content .lead {
    font-size: 18px;
  }

  .entry-content h2 {
    margin-top: 42px;
    font-size: 29px;
  }

  .entry-content h3 {
    font-size: 21px;
  }

  .entry-content .callout,
  .entry-content .warnbox,
  .entry-content .also {
    padding: 18px;
  }

  .entry-content .botcta {
    min-height: 0;
    padding: 20px 18px 20px 74px;
  }

  .entry-content .botcta::before {
    top: 20px;
    left: 18px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

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

  .header-inner {
    gap: 12px;
  }

  .brand-copy small {
    display: none;
  }

  .main-nav {
    gap: 14px;
    font-size: 14px;
  }

  .main-nav ul {
    gap: 14px;
  }

  .main-nav > .button {
    display: none;
  }

  .hero-content {
    padding: 52px 0 44px;
  }

  .section {
    padding: 58px 0;
  }

  .card,
  .post-card-body,
  .sidebar-box {
    padding: 22px;
  }

  .principle-card {
    min-height: 0;
  }

  .tool-card {
    min-height: 0;
    padding: 22px;
  }

  .blog-posts .post-card-body {
    padding: 24px;
  }

  .blog-posts .post-card h3 {
    font-size: 30px;
  }
}
