/**
 * CSS for adjusting styles of migrated data
 */

@layer legacy-base {
  [data-static-html][data-src-domain="www.itoguchi-navi.com"] {
    /* Avoid class conflicts between legacy CSS and Tailwind. */
    .size-full {
      width: auto;
      max-width: 100%;
      height: auto;
    }
  }
}

@layer legacy {
  :root,:host {
    --font-family: yakuHan, Noto Sans JP, ui-sans-serif, system-ui, sans-serif;
  }

  /* * {
    font-family: var(--font-family) !important;
  } */

  [data-static-head] {
    display: contents;
  }

  [data-static-body] {
    * {
      all: revert;
    }
    /* Restore presentational hints cleared by `all: revert` */

    /* width / height attributes → img */
    img[width]  { width: revert-layer; aspect-ratio: revert-layer; }
    img[height] { height: revert-layer; aspect-ratio: revert-layer; }

    /* width / height attributes -> embedded content */
    :is(iframe, video, canvas, object, embed)[width]  { width: revert-layer; }
    :is(iframe, video, canvas, object, embed)[height] { height: revert-layer; }

    /* width / height attributes -> table elements */
    :is(table, td, th, col)[width]  { width: revert-layer; }
    :is(table, td, th, col)[height] { height: revert-layer; }
    table[cellspacing] { border-spacing: revert-layer; }

    /* align / valign attributes */
    :is(div, p, h1, h2, h3, h4, h5, h6, td, th, caption)[align] { text-align: revert-layer; }
    :is(td, th)[valign] { vertical-align: revert-layer; }

    /* bgcolor attribute */
    :is(table, td, th, body)[bgcolor] { background-color: revert-layer; }

    /* font element */
    font[color] { color: revert-layer; }
    font[face]  { font-family: revert-layer; }
    font[size]  { font-size: revert-layer; }
  }

  [data-static-html][data-src-domain="www.restargp.com"] {
    * {
      font-size: revert!important;
    }
    [data-static-body] {
      overflow: clip;

      #container {
        padding-top: 0!important;
      }
    }
    &[data-static-preview] .loading #container {
      opacity: unset;
    }
  }

  [data-static-html][data-src-domain="www.restar-ele.com"] {
    #contents_left {
      width: 100%!important;
    }
  }

  [data-static-html][data-src-domain="www.restarcc.com"] {
    /* Remove unnecessary scrollbar */
    overflow: unset;

    /* Remove unnecessary scrollbar */
    [data-static-body] {
      overflow: unset;
    }

    #contents,#contents_in,#contents_left {
      width: 100%!important;
    }
    #contents_left {
      width: 100%!important;
    }
    .content-area-wrapper {
      display: flex;
      justify-content: center;
    }
    /* .content-area-left-wrapper {
      width: 100%!important;
    } */
    #main {
      * {
        font-size: revert;
      }
      border: none;
      padding: 0;
      font-size: 1rem;
    }
    @media screen and (min-width: 768px) {
      &:has(.ledlp-container,.pagetitle_area02,.munic-main) {
        grid-column: full-start / full-end!important;
        width: 1280px!important;
        justify-self: center!important;
      }
    }
  }

  [data-static-html][data-src-domain="tacsystem.jp"] {
    #main_content {
      width: 100%!important;
    }
    .wrapper {
      margin-top: 0;
    }
  }

  [data-static-html][data-src-domain="www.itoguchi-navi.com"] {
    /* Remove unnecessary scrollbar */
    overflow: clip;

    &[data-content-name="solutions-product"],
    &[data-content-name="solutions-sol"] {
      #page_header {
        z-index: 0;
      }
      #page_header_inner * {
        opacity: unset;
      }
      @media (min-width: 1252px) {
        #page_header_inner {
          width: 100%!important;
        }
      }
      @media (min-width: 1052px) {
        #product_single {
          #main_contents {
            width: 100%!important;
          }
          #main_col {
            width: calc(100% - 400px)!important;
          }
        }
      }
    }

    #blog_single {
      padding: 0;
      border-top: none;
      background: unset!important;
    }
    #main_contents:not(#product_single #main_contents) {
      width: 100%!important;
      #main_col {
        width: 100%!important;
      }
      .post_content {
        grid-template-columns: unset;
      }
    }
  }

  .whitespace-pre-wrap {
    &:has([data-static-html][data-content-name="news"]),
    &:has([data-static-html][data-content-name="news-archive"]) {
      white-space: unset;
    }
  }
}
