/*****************************************************************************
 * 
 * Common styles of j-world.co.jp
 * 
 * 2025 joy world pacific Co.,Ltd.
 * 
 *****************************************************************************/

/* === variables === */
:root {
  --color-primary   : #0071BC;
  --color-secondery : #29ABE2;
  --color-borders   : #ddd;
  --color-info      : #29ABE2;
  --color-success   : #39B54A;
  --color-warning   : #E9D502;
  --color-error     : #FF1D25;
}

/* === reset === */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: clamp(16px, 1.8vw, 20px);
  font-family: 'Lucida Grande','Hiragino Kaku Gothic ProN',Meiryo,sans-serif;
}

body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: #333;
}

/* === common layouts === */
.jwp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-top: 8px solid var(--color-primary);
  border-bottom: 1px solid var(--color-borders);

  .logo {
    margin: 0;
    font-weight: bold;
  }
  .logo img {
    display:block;
    width: 100%;
    height: auto;
  }

  .nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
  }

  .nav a {
    display: block;
    text-decoration: none;
    color: #333;
  }

  .nav-toggle {
    display: none;
  }

  .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }

  .hamburger span {
    width: 24px;
    height: 2px;
    background: #333;
  }

  @media (max-width: 750px) {

    .nav {
      position: absolute;
      top: 64px;
      right: 0;
      width: 70vw;
      background: #fff;
      display: none;
      z-index: 999;
      border: 1px solid var(--color-borders);
      box-shadow: -2px 2px 3px rgba(200,200,200,.75);
    }

    .nav ul {
      flex-direction: column;
      padding: 16px;
      gap: 16px;
    }

    .nav li {
    }

    .nav-toggle:checked ~ .nav {
      display: block;
    }

    .hamburger {
      display: flex;
    }
  }
}

.jwp-footer {
  position: sticky;
  top: 100vh;
  border-top: 1px solid #ddd;
  padding: .5em;


  .copy {
    text-align: center;
  }
}

.jwp-main {
  padding-bottom: 4em;
}

/* === components === */
.jwp-section {
  width: 80vw;
  margin: 2em auto;

  h1 {
    margin: 0 0 1em 0;
    font-size: 150%;
  }

  h2 {
    font-size: 120%;

    &:before {
      background-color: var(--color-primary);
      border-radius: 3px; /* 線幅の半分 */
      content: "";
      display: inline-block;
      height: 1.5em; /* 線の長さ */
      margin-right: .5em; /* 線右の余白 */
      vertical-align: middle;
      width: 6px; /* 線幅 */
    }
  }
}

.jwp-navbar {
  width: 80vw;
  margin: 1em auto;
  padding: 0;
  font-size: 80%;
  border-bottom: 4px solid var(--color-borders);

  ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: .25em;
  }
  li {
    min-width: 8em;
    text-align: center;
    white-space: nowrap;
  }
  li.title {
    display: block;
    padding: .5em 1em;
    font-weight: bold;
  }
  li a {
    display: block;
    padding: .5em 1em;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--color-borders);
    border-width: 4px 1px 0 1px;
    border-radius: 4px 4px 0 0;
  }
  li a.active {
    /*color: var(--color-primary);*/
    border-top: 4px solid var(--color-primary);
  }

  .mobile-toggle {
    display: none;

    input {
      display: none;
    }
  }

  @media(max-width: 750px) {
    & {
      border: 0;
      font-size: 100%;
    }
    .mobile-toggle {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: .5em 1em;
      border: 1px solid var(--color-borders);
      font-weight: bold;
      cursor: pointer;
    }
    .mobile-toggle::after {
      transform: rotate(135deg);
      width: 5px;
      height: 5px;
      margin-left: 10px;
      border-top: 2px solid  var(--color-primary);
      border-right: 2px solid  var(--color-primary);
      content: '';
    }
    .mobile-toggle:has(:checked)::after {
      transform: rotate(-45deg);
    }
    .mobile-toggle:has(:checked)+ul {
      display: block;
    }
    ul {
      display: none;
    }
    .title {
      display: none!important;
    }
    li {

    }
    li a {
      text-align: left;
      border-radius: 0;
      border: 1px solid var(--color-borders);
    }
    li a:hover {
      /*color: var(--color-primary);*/
    }
    .active {
      color: var(--color-primary);
      border-top: none!important;
      border-left: 6px solid var(--color-primary);
    }
  }
}

.jwp-notice {
  padding: 1em;
  font-weight: bold;
  background-color: var(--color-warning);
  border-radius: 8px;
}

.jwp-cardview {
  ul {
    margin: 0 auto;
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 3vw;
  }
  li {
    width: 30%;
  }
  .image {
    & {
      overflow: hidden;
      position: relative;
      border-radius: 8px 8px 0 0;
    }
    &:before{
      vertical-align: top;
      content: "";
      display: block;
      padding-top: 56.25%;
    }
    img {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      margin: auto;
      object-fit: cover;
    }
  }
  .description {
    padding-top: 1em;
    text-align: center;
  }
  .title {
    padding-top: .5em;
    text-align: center;
    font-weight: bold;
  }
  .description+.title {
    padding-bottom: .5em;
  }
  .title+.description {
    padding: 1em;
    text-align: left;
    font-size: 80%;
  }
  a {
    display: block;
    text-decoration: none;
    color: inherit;
    box-shadow: 2px 2px 8px rgba(200,200,200,.75);
    border-radius: 8px;
    scale: .98;
    transition: all .5s ease;
  }
  a:hover {
    opacity: .6;
    scale: 1;
  }

  @media(max-width: 1080px) {
    ul {
      /*gap: 2vw;*/
    }
    li {
      width: 48%;
    }
  }

  @media(max-width: 748px) {
    li { 
      width:100%; 
    }
    .description {
      font-size: 100%!important;
    }
  }
}

.jwp-cardview2 {
  ul {
    margin: 2em auto;
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 3vw;
  }
  ul::after {
    content: "";
    display: list-item;
    width: 30%;
  }
  li {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--color-borders);
  }
  .image {
    & {
      background: #ccc;
      overflow: hidden;
      position: relative;
      border-top: 1px solid var(--color-borders);
      border-bottom: 1px solid var(--color-borders);
    }
    &:before{
      vertical-align: top;
      content: "";
      display: block;
      padding-top: 56.25%;
    }
    &>img {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      margin: auto;
      object-fit: cover;
    }
    .slider {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }
  .title {
    padding: .5em;
    text-align: center;
    font-weight: bold;
    border-top: 6px solid var(--color-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .content {
    font-size: 80%;
    padding: 1em;
    text-align: left;
  }
  .tags {
    margin-top: auto;
    font-size: 60%;
    padding: 1em;
    text-align: center;

    span {
      display: inline-block;
      padding: .25em .5em;
      margin-bottom: .5em;
      color: white;
      background: var(--color-secondery);
      border-radius: 4px;
    }
  }

  @media(max-width: 1080px) {
    ul {
      /*gap: 2vw;*/
    }
    li {
      width: 48%;
    }
  }

  @media(max-width: 748px) {
    li { 
      width:100%; 
    }
    .description {
      font-size: 100%!important;
    }
  }
}

.jwp-table1 {
  width: 100%;
  margin: 2em 0;
  border-spacing: none;
  border-collapse: collapse;
  border-top: 1px solid var(--color-borders);

  th {
    width: 1%;
    font-weight: normal;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--color-borders);
    padding: 1em 4em 1em 1em;
  }

  td {
    padding: 1em;
    border-bottom: 1px solid var(--color-borders);
  }

  @media(max-width: 750px) {
    th {
      display: block;
      border: none;
      font-weight: bold;
      padding-bottom: 0;
    }
    td {
      display: block;
    }
  }
}

.jwp-list1 {
  & {
    list-style-type: disc;
  }

  &.border {
    padding: 1em 1em 1em 3em;
    border: 1px solid var(--color-borders);
    border-radius: 6px;
  }

  & li {
    padding: .3em .3em .3em 0;
  }

  & li::marker {
    color: var(--color-primary);
    font-size: 1.1em;
  }
}

.jwp-list2 {
  & {
    list-style-type: disc;
    color: white;
    background-color: var(--color-primary);
    border-radius: 6px;
    padding-top: 1em;
  }

  & li {
    padding: 0 1em 1em .25em;
  }

  & li::marker {
    color: white;
    font-size: 1.1em;
  }
}

.jwp-form {

  & {
    padding-top: 1.5em;
    border-top: 1px solid var(--color-borders);
  }

  .fieldset {
    margin-bottom: 1.5em;
  }

  .legend, .label > label {
    font-weight: bold;

    &:before {
      background-color: var(--color-primary);
      border-radius: 3px; /* 線幅の半分 */
      content: "";
      display: inline-block;
      height: 1.5em; /* 線の長さ */
      margin-right: .5em; /* 線右の余白 */
      vertical-align: middle;
      width: 6px; /* 線幅 */
    }
  }

  .field {
    padding: 1em;
  }

  /*
   * text
   */
  input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-borders);
    border-radius: 6px;
    font-size: 1em;
    line-height: 1.5;

    &::placeholder {
      color: var(--color-borders);
    }
  }

  /*
   * textarea
   */
  textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-borders);
    border-radius: 6px;
    font-size: 1em;
    line-height: 1.5;
    height: 10em;

    &::placeholder {
      color: var(--color-borders);
    }
  }

  /*
   * select
   */
  select {
    padding: 8px 10px;
    border: 1px solid var(--color-borders);
    border-radius: 6px;
    font-size: 1em;
    line-height: 1.5;
  }

  /*
   * radio
   */
  input[type="radio"] {
    display: none;
  }
  input[type="radio"] + label {
    cursor: pointer;
    padding-left: 2em;
    position: relative;
  }
  input[type="radio"] + label::before,
  input[type="radio"] + label::after {
    content: "";
    display: block;
    border-radius: 50%;
    position: absolute;
    transform: translateY(-50%);
    top: 50%;
  }
  input[type="radio"] + label::before {
    background-color: #fff;
    border: 1px solid var(--color-primary);
    height: 1em;
    width: 1em;
    left: .5em;
  }
  input[type="radio"] + label::after {
    background-color: var(--color-success);
    opacity: 0;
    height: .7em;
    width: .7em;
    left: .65em;
  }
  input[type="radio"]:checked + label::after {
    opacity: 1;
  }

  /*
   * buttons
   */
  .buttons {
    padding: 1em;
    display: flex;
    justify-content: center;

    @media(max-width: 750px) {
      display: block;

      input[type="submit"], input[type="button"], button, .button {
        width: 100%;
        margin-left: 0!important;
        margin-bottom: 1em;
      }
    }
  }

  input[type="submit"], input[type="button"], button, .button {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    /*width: 250px;*/
    /*margin:0 auto;*/
    padding: .9em 2em;
    border: 1px solid var(--color-primary);
    border-radius: 5px;
    background-color: #fff;
    color:  var(--color-primary);
    font-size: 1em;
    text-decoration: none;

    &::after {
      transform: rotate(45deg);
      width: 5px;
      height: 5px;
      margin-left: 10px;
      border-top: 2px solid  var(--color-primary);
      border-right: 2px solid  var(--color-primary);
      content: '';
    }

    & + & {
      margin-left: 1em;
    }

    &.back {
      &::after {
        display: none;
      }
      &::before {
        transform: rotate(45deg);
        width: 5px;
        height: 5px;
        margin-right: 10px;
        border-bottom: 2px solid  var(--color-primary);
        border-left: 2px solid  var(--color-primary);
        content: '';
      }
    }
  }
}

/*
-----------------------------------------------------------------
  .home
-------------------------------------------------------------------
*/
.home-slider {
  img {
    width: 100%;
    height: auto;
  }
}

.home-news {
  margin: 0 auto;
  max-width: 80vw;
}
.home-news h1 {
  font-size: 150%;
  text-align: center;
  border-bottom: 3px solid #0071BC;
}
.home-news ul {
  list-style: none;
  padding-left: 0;
}
.home-news li {
  padding: 1em;
  border-bottom: 1px solid #ddd;
}
.news-date {
  color: var(--color-primary);
}

.jwp-home-news-list {
  & {
    list-style: none;
    padding: 0;
    border-top: 6px solid var(--color-primary);
  }
  a {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: all ease .5s;
    &:hover {
      opacity: .5;
    }
  }
  li {
    display: flex;
    gap: 1em;
    align-items: center;
    white-space: nowrap;
    padding: 1em 0;
    border-bottom: 1px solid var(--color-borders);
  }
  .type {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: .5em 1em;
    border: 1px solid var(--color-primary);
    border-radius: 5px;
    background-color: #fff;
    color:  var(--color-primary);
    font-size: 80%;
    text-decoration: none;
  }
  .date {
    color: var(--color-primary);
  }
  .title {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.jwp-home-news-all {
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: .9em 2em;
  border: 1px solid var(--color-primary);
  border-radius: 5px;
  background-color: #fff;
  color:  var(--color-primary);
  font-size: 1em;
  text-decoration: none;
}