.layout-container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.layout-container > header,
.layout-container > footer {
  width: 100%;
}

.layout-container > main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: start;
}

.layout-sidebar-first {
  grid-column: 1;
}

.layout-content {
  grid-column: 2;
}

.layout-sidebar-second {
  grid-column: 3;
}

@media (max-width: 900px) {
  .layout-container > main {
    grid-template-columns: 1fr;
  }

  .layout-sidebar-first,
  .layout-content,
  .layout-sidebar-second {
    grid-column: 1;
  }
}

/* Keep the accessibility anchor from occupying a grid cell. */
.layout-container > main > #main-content {
  position: absolute;
}

.layout-sidebar-first {
  grid-column: 1;
  grid-row: 1;
}

.layout-content {
  grid-column: 2;
  grid-row: 1;
}

.layout-sidebar-second {
  grid-column: 3;
  grid-row: 1;
}
/* Waffle header */
.site-header {
  background: #CDB887;
  border: 1px solid #8B4513;
  padding: 3px;
  min-height: 120px;
  box-sizing: border-box;
}

/* Original Waffle page background */
body {
  background-color: #D2B48C;
  background-image: url("../images/bg.gif");
  color: #666666;
  font-family: Verdana, Arial, Helvetica, sans-serif;
}

/* Original Waffle main content background */
.site-main {
  background: #F5F5DC;
}

/* Original Waffle sidebar block titles */
.layout-sidebar-first .block > h2,
.layout-sidebar-second .block > h2 {
  background-image: url("../images/bg2.gif");
  color: #8B0000;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #8B4513;
  padding: 3px 5px;
  margin: 0 0 4px 0;
}

.layout-sidebar-first .block > h2::before,
.layout-sidebar-second .block > h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  background-image: url("../images/maru.gif");
  background-repeat: no-repeat;
  vertical-align: middle;
}

/* Original Waffle three-column proportions */
.layout-container > main {
  grid-template-columns: 20% minmax(0, 1fr) 20%;
}

/* Original Waffle spacing */
.site-header {
  margin-bottom: 15px;
}

.site-main {
  margin-bottom: 15px;
}

/* Waffle classic header */
.waffle-time {
  height: 28px;
  line-height: 28px;
  font-weight: bold;
  color: #666666;
}

.waffle-time img {
  width: 10px;
  height: 10px;
  margin-right: 4px;
}

.waffle-bar {
  width: 100%;
  height: 8px;
  background-color: #8B4510;
}

.waffle-banner {
  border: 0;
  padding: 12px 0;
}

.waffle-banner img {
  display: block;
  width: 377px;
  height: 94px;
}

/* Make header bars touch the banner image */
.waffle-banner {
  padding: 0;
  margin: 0;
}

.waffle-banner img {
  display: block;
  margin: 0;
}

/* More breathing room between sidebar items */
.layout-sidebar-first .block li,
.layout-sidebar-second .block li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Relax spacing for Drupal-generated sidebar lists only */
.layout-sidebar-first ul.menu > li,
.layout-sidebar-first .item-list li,
.layout-sidebar-first .views-row,
.layout-sidebar-first .links li,
.layout-sidebar-second ul.menu > li,
.layout-sidebar-second .item-list li,
.layout-sidebar-second .views-row,
.layout-sidebar-second .links li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Taxonomy tree: hide Drupal's original menu marker */
#block-waffle-wenzhangfenlei li::marker {
  content: "";
}

/* 相簿照片縮圖排列 */
.field--name-field-xiang-pian {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.field--name-field-xiang-pian > .field__item {
  flex: 0 0 auto;
}

.field--name-field-xiang-pian img {
  display: block;
}

/* 相簿多張照片橫向排列 */
.field--name-field-xiang-pian .field__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.field--name-field-xiang-pian .field__items > .field__item {
  flex: 0 0 auto;
  margin: 0;
}


/* 相簿影片：120 × 90 縮圖 */
.field--name-field-ying-pian .waffle-video-lightbox {
  display: inline-block;
  position: relative;
  width: 120px;
  height: 90px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  vertical-align: top;
}

/* 目前暫時的影片縮圖底板 */
.field--name-field-ying-pian .waffle-video-thumb {
  display: block;
  position: relative;
  width: 120px;
  height: 90px;
  background: #222;
}

/* 中央播放圖示 */
.field--name-field-ying-pian .waffle-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  line-height: 1;
  color: white;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}


/* =========================================================
   Waffle Video Lightbox - 手機大畫面
   ========================================================= */
@media (max-width: 768px) {

  .glightbox-container .gslide-video {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .glightbox-container .gslide-video .gvideo-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
  }

  .glightbox-container .gslide-video video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
  }

  .glightbox-container .gslide-video .plyr {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
  }
}

/* =========================================================
   Waffle video gallery
   Display video thumbnails in a photo-style grid.
   ========================================================= */

.field--name-field-ying-pian {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.field--name-field-ying-pian > .field__label {
  flex: 0 0 100%;
}

.field--name-field-ying-pian > .field__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}

.field--name-field-ying-pian .field__item {
  width: 120px;
  margin: 0;
}

.waffle-video-lightbox {
  display: block;
  width: 120px;
  text-decoration: none;
}

.waffle-video-thumb {
  position: relative;
  display: block;
  width: 120px;
  height: 90px;
  overflow: hidden;
  background: #222;
}

.waffle-video-thumb img {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: cover;
}

.waffle-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  line-height: 1;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Smaller screens */
@media (max-width: 600px) {
  .field--name-field-ying-pian,
  .field--name-field-ying-pian > .field__items {
    gap: 6px;
  }
}

