/*------------------------------------
  変数
------------------------------------*/
:root {
  /* 色 */
  --color-ink: #000;
  --color-blue: #0b3484;
  --color-orange: #f3a218;

  /* 文字サイズ */
  --font-size-base: 16px;
  --line-height-base: 1.5;
  --font-size-lg: 1.25rem;
  --line-height-lg: 1.3;
  --font-size-xl: 1.5rem;
  --line-height-xl: 1.3;
  --font-size-sm: 0.875rem;
  --line-height-sm: 1.5;
  --font-size-xs: 0.75rem;
  --line-height-xs: 1.5;
  --font-size-xxs: 0.625rem;
  --line-height-xxs: 1.5;

  /* 書体 */
  --font-family-gothic: sans-serif;
  --font-family-mincho: serif;

  /* レイアウト */
  --app-width: min(100%, var(--font-size-base) * 40);
  --app-gap: 1.5rem;
}

/*------------------------------------
  
------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  font-family: var(--font-family-gothic);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-ink);
  background-color: #fff;
}

body {
  margin: 0;
}

:where(a) {
  color: var(--color-blue);
  text-decoration: underline;
}

:where(
  input:not([type='checkbox']),
  input:not([type='radio']),
  input:not([type='submit']),
  input:not([type='button']),
  input:not([type='reset']),
  input:not([type='hidden']),
  input:not([type='image']),
  input:not([type='file']),
  input:not([type='color']),
  input:not([type='range']),
  textarea
) {
  padding: .4em .6em;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 100%;
  font-weight: normal;
  font-family: inherit;
  line-height: 1.5;
}

:where(textarea) {
  min-height: calc((0.3em + 1px) * 2 + 3lh);
  field-sizing: content;
  resize: none;
  @supports not (field-sizing: content) {
    resize: vertical;
  }
}

.Stacs {
  --gap: var(--app-gap);
  display: grid;
  gap: var(--gap);
  & > * {
    margin-block: 0;
  }
}

.PageTitle {
  padding-bottom: .5rem;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: bold;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  & > a {
    font-weight: normal;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }

  & > :nth-child(n + 2) {
    &::before {
      content: '/';
      margin: 0 0.3em;
      font-weight: normal;
    }
  }
}

.FormStacs {
  display: grid;
  gap: .9rem;
}

.FormField {
  display: grid;
  gap: 0.2em;
}

.FormRadios {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1em;
  & > label {
    display: flex;
    align-items: baseline;
    gap: 0.1em;
  }
}

.FormInputFile {
  display: flex;
  align-items: center;
  gap: .1em;
  padding: .6em 2em;
  width: fit-content;
  border: 1px solid #999;
  border-radius: 1.2em;
  font-size: 100%;
  font-weight: normal;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  &::before {
    content: ' ';
    width: 1.2em;
    height: 1.2em;
    background-image: url('../icons/image.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  & > input[type='file'] {
    display: none;
  }
}

.FormSubmit {
   margin-top: 1em;
   & .Button {
    width: 100%;
   }
}

.Button {
  padding: .6em .8em;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: #fff;
  font-size: 100%;
  font-weight: bold;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  &.full {
    width: 100%;
  }
}

.DeleteButton {
  border: none;
  padding: .2em .6em;
  background: #dc3545;
  border-radius: 4px;
  color: #fff;
  font-size: 100%;
  cursor: pointer;
}

.ArticleFormContent {
  & > [data-header] {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: .2em 1em .2em 0.5em;
    background: #eee;
    font-size: 0.9rem;
    & label {
      flex-grow: 1;
      padding: 0 0.3em;
    }
    & button {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
      & > svg {
        width: 1.2em;
        height: 1.2em;
      }
    }
  }
  & > [data-text] {
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    & textarea {
      display: block;
      padding: 0.3em;
      width: 100%;
      border: none;
      font-size: 100%;
      line-height: 1.3;
      min-height: calc(0.3em * 2 + 3lh);
      field-sizing: content;
      resize: none;
      @supports not (field-sizing: content) {
        resize: vertical;
      }
    }
  }
  & > [data-image] {
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    & label {
      display: block;
      padding: 1.2em;
      & input[type="file"] {
        display: none;
      }
      & img {
        display: block;
        margin: 0 auto 1em;
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 400px;
      }
      & span {
        font-size: .9rem;
        line-height: 1;
        display: block;
        margin: 0 auto;
        width: fit-content;
        border: 1px solid #ccc;
        padding: 0.5em 2em;
        border-radius: 1em;
      }
    }
  }
  & > [data-file] {
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    & > label {
      display: block;
      padding: 1.2em;
      & > input[type="file"] {
        display: none;
      }
      & > span {
        font-size: .9rem;
        line-height: 1;
        display: block;
        margin: 0 auto;
        width: fit-content;
        border: 1px solid #ccc;
        padding: 0.5em 2em;
        border-radius: 1em;
      }
    }
    & > div {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5em;
      padding: 0 1em 1em;
      & > a {}
      & > label {
        display: flex;
        align-items: center;
        gap: 0.5em;
        font-size: 90%;
        & > input {
          font-size: 100%;
        }
      }
    }
  }
}



.NewsFormBlocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5em;
}
.NewsFormTitle {
  font-size: 150%;
  font-weight: bold;
  & > label {
    display: flex;
    align-items: center;
    gap: 0.4em;
    & > span {
      white-space: nowrap;
    }
    & > input {
      flex: 1;
      font-size: 100%;
      padding: 0.3em;
    }
  }
}

.NewsFormDate {
  display: flex;
  justify-content: flex-end;
  & > label {
    display: flex;
    align-items: center;
    gap: 0.4em;
  }
}

.NewsFormContents {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1em;
}

.NewsFormContent {
  border: 1px solid #ccc;
  padding: 1em;
}

.NewsFormContentHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.NewsFormContentHeader div {
  display: flex;
  align-items: center;
}
.NewsFormContentHeader div button {
  margin-right: 0.5em;
}
.NewsFormContentText {
  margin-top: 1em;
}
.NewsFormContentText textarea {
  box-sizing: border-box;
  padding: 0.3em;
  line-height: 1.3;
  width: 100%;
  min-height: calc((1px + 0.3em) * 2 + 4lh);
  field-sizing: content;
  resize: none;
  @supports not (field-sizing: content) {
    resize: vertical;
  }
}
.NewsFormContentImage {
  display: flex;
  flex-direction: column;
}
.NewsFormContentImage input[type='file'] {
  margin-top: 1em;
}
.NewsFormContentImage {
  margin-top: 1em;
}
.NewsFormContentImage img {
  display: block;
  margin: 0 auto;
  width: min(100%, 800px);
  height: auto;
}
.NewsFormContentsAdd {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7em 1em;
  & > p {
    margin: 0;
    flex-basis: 100%;
    text-align: center;
  }
}

.NewsFormSubmit {
  margin-top: 1em;
  display: flex;
  & > button {
    flex: 1;
    padding: 0.5em 1em;
    font-size: 130%;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
}
