/*.....................................................................
	snippet.css
	version v1
	copylight petarna co.,ltd.
	date 2017.11.01
.....................................................................*/

/*
  table
=======================================================================*/
/* default */
[data-snippet|="table"] {
	table-layout: fixed;
  width: 100%;
}

/*
  User Interface
=======================================================================*/

/*
  ui (base) 入力のサポート
  data-help属性に入力の際のサポートを設定するとフォーカス時に表示
  <label data-snippet="ui">
    <input|textarea />
    <i data-help=""></i>
    <span>label text</span>
  </label>
.....................................................................*/

[data-snippet|="ui"] {
  display:  block;
  position: relative;  
}

label[data-snippet|="ui"] > i[data-help]::after {
  content: attr(data-help);
  white-space: pre;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: .5em;

  text-align: center;
  font-style: normal;

  box-shadow: 0 5px 15px rgba(125, 125, 125, 0.5);

  opacity: 0;  
  transform: translateY(-100%);
  
  -webkit-transition: all 200ms ease-in;
  transition: all 200ms ease-in;

}

label[data-snippet|="ui"] > input:focus + i[data-help]::after,
label[data-snippet|="ui"] > textarea:focus + i[data-help]::after,
label[data-snippet|="ui"] > select:focus + i[data-help]::after {
  opacity: 1;
  transform: translateY(0%);
}

label[data-snippet|="ui"] > span {
  display: inline-block;
  height: inherit;  
}

/*
  button
.....................................................................*/

[data-snippet|="ui-button"] {
  display: inline-block;
  margin: .25rem;
  padding: .5rem 1rem;
  min-width: 12rem;
  text-align: center;
  text-decoration: none;
  box-shadow: 0px .2rem .5rem rgba(0, 0, 0, 0.2);
  cursor:   pointer;
  
  transition: all .3s ease-in-out;
}

[data-snippet|="ui-button"][data-attr~="round"] {
  border-radius: 2rem; 
}
 
/* 
  ui-choose 選択
  <label data-snippet="ui-choose">
    <input type="checkbox|radio" name="" value=""/>
    <i></i>
    <span>label text</span>
  </label>
.....................................................................*/
label[data-snippet|="ui-choose"] {
  
  margin-bottom: 0.5em;

  /* base size */
  height: 2rem;

  cursor: pointer;
}

label[data-snippet|="ui-choose"]::before {
  content: "";
  display: block;
  position: absolute;
  top:0;
  left:0;
  
  /* base size */
  width:  2rem;
  height: inherit;

  /* base border-color bk-color */
  border: solid 1px rgba(139, 139, 139, 0.91);
}

label[data-snippet|="ui-choose"] > i {
  display:  inline-block;
  position: absolute;
  top: 0;
  left: 0;

  /* size */
  width:  2rem;
  height: inherit;
    
  /* off color */
  border: solid 1px rgba(139, 139, 139, 0.91);

  -webkit-transition: all 200ms ease-in;
  transition: all 200ms ease-in;
}

label[data-snippet|="ui-choose"] > input:checked + i {
  
  /* on color */
  background-color: rgba(47, 47, 47, 1);
  border: none;

}

label[data-snippet|="ui-choose"] > span {
  /* label text left space */
  margin-left: 2rem; 
}

label[data-snippet|="ui-choose"] > input {
  opacity: 0;
  height: 0;
  width: 0;
}

/* 
  ui-choose attr
.....................................................................*/
label[data-snippet|="ui-choose"][data-attr~="round"]::before {
  border-radius: 1rem;
}

label[data-snippet|="ui-choose"][data-attr~="round"] > i {
  border-radius: 50%;
}

label[data-snippet|="ui-choose"][data-attr~="inline"]{
  display: inline-block;
}

label[data-snippet|="ui-choose"][data-attr~="slide"]::before {
  width: 4rem;
}

label[data-snippet|="ui-choose"][data-attr~="slide"] > input:checked + i {
  left: 2rem;
}

label[data-snippet|="ui-choose"][data-attr~="slide"] > span {
  /* label text left space */
  margin-left: 4rem; 
}

/* 
  ui-panel
  <input id="xxx" data-status="ui-toggle" type="checkbox"/>
  ...
  <label for="xxx">
    <elm>menu</elm>
  </label>
  ...
  <elm data-snippet="ui-panel" data-attr="top|bottom|left|right">
    <label for="xxx">
      <elm>close</elm>
    </label>
    <!-- panel content -->
    ...
  </elm>
.....................................................................*/

[data-status|="ui-toggle"] {
  display: none;  
}

[data-status|="ui-toggle"]:checked ~ [data-snippet|="ui-panel"] {
  transform: translate(0,0);
}

[data-snippet|="ui-panel"] {
  position: fixed;
  top:0;
  left:0;
  right: 0;
  bottom: 0;
  z-index: 2;
  
  /* base color */
  background-color: #fff;

}

[data-snippet|="ui-panel"][data-attr~="top"] {
  transition: all .7s ease-in-out;
  transform: translate(0, -100%);
}

[data-snippet|="ui-panel"][data-attr~="bottom"] {
  transition: all .7s ease-in-out;
  transform: translate(0, 100%);
}

[data-snippet|="ui-panel"][data-attr~="left"] {
  transition: all .7s ease-in-out;
  transform: translate(-100%,0);
}

[data-snippet|="ui-panel"][data-attr~="right"] {
  transition: all .7s ease-in-out;
  transform: translate(100%, 0);
}




/*
  flow
  flow itemが画面幅に収まらない時にスライド
  <elm data-snippet="flow">
    <elm>...</elm> <!-- flow item -->
    ...
  </elm>
=======================================================================*/

  [data-snippet|="flow"] {
    position: relative;
    display: block;
    min-width: 100%;
    overflow-x: auto;
  }
    
  [data-snippet|="flow"] > * {
    display: table-cell;
  }

/*
  fit
  imgのトリミング
  <elm data-snippet="fit">
    <img >
    ...
  </elm>
  * font-family ::= ie ~11 and edge 12~15 use object-fit-images js
      https://github.com/bfred-it/object-fit-images
=======================================================================*/
[data-snippet|="fit"] > img {
  object-fit: cover;
  object-position: 50% 50%;
  font-family: 'object-fit: cover; object-position: 50% 50%;';
}

[data-snippet="fit-cover"] > img {
  object-fit: cover;
  object-position: 50% 50%;
  font-family: 'object-fit: cover; object-position: 50% 50%;';
}

[data-snippet="fit-contain"] > img {
  object-fit: contain;
  object-position: 50% 50%;
  font-family: 'object-fit: contain; object-position: 50% 50%;';
}
