/* ==========================================================================
   Onesto Global: WordPress additions
   Loaded after styles.css (the home page, header and footer from the static
   site). This file covers what WordPress adds: the toolbar offset, the header
   menu on smaller screens, pages and posts created in the editor, their block
   content, post lists and the 404 page. Same tokens as styles.css.
   ========================================================================== */

/* ---------- 1. WordPress toolbar (logged-in users) ---------- */
.admin-bar .site_header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site_header { top: 46px; }
}
/* Below 600px the toolbar scrolls away with the page */
@media screen and (max-width: 600px) {
  .admin-bar .site_header { top: 0; }
}

/* WordPress's own hidden-text class (search form, pagination headings) */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  width: auto; height: auto;
  clip: auto;
  z-index: var(--z_skip);
  padding: 10px 16px;
  background: var(--color_cream);
  border-radius: var(--radius_button);
}

/* ---------- 2. Header menu ---------- */
/* The page the visitor is on, for menus built in Appearance > Menus */
.header_nav a[aria-current="page"],
.header_nav .current-menu-item > a { background: var(--color_cream); }

/* The CTA inside the menu only shows in the folded menu on phones */
.header_nav .nav_cta {
  display: none;
  justify-content: center;
  min-height: 48px;
  margin-top: 12px;
  border-radius: var(--radius_button);
  background: var(--color_green_dark);
  color: var(--color_cream);
  font-weight: 600;
}
.header_nav .nav_cta:hover { background: var(--color_green_deep); }

.menu_toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color_cream);
  color: var(--color_ink);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.menu_toggle:hover { background: var(--color_white); }
/* Three bars that turn into a cross */
.menu_toggle_bars,
.menu_toggle_bars::before,
.menu_toggle_bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease_out), background-color 0.2s ease;
}
.menu_toggle_bars { position: relative; }
.menu_toggle_bars::before,
.menu_toggle_bars::after { content: ""; position: absolute; left: 0; }
.menu_toggle_bars::before { top: -6px; }
.menu_toggle_bars::after { top: 6px; }
.menu_toggle[aria-expanded="true"] .menu_toggle_bars { background-color: transparent; }
.menu_toggle[aria-expanded="true"] .menu_toggle_bars::before { transform: translateY(6px) rotate(45deg); }
.menu_toggle[aria-expanded="true"] .menu_toggle_bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Under 1100px the links fold into a panel below the header (with JavaScript;
   without it the header keeps the static site's behaviour) */
@media (max-width: 1099px) {
  .js .menu_toggle { display: inline-flex; }
  .js .header_nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header_h));
    max-height: calc(100dvh - var(--header_h));
    overflow-y: auto;
    padding: 12px var(--gutter) 24px;
    background: var(--color_yellow);
    border-top: 1px solid var(--color_line);
    box-shadow: 0 18px 30px rgba(58, 57, 60, 0.14);
    visibility: hidden;
    opacity: 0;
    translate: 0 -8px;
    transition: opacity 0.2s ease, translate 0.25s var(--ease_out), visibility 0s linear 0.25s;
  }
  .js .site_header.is_menu_open .header_nav {
    visibility: visible;
    opacity: 1;
    translate: none;
    transition-delay: 0s;
  }
  .js .header_nav ul { flex-direction: column; gap: 2px; }
  .js .header_nav li > a { display: flex; width: 100%; min-height: 48px; font-size: 17px; }
}
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) {
  .js .header_nav { transition: none; translate: none; }
}
/* Narrow phones: when there is a menu, the CTA moves from the header bar into it */
@media (max-width: 459px) {
  .js .site_header:has(.header_nav) .header_cta { display: none; }
  .js .header_nav .nav_cta { display: flex; }
}

/* ---------- 3. Footer legal line ---------- */
.footer_legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
}
.legal_links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer_legal a {
  text-decoration: underline;
  text-decoration-color: rgba(58, 57, 60, 0.35);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.footer_legal a:hover { color: var(--color_green_dark); text-decoration-color: currentColor; }

/* ---------- 4. Contact form additions ---------- */
/* Honeypot field: off screen for people, still filled in by bots */
.field_hp {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.field_check label a {
  color: var(--color_green_dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.field_check label a:hover { color: var(--color_green_deep); }
.contact_form[aria-busy="true"] .btn_block { opacity: 0.7; cursor: progress; }

/* ---------- 5. Pages and posts on a card ---------- */
.entry_section { padding-top: 0; }
.entry_card {
  --card_pad_x: max(20px, calc(52 * var(--s)));
  position: relative;
  overflow: hidden;
  padding: max(36px, calc(80 * var(--s))) var(--card_pad_x) max(40px, calc(80 * var(--s)));
}
.entry_card > :not(.art_layer) { position: relative; z-index: 1; }
.entry_glow { right: -220px; top: -300px; width: 680px; }
.entry_dots { right: 24px; top: 16px; opacity: 0.14; }

.entry_header { max-width: 760px; margin: 0 auto max(28px, calc(44 * var(--s))); }
.entry_title { overflow-wrap: break-word; }
.entry_lead { margin-top: max(16px, calc(24 * var(--s))); color: var(--color_ink); }
.entry_meta { margin-bottom: 12px; color: var(--color_muted); }
.entry_media {
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  margin: 0 auto max(28px, calc(44 * var(--s)));
}

/* ---------- 6. Block content ---------- */
.entry_content {
  --flow: 1.2em;
  --measure: 760px;
  --wide: 1100px;
  font-size: max(17px, calc(20 * var(--s)));
  line-height: 1.65;
}
.entry_content::after { content: ""; display: table; clear: both; }
.entry_content > * { max-width: var(--measure); margin: 0 auto; }
.entry_content > * + * { margin-top: var(--flow); }
.entry_content > .alignwide { max-width: var(--wide); }
.entry_content > .alignfull { max-width: none; }
.entry_card .entry_content > .alignfull { margin-inline: calc(-1 * var(--card_pad_x)); }

/* Floats sit inside the reading column */
.entry_content .alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.entry_content .alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.entry_content > .alignleft { margin-left: max(0px, calc((100% - var(--measure)) / 2)); }
.entry_content > .alignright { margin-right: max(0px, calc((100% - var(--measure)) / 2)); }
.entry_content .aligncenter { margin-inline: auto; text-align: center; }

/* Headings */
.entry_content :is(h1, h2, h3, h4) {
  font-family: var(--font_display);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--color_ink);
  text-wrap: balance;
  margin-bottom: 0;
}
.entry_content :is(h5, h6) {
  font-family: var(--font_body);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0;
}
.entry_content h1 { font-size: max(34px, calc(60 * var(--s))); }
.entry_content h2 { font-size: max(28px, calc(46 * var(--s))); }
.entry_content h3 { font-size: max(23px, calc(33 * var(--s))); }
.entry_content h4 { font-size: max(20px, calc(25 * var(--s))); }
.entry_content h5 { font-size: 1em; }
.entry_content h6 { font-size: 0.85em; letter-spacing: 0.06em; text-transform: uppercase; }
.entry_content > :is(h2, h3, h4, h5, h6) { margin-top: 1.7em; }
.entry_content > :is(h2, h3, h4, h5, h6) + * { margin-top: 0.6em; }
.entry_content > :first-child { margin-top: 0; }

/* Text */
.entry_content strong { font-weight: 700; }
.entry_content a:where(:not(.wp-element-button):not(.wp-block-button__link)) {
  color: var(--color_green_dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.entry_content a:where(:not(.wp-element-button):not(.wp-block-button__link)):hover {
  color: var(--color_green_deep);
  text-decoration-thickness: 2px;
}
.entry_content .has-large-font-size,
.entry_content .has-x-large-font-size,
.entry_content .has-xx-large-font-size { line-height: 1.15; }

/* Lists from the List block or classic content (other blocks style their own lists) */
.entry_content :is(ul, ol):where(.wp-block-list, :not([class])) { padding-left: 1.3em; }
.entry_content ul:where(.wp-block-list, :not([class])) { list-style: disc; }
.entry_content ol:where(.wp-block-list, :not([class])) { list-style: decimal; }
.entry_content :is(ul, ol):where(.wp-block-list, :not([class])) li + li { margin-top: 0.4em; }
.entry_content :is(ul, ol):where(.wp-block-list, :not([class])) li::marker { color: var(--color_green_dark); }
.entry_content :is(ul, ol):where(.wp-block-list, :not([class])) :is(ul, ol) { margin-top: 0.4em; }

/* Quotes */
.entry_content blockquote,
.entry_content .wp-block-quote {
  margin-inline: auto;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 4px solid var(--color_green);
  font-family: var(--font_display);
  font-size: 1.25em;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.entry_content blockquote p + p { margin-top: 0.6em; }
.entry_content blockquote cite,
.entry_content .wp-block-quote cite,
.entry_content .wp-block-pullquote cite {
  display: block;
  margin-top: 0.8em;
  font-family: var(--font_body);
  font-size: 0.65em;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color_muted);
}
.entry_content .wp-block-pullquote {
  padding-block: 1.5em;
  border-block: 2px solid var(--color_ink);
  font-family: var(--font_display);
}
.entry_content .wp-block-pullquote blockquote { border: 0; padding: 0; }

/* Media */
.entry_content :is(.wp-block-image, .wp-block-video, .wp-block-embed) { margin-bottom: 0; }
.entry_content .wp-block-image:not(.is-style-rounded) img,
.entry_content .wp-block-video video { border-radius: var(--radius); }
.entry_content .alignfull img,
.entry_content .alignfull video { border-radius: 0 !important; }
.entry_content :is(figcaption, .wp-element-caption, .wp-caption-text) {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color_muted);
  text-align: center;
}
.entry_content .wp-caption { max-width: 100%; }
.entry_content .wp-block-cover { border-radius: var(--radius); overflow: hidden; }
.entry_content .wp-block-cover.alignfull { border-radius: 0; }
.entry_content .wp-block-group.has-background { border-radius: var(--radius); }
.entry_content .wp-block-group.alignfull.has-background { border-radius: 0; }

/* Buttons */
.entry_content :is(.wp-block-button__link, .wp-element-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--radius_button);
  background-color: var(--color_green_dark);
  color: var(--color_cream);
  font-family: var(--font_body);
  font-size: var(--fs_ui);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease_out);
}
.entry_content :is(.wp-block-button__link, .wp-element-button):hover {
  background-color: var(--color_green_deep);
  color: var(--color_cream);
}
@media (hover: hover) {
  .entry_content :is(.wp-block-button__link, .wp-element-button):hover { transform: translateY(-1px); box-shadow: var(--shadow_button); }
}
.entry_content .is-style-outline > .wp-block-button__link {
  border: 2px solid currentColor;
  background-color: transparent;
  color: var(--color_green_dark);
}
.entry_content .is-style-outline > .wp-block-button__link:hover {
  background-color: var(--color_green_dark);
  color: var(--color_cream);
}

/* Separators, tables, code */
.entry_content hr,
.entry_content .wp-block-separator {
  margin-block: 2.2em;
  border: 0;
  border-top: 1px solid var(--color_line);
  opacity: 1;
}
.entry_content .wp-block-separator.has-background { border-top: 0; height: 2px; }
.entry_content table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.entry_content :is(th, td) {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--color_line);
  text-align: left;
  vertical-align: top;
}
.entry_content thead :is(th, td) { border-bottom: 2px solid var(--color_ink); font-weight: 700; }
.entry_content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: rgba(239, 205, 94, 0.25); }
.entry_content :is(code, kbd) { padding: 0.1em 0.35em; border-radius: 4px; background: rgba(58, 57, 60, 0.07); font-size: 0.88em; }
.entry_content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--radius_button);
  background: rgba(58, 57, 60, 0.07);
  font-size: 0.85em;
  line-height: 1.5;
}
.entry_content pre code { padding: 0; background: none; }

/* Page breaks (<!--nextpage-->) */
.entry_content .post-nav-links { font-weight: 600; }

/* ---------- 7. Full width template (page-templates/page-full-width.php) ---------- */
.entry_wide_header { padding-block: max(40px, calc(80 * var(--s))) max(28px, calc(48 * var(--s))); }
.entry_wide_title { max-width: 16ch; overflow-wrap: break-word; }
.entry_wide_header .entry_lead { max-width: 640px; }
.entry_wide_glow { right: -160px; top: -200px; width: 620px; }
.entry_wide_dots { left: -20px; bottom: -40px; }
.entry_content_wide { padding-bottom: max(48px, calc(80 * var(--s))); }
.entry_content_wide > * { max-width: min(var(--measure), 100% - 2 * var(--gutter)); }
.entry_content_wide > .alignwide { max-width: min(var(--content_max) - 2 * var(--gutter), 100% - 2 * var(--gutter)); }
.entry_content_wide > .alignfull { max-width: none; }
.entry_content_wide > .alignfull.has-background { padding-inline: var(--gutter); }

/* ---------- 8. Post lists, search and pagination (index.php) ---------- */
.listing { padding-top: max(40px, calc(70 * var(--s))); padding-bottom: max(48px, calc(80 * var(--s))); }
.listing_glow { right: -200px; top: -240px; width: 640px; }
.listing_dots { left: -30px; top: 40px; }
.listing_header { max-width: 900px; margin-bottom: max(28px, calc(44 * var(--s))); }
.listing_lead { margin-top: 16px; }

.post_grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap_wide); }
.post_card { display: flex; flex-direction: column; overflow: hidden; }
.post_card_media { display: block; aspect-ratio: 16 / 10; border-radius: 0; }
.post_card_body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: max(20px, calc(28 * var(--s)));
}
.post_card .entry_meta { margin: 0; font-size: 15px; }
.post_card_title { font-size: max(23px, calc(30 * var(--s))); line-height: 1.05; }
.post_card_title a { text-decoration: none; }
.post_card_title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post_card_excerpt { font-size: var(--fs_small); line-height: 1.5; color: var(--color_ink); }
.post_card .btn_link { margin-top: auto; }

.empty_card { max-width: 760px; padding: max(28px, calc(44 * var(--s))); }
.empty_card .search-form { margin-top: 20px; }

.search-form { display: flex; gap: 10px; }
.search-form label { flex: 1; }
.search-form .search-field {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--color_field_border);
  border-radius: 8px;
  background: var(--color_white);
  color: var(--color_ink);
  font: inherit;
  font-size: 17px;
}
.search-form .search-field:focus-visible {
  outline: none;
  border-color: var(--color_green_dark);
  box-shadow: 0 0 0 3px rgba(14, 94, 62, 0.3);
}
.search-form .search-submit {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius_button);
  background: var(--color_green_dark);
  color: var(--color_cream);
  font: 600 17px var(--font_body);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.search-form .search-submit:hover { background: var(--color_green_deep); }

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: max(32px, calc(48 * var(--s)));
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--color_cream);
  font-size: var(--fs_ui);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
a.page-numbers:hover { background: var(--color_white); }
.page-numbers.current { background: var(--color_ink); color: var(--color_cream); }
.page-numbers.dots { background: transparent; }

/* Previous / next post (single.php) */
.post_nav_section { padding-top: 0; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap_wide); }
.post-navigation .nav-next { grid-column: 2; text-align: right; }
.post-navigation a {
  display: block;
  height: 100%;
  padding: max(18px, calc(24 * var(--s)));
  border-radius: var(--radius);
  background: var(--color_cream);
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow 0.25s ease, transform 0.25s var(--ease_out);
}
.post_nav_dir { color: var(--color_green_dark); }
@media (hover: hover) {
  .post-navigation a:hover { transform: translateY(-2px); box-shadow: var(--shadow_lift); }
}

/* ---------- 9. 404 ---------- */
.not_found { min-height: calc(560 * var(--s)); }
.not_found_code {
  margin-bottom: 12px;
  font-family: var(--font_display);
  font-size: max(88px, calc(180 * var(--s)));
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: var(--color_green);
}
.not_found_actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px max(20px, calc(28 * var(--s)));
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- 10. Tablet and mobile ---------- */
@media (max-width: 1023px) {
  .post_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .entry_card { --card_pad_x: 20px; padding-top: 32px; }
  .entry_content .alignleft,
  .entry_content .alignright { float: none; margin-inline: auto; }
  .post_grid { grid-template-columns: minmax(0, 1fr); }
  .post-navigation .nav-links { grid-template-columns: minmax(0, 1fr); }
  .post-navigation .nav-next { grid-column: auto; }
  .not_found_actions .btn_large { width: 100%; }
  .search-form { flex-direction: column; }
}
