/* ==========================================================================
   My Immunity – homepage styles
   Layout, colours and sizes follow the original my-immunity.com site.
   ========================================================================== */

:root {
  --green: #7aa33d;          /* top bar, quote border, accents */
  --green-light: #7aad33;    /* footer links, read-more icon */
  --link: #006400;           /* post titles, read more */
  --text: #000000;
  --title-grey: #333333;
  --card-bg: #f6f6f6;
  --card-border: #ebeaea;
  --header-bg: #191919;
  --footer-bg: #0a0909;
  --copyright-bg: #000000;

  --font-body: Arial, Helvetica, sans-serif;
  --font-head: "Antic Slab", Georgia, serif;

  --container: 1180px;
  --side-pad: 30px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--link); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--green); }

p { margin: 0 0 20px; }

svg { width: 1em; height: 1em; }

.wrap { padding: 0 var(--side-pad); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--side-pad));
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--green);
  border-bottom: 1px solid var(--green);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}
.topbar p { margin: 0; padding: 13px 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--green);
  transition: box-shadow .3s ease;
}
.site-header.is-scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.header-inner { display: flex; align-items: center; }
.logo { display: block; margin: 5px 0; }
.logo img {
  width: auto;
  height: 150px;
  transition: height .3s ease;
}
.site-header.is-scrolled .logo img { height: 80px; }

/* ---------- Main ---------- */
.site-main { padding: 15px 0 20px; }

/* ---------- Banner slider ---------- */
.slider {
  position: relative;
  margin-bottom: 20px;
}
.slides {
  position: relative;
  aspect-ratio: 940 / 330;
  overflow: hidden;
  background: #f6f6f6;
}
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity .9s ease;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }

.slider-arrow {
  position: absolute;
  top: calc(50% - 20px);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 3px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .3s ease, background .2s ease;
}
.slider-arrow svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }
.slider:hover .slider-arrow,
.slider:focus-within .slider-arrow { opacity: 1; }
.slider-arrow:hover { background: var(--green); }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 12px;
}
.slider-dots button {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #cccccc;
  cursor: pointer;
  transition: background .3s ease, transform .3s ease;
}
.slider-dots button:hover { background: #999; }
.slider-dots button[aria-selected="true"] { background: var(--green); transform: scale(1.1); }

/* ---------- Content + sidebar ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 755fr) minmax(0, 378fr);
  column-gap: 47px;
  align-items: start;
}

.intro p { line-height: 21px; }

/* Quote – same as original: small, italic, green left border */
.quote {
  margin: 28px 40px;
  padding: 15px;
  border-left: 4px solid var(--green);
  font-style: italic;
  text-align: center;
  line-height: 21px;
}
.quote p:last-child { margin-bottom: 0; }

/* ---------- Posts (grid like original) ---------- */
.posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  margin-top: 40px;
}
.post { display: flex; }
.post[hidden] { display: none; }
.post-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 30px 25px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-bottom-width: 3px;
  transition: box-shadow .3s ease, transform .3s ease;
}
.post-inner:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .07);
  transform: translateY(-2px);
}
.post-title {
  margin: 0 0 5px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 400;
  line-height: 27px;
  color: var(--title-grey);
}
.post-title a { color: var(--link); }
.post-title a:hover { color: var(--green); }
.post-sep {
  height: 6px;
  margin-top: 20px;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}
.post-excerpt {
  margin: 20px 0 0;
  line-height: 21px;
}
.post-meta {
  margin-top: auto;
  padding: 30px 0 5px;
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  line-height: 18px;
  color: var(--link);
}
.read-more svg {
  font-size: 14px;
  fill: none;
  stroke: var(--green-light);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}
.read-more:hover svg { transform: translateX(3px); }

/* new posts fade in after "Load more" */
.post.is-new { animation: fadeUp .5s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.load-more {
  display: block;
  width: 100%;
  height: 50px;
  margin: 40px 0 40px;
  border: 0;
  background: var(--card-border);
  color: var(--title-grey);
  font: 700 14px/50px var(--font-body);
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.load-more:hover { background: var(--green); color: #fff; }
.load-more[hidden] { display: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sidebar img {
  width: 200px;
  border-radius: 50%;
  transition: transform .35s ease;
}
.sidebar img:hover { transform: scale(1.05); }

/* ---------- Footer ---------- */
.site-footer { border-top: 12px solid #fff; }

.footer-widgets {
  background: var(--footer-bg);
  padding: 43px 0 40px;
  color: #fff;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 32px;
}
.footer-col h4 {
  margin: 0 0 28px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  text-transform: uppercase;
  color: #fff;
}
.footer-col p { line-height: 21px; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li { padding: 0 0 15px; line-height: 21px; }
.footer-links a { color: var(--green-light); }
.footer-links a:hover { color: #fff; }

.copyright {
  background: var(--copyright-bg);
  border-top: 1px solid #4b4c4d;
  padding: 18px 0 16px;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}
.copyright p { margin: 0 0 18px; }
.copyright p:last-child { margin-bottom: 0; }
.copyright a { color: var(--green-light); }
.copyright a:hover { color: #fff; }

/* ---------- Cookie notice (like original) ---------- */
.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  padding: 14px var(--side-pad);
  background: #fff;
  color: #000;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 -1px 10px rgba(0, 0, 0, .18);
  transform: translateY(110%);
  transition: transform .45s ease;
}
.cookie.is-visible { transform: none; }
.cookie p { margin: 0; }
.cookie-accept {
  padding: 6px 12px;
  border: 0;
  background: #000;
  color: #fff;
  font: 14px var(--font-body);
  cursor: pointer;
}
.cookie-accept:hover { background: var(--green); }
.cookie-more { color: #333; text-decoration: underline; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 30px;
  bottom: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 48px;
  height: 36px;
  border-radius: 4px 4px 0 0;
  background: #333;
  color: #fff;
  font-size: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s, background .2s ease;
}
.to-top svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--green); color: #fff; }
body.cookie-open .to-top { bottom: 60px; }

/* ==========================================================================
   Article pages (single post / page) – like the original
   ========================================================================== */

/* Green page title bar under the header */
.page-title-bar {
  background: var(--green-light);
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
}
.page-title-bar .container {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding-top: 5px;
  padding-bottom: 5px;
}
.page-title-bar h1 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #000;
}

.page-main { padding-top: 15px; }

/* Previous / Next */
.single-nav {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin: 0 0 60px;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  line-height: 34px;
}
.single-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
}
.single-nav a:hover { color: var(--green-light); }
.single-nav svg {
  width: 10px; height: 10px;
  fill: none; stroke: var(--green-light); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.page-main--plain .article-layout { margin-top: 45px; }

/* Content 3/4 + sidebar 1/4 */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 72fr) minmax(0, 24fr);
  column-gap: 4%;
  align-items: start;
}

/* Article typography */
.article-body { line-height: 21px; }
.article-body p { margin: 0 0 20px; }
.article-body h2 {
  margin: 22px 0;
  font-family: var(--font-body);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.4;
}
.article-body h3 {
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  line-height: 27px;
}
.article-body h4,
.article-body h5,
.article-body h6 {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
}
.article-body ul,
.article-body ol { margin: 14px 0 20px; padding-left: 40px; }
.article-body li { margin-bottom: 15px; }
.article-body li > p { margin-bottom: 8px; }
.article-body a { color: var(--link); word-break: break-word; }
.article-body a:hover { color: var(--green-light); text-decoration: underline; }
.article-body img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}
.article-body .alignleft { float: left; margin: 4px 25px 15px 0; }
.article-body .alignright { float: right; margin: 4px 0 15px 25px; }
.article-body .aligncenter { display: block; margin: 10px auto 20px; }
.article-body h2,
.article-body h3,
.article-body .share-box { clear: both; }
.article-body::after { content: ""; display: table; clear: both; }
.article-body blockquote {
  margin: 20px 0;
  padding: 10px 20px;
  border-left: 4px solid var(--green);
  font-style: italic;
}
.article-body table { width: 100%; margin: 0 0 20px; border-collapse: collapse; }
.article-body td,
.article-body th { padding: 6px 10px; border: 1px solid var(--card-border); text-align: left; }
.article-body .video {
  position: relative;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  margin: 0 0 20px;
}
.article-body .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Share box */
.share-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 60px 0 55px;
  padding: 20px;
  background: var(--card-bg);
}
.share-box h4 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 400;
  color: var(--title-grey);
  text-transform: uppercase;
}
.share-links { display: flex; gap: 18px; }
.share-links a { display: inline-flex; color: var(--link); transition: color .2s, transform .2s; }
.share-links a:hover { color: var(--green-light); transform: translateY(-2px); }
.share-links svg { width: 16px; height: 16px; fill: currentColor; }

/* Article sidebar – recent posts */
.article-sidebar .widget-title {
  margin: 17px 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 400;
  line-height: 19.5px;
  color: var(--title-grey);
}
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
  position: relative;
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid #000;
}
.recent-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 17px;
  width: 5px; height: 5px;
  border-top: 1.5px solid var(--green-light);
  border-right: 1.5px solid var(--green-light);
  transform: rotate(45deg);
}
.recent-list a { color: var(--link); }
.recent-list a:hover { color: var(--green-light); }
.recent-list a[aria-current="page"] { font-weight: 700; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 30px;
  }
  .sidebar img { width: 170px; }
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .footer-col:last-child { grid-column: 1 / -1; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { margin-bottom: 40px; }
}

@media (max-width: 800px) {
  :root { --side-pad: 20px; }
  .topbar { text-align: center; }
  .header-inner { justify-content: center; }
  .logo img { height: 120px; }
  .site-header.is-scrolled .logo img { height: 64px; }
  .slider-arrow { display: none; }
}

@media (max-width: 640px) {
  :root { --side-pad: 16px; }
  .topbar { font-size: 11px; }
  .topbar p { padding: 9px 0; }
  .logo img { height: 100px; }
  .site-header.is-scrolled .logo img { height: 56px; }
  .slider-dots { padding: 10px 0 8px; }
  .quote { margin: 24px 0; }
  .posts { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; }
  .load-more { margin: 24px 0 32px; }
  .sidebar img { width: calc(50% - 5px); max-width: 200px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col h4 { margin-bottom: 18px; }
  .cookie { padding: 14px 16px; }
  .cookie p { flex-basis: 100%; }
  body.cookie-open .to-top { bottom: 130px; }
  .to-top { right: 16px; }
  .page-title-bar .container { min-height: 56px; }
  .page-title-bar h1 { font-size: 16px; }
  .single-nav { margin-bottom: 32px; }
  .page-main--plain .article-layout { margin-top: 24px; }
  .article-body h2 { font-size: 26px; margin: 18px 0; }
  .article-body h3 { font-size: 17px; }
  .article-body ul, .article-body ol { padding-left: 24px; }
  .article-body .alignleft,
  .article-body .alignright { float: none; display: block; margin: 0 0 16px; }
  .share-box { margin: 40px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
