/* ===== base ===== */
* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  background-color: #fffdfd;
  margin: 0;
}

body {
  width: 100%;
  min-height: 100%;
  background-color: #fffdfd;
  margin: 0;
  font-family: 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif;

  /* fixed header/footer に隠れないようにする（最重要） */
  padding-top: 44px;   /* header height */
  padding-bottom: 35px;/* footer height */
}

/* ===== header / nav ===== */
header {
  width: 100%;
  height: 44px;
  background-color: #ddd8d8;
  position: fixed;
  top: 0;
  left: 0;
  padding: 0;
  margin: 0;
  z-index: 10;
}

nav {
  width: 100%;
  height: 90%;
  position: absolute;
  margin-top: 0%;
}

nav.menu {
  padding: 0px;
}

nav ul {
  list-style-type: none;
  padding-left: 5%;
}

nav li {
  font-size: 14px;
  color: #444444;
  padding: 0px 3px;
  display: inline-block;
}

/* upper nav link for PhotoGallery, TripNote, AboutUS */
nav ul li a {
  color: #888888;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
}

@media screen and (min-width: 600px) and (max-width: 899px) {
  nav ul li a { font-size: 16px; }
}
@media screen and (min-width: 900px) {
  nav ul li a { font-size: 20px; }
}

nav ul li a:hover {
  color: #444444;
}

/* upper nav link for TabiPhotogram */
nav li#logo a {
  margin-right: 10px;
  font-size: 14px;
  color: #666666;
  display: inline-block;
}

@media screen and (min-width: 600px) and (max-width: 899px) {
  nav li#logo a { font-size: 18px; }
}
@media screen and (min-width: 900px) {
  nav li#logo a { font-size: 22px; }
}

nav li#logo a:hover {
  color: #333333;
}

/* ===== main =====
   ここが横長でタイルが消える根本原因だったので修正
   - height:95% と overflow:hidden をやめる
*/
main {
  position: relative;
  margin-top: 0;      /* body padding-top でヘッダー分は確保できる */
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ===== headings / description ===== */
article#page_description {
  margin-top: 0;      /* -5px はヘッダー隠れを誘発しやすいのでやめる */
  width: 100%;
  text-align: center;
  color: #444400;
}

article#page_description.trip_note {
  margin-top: 18px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 26px;
  font-weight: bold;
}

h1 {
  margin-top: 18px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 26px;
  font-weight: bold;
}

@media screen and (min-width: 600px) {
  article#page_description { margin-top: 0; }
}

article.trip_note,
article.profile {
  margin-right: 10px;
  margin-left: 10px;
  text-align: left;
  color: #222222;
}

@media screen and (min-width: 600px) and (max-width: 899px) {
  article.trip_note { margin: 0px 20px; }
}
@media screen and (min-width: 900px) {
  article.trip_note { margin: 0px 40px; }
}

/* ===== tiles ===== */
div#photo_tile {
  width: 100%;
  height: auto;
  margin-top: -10px;
  overflow: visible;
}

div#photo_tile_index {
  width: 80%;
  height: auto;          /* 400px 固定をやめる（横長で苦しくなる） */
  margin-left: 10%;
  margin-right: 10%;
  padding-bottom: 10px;
}

@media screen and (min-width: 600px) and (max-width: 899px) {
  div#photo_tile_index {
    width: 50%;
    margin-left: 25%;
    margin-right: 25%;
  }
}

@media screen and (min-width: 900px) {
  div#photo_tile_index {
    width: 40%;
    margin-left: 30%;
    margin-right: 30%;
  }
}

/* for smart phone, 2 columns for Gallery_list */
figure.gallery_list {
  float: left;
  width: 50%;
  margin: 0px;
  overflow: hidden;
}

figure.gallery_list_index {
  float: left;
  width: 45%;
  margin: 2%;
  margin-top: 20px;
  overflow: hidden;
}

/* iPad 3 columns for Gallery_list */
@media screen and (min-width: 600px) and (max-width: 899px) {
  figure.gallery_list {
    width: 32.8%;
    margin: 1px;
  }
}

/* 800 px or larger 4 columns for Gallery_list */
@media screen and (min-width: 900px) {
  figure.gallery_list {
    width: 24.7%;
    margin: 1px;
  }
}

img.gallery_list {
  width: 100%;
  height: auto;
}

/* show figcaption in gallery_list */
figcaption.gallery_list {
  position: relative;
  margin-top: -30px;
  width: 100%;
  display: block;
  height: 25px;
  padding: 0px;
  color: #eee;
  background: #222222;
  background: rgba(0, 0, 0, .2);
  font-size: 1.2em;
  font-style: italic;
  text-align: center;
  text-overflow: ellipsis;
}

/* ===== gallery ===== */
div#photo_gallery {
  width: 100%;
  height: auto;
  margin: 0px;
  text-align: center;
  overflow: visible;
}

div#photo_gallery_index {
  margin-top: 0; /* body padding-top があるので追加オフセット不要 */
}

figure.slides,
figure.gallery_index.slides {
  height: auto;
}

/* iPad portrait screen size */
@media screen and (min-width: 750px) and (max-width: 1024px) and (orientation: portrait) {
  div#photo_gallery {
    width: 100%;
    height: 900px;
  }
  figure.slides { height: 870px; }
}

/* landscape: 従来の固定height（各ページの見た目維持） */
@media screen and (max-width: 700px) and (orientation: landscape) {
  div#photo_gallery { width: 100%; height: 380px; }
  figure.slides { height: 350px; }
}
@media screen and (min-width: 700px) and (max-width: 800px) and (orientation: landscape) {
  div#photo_gallery { width: 100%; height: 430px; }
  figure.slides { height: 400px; }
}
@media screen and (min-width: 800px) and (max-width: 900px) and (orientation: landscape) {
  div#photo_gallery { width: 100%; height: 630px; }
  figure.slides { height: 600px; }
}
@media screen and (min-width: 900px) and (orientation: landscape) {
  div#photo_gallery { width: 100%; height: 680px; }
  figure.slides { height: 650px; }
}

/* hide image by default */
figure.slides {
  display: none;
  width: 100%;
  margin: 0px;
  text-align: center;
}

img.gallery {
  object-fit: scale-down;
}

figcaption.gallery {
  position: relative;
  width: 100%;
  display: block;
  height: 30px;
  padding: 0px;
  color: #555555;
  font-size: 1.2em;
  font-style: italic;
  text-align: center;
}

div#arrows {
  width: 100%;
  text-align: center;
  position: fixed;
  bottom: 22px;
}

div#arrows_gallery_index {
  width: 100%;
  text-align: center;
}

/* Next & previous buttons */
.prev,
.next {
  position: relative;
  cursor: pointer;
  top: 50%;
  width: 8px;
  height: 35px;
  margin-top: 300px;
  color: #bbb;
  font-weight: bold;
  font-size: 30px;
  transition: 0.6s ease;
  user-select: none;
  padding: 1px;
}

.prev:hover,
.next:hover {
  color: #717171;
}

div#pseudoblock {
  height: calc(1px + env(safe-area-inset-bottom));
  width: 100%;
}

/* Fading animation */
.fade {
  -webkit-animation-name: fade;
  -webkit-animation-duration: 1.5s;
  animation-name: fade;
  animation-duration: 1.5s;
}

@-webkit-keyframes fade {
  from { opacity: .4 }
  to { opacity: 1 }
}
@keyframes fade {
  from { opacity: .4 }
  to { opacity: 1 }
}

/* ===== tripnote text / tables ===== */
article.trip_note p {
  padding-left: 10px;
  padding-right: 5px;
  margin-top: 2px;
  margin-bottom: 10px;
}

div.trip_note.header {
  font-size: 20px;
  font-weight: bold;
  padding-left: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  clear: both;
  background-color: #f1efef;
}

div.trip_note.header2 {
  font-size: 19px;
  font-weight: bold;
  padding-left: 10px;
  clear: both;
  margin-top: 5px;
}

table.trip_note { font-size: 12pt; }

th, td { padding-left: 30px; }

img.trip_note {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

img.trip_note.left {
  float: left;
  margin-right: 20px;
}

img.trip_note.right {
  float: right;
  margin-left: 20px;
}

/* non-smart phone */
@media screen and (min-width: 600px) {
  img.trip_note {
    margin-top: 3px;
    margin-bottom: 3px;
  }
  img.trip_note.portrait { width: 300px; height: 400px; }
  img.trip_note.portrait_long { width: 300px; height: 450px; }
  img.trip_note.landscape { width: 400px; height: 300px; }
  img.trip_note.landscape_long { width: 450px; height: 300px; }
  img.trip_note.landscape_pano { width: 600px; height: 300px; }
  img.trip_note.square { width: 350px; height: 350px; }
  img.trip_note.portrait125 { width: 300px; height: 370px; }
  img.trip_note.portrait133 { width: 300px; height: 400px; }
  img.trip_note.portrait140 { width: 295px; height: 413px; }
  img.trip_note.portrait150 { width: 286px; height: 429px; }
  img.trip_note.portrait200 { width: 250px; height: 500px; }
  img.trip_note.landscape125 { width: 370px; height: 300px; }
  img.trip_note.landscape133 { width: 400px; height: 300px; }
  img.trip_note.landscape140 { width: 413px; height: 295px; }
  img.trip_note.landscape150 { width: 429px; height: 286px; }
  img.trip_note.landscape200 { width: 500px; height: 250px; }
}

ul.trip_note.itinerary { list-style-type: none; }

a.gallery_link { text-decoration: none; }

a.gallery_link:visited { color: red; }

/* ===== footer ===== */
footer {
  width: 100%;
  height: 35px;
  clear: left;
  background-color: #ddd8d8;
  text-align: right;
  color: #333333;
  font-size: 10px;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10;
}

footer p {
  margin: 0;
  padding-right: 5%;
  line-height: 35px; /* footer height と合わせる */
}

/* ===== about / forms ===== */
article.about_us {
  width: 320px;
  margin: 0 auto;
}

form {
  width: 320px;
  margin: 0 auto;
}

@media screen and (min-width: 600px) {
  form { width: 450px; }
  article.about_us { width: 550px; }
}

.item {
  overflow: hidden;
  width: 100%;
  margin-bottom: 20px;
}

.label {
  margin-right: 20px;
  margin-top: 5px;
  width: 50%;
  border-left: solid 3px #ddd8d8;
  padding-left: 5px;
  float: left;
  text-align: left;
}

.inputs {
  width: 90%;
  float: left;
}

@media screen and (min-width: 600px) {
  .label { width: 25%; }
  .inputs { width: 60%; float: left; }
}

input[type="text"],
input[type="email"] {
  border: solid 1px #aaa;
  border-radius: 5px;
  padding: 10px;
  font-size: 15px;
}

textarea {
  border: solid 1px #aaa;
  border-radius: 5px;
  padding: 10px;
  height: 160px;
  font-size: 15px;
}

.btn-area { text-align: center; }

input[type="submit"],
input[type="reset"] {
  background: #ddd8d8;
  border: none;
  color: #666666;
  font-size: 14px;
  padding: 8px 16px;
  margin: 0 5px;
}

div.ss_link {
  width: 98%;
  position: fixed;
  bottom: 30px;
  z-index: 10;
  text-align: right;
}

div.ssn_link {
  text-align: center;
  margin-bottom: 10px;
}

/* Instagram button */
.insta_btn {
  color: #FFF;
  border-radius: 3px;
  position: relative;
  margin-top: -11px;
  display: inline-block;
  height: 22px;
  width: 120px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 22px;
  vertical-align: middle;
  background: -webkit-linear-gradient(135deg, #427eff 0%, #f13f79 70%) no-repeat;
  background: linear-gradient(135deg, #427eff 0%, #f13f79 70%) no-repeat;
  overflow: hidden;
  text-decoration: none;
}

.insta_btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: -webkit-linear-gradient(15deg, #ffdb2c, rgb(249, 118, 76) 25%, rgba(255, 77, 64, 0) 50%) no-repeat;
  background: linear-gradient(15deg, #ffdb2c, rgb(249, 118, 76) 25%, rgba(255, 77, 64, 0) 50%) no-repeat;
}

.insta_btn .fa-instagram {
  font-size: 22px;
  position: relative;
  top: 5px;
}

.insta_btn span {
  display: inline-block;
  position: relative;
  transition: .5s;
}

.insta_btn:hover span {
  -webkit-transform: rotateX(360deg);
  -ms-transform: rotateX(360deg);
  transform: rotateX(360deg);
}

/* ===== index page ONLY: 横長でタイルが見えるようにギャラリーを抑える =====
   index.html の <body class="page-index"> にしてください
*/
@media (orientation: landscape) {
  body.page-index #photo_gallery_index {
    max-height: 60dvh;  /* 55~70 で好みに調整 */
    overflow: hidden;
  }
}

/* Column (aside) */
.trip_note.column{
  border-left: 6px solid #777;
  background: #f7f7f7;
  padding: 12px 14px;
  margin: 18px 0;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.trip_note.column .column_header{
  font-weight: 700;
  margin: 0 0 8px 0;
}

.trip_note.column p{
  margin: 8px 0 0 0;
}

/* floatで並ぶタイルの親が潰れないようにする */
#photo_tile::after {
  content: "";
  display: block;
  clear: both;
}