/* ===========================
   Layers
=========================== */
@layer reset, components;

/* ---------------------------
   Root variables (global)
--------------------------- */
:root {
  --header-offset: 120px; /* JS updates this */
  --tile-bg: #d4dcee;
  --tile-text: #000000;
  --tile-accent: #10137d;
  --tile-radius: 1rem;
  --tile-gap: 16px;
  --tile-border-accent: #90a2c5;
  --tile-col-max: 360px;
}

/* ===========================
   Reset layer (reserved)
=========================== */
@layer reset {}

/* ===========================
   Components
=========================== */
@layer components {

  /* -------------------------
     Base content typography
  ------------------------- */
  :where(.entry-content, .wordpress__content) :is(li, p) {
    font-size: 1.07rem;
    line-height: 1.5;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
  }



  /* -------------------------
     Content links (not buttons)
     Keep original underline + offset; thicken on hover
  ------------------------- */
  :where(.entry-content, .wordpress__content)
  :where(a):not(:is(.btn, [class^="btn-"], [class*=" btn-"])) {
    text-decoration: underline;
    text-decoration-color: #333;
    text-underline-offset: 2px;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: 0.5px;
  }

  :where(.entry-content, .wordpress__content)
  :where(a):not(:is(.btn, [class^="btn-"], [class*=" btn-"])):is(:hover, :focus-visible) {
    text-decoration-thickness: 1px;
    background-color: #f0f7ff;
  }

  /* Override for heading links (h1–h4) */
  :where(.entry-content, .wordpress__content)
  :is(h1 a, h2 a, h3 a, h4 a) {
    text-decoration: none;
    background-color: transparent;
  }

  :where(.entry-content, .wordpress__content)
  :is(h1 a, h2 a, h3 a, h4 a):is(:hover, :focus-visible) {
    text-decoration: none;
    background-color: transparent;
  }

  /* -------------------------
     Icon list
  ------------------------- */
  ul.icon-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
  }
  ul.icon-list li {
    position: relative;
    padding-left: 2em; /* room for the icon */
  }
  ul.icon-list li::before {
    content: "\f058"; /* fa-check-circle */
    font-family: "Font Awesome 5 Pro";
    font-weight: 900; /* solid */
    color: #96c9fd;
    position: absolute;
    left: 0;
    top: 0.15em;
  }

  /* -------------------------
     Utilities
  ------------------------- */
  .blue-box-100 { width: 100%; }

  .fa-circle-right {
    color: #96c9fd;
    font-size: 1.2rem;
  }

  /* -------------------------
     Dark tile (link/button style)
  ------------------------- */
  .tile,
  .tile:active,
  .tile:hover,
  .tile:focus,
  .tile:visited {
    display: flex;
    column-gap: 10px;
    width: 100%;
    min-width: 220px;
    padding: 1rem;
    background-color: #10137d;
    border-radius: 1rem;
    color: #ffffff;
    font-weight: bold;
    border: 3px solid #dddddd;
    text-decoration: none;
  }
  .tile:hover { border-color: #96c9fd; }

  /* -------------------------
     Table with tiles
  ------------------------- */
  .table-with-tiles td {
    padding: 10px 10px;
    font-size: 1rem;
    vertical-align: top;
  }
  .table-with-tiles .heading-with-line { margin-bottom: 0; }

  /* -------------------------
     Video & embeds
  ------------------------- */
  .wp-block-video {
    border-radius: 2rem;
    overflow: hidden;
  }
  .wp-block-embed.is-type-video { border-radius: 0; }
  .wp-block-embed__wrapper iframe { border-radius: 2rem; }

  /* -------------------------
     Feature tiles (light variant)
  ------------------------- */
  .feature-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, var(--tile-col-max)));
    gap: var(--tile-gap);
    justify-content: center;
    justify-items: stretch;
    margin-inline: auto;
  }
  .tile_ {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--tile-bg);
    color: var(--tile-text);
    border-radius: var(--tile-radius);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    min-height: 92px;
  }
  .tile_:hover { border: 1px solid var(--tile-border-accent); }

  .tile__text {
    margin: 0;
    letter-spacing: .2px;
  }
  p.tile__text { font-size: 1.1rem; }

  .tile__icon {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    border: 1px solid var(--tile-border-accent);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: var(--tile-accent);
    font-size: 40px; /* FA size */
    overflow: hidden;
  }
  .tile__icon:hover { border: 1px solid rgba(0,0,0,0.5); }

  /* -------------------------
     Anchor offset for sticky headers
  ------------------------- */
  html { scroll-padding-top: var(--header-offset); }
  [id] { scroll-margin-top: var(--header-offset); }
  /* Remove old fallback to prevent layout shifts */
  :target::before { content: none !important; }

  /* -------------------------
     Responsive (Gutenberg-style)
  ------------------------- */
  @media (max-width: 782px) {
    /* safety: ensure columns stack */
    .wordpress__content .wp-block-columns {
      display: flex;
      flex-direction: column;
    }
    /* only two-column groups */
    .wordpress__content .wp-block-columns:not(:has(> .wp-block-column:nth-child(3))) > .wp-block-column {
      order: 1; /* text first */
    }
    /* column with image goes second */
    .wordpress__content .wp-block-columns:not(:has(> .wp-block-column:nth-child(3)))
    > .wp-block-column:has(.wp-block-image) {
      order: 2;
    }
  }
}
