/* ==========================================================================
   Gallery
   ========================================================================== */
/* 이 파일은 독립 `/gallery` 페이지에서 단독으로 로드되며 homepage.css를 함께
   로드하지 않으므로, homepage.css `--font-size Manage` 구역의 대상이 아니다.
   이 파일 안의 font-size는 컴포넌트 규칙에 그대로 선언한다(별도 관리 구역 없음
   — 필요해지면 이 파일 상단에 이 페이지만의 관리 구역을 새로 만들 것). */

:root {
      --bg: #ffffff;
      --tile: #e5e5e5;
      --text: #111111;
      --muted: #9a9a9a;
      --hero-height: 70vh;
      --search-width: min(420px, 52vw);
      --gap: 3px;
      --cols: 5;
      --topbar-height: 64px;
    }

    html,
    body {
      background: var(--bg);
    }

    body { overflow-x: hidden; }

    .hero {
      position: relative;
      height: var(--hero-height);
      min-height: 360px;
      display: grid;
      place-items: center;
      background: #fff;
    }

    .hero::after {
      content: "";
      position: absolute;
      inset: auto 0 0;
      height: 30%;
      pointer-events: none;
      background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 78%);
    }

    .center-ui {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      transform: translateY(2vh);
    }

    .logo {
      margin: 0 0 18px;
      font-family: Georgia, "Times New Roman", serif;
      font-size: clamp(28px, 3vw, 44px);
      font-weight: 400;
      letter-spacing: 0.42em;
      text-indent: 0.42em;
      line-height: 1;
    }

    .search {
      width: var(--search-width);
      height: 48px;
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 0 22px;
      border: 0;
      border-radius: 999px;
      background: rgba(229, 229, 229, 0.72);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: none;
    }

    .search svg {
      width: 21px;
      height: 21px;
      flex: 0 0 auto;
      color: #777;
    }

    .search input {
      width: 100%;
      border: 0;
      outline: 0;
      background: transparent;
      color: #555;
      font-size: 14px;
    }

    .search input::placeholder { color: #aaa; }

    .sticky-search {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 20;
      height: var(--topbar-height);
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 24px;
      padding: 8px 24px;
      background: rgba(255, 255, 255, 0.82);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      transform: translateY(-100%);
      opacity: 0;
      pointer-events: none;
      transition: transform 220ms ease, opacity 220ms ease;
    }

    .sticky-search.is-visible {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
    }

    .sticky-logo {
      margin: 0;
      font-family: Georgia, "Times New Roman", serif;
      font-size: 16px;
      font-weight: 400;
      letter-spacing: 0.34em;
      text-indent: 0.34em;
      white-space: nowrap;
    }

    .sticky-search .search {
      width: min(360px, 54vw);
      height: 40px;
    }

    .gallery {
      width: 100vw;
      column-count: var(--cols);
      column-gap: var(--gap);
      padding: 0;
      margin: 0;
    }

    .tile {
      width: 100%;
      aspect-ratio: var(--ratio, 1 / 1);
      margin: 0 0 var(--gap);
      display: block;
      break-inside: avoid;
      background: var(--tile);
      cursor: pointer;
    }

    .fixed-info {
      position: fixed;
      left: 16px;
      bottom: 14px;
      z-index: 10;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
      padding: 8px 9px;
      color: #111;
      font-size: 12px;
      line-height: 1.25;
      background: rgba(255,255,255,0.18);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .fixed-info a,
    .fixed-info span {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: inherit;
      text-decoration: none;
      white-space: nowrap;
    }

    .fixed-info .social-row { display: flex; gap: 14px; }
    .fixed-info svg { width: 15px; height: 15px; flex: 0 0 auto; }

    .star-button {
      position: fixed;
      right: 22px;
      bottom: 22px;
      z-index: 21;
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border: 0;
      background: transparent;
      color: #111;
      font-size: 40px;
      line-height: 1;
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transform: scale(0.92);
      transition: opacity 220ms ease, transform 220ms ease;
    }

    .star-button.is-visible {
      opacity: 1;
      pointer-events: auto;
      transform: scale(1);
    }



    .art-modal {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: grid;
      place-items: center;
      padding: 5vh 6vw;
      background: rgba(0, 0, 0, 0.62);
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
      transition: opacity 180ms ease;
    }

    .art-modal.is-open {
      visibility: visible;
      opacity: 1;
      pointer-events: auto;
    }

    .modal-artwork {
      position: relative;
      width: min(1180px, 92vw);
      height: min(760px, 82vh);
      border-radius: 18px;
      background: #e5e5e5;
      box-shadow: 0 22px 70px rgba(0,0,0,0.25);
      transition: width 180ms ease, height 180ms ease;
    }

    .modal-close {
      position: absolute;
      top: 18px;
      right: 18px;
      z-index: 2;
      width: 34px;
      height: 34px;
      border: 0;
      background: transparent;
      color: #111;
      cursor: pointer;
    }

    .modal-close::before,
    .modal-close::after {
      content: "";
      position: absolute;
      left: 7px;
      top: 16px;
      width: 20px;
      height: 1.5px;
      background: currentColor;
    }

    .modal-close::before { transform: rotate(45deg); }
    .modal-close::after { transform: rotate(-45deg); }

    .modal-meta {
      position: absolute;
      left: 24px;
      bottom: 20px;
      z-index: 2;
      display: flex;
      flex-direction: column;
      gap: 9px;
      color: #111;
      font-size: 11px;
      line-height: 1.2;
    }

    .modal-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .modal-tags span {
      padding: 4px 8px;
      border: 1px solid rgba(0,0,0,0.26);
      border-radius: 999px;
      background: rgba(255,255,255,0.22);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }

    .modal-detail-row {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .modal-detail-row span,
    .modal-detail-row a {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
      color: inherit;
      text-decoration: none;
    }

    .modal-detail-row svg {
      width: 14px;
      height: 14px;
      flex: 0 0 auto;
    }

    .modal-detail-row .modal-icon-link {
      width: 16px;
      height: 16px;
      justify-content: center;
    }

    @media (max-width: 700px) {
      :root {
        --search-width: 78vw;
        --gap: 2px;
        --topbar-height: 58px;
      }

      .hero { min-height: 320px; }
      .logo { margin-bottom: 14px; font-size: 24px; }
      .search { height: 44px; padding: 0 18px; }
      .sticky-search { gap: 12px; justify-content: flex-start; }
      .sticky-logo { font-size: 13px; letter-spacing: 0.24em; text-indent: 0.24em; }
      .sticky-search .search { width: 100%; min-width: 0; }
      .fixed-info { font-size: 11px; left: 8px; bottom: 10px; }
      .star-button { right: 12px; bottom: 14px; font-size: 34px; }
      .art-modal { padding: 4vh 4vw; }
      .modal-artwork { border-radius: 14px; }
      .modal-meta { left: 14px; bottom: 14px; max-width: calc(100% - 90px); font-size: 10px; gap: 7px; }
      .modal-tags { gap: 4px; }
      .modal-tags span { padding: 3px 6px; }
      .modal-close { top: 10px; right: 10px; }
    }

/* Modal visibility hardening */
.art-modal[aria-hidden="false"] {
  visibility: visible;
}
