/* ------------------------------
   Design tokens & base
   ------------------------------ */

/* 1) Semantic color variables and light palette */
:root {
  color-scheme: light;

  --bg: #fdfdfb;
  --surface: #f3f3f0;
  --surface-hover: #ecece8;
  --text: #222222;
  --muted: #555555;
  --link: #444444;
  --link-hover: #666666;
  --brand: #0066ff;
  --border: #cccccc;
  --navigation-fg: #444444;
  --navigation-fg-strong: #333333;
  --navigation-border: #cccccc;
  --navigation-hover: #666666;
  --scrim: rgba(0, 0, 0, 0.5);
  --share-icon-filter: none;
  --theme-switch-filter: brightness(0) opacity(0.75);

  /* Type scale */
  --size-100: 0.875rem;
  --size-200: 1rem;
  --size-300: 1.125rem;
  --size-400: 1.25rem;
  --size-500: 1.5rem;
  --size-550: 1.75rem;
  --size-600: 2rem;

  /* Layout and text flow */
  --container: 78ch;
  --text-measure: 66ch;
  --gutter: 1rem;
  --flow-space: 1.15em;
  --paragraph-leading: 1.58;

  /* #navigation width */
  --nav-width: 8rem;
}

/* Resolved by theme.js before this stylesheet is parsed. */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1b1b1a;
  --surface: #242422;
  --surface-hover: #2d2d2a;
  --text: #dddddd;
  --muted: #aaaaaa;
  --link: #bdbdb8;
  --link-hover: #ededed;
  --brand: #78aaff;
  --border: #4a4a46;
  --navigation-fg: #b5b5b0;
  --navigation-fg-strong: #dddddd;
  --navigation-border: #4a4a46;
  --navigation-hover: #ededed;
  --scrim: rgba(0, 0, 0, 0.68);
  --share-icon-filter: grayscale(1) brightness(0) invert(1) opacity(0.82);
  --theme-switch-filter: none;
}

/* 2) Fluid root font-size; replaces body font scaling */
html { 
  /* 18px → 20px between ~250–750px viewport; then capped at 20px */
  font-size: clamp(18px, 17px + 0.4vw, 20px);
}

/* Base body — no max-width and no body font scaling */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.45;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  margin: 0;
}

/* Links pick up tokens */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.18s ease;
}

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

h1 {
  margin: 0.67rem 0;
  font-weight: 300;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.5rem); /* fluid, capped by html clamp */
}

/* Display title used on the page */
.header {
  max-width: 12ch;
  margin: 0 0 2.1rem;
  padding-left: 0;
  color: var(--text);
  font-family: 'EB Garamond', serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}


/* local nav tokens (scoped) */
#navigation {
  --nav-fg: var(--navigation-fg);
  --nav-fg-strong: var(--navigation-fg-strong);
  --nav-border: var(--navigation-border);
  --nav-border-hover: var(--brand);
  --nav-hover: var(--navigation-hover);

  position: fixed;
  height: auto;
  top: 8.0rem;
  left: 0;
  width: var(--nav-width);
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.0;
  color: var(--nav-fg);
  padding: 0;
  overflow: hidden;
  z-index: 50;
}

#navigation a {
  color: var(--nav-fg);
  text-decoration: none;
  display: block;
  border-width: 2pt;
  border-top-style: dotted;
  border-top-color: var(--nav-border);
  border-bottom-color: var(--nav-border);
}

#navigation a:hover {
  color: var(--nav-hover);
  border-top-color: var(--nav-border-hover);
  border-bottom-color: var(--nav-border-hover);
}


/* list reset */
#navigation-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

/* list link styling */
#navigation-list li a {
  text-decoration: none;
  color: var(--nav-fg-strong);
  display: block;
  padding: .5rem 0 .65rem .5rem;
}

#menubutton {
  display: none;
  }
#closebutton {
  display: none;
}


#content {
  position: relative;
  top: 0;
  left: 0;                     /* no absolute shove */

  margin: 3.3rem auto 0;
  padding: 0 var(--gutter) 20px var(--gutter);

  max-width: var(--container);
  overflow: visible;          /* avoids unwanted inner scrollbars */
}

/* Editorial reading width and vertical rhythm */
.editorial-content {
  max-width: var(--text-measure);
}

.content-flow > * {
  margin-block: 0;
}

.content-flow > * + * {
  margin-top: var(--flow-space);
}

.content-flow > .header {
  margin-bottom: 2.1rem;
}

.content-flow p {
  line-height: var(--paragraph-leading);
}

/* Compact sharing controls at the end of editorial content */
.content-flow > .share-bar {
  margin-top: 1.7rem;
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: -0.3rem;
}

.share-bar__item {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}

.share-bar__item:hover {
  background-color: var(--surface-hover);
  transform: translateY(-1px);
}

.share-bar__item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.share-bar__icon {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
  filter: var(--share-icon-filter);
  transition: filter 0.2s ease;
}

.share-bar__status {
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: var(--size-100);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.1rem);
  transition:
    opacity 0.30s ease,
    transform 0.18s ease;
}

.share-bar__status.is-visible {
  opacity: 0.9;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .share-bar__item:hover {
    transform: none;
  }
}

/* Reusable site footer */
.site-footer {
  color: var(--muted);
  font-size: var(--size-100);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin: clamp(3.25rem, 8vw, 5.5rem) auto 0;
  padding: 1rem var(--gutter) max(1.4rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.site-footer__signature {
  margin: 0;
  line-height: 1.4;
}

.site-footer__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.site-footer__controls:empty {
  display: none;
}

/* Three-state theme switch */
.theme-switch {
  position: relative;
  display: none;
  width: 3.5rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.theme-enabled .theme-switch {
  display: inline-grid;
  place-items: center;
}

.theme-switch:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.theme-switch__image {
  position: absolute;
  display: block;
  width: 3rem;
  height: auto;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  user-select: none;
  filter: var(--theme-switch-filter);
  transition:
    filter 0.2s ease,
    opacity 0.22s ease,
    transform 0.24s ease;
}

html[data-theme-preference="light"] .theme-switch__image--light,
html[data-theme-preference="auto"] .theme-switch__image--auto,
html[data-theme-preference="dark"] .theme-switch__image--dark {
  opacity: 1;
  transform: scale(1);
}

.theme-switch:active .theme-switch__image {
  transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
  .theme-switch__image {
    transition: none;
  }
}

/* Lead media block for editorial pages */
.lead-media {
  max-width: min(100%, 34rem);
  margin: 0 0 clamp(1.4rem, 3vw, 2.4rem);
}

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

.lead-media-narrow {
  max-width: 28rem;
}

.lead-media-wide {
  max-width: min(100%, var(--container));
}

.lead-media-float {
  float: left;
  width: min(36%, 260px);
  max-width: none;
  margin: 0 1rem 1rem 0;
}

/* Reusable floated media block for editorial pages */
.media-float {
  margin: 0 1rem 1rem 0;
}

.media-float-left {
  float: left;
  max-width: min(45%, 260px);
}

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

/* Desktop: leave room for the fixed left nav */
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  #content {
    /* push content to the right of the nav, plus a gutter */
    margin-left: calc(var(--nav-width) + var(--gutter));
    margin-right: var(--gutter);
  }
}

#whatsapp {
  display: none;
}
#ipcheck {
  display: none;
}

/* Scrim sits behind the drawer and catches clicks */
#scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);     /* invisible when closed */
  pointer-events: none;           /* no clicks when closed */
  transition: background .2s ease;
  z-index: 49;                    /* under #navigation (50) */
}

/* When menu is open, we’ll add a class to body to activate the scrim */
.body--nav-open #scrim {
  background: var(--scrim);
  pointer-events: auto;
}

/* Ensure the drawer stays above scrim */
#navigation { z-index: 50; }  /* already present, keep it that way */


@media (max-width: 1200px) {
  body {
	max-width: unset;
  }
  #navigation {
    width: 0;
    background-color: var(--bg);
    display: block;
    height : 100%;
    top : 0px;
    left : 0;
	font-size: 1.2em;
    color : var(--navigation-fg);
    padding-top : 120px;
    overflow : hidden;
    overflow-x: hidden;
    transition: 0.2s;
    z-index: 50;
  }
  #menubutton {
    font-size: 45px;
    cursor: pointer;
    background-color: var(--bg);
    position: fixed;
    top: 0;
    left: 4px;
    padding: 2px;
    display: block;
    z-index: 10;
  }
  #closebutton {
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    background-color: var(--bg);
    position: fixed;
    top: 0;
    left: 4px;
    padding: 2px;
    display: none;
    z-index: 51;
  }
  #content {
    position : relative;
    top: 0;
    left: 0px;
    margin : 50px 0px 0px 0px;
    max-width : unset;
    z-index: 1;
  }
  .media-float-left {
    float: none;
    max-width: 100%;
    margin: 0 0 var(--flow-space);
  }
  #whatsapp {
	margin-top: 50px;
	width: 70px;
    height: 70px;
    display: block;
  }
}
@media (min-resolution: 192dpi) {
  body {
	max-width: unset;
  }

  #navigation {
    width: 0;
    background-color: var(--bg);
    display: block;
    height : 100%;
    top : 0px;
    left : 0;
	font-size: 1.1em;
	line-height: 1.4;
    color : var(--navigation-fg);
    padding-top : 220px;
    overflow : hidden;
    overflow-x: hidden;
    transition: 0.2s;
    z-index: 50;
  }
  #menubutton {
    font-size: 90px;
    cursor: pointer;
    background-color: var(--bg);
    position: fixed;
    top: 0;
    left: 4px;
    padding: 4px;
	padding-right: 14px;
    display: block;
    z-index: 10;
  }
  #closebutton {
    font-size: 100px;
    font-weight: bold;
    cursor: pointer;
    background-color: var(--bg);
    position: fixed;
    top: 0;
    left: 4px;
    padding: 2px;
    display: none;
    z-index: 51;
  }
  #content {
    position : relative;
    top: 0;
    left: 0px;
    margin : 50px 0px 0px 0px;
    max-width : unset;
    z-index: 1;
  }
  #whatsapp {
	margin-top: 60px;
	width: 100px;
    height: 100px;
    display: block;
  }
}
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2) {
  #ipcheck {
  position : fixed;
  height : auto;
  top : 260px;
  left : 0;
  width : auto;
  margin : 0px 0px 0px 0px;
  font-size: 3em;
  line-height: 1.0;
  color : red;
  padding : 0px;
  overflow : hidden;
  z-index: 150;
  display: block;
  }
}

/* Wide tablet and desktop refinement: keep the classic side navigation */
@media (min-width: 900px) {
  #menubutton,
  #closebutton {
    display: none !important;
  }

  #navigation {
    position: fixed;
    height: auto;
    top: 8rem;
    left: 0;
    width: var(--nav-width) !important;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: transparent;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 50;
  }

  #content {
    margin: 3.3rem var(--gutter) 0 calc(var(--nav-width) + var(--gutter));
    padding: 0 var(--gutter) 20px var(--gutter);
    max-width: var(--container);
  }

  .site-footer__inner {
    margin-left: calc(var(--nav-width) + var(--gutter));
    margin-right: var(--gutter);
  }
}

/* Compact navigation: phones and narrow tablets */
@media (max-width: 899px) {
  :root {
    --gutter: 1.25rem;
  }

  #content {
    margin: 3.4rem 0 0;
    padding-inline: var(--gutter);
  }

  #menubutton,
  #closebutton {
    top: 1rem;
    left: 1rem;
    width: 3.4rem;
    height: 3.4rem;
    padding: 0;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    line-height: 1;
    z-index: 60;
  }

  #menubutton {
    display: flex;
    font-size: clamp(2.6rem, 12vw, 3.3rem);
  }

  #closebutton {
    font-size: clamp(2.8rem, 13vw, 3.6rem);
  }

  .body--nav-open #menubutton {
    display: none;
  }

  .body--nav-open #closebutton {
    display: flex;
  }

  .header {
    max-width: calc(100% - 4.9rem);
    margin-left: 4.9rem;
    margin-bottom: 1.8rem;
    font-size: clamp(2.15rem, 10.5vw, 3.15rem);
    line-height: 0.95;
  }

  .lead-media,
  .lead-media-float {
    float: none;
    width: auto;
    max-width: none;
    margin: 0 0 var(--flow-space);
  }

  .lead-media img {
    width: 100%;
  }

  .media-float-left {
    float: none;
    max-width: 100%;
    margin: 0 0 var(--flow-space);
  }

  .media-float img {
    width: min(100%, 260px);
    height: auto;
  }

  .content-flow > .share-bar {
    margin-top: 1.5rem;
  }

  .share-bar {
    gap: 0;
    margin-left: -0.55rem;
  }

  .share-bar__item {
    width: 2.75rem;
    height: 2.75rem;
  }

  .share-bar__icon {
    width: 1.6rem;
    height: 1.6rem;
  }
}

/* Keep every interaction still when the user requests reduced motion. */
@media (prefers-reduced-motion: reduce) {
  body,
  a,
  #navigation,
  #menubutton,
  #closebutton,
  #scrim,
  .share-bar__item,
  .share-bar__icon,
  .share-bar__status,
  .site-footer__inner,
  .theme-switch__image {
    transition: none;
  }
}
