/* =====================================================================
   CGC Back Office - Lobby popups                 assets/css/popup.css
   The popup over the lobby (assets/js/popup.js). Colors: CGC Color Index.
   =====================================================================

   INDEX
   1. Full screen popup ... covers the whole lobby; the page shows its own heading
   2. Window popup ........ a window over the dimmed lobby, fleuron and
                           title on top, Close at the bottom (like the main
                           website's small popups); popup.js sizes it to its
                           page, so the size here is only where it starts.
                           Windows opened from a window lie on top of it.
   3. Large window ........ nearly the whole screen over the dimmed lobby,
                           title at the left and Close at the right of the top
                           bar (like the main website's Meetings and Events)
   4. Picture ............. the page alone over the dimmed lobby, no window
                           and no button (a click around it, or Esc, closes it)
   5. Close button ........ Close / Back; Lobby and Sign Out at the top right
                           of a full-screen page opened from the lobby
   6. Small screens
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Full screen popup
   --------------------------------------------------------------------- */
.cgc-popup {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E2E9DC;
}

.cgc-popup__window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #E2E9DC;
}
.cgc-popup__frame { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: #E2E9DC; }   /* min-height 0: the frame gives way, never the title or the button (popup.js measures them) */

.cgc-popup__head  {                              /* hidden on screen in full screen, read aloud */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}


/* ---------------------------------------------------------------------
   2. Window popup
   Starting size: up to 760px wide and 80% of the screen tall; then the
   size its page asks for (popup.js, section 3).
   --------------------------------------------------------------------- */
.cgc-popup.is-window,
.cgc-popup.is-large,
.cgc-popup.is-picture { background: rgba(20, 32, 24, .55); }       /* the dimmed lobby around windows and pictures */

.cgc-popup.is-window .cgc-popup__window {
  width: min(760px, calc(100% - 32px));
  height: min(80%, 720px);
  border: 1px solid #195D3B;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  transition: width .2s ease, height .2s ease;
}
.cgc-popup.is-window .cgc-popup__head {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  padding: 14px 24px 0;
  text-align: center;
}
.cgc-popup__fleuron { display: block; color: #195D3B; font-size: 22px; line-height: 1; }
.cgc-popup__title {
  margin: 4px 0 0;
  color: #195D3B;
  font: 600 24px/1.2 "EB Garamond", Garamond, Georgia, serif;
  font-variant: small-caps;
  letter-spacing: .03em;
}
.cgc-popup__title::after {                       /* short rule under the title */
  content: "";
  display: block;
  width: 85px;
  height: 1px;
  margin: 8px auto 0;
  background: #195D3B;
}


/* ---------------------------------------------------------------------
   3. Large window
   Top bar: title (left) | Close (right), a line under it, then the page.
   Size: up to 1500px wide, the screen's height less 16px top and bottom.
   --------------------------------------------------------------------- */
.cgc-popup.is-large .cgc-popup__window {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "head close" "frame frame";
  width: min(1500px, calc(100% - 48px));
  height: calc(100% - 32px);
  border: 2px solid #195D3B;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.cgc-popup.is-large .cgc-popup__head {
  grid-area: head;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  padding: 16px 40px 14px;
}
.cgc-popup.is-large .cgc-popup__fleuron { display: none; }
.cgc-popup.is-large .cgc-popup__title {
  margin: 0;
  color: #174E2B;
  font: italic 700 40px/1.15 "Adobe Garamond Pro", "EB Garamond", Garamond, Georgia, serif;
  font-variant: normal;
  letter-spacing: 0;
}
.cgc-popup.is-large .cgc-popup__title::after { display: none; }
.cgc-popup.is-large .cgc-popup__head:has(.cgc-popup__sub:not(:empty)) { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 40px; }
.cgc-popup__sub { display: none; }
.cgc-popup.is-large .cgc-popup__sub:not(:empty) { display: block; margin: 0; color: #195D3B; font: italic 22px/1.3 Georgia, serif; }   /* beside the title: a photo's name */
.cgc-popup__sub small { margin-left: 12px; color: #555; font-size: .8em; }                             /* "9 of 77" */
.cgc-popup.is-large .cgc-popup__head:has(.cgc-popup__find) { display: flex; align-items: center; gap: 16px 70px; }
.cgc-popup__find { display: flex; align-items: center; gap: 8px; }                                   /* a page's Find, in the title strip */
.cgc-popup__find input {
  width: 340px;
  padding: 8px 14px;
  border: 1px solid rgba(25, 93, 59, .35);
  border-radius: 6px;
  background: #fff;
  font: 18px/1.3 Georgia, serif;
}
.cgc-popup__find-go {                                                                                 /* the standard outline button (forms.css, 4) */
  padding: 6px 30px;
  border: 1px solid #195D3B;
  border-radius: 999px;
  background: transparent;
  color: #195D3B;
  font: 600 15px/1.3 "EB Garamond", Garamond, Georgia, serif;
  font-variant: small-caps;
  letter-spacing: .03em;
  cursor: pointer;
}
.cgc-popup__find-go:hover,
.cgc-popup__find-go:focus-visible { background: #195D3B; color: #fff; outline: none; }
.cgc-popup.has-own-back .cgc-popup__close { display: none; }                                           /* the page shows it in its own row */
.cgc-popup.is-large .cgc-popup__frame {
  grid-area: frame;
  height: 100%;
  border-top: 1px solid rgba(25, 93, 59, .35);                     /* the line under the top bar */
}
.cgc-popup.is-large .cgc-popup__close {
  grid-area: close;
  position: static;
  align-self: center;
  margin-right: 40px;
}


/* ---------------------------------------------------------------------
   4. Picture
   Size: set by popup.js to the page's own shape, up to the screen.
   --------------------------------------------------------------------- */
.cgc-popup.is-picture .cgc-popup__window {
  background: transparent;
  transition: width .2s ease, height .2s ease;
}
.cgc-popup.is-picture .cgc-popup__frame { background: transparent; }
.cgc-popup.is-picture .cgc-popup__close { display: none; }   /* a Picture has no button: a click around it, or Esc, closes it */


/* ---------------------------------------------------------------------
   5. Close / Back button (outlined pill)
   Says Close, or Back on a window opened from another window.
   Full screen opened from the lobby: Lobby and Sign Out, top right.
   Window: centered at the bottom.
   Large window: in the top bar (section 3), unless the page shows it in
   its own row of buttons (data-popup-back, assets/js/popup-page.js).
   --------------------------------------------------------------------- */
.cgc-popup__close {                               /* the standard outline button (forms.css, 4) */
  position: absolute;
  top: 14px;
  right: 22px;
  z-index: 2;
  padding: 6px 30px;
  border: 1px solid #195D3B;
  border-radius: 999px;
  background: transparent;
  color: #195D3B;
  font: 600 15px/1.3 "EB Garamond", Garamond, Georgia, serif;
  font-variant: small-caps;
  letter-spacing: .03em;
  white-space: nowrap;                           /* "Back to Club Library" stays on one line */
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cgc-popup__close:hover,
.cgc-popup__close:focus-visible { background: #195D3B; color: #fff; outline: none; }

.cgc-popup.is-window .cgc-popup__close {
  position: static;
  align-self: center;
  margin: 8px 0 14px;
}

/* Lobby and Sign Out (a full-screen page opened from the lobby, e.g. the office) */
.cgc-popup__corner {
  position: absolute;
  top: 14px;
  right: 22px;
  z-index: 2;
  display: flex;
  gap: 10px;
}
.cgc-popup__corner .cgc-popup__close { position: static; text-decoration: none; }


/* ---------------------------------------------------------------------
   6. Small screens
   --------------------------------------------------------------------- */
@media (max-width: 700px) {
  .cgc-popup__close  { top: 8px; right: 8px; padding: 4px 14px; font-size: 15px; }
  .cgc-popup__corner { top: 8px; right: 8px; gap: 6px; }
  .cgc-popup.is-window .cgc-popup__window { height: calc(100% - 32px); }
  .cgc-popup.is-large .cgc-popup__head    { padding: 10px 16px; }
  .cgc-popup.is-large .cgc-popup__title   { font-size: 26px; }
  .cgc-popup.is-large .cgc-popup__close   { margin-right: 16px; }
}
