/*
Theme Name: Tarot of Change
Theme URI: https://tarotofchange.com/
Author: Tarot of Change
Description: Own block theme for tarotofchange.com. Calm forest-ink design system with editorial images, grounded typography, and clear reading flows.
Requires at least: 6.5
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: tarotofchange
*/

/* Polished static export layer. WordPress emits most presets inline, so these
   rules intentionally use semantic selectors and light overrides. */
:root {
  --wp--preset--color--primary: #24543a;
  --wp--preset--color--primary-hover: #173b23;
  --wp--preset--color--mono-1: #14251b;
  --wp--preset--color--mono-2: #514f49;
  --wp--preset--color--mono-3: #d7d0bf;
  --wp--preset--color--mono-4: #f1ecdf;
  --wp--preset--color--contrast-light: #fbf7ec;
  --wp--preset--color--contrast-dark: #20201d;
  --wp--preset--color--base: #fbfaf6;
  --wp--preset--color--featured: #14251b;
  --wp--preset--color--tertiary: #9a5734;
  --toc-surface: #fffdf8;
  --toc-border: rgba(36, 84, 58, .18);
  --toc-shadow: 0 22px 60px rgba(20, 37, 27, .12);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(180deg, #fbfaf6 0%, #f3efe4 100%);
  color: var(--wp--preset--color--contrast-dark);
  text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
  text-underline-offset: .18em;
}

a:focus-visible,
.wp-block-button__link:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(154, 87, 52, .55);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.has-fontprimary-font-family,
.has-alegreya-font-family {
  font-family: "Cormorant Garamond", "Fraunces", Georgia, serif !important;
  letter-spacing: 0;
}

h1.wp-block-heading {
  max-width: 820px;
  font-size: clamp(2.9rem, 7vw, 5.8rem) !important;
  line-height: .94 !important;
  font-weight: 700 !important;
}

h2.wp-block-heading {
  letter-spacing: 0;
}

p {
  max-width: 68ch;
}

.wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 20;
}

header.wp-block-template-part > .wp-block-group {
  border-color: rgba(36, 84, 58, .14) !important;
  background: rgba(251, 250, 246, .92) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

header.wp-block-template-part .wp-block-columns {
  display: grid !important;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.8fr) auto;
  gap: clamp(.75rem, 2vw, 1.25rem);
  align-items: center;
}

header.wp-block-template-part .wp-block-column {
  min-width: 0;
}

.wp-block-site-title a {
  color: var(--wp--preset--color--mono-1) !important;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.wp-block-navigation__container {
  flex-wrap: nowrap !important;
  gap: .2rem !important;
}

.wp-block-navigation-item__content {
  border-radius: 999px;
  padding: .42rem .58rem;
  transition: background-color .2s ease, color .2s ease;
  white-space: nowrap;
}

.wp-block-navigation-item__content:hover {
  background: rgba(36, 84, 58, .08);
  color: var(--wp--preset--color--primary-hover) !important;
}

.wp-block-button__link,
.wp-element-button {
  border-radius: 8px !important;
  box-shadow: 0 10px 24px rgba(23, 59, 35, .18);
  font-weight: 700;
  letter-spacing: 0;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(23, 59, 35, .22);
}

.wp-block-button__link:active,
.wp-element-button:active {
  transform: translateY(1px);
}

.has-tertiary-background-color .wp-block-button__link,
.wp-block-button__link.has-tertiary-background-color {
  background: var(--wp--preset--color--tertiary) !important;
  color: #fff9ee !important;
}

.has-tertiary-background-color {
  color: #fff9ee !important;
  border-radius: 14px !important;
}

.has-tertiary-background-color p,
.has-tertiary-background-color h3,
.has-tertiary-background-color h4,
.has-tertiary-background-color h5,
.has-tertiary-background-color h6 {
  color: #fff9ee !important;
}

.has-tertiary-background-color .wp-block-button__link:not(.has-tertiary-background-color) {
  background: #fff9ee !important;
  color: #173b23 !important;
  box-shadow: 0 10px 24px rgba(20, 37, 27, .18);
}

.has-tertiary-background-color .is-nowrap {
  flex-wrap: wrap !important;
  align-items: center;
}

.has-tertiary-background-color .is-nowrap .wp-block-image {
  flex: 0 0 64px;
}

.has-tertiary-background-color .is-nowrap .wp-block-image img {
  width: 64px !important;
  height: 64px !important;
}

.wp-block-group.alignfull {
  overflow: clip;
}

body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) {
  padding-top: clamp(3rem, 8vw, 6.5rem) !important;
}

body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) > .wp-block-group:first-child {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.35rem;
}

body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) .wp-block-buttons {
  margin-top: .2rem;
}

body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) figure img {
  width: min(1120px, 100%) !important;
  height: clamp(320px, 46vw, 560px) !important;
  border-radius: 18px !important;
  box-shadow: var(--toc-shadow);
}

.wp-block-image img {
  display: block;
  border-radius: 14px;
  background: #eee7d8;
}

.wp-block-image.has-custom-border img,
.wp-block-cover__image-background {
  border-radius: 14px !important;
}

.wp-block-image img[src*="toc-reader-"],
.wp-block-image img[src*="toc-icon-"] {
  box-shadow: 0 8px 18px rgba(20, 37, 27, .14);
}

.wp-block-image img[src*="toc-icon-"] {
  border-radius: 12px !important;
}

.wp-block-columns.alignwide {
  gap: clamp(1.25rem, 3vw, 2rem);
}

.wp-block-column.has-primary-background-color,
.has-mono-4-background-color,
.has-contrast-light-background-color {
  border: 1px solid var(--toc-border);
  border-radius: 14px !important;
  box-shadow: 0 12px 34px rgba(20, 37, 27, .07);
}

.has-primary-background-color {
  background: linear-gradient(145deg, #24543a, #173b23) !important;
}

.has-mono-4-background-color {
  background: var(--toc-surface) !important;
}

.wp-block-cover {
  min-height: clamp(440px, 62vw, 640px);
}

.wp-block-cover .wp-block-cover__background {
  background-color: #14251b !important;
  opacity: .62 !important;
}

.wp-block-cover__inner-container {
  border-radius: 16px;
}

.legal-links-row a,
footer .wp-block-paragraph a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.wp-block-group.toc-footer {
  background:
    linear-gradient(180deg, #14251b 0%, #102016 100%) !important;
}

.wp-block-group.toc-footer a {
  color: inherit;
}

.wp-block-group.toc-footer .wp-block-separator {
  opacity: .32;
}

body:not(.home) .wp-site-blocks > .wp-block-group,
body.page .wp-site-blocks > .wp-block-group {
  padding-top: clamp(2.5rem, 7vw, 5rem) !important;
  padding-bottom: clamp(2.5rem, 7vw, 5rem) !important;
}

body.page h1.wp-block-heading,
body.page .wp-block-post-title {
  font-size: clamp(2.5rem, 6vw, 4.8rem) !important;
  line-height: 1 !important;
}

.toc-legal-cover {
  margin: 0 auto var(--wp--preset--spacing--superbspacing-small);
  max-width: 800px;
  border: 1px solid rgba(36, 84, 58, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: var(--toc-paper);
  box-shadow: var(--toc-shadow);
}

.toc-legal-cover img {
  display: block;
  width: 100%;
  height: clamp(220px, 34vw, 360px);
  object-fit: cover;
}

.toc-legal-cover figcaption {
  margin: 0;
  padding: 14px 18px 16px;
  color: var(--toc-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  background: rgba(250, 246, 237, 0.92);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }
}

@media (max-width: 781px) {
  header.wp-block-template-part .wp-block-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .65rem;
  }

  header.wp-block-template-part .wp-block-column:nth-child(3) {
    justify-self: end;
  }

  header.wp-block-template-part .wp-block-site-title a {
    font-size: 1.05rem;
  }

  header.wp-block-template-part .wp-block-button__link {
    padding: .62rem .85rem !important;
    font-size: .86rem !important;
    white-space: nowrap;
  }

  .wp-block-buttons.is-nowrap {
    flex-wrap: wrap !important;
  }

  h1.wp-block-heading {
    font-size: clamp(2.45rem, 11vw, 3.05rem) !important;
    line-height: .98 !important;
  }

  body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) {
    padding-top: 2.2rem !important;
  }

  body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) p {
    font-size: 1rem !important;
    line-height: 1.55;
  }

  body.home .wp-site-blocks > .wp-block-group:nth-of-type(1) figure img {
    height: 300px !important;
  }

  .wp-block-cover {
    min-height: 520px;
  }
}
