/* =====================================================================
   Eagle's Landing Day Camp — Photo Gallery
   theme.css : whitewashed wood, parent blue, guest orange
   ===================================================================== */

:root {
  --brand-blue:        #2E7CC9;
  --brand-blue-dark:   #1E5FA0;
  --brand-orange:      #D9943A;
  --brand-orange-dark: #B57928;
  --brand-forest:      #2D3B2A;
  --brand-bark:        #6B4423;
  --brand-cream:       #F5E6D3;
  --brand-white:       #FFFCF5;
  --brand-wood-1:      #FAF4EA;
  --brand-wood-2:      #F0E6D5;
  --brand-wood-3:      #F5EBDB;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card:        0 2px 8px  rgba(45, 59, 42, 0.08);
  --shadow-card-hover:  0 4px 16px rgba(45, 59, 42, 0.15);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--brand-forest);
  background: var(--brand-wood-1) repeating-linear-gradient(
    to bottom,
    var(--brand-wood-1) 0px, var(--brand-wood-1) 4px,
    var(--brand-wood-2) 4px, var(--brand-wood-2) 5px,
    var(--brand-wood-1) 5px, var(--brand-wood-1) 11px,
    var(--brand-wood-3) 11px, var(--brand-wood-3) 12px
  );
  min-height: 100vh;
  line-height: 1.5;
  font-size: 15px;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ----- Containers ----- */
.container        { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.container-narrow { max-width: 720px;  margin: 0 auto; padding: 1.5rem 1rem; }

/* ----- Brand header (dark band w/ logo) ----- */
.brand-header {
  background: var(--brand-forest);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem 2rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.brand-header img { max-height: 140px; margin: 0 auto; width: auto; }
.brand-header-compact { padding: 0.75rem 1rem; margin-bottom: 1rem; }
.brand-header-compact img { max-height: 60px; }

.welcome-text {
  text-align: center;
  font-size: 17px;
  color: var(--brand-bark);
  margin: 0 0 1.5rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Accessible-but-hidden helper for headings/labels read by screen readers and indexed by SEO */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Top nav (post-login) ----- */
.topnav {
  background: var(--brand-forest);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--brand-white);
  flex-wrap: wrap;
  gap: 8px;
}
.topnav-brand { font-weight: 600; color: var(--brand-white); display: flex; align-items: center; gap: 8px; }
.topnav-brand img { max-height: 36px; }
.topnav-actions { display: flex; gap: 4px; align-items: center; }
.topnav-actions a, .topnav-actions span {
  color: var(--brand-white);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}
.topnav-actions a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.topnav-user { opacity: 0.85; font-size: 12px; }

/* ----- Cards ----- */
.card        { background: var(--brand-white); border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow-card); }
.card-parent { background: var(--brand-blue);   color: var(--brand-white); border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow-card); }
.card-guest  { background: var(--brand-orange); color: var(--brand-white); border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow-card); }

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
}
.card-header i { font-size: 22px; }

.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feature-list { margin: 0 0 12px; font-size: 13px; line-height: 1.7; }
.feature-list div { display: flex; align-items: center; gap: 6px; }
.feature-list i { font-size: 14px; }
.muted-note { margin: 10px 0 0; font-size: 11px; opacity: 0.85; }

@media (max-width: 640px) {
  .login-grid    { grid-template-columns: 1fr; }
  .brand-header  { padding: 1rem; }
  .brand-header img { max-height: 90px; }
  .welcome-text  { font-size: 16px; }
}

/* ----- Forms ----- */
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--brand-white);
  color: var(--brand-forest);
  font-family: inherit;
  margin-bottom: 10px;
}
.form-input:focus { outline: 2px solid var(--brand-white); outline-offset: 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }
.btn-blue   { background: var(--brand-blue);   color: var(--brand-white); }
.btn-blue:hover   { background: var(--brand-blue-dark);   text-decoration: none; color: var(--brand-white); }
.btn-orange { background: var(--brand-orange); color: var(--brand-white); }
.btn-orange:hover { background: var(--brand-orange-dark); text-decoration: none; color: var(--brand-white); }
.btn-block  { width: 100%; }
.btn-ghost  { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-ghost:hover { background: rgba(255,255,255,0.15); text-decoration: none; color: inherit; }

/* ----- OTP code entry ----- */
.otp-wrap { text-align: center; }
.otp-input {
  width: 100%;
  max-width: 320px;
  padding: 14px;
  font-size: 28px;
  text-align: center;
  letter-spacing: 12px;
  font-weight: 500;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--brand-white);
  color: var(--brand-forest);
  border: 2px solid var(--brand-blue);
  border-radius: var(--radius-md);
  margin: 0 auto 1rem;
  display: block;
}

/* ----- Album & photo grids ----- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 1rem 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 1rem 0; }
@media (max-width: 480px) {
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

.album-tile {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--brand-forest);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}
.album-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.album-tile-cover { aspect-ratio: 4 / 3; background: var(--brand-cream); overflow: hidden; }
.album-tile-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-tile-meta { padding: 10px 14px; }
.album-tile-title { font-size: 14px; font-weight: 600; color: var(--brand-forest); margin: 0; }
.album-tile-date  { font-size: 12px; color: var(--brand-bark); margin: 2px 0 0; }
.album-tile-count { font-size: 11px; color: var(--brand-bark); opacity: 0.7; margin: 2px 0 0; }

.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--brand-cream);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}
.photo-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.2s ease;
  -webkit-user-drag: none;
  pointer-events: none;
}
.photo-tile:hover img { transform: scale(1.05); }

.photo-tile-fav {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,0.45);
  color: var(--brand-white);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo-tile-fav.is-fav { background: var(--brand-orange); }
.photo-tile-fav:hover { background: var(--brand-orange-dark); }

/* ----- Page heading row ----- */
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 1rem 0 0.5rem;
  flex-wrap: wrap; gap: 8px;
}
.page-head h1 { font-size: 24px; font-weight: 600; color: var(--brand-forest); margin: 0; }
.page-head .meta { font-size: 13px; color: var(--brand-bark); }

/* ----- Lightbox ----- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(45, 59, 42, 0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.lightbox-img-wrap { position: relative; max-width: 92vw; max-height: 88vh; }
.lightbox-img {
  max-width: 100%; max-height: 88vh;
  border-radius: var(--radius-md);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.lightbox-controls {
  position: fixed; top: 18px; right: 18px;
  display: flex; gap: 8px;
}
.lightbox-controls .btn { padding: 8px 14px; }
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255, 252, 245, 0.92);
  color: var(--brand-forest);
  border: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav-prev { left: 18px; }
.lightbox-nav-next { right: 18px; }
.lightbox-caption { position: fixed; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--brand-white); font-size: 13px; opacity: 0.85; }

/* ----- Guest banner ----- */
.guest-banner {
  background: var(--brand-orange);
  color: var(--brand-white);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 1rem;
}

/* ----- Notices ----- */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 14px;
  border-left: 4px solid currentColor;
}
.notice-info    { background: rgba(46, 124, 201, 0.10); color: var(--brand-blue-dark);  border-left-color: var(--brand-blue); }
.notice-error   { background: rgba(212, 50, 50, 0.10);  color: #B23535; border-left-color: #D43232; }
.notice-success { background: rgba(99, 153, 34, 0.10);  color: #4D7415; border-left-color: #639922; }

/* ----- Anti-copy hardening ----- */
.protected, .protected img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

/* ----- Footer ----- */
.footer {
  text-align: center;
  margin: 2rem 0 1rem;
  font-size: 12px;
  color: var(--brand-bark);
  opacity: 0.75;
}

/* ------- Guest disclaimer in lightbox (added by patch 01) ------- */
.lightbox-guest-notice {
  position: absolute;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(255, 252, 245, 0.96);
  color: var(--brand-forest, #2a3d2a);
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
  max-width: min(92%, 580px);
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox-guest-notice .ti {
  vertical-align: middle;
  margin-right: 0.35rem;
  color: var(--brand-tomato, #c0392b);
  font-size: 1.05em;
}
.lightbox-guest-notice strong {
  color: var(--brand-forest, #2a3d2a);
  font-weight: 600;
}
.lightbox-guest-link {
  margin-left: 0.5rem;
  color: var(--brand-tomato, #c0392b);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.lightbox-guest-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .lightbox-guest-notice { bottom: 7rem; font-size: 0.8rem; padding: 0.45rem 0.85rem; }
  .lightbox-guest-link { display: block; margin: 0.35rem 0 0; }
}
