/* Palette and type lifted from web.everanhospital.com.tw so this page reads
   as part of the hospital site rather than a bolted-on microsite. */
:root {
  --color-primary: #75482b;
  --color-primary-hover: #593823;
  --color-secondary: #f5961d;
  --color-secondary-hover: #fda634;
  --color-bg-light: #f6f0e9;
  --color-bg-white: #ffffff;
  --color-text-dark: #444;
  --color-text-light: #6c757d;
  --color-border: #dbd5d5;
  --color-border-dark: #bbb;
  --color-primary-light: #b69d75;
  --color-accent-peach: #f6c689;
  --color-amber: #fea815;
  --color-danger: #f05a2b;
  --color-accent-brown: #905911;
  --header-height: 70px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --font-family-base: Arial, 'Microsoft JhengHei', '微軟正黑體', sans-serif;

  /* Social brand colors, footer hover states only */
  --line-color: #06c755;
  --youtube-color: #ff0000;
  --facebook-color: #1877f2;
  --map-color: #ea4335;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-family-base);
  color: var(--color-text-dark);
  padding-top: var(--header-height);

  /* Same treatment as the hospital site's sub-page background
     (.l-sub__bg): faded building photo, fixed, anchored to the bottom. */
  background-color: var(--color-bg-white);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.5)),
    url("../img/bg-sub-page.eb74e1b90a4c.webp");
  background-attachment: fixed;
  background-position: center bottom;
  background-repeat: no-repeat;
  /* 100% width, auto height keeps the photo's real proportions (no
     distortion/zoom) while still spanning edge-to-edge horizontally —
     "contain" left letterboxed gaps on wide screens, "cover" cropped/zoomed
     the building to fill both dimensions and made it look too tall. */
  background-size: 100% auto;
}

a { color: inherit; text-decoration: none; }

/* Header: copied from the hospital site's own .m-header component
   (Public/common/css/refactored/header.css), nav/hamburger stripped since
   this page only needs the logo + one title. */
.m-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--color-bg-white);
  box-shadow: none;
  z-index: 999;
  font-family: Arial, 'Microsoft JhengHei', sans-serif;
  transition: var(--transition);
  margin: 0;
}

.m-header.is-scrolled {
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--color-primary-light);
}

@media (max-width: 799px) {
  .m-header.is-scrolled {
    border-bottom: none;
  }
}

.m-header__container {
  max-width: 100%;
  margin: 0 auto;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0 10px;
}

.m-header__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Hidden on mobile (title just sits next to the logo there). At the
   row-layout breakpoint below, this becomes a same-sized, invisible
   mirror of .m-header__logo in the grid's 3rd column, so the title is
   truly centered on the whole bar — no hardcoded margin to keep in sync
   if the logo's own size ever changes. */
.m-header__logo-spacer {
  display: none;
}

/* Matches the color of the official header's own nav links, which pick up
   body's `color: var(--color-primary)` rather than any explicit color. */
.m-header__page-title {
  color: var(--color-primary);
  text-align: center;
  /* Grid items default to min-width:auto, which refuses to shrink below the
     text's unwrapped width and pushes it past the viewport on narrow
     screens. min-width:0 lets it actually wrap/shrink instead. */
  min-width: 0;
}

/* Main slogan + subtitle stacked as two fixed lines rather than one long
   line left to wrap wherever the browser finds space — at 20+ characters,
   an unstyled single line wraps unpredictably on narrow screens. */
.m-header__page-title > h3 {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.m-header__title-main {
  font-size: 1.15rem;
  font-weight: bold;
}

.m-header__title-sub {
  font-size: 0.8rem;
  font-weight: 500;
}

@media (max-width: 480px) {
  .m-header__title-main {
    font-size: 0.9rem;
  }

  .m-header__title-sub {
    font-size: 0.65rem;
  }
}

/* At 800px+ there's usually room for the title on one line, truly
   centered on the whole bar via the mirrored 3rd column below.
   flex-wrap (not white-space:nowrap) is the overflow safety net: if a
   future font/text change doesn't fit, the subtitle wraps to its own
   centered line instead of overlapping the logo. */
@media (min-width: 800px) {
  .m-header__container {
    grid-template-columns: auto 1fr auto;
  }

  .m-header__logo-spacer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    visibility: hidden;
  }

  .m-header__page-title > h3 {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 6px 10px;
  }

  .m-header__title-main {
    font-size: 1.4rem;
  }

  .m-header__title-sub {
    font-size: 1.05rem;
    font-weight: 800;
  }
}

.m-header__logo img,
.m-header__logo-spacer img {
  height: 55px;
  transition: var(--transition);
  display: block;
}

@media (min-width: 992px) {
  .m-header__container {
    max-width: 80%;
  }

  .m-header__logo img,
  .m-header__logo-spacer img {
    height: 70px;
  }
}

/* Page content: floats as an opaque panel over the background photo,
   mirroring .l-container-panel on the hospital site. */
.page-container {
  max-width: 82.5rem;
  margin: 24px auto 40px;
  padding: 32px 20px 60px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.category-section + .category-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.category-heading {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin: 0 0 28px;
}

.award-group + .award-group {
  margin-top: 32px;
}

.award-heading {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 16px;
  font-size: 1rem;
  color: var(--color-bg-white);
  background: var(--color-primary-light, #b69d75);
}

.award-heading--honorable { background: var(--color-accent-brown); }

/* Fixed 3-column layout (not auto-fill) so every row's columns line up
   at the same x-position regardless of how many cards are in that row. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 280px);
  gap: 16px;
  justify-content: center;
}

/* .page-container caps content at 1320px with 20px side padding, so 3 fixed
   280px columns (872px) need a ~912px viewport; below that, drop to 2
   columns before the 700px breakpoint collapses to 1. */
@media (max-width: 911px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 280px);
  }
}

@media (max-width: 700px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Border/hover treatment matches .c-sidebar-trust__item on the hospital site. */
.artwork-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-accent-peach);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.artwork-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(117, 72, 43, 0.08);
}

.artwork-card__image-wrap {
  position: relative;
}

.artwork-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--color-bg-light);
  cursor: zoom-in;
}

.artwork-card__placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  background: repeating-linear-gradient(
    45deg,
    var(--color-bg-light),
    var(--color-bg-light) 10px,
    #efe6d8 10px,
    #efe6d8 20px
  );
}

.award-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-bg-white);
}

.award-badge--gold { background: var(--color-danger); }
.award-badge--silver { background: var(--color-amber); }
.award-badge--bronze { background: var(--color-secondary); }
.award-badge--honorable { background: var(--color-accent-brown); }

.artwork-card__body {
  padding: 16px;
}

.artwork-card__title {
  font-weight: bold;
  color: var(--color-text-dark);
}

.artwork-card__artist {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--color-text-light);
  padding: 60px 0;
}

.view-switch {
  text-align: right;
  margin-bottom: 20px;
}

.view-switch__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--color-primary);
  border: 1px solid var(--color-primary-light);
  transition: var(--transition);
}

.view-switch__link:hover {
  color: var(--color-bg-white);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* ==========================================================================
   Artwork viewer (viewer.html): sidebar thumbnail accordion + large image
   stage. Accordion header/list treatment adapted from the hospital site's
   own .c-sidebar-trust component (Public/common/css/sub-style.css) so it
   reads as a native part of the site rather than a one-off layout.
   ========================================================================== */
.artwork-viewer {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 800px) {
  .artwork-viewer {
    grid-template-columns: 1fr;
  }
}

.artwork-viewer__sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.viewer-accordion {
  border: 1px solid var(--color-accent-peach);
}

.viewer-accordion__header {
  display: block;
  width: 100%;
  padding: 1rem;
  background-color: var(--color-bg-light);
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.viewer-accordion__title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-accordion__title-row h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-dark);
}

.viewer-accordion__icon {
  color: var(--color-primary);
  font-size: 0.9rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.viewer-accordion.is-open .viewer-accordion__icon {
  transform: rotate(180deg);
}

.viewer-accordion__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
  overflow: hidden;
}

.viewer-accordion__body > * {
  min-height: 0;
}

.viewer-accordion.is-open .viewer-accordion__body {
  grid-template-rows: 1fr;
}

/* One row per artwork — artist name + title, same border/hover treatment as
   the hospital site's .c-sidebar-trust__item nav rows. */
.viewer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.viewer-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-accent-peach);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.viewer-list-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(117, 72, 43, 0.08);
}

.viewer-list-item.is-active {
  border-color: var(--color-primary);
}

.viewer-list-item.is-active .viewer-list-item__artist {
  color: var(--color-primary);
}

.viewer-list-item__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viewer-rank-badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-bg-white);
}

.viewer-rank-badge--gold { background: var(--color-danger); }
.viewer-rank-badge--silver { background: var(--color-amber); }
.viewer-rank-badge--bronze { background: var(--color-secondary); }
.viewer-rank-badge--honorable { background: var(--color-accent-brown); }

.viewer-list-item__artist {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-dark);
  transition: color 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-list-item__title {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-list-item__arrow {
  flex-shrink: 0;
  margin-left: 12px;
  color: var(--color-border-dark);
  font-size: 0.8rem;
  transition: all 0.3s;
}

.viewer-list-item.is-active .viewer-list-item__arrow,
.viewer-list-item:hover .viewer-list-item__arrow {
  color: var(--color-primary);
  transform: translateX(2px);
}

.artwork-viewer__main {
  min-width: 0;
}

.artwork-viewer__heading {
  margin-bottom: 16px;
}

.artwork-viewer__category {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-bg-white);
  background: var(--color-primary);
}

.artwork-viewer__title {
  margin: 0 0 4px;
  color: var(--color-primary);
  font-size: 1.75rem;
}

.artwork-viewer__artist {
  margin: 0;
  color: var(--color-text-light);
}

.artwork-viewer__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
}

.artwork-viewer__image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.artwork-viewer__placeholder {
  color: var(--color-text-light);
}

.artwork-viewer__award-badge {
  top: 16px;
  left: 16px;
}

body.no-scroll {
  overflow: hidden;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__body {
  display: flex;
  width: 90vw;
  height: 90vh;
  background: var(--color-bg-white);
  overflow: hidden;
}

@media (max-width: 800px) {
  .lightbox__body {
    flex-direction: column;
    width: 95vw;
    height: 95vh;
  }
}

/* Fixed-size scroll port; grows real scrollbars once the (zoomed) image
   inside is bigger than it, so panning is native scroll — wheel, trackpad,
   dragging the scrollbar, or touch swipe — not a custom drag gesture. */
.lightbox__viewport {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF;
}

@media (max-width: 800px) {
  .lightbox__viewport {
    flex: none;
    height: 55%;
    width: 100%;
  }
}

/* Artwork title, artist, and statement of intent (作品理念) — shown
   alongside the image the moment the lightbox opens, not just the photo. */
.lightbox__caption {
  flex-shrink: 0;
  width: 340px;
  height: 100%;
  padding: 28px 24px;
  overflow-y: auto;
  background: var(--color-bg-light);
  border-left: 1px solid var(--color-border);
}

@media (max-width: 800px) {
  .lightbox__caption {
    width: 100%;
    height: 45%;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }
}

.lightbox__caption-title {
  margin: 0 0 6px;
  color: var(--color-primary);
  font-size: 1.3rem;
}

.lightbox__caption-artist {
  margin: 0 0 20px;
  color: var(--color-text-dark);
  font-size: 0.95rem;
  font-weight: 900;
}

.lightbox__caption-label {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-bg-white);
  background: var(--color-primary);
}

.lightbox__caption-desc {
  margin: 0;
  color: var(--color-text-dark);
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-line;
}

/* Centering via flex only works while content fits; once the zoomed image
   overflows, flex's auto-centered overflow clips inconsistently across
   browsers, so switch to plain top-left flow and center via scroll
   position instead (set in JS). */
.lightbox__viewport.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__image.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 24px;
  background: transparent;
  border: none;
  color: var(--color-bg-white);
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   Minimal grid shim for the handful of Bootstrap classes footer.html uses
   (container, row, col-lg-N, mb-N, py-N) — not pulling in all of Bootstrap for
   four utility classes.
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

/* Same specificity as the .col-lg-N / .col-md-N breakpoint rules below, so
   source order (not selector weight) decides the winner — otherwise this
   catch-all always beat them and columns stayed stacked at every width. */
.col-lg-3, .col-lg-4, .col-lg-5, .col-md-6, .col-md-12 {
  padding: 0 15px;
  width: 100%;
}

.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

@media (min-width: 768px) {
  .col-md-6 { width: 50%; }
  .col-md-12 { width: 100%; }
}

@media (min-width: 992px) {
  .col-lg-3 { width: 25%; }
  .col-lg-4 { width: 33.3333%; }
  .col-lg-5 { width: 41.6667%; }
  .mb-lg-0 { margin-bottom: 0; }
}

/* ==========================================================================
   Footer: copied from the hospital site's own .l-footer component
   (Public/common/css/refactored/layout.css).
   ========================================================================== */
.l-footer {
  position: relative;
  background: var(--color-primary-hover) url("../img/footer_bg.d73a56850531.webp") no-repeat center center;
  background-size: cover;
  color: var(--color-bg-white);
  font-size: 1.3125rem;
}

.l-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-primary));
}

.l-footer__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-bg-white);
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.l-footer__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 48px;
  background: var(--color-secondary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.l-footer__col:hover .l-footer__title::after {
  width: 72px;
}

.l-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.l-footer__links li {
  margin-bottom: 10px;
}

.l-footer__link {
  color: rgba(255, 255, 255, 0.90);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s, font-weight 0.1s;
}

.l-footer__link:hover {
  color: var(--color-bg-white);
  text-decoration: none;
  font-weight: 700;
}

.l-footer__contact {
  line-height: 1.8;
}

.l-footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.l-footer__contact-item i {
  color: var(--color-bg-white);
  font-size: 1.25rem;
  width: 22px;
  flex-shrink: 0;
  margin-top: 3px;
}

.l-footer__contact-main {
  font-size: 1.1rem;
  color: var(--color-bg-white);
  font-weight: 600;
  margin: 0 0 2px 0;
}

.l-footer__contact-sub {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  line-height: 1.5;
}

.l-footer__credits {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.8;
}

.l-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.l-footer__social-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 46px;
  height: 46px;
  font-size: 1.375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--color-bg-white);
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}

.l-footer__social-link:hover {
  color: var(--color-bg-white);
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.l-footer__social-link--facebook:hover { background: var(--facebook-color); border-color: var(--facebook-color); }
.l-footer__social-link--youtube:hover  { background: var(--youtube-color); border-color: var(--youtube-color); }
.l-footer__social-link--line:hover     { background: var(--line-color); border-color: var(--line-color); }
.l-footer__social-link--map:hover      { background: var(--map-color); border-color: var(--map-color); }

.l-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  padding: 12px 0;
}

.l-footer__copyright {
  text-align: center;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.80);
  line-height: 1.6;
  margin-bottom: 0;
}

.l-footer__copyright a {
  color: var(--color-bg-white);
  font-weight: 700;
  text-decoration: none;
  transition: text-decoration 0.2s;
}

.l-footer__copyright a:hover {
  color: var(--color-bg-white);
  text-decoration: underline !important;
}
