/* Base Container & Font Scaling */
:root {
  --size-unit: 16;
  /* Body font-size in design units (no px) */
  --size-container-ideal: 1680;
  --size-container-min: 992px;
  --size-container-max: 1920px;
  --size-container: clamp(
    var(--size-container-min),
    100vw,
    var(--size-container-max)
  );
  --size-font: calc(
    var(--size-container) / (var(--size-container-ideal) / var(--size-unit))
  );
  font-size: var(--size-font);

  --default-ease: cubic-bezier(0.65, 0.05, 0, 1);
}

/* Tablet */
@media screen and (max-width: 991px) {
  :root {
    --size-container-ideal: 834;
    --size-container-min: 768px;
    --size-container-max: 991px;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 767px) {
  :root {
    --size-container-ideal: 430;
    --size-container-min: 480px;
    --size-container-max: 767px;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 479px) {
  :root {
    --size-container-ideal: 430;
    --size-container-min: 320px;
    --size-container-max: 428px;
  }
}

/* ------------------------------------------------
  02. Color System: OKLCH and Display-P3 Fallback
  ------------------------------------------------ */

/* Fallback: OKLCH if P3 is not supported */
@supports (color: oklch(60% 0 0)) {
  :root {
    --_colors---black: oklch(0% 0 0deg);
    --_colors---blue-ink: oklch(20.9192% 0.03585 251.42deg);
    --_colors---celtic-blue: oklch(56.29019% 0.1934 256.16deg);
    --_colors---off-white: oklch(96.61796% 0.00343 38.52deg);
    --_colors---white: oklch(100% 0 0deg);
  }
}

/* Preferred: Display-P3 */
@supports (color: color(display-p3 1 1 1)) {
  :root {
    --_colors---black: color(display-p3 0 0 0);
    --_colors---blue-ink: color(display-p3 0.05581 0.09664 0.15203);
    --_colors---celtic-blue: color(display-p3 0.18741 0.43617 0.86034);
    --_colors---off-white: color(display-p3 0.96269 0.95333 0.94948);
    --_colors---white: color(display-p3 1 1 1);
  }
}

/* ------------------------------------------------
  03. Reset & Box Model
  ------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  text-size-adjust: 100%;
  text-decoration-skip-ink: auto;
  text-decoration-thickness: 8%;
  text-underline-offset: -8%;
  text-underline-position: from-font;
}

html {
  scroll-behavior: initial;
  scrollbar-width: none;
  /* Firefox */
  -webkit-font-smoothing: antialiased;
}

body {
  width: 100vw;
  font-feature-settings: "case" on, "ss07" on, "ss08" on, "cv01" on, "cv03" on,
    "cv04" on, "cv09" on, "cv10" on, "cv12" on, "cv13" on, "liga" 1, "calt" 1;
}

/* Hide scrollbars universally */
body::-webkit-scrollbar,
body ::-webkit-scrollbar {
  display: none;
  width: 100vw;
}

/* SVG Reset */
svg {
  max-width: none;
  height: auto;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Reset Link Color */
a {
  color: inherit;
}

/* ------------------------------------------------
  04. Typography Utilities
  ------------------------------------------------ */

/* Content & Article Styling for Rich Text */
.rte > :first-child,
.rte-f > :first-child,
.blog-rich-text > :first-child {
  margin-top: 0;
}

.rte > :last-child,
.rte-f > :last-child,
.blog-rich-text > :last-child {
  margin-bottom: 0;
}

.rte > div:first-child > :first-child,
.rte-f > div:first-child > :first-child,
.blog-rich-text > div:first-child > :first-child {
  margin-top: 0;
}

.rte > div:last-child > :last-child,
.rte-f > div:last-child > :last-child,
.blog-rich-text > div:last-child > :last-child {
  margin-bottom: 0;
}

.blog-rich-text br,
.events-rich-text br {
  display: none;
}

.blog-rich-text p:empty,
.events-rich-text p:empty {
  display: none;
}

/* ------------------------------------------------
  05. Utility Attributes
  ------------------------------------------------ */

/* Scrollbars */
[scroll-show="false"] {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

[scroll-show="false"]::-webkit-scrollbar {
  display: none;
}

/* Truncate Text Utility // Show "..." after 1 line */
[data-truncate] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

/* Show "..." after 1 line */
[data-truncate="1"] {
  -webkit-line-clamp: 1;
}

/* Show "..." after 1 line */
[data-truncate="2"] {
  -webkit-line-clamp: 2;
}

/* Selection Highlight */
::selection {
  background-color: #0071e340;
  color: #0071e3;
  text-shadow: none;
}
::-moz-selection {
  background-color: #0071e340;
  color: #0071e3;
  text-shadow: none;
}

/* Gradients */
[data-gradient] {
}

[data-gradient-text] {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ------------------------------------------------
  06. Interactive Link Effects
  ------------------------------------------------ */

/* Underline Animation Link */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  top: 92%;
  left: 0%;
  height: 1px;
  width: 0%;
  background: currentColor;
  transition: width 735ms cubic-bezier(0.65, 0.05, 0, 1);
}

.link-underline:hover::after {
  width: 100%;
}

.link-underline:not(:hover)::after {
  left: auto;
  right: 0%;
  width: 0%;
}

/* ------------------------------------------------
  07. Animations
  ------------------------------------------------ */

/* Keyframes */
@keyframes loop {
  from {
    transform: translateX(0%);
  }

  to {
    transform: translateX(-100%);
  }
}

/* Loop Animation (Horizontal Slide) */
.loop-animate {
  animation: loop 60s linear infinite;
  will-change: transform;
}

.loop-animate.reverse {
  animation: loop 60s linear infinite reverse;
  will-change: transform;
}

/* ------------------------------------------------
  08. Components / Patterns
  ------------------------------------------------ */

/* Remove wrapper pseudo-elements (redundant after refactor) */
.s-wrapper::before,
.s-wrapper::after {
  display: none;
}

.button-w::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 24rem;
  background-color: color-mix(in srgb, currentColor 12%, transparent);
  z-index: 1;

  opacity: 0;
  transition: transform 0.24s var(--default-ease),
    opacity 0.24s var(--default-ease);
}

.button-w:hover::after {
  opacity: 1;
}

.s-page-header .rte-f p,
[data-rte-font="regular"] p {
  line-height: 1.56em;
}
[data-rte-font="regular"] {
  font-size: 1em;
}
.page-header-tags * {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875em;
  padding: 0 0.75em;
  font-weight: 500;
  line-height: 1em;

  height: 1.75em;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  border-radius: var(--border-radius--rounded);
}

.directory-article-description {
  overflow: hidden; /* Hide overflow content */
  text-overflow: ellipsis; /* Add ellipsis */
  display: -webkit-box; /* Use WebKit box model for clamping */
  -webkit-box-orient: vertical; /* Vertical orientation for WebKit box */
  -webkit-line-clamp: var(--_custom---directory-article-line);
  word-wrap: break-word; /* Ensure long words break correctly */
}
