/*!
 * Schematic Parts – sp-base.css
 * Path: assets/css/sp-base.css
 */

@layer sp {
  .sp-page {
    padding: var(--sp-pad-md);
    max-width: 1440px;
    margin-inline: auto;
    box-sizing: border-box;
    min-width: 0;
  }

  @media (min-width: 768px) {
    .sp-page {
      padding: var(--sp-pad-lg);
    }
  }

  @media (min-width: 1200px) {
    .sp-page {
      padding: var(--sp-pad-xl);
    }
  }

  @media (max-width: 480px) {
    .ast-plain-container .site-content > .ast-container {
      padding-top: 6px !important;
    }

    .sp-page {
      padding-top: 8px;
      padding-left: 10px;
      padding-right: 10px;
    }
  }

  @media (max-width: 360px) {
    .sp-page {
      padding-left: 8px;
      padding-right: 8px;
    }
  }

  .sp-page > h1 {
    margin-top: 0;
    margin-bottom: 18px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    min-width: 0;
  }


  .sp-page > h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .sp-breadcrumbs {
    margin: 10px 0;
    font-size: var(--sp-fs-breadcrumbs);
    border: none;
    background: transparent;
    padding: 0;
    min-width: 0;
  }

  @media (max-width: 480px) {
    .sp-breadcrumbs {
      margin: 6px 0;
      overflow-wrap: anywhere;
      word-break: break-word;
    }
  }

  .sp-years .sp-year-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }

  .sp-years .sp-year-list li a {
    display: block;
    padding: 10px;
    border: var(--sp-border);
    text-align: center;
    background: #fff;
    text-decoration: none;
    color: inherit;
    border-radius: var(--sp-radius);
  }

  .sp-years .sp-year-list li a:hover {
    box-shadow: var(--sp-shadow-hover);
  }

  .sp-years .sp-year-list li a:focus-visible {
    outline: none;
    box-shadow: var(--sp-shadow-focus);
  }

  .sp-page-section {
    margin-top: 16px;
  }

  .sp-name-wrap {
    position: relative;
    min-width: 0;
  }

  .sp-name-wrap .sp-subtext {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: vertical;
  }

  .sp-name-wrap .sp-subtext > *:last-child {
    margin-bottom: 0;
  }

  .sp-more-toggle {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1;
    background: #fff;
    border: 0;
    color: var(--tm-red);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color .15s ease, color .15s ease;
  }

  .sp-more-toggle:hover {
    text-decoration: none;
    background: #fff5f5;
  }

  #sp-toast-wrap {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 99999;
    pointer-events: none;
  }

  .sp-toast {
    position: relative;
    pointer-events: auto;
    background: #fff;
    color: #111;
    border-radius: 14px;
    padding: 20px 20px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    width: 320px;
    max-width: 92vw;
    border: 1px solid #e6e8ec;
    font-size: 14px;
    line-height: 1.45;
    animation: spToastIn .16s ease-out both;
  }

  /* Close button — small, gray, unobtrusive */
  .sp-toast .sp-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    background: #f0f0f0;
    color: #555;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s, color .12s;
  }
  .sp-toast .sp-x:hover { background: #e0e0e0; color: #111; }

  /* Icon + text row */
  .sp-toast .sp-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 32px;
  }

  .sp-toast .sp-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2e7d32;
  }

  .sp-toast .sp-title {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    margin-bottom: 2px;
  }

  .sp-toast .sp-meta {
    font-size: 12px;
    color: #777;
  }

  /* Action buttons */
  .sp-toast .sp-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef0f3;
  }

  .sp-toast .sp-link {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #111;
    transition: background .12s, border-color .12s;
    display: block;
  }
  .sp-toast .sp-link:hover { background: #f5f5f5; text-decoration: none; color: #111; }

  .sp-toast .sp-link--primary {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
  }
  .sp-toast .sp-link--primary:hover { background: #a93226; border-color: #a93226; color: #fff; }

  @keyframes spToastIn {
    from {
      opacity: 0;
      transform: scale(.98);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .sp-block-card,
    .sp-block-card__inner,
    .spm-btn,
    .spm-add,
    .spm-heart-btn,
    .spm-fab,
    .sp-toast {
      transition: none !important;
      animation: none !important;
    }
  }
}
