/* ==================
   MAIN LAYOUT
   ================== */

.main {
  flex: 1;
  overflow-x: clip; /* clip, not hidden — hidden creates a scroll container that breaks position:sticky on children */
}

/* ==================
   SPLASH SCREEN (app root)
   ================== */

.splash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 48px - 60px);
  gap: 0.5rem;
  padding: 2rem 1.5rem;
}

.splash-logo   { margin-bottom: 0.5rem; }
.splash-title  { font-size: 1.4rem; font-weight: 700; color: var(--cat-green); line-height: 1.25; margin-bottom: 0; }
.splash-year   { font-size: 1rem; color: var(--cat-muted); margin-bottom: 1.5rem; }

.splash-cta {
  display: inline-block;
  background: var(--cat-green);
  color: var(--cat-white);
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.splash-cta:hover { background: #214D3A; color: var(--cat-white); }

.splash-build { font-size: 0.7rem; color: var(--cat-muted); margin-top: 2rem; margin-bottom: 0; }

/* ==================
   FLASH MESSAGES
   ================== */

.flash-notice { background: #e6f4ea; color: #276221; border: 1px solid #b7dfb9; border-radius: 6px; padding: 0.5rem 0.875rem; margin-bottom: 1rem; font-size: var(--font-size-sm); }
.flash-alert  { background: #fdecea; color: #a61c00; border: 1px solid #f5c6c2; border-radius: 6px; padding: 0.5rem 0.875rem; margin-bottom: 1rem; font-size: var(--font-size-sm); }

/* ==================
   MISC UTILITIES
   ================== */

.none-text { color: #bbb; font-size: var(--font-size-sm); font-style: italic; }
.mono      { font-family: var(--font-mono); }

/* ==================
   VIEW TOGGLES
   ================== */

.view-toggle, .view-toggle-active {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: var(--font-size-sm);
  margin-right: 4px;
}

.view-toggle        { color: #7c5cbf; text-decoration: none; border: 1px solid #c4b0e8; }
.view-toggle:hover  { background: #f0eafa; }
.view-toggle-active { background: #7c5cbf; color: #fff; font-weight: 600; }

/* ==================
   FIELD LIST THUMBNAILS
   ================== */

.field-thumb {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  border: 1px solid #e5e5e5;
}

.field-thumb:hover { opacity: 0.85; }

/* ==================
   TRIAL ATTACHMENTS
   ================== */

.trial-attachments           { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.875rem; }
.trial-attachment-item       { display: inline-flex; align-items: center; gap: 0.25rem; background: #f0f4ff; border: 1px solid #c7d4f5; border-radius: 5px; padding: 0.2rem 0.5rem; font-size: var(--font-size-sm); }
.trial-attachment-link       { color: #3b5bdb; text-decoration: none; font-weight: 500; }
.trial-attachment-link:hover { text-decoration: underline; }
.trial-attachment-remove     { background: none; border: none; color: #aaa; cursor: pointer; font-size: 11px; padding: 0 0.1rem; line-height: 1; }
.trial-attachment-remove:hover { color: #dc2626; }
.trial-attachment-add          { font-size: var(--font-size-sm); }
.trial-attachment-add summary  { color: #3b5bdb; cursor: pointer; font-weight: 500; list-style: none; }
.trial-attachment-add summary::-webkit-details-marker { display: none; }
.trial-attachment-form         { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.4rem; flex-wrap: wrap; }
.attachment-link               { font-size: 16px; text-decoration: none; }
.attachment-link:hover         { opacity: 0.7; }

/* ==================
   PHOTO WALL
   ================== */

.photo-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

@media (max-width: 1400px) { .photo-wall { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1100px) { .photo-wall { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px)  { .photo-wall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px)  { .photo-wall { grid-template-columns: repeat(2, 1fr); } }

.photo-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.photo-card img:hover { opacity: 0.85; }

.photo-caption    { padding: 0.35rem 0.5rem; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.photo-plot-plant { font-weight: 700; font-size: var(--font-size-sm); }
.photo-seedkey    { font-size: 12px; color: #555; }
.photo-name       { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-markers    { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }

/* Photo search (different from filter bar search-wrap) */
.search-input-wrap          { position: relative; display: inline-flex; align-items: center; }
.search-input-wrap input    { padding-right: 1.5rem; }
.search-clear-btn           { position: absolute; right: 4px; background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: #aaa; padding: 0 2px; }
.search-clear-btn:hover     { color: #555; }

/* ==================
   PHOTO PAGER
   ================== */

.photo-pager         { display: flex; align-items: center; gap: 0.5rem; }
.photo-pager--bottom { justify-content: center; margin-top: 1.5rem; margin-bottom: 1rem; }
.pager-btn           { display: inline-block; padding: 3px 12px; border-radius: 3px; font-size: var(--font-size-sm); color: #7c5cbf; text-decoration: none; border: 1px solid #c4b0e8; }
.pager-btn:hover     { background: #f0eafa; }
.pager-info          { font-size: var(--font-size-sm); color: #888; }

/* ==================
   PHOTO CAROUSEL
   ================== */

.photo-carousel {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  min-height: 40px;
}

.photo-thumb img { width: 150px; height: 150px; object-fit: cover; border-radius: 4px; display: block; }

.photo-thumb-wrap {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 150px;
}

.photo-thumb-img-row {
  position: relative;
  width: 150px; height: 150px;
}

.photo-thumb-wrap--red   .photo-thumb img { border: 3px solid #e74c3c; border-radius: 4px; }
.photo-thumb-wrap--blue  .photo-thumb img { border: 3px solid #3b82f6; border-radius: 4px; }
.photo-thumb-wrap--green .photo-thumb img { border: 3px solid #2d9c6e; border-radius: 4px; }

.photo-thumb-img-row .photo-thumb img { width: 150px; height: 150px; object-fit: cover; border-radius: 4px; display: block; }

/* ==================
   MOBILE SEED CARDS
   ================== */

.seed-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.seed-card {
  display: block;
  background: var(--cat-card-bg);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--cat-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.12s, box-shadow 0.12s;
}

.seed-card:hover      { background: #f4f4f0; box-shadow: 0 2px 5px rgba(0,0,0,0.09); }
.seed-card--trial     { border-left: 3px solid var(--cat-green-mid); }

.seed-card-key {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--cat-green);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.seed-card-trial-badge {
  font-size: 11px;
  background: #E1F5EE;
  color: #0F6E56;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
}

.seed-card-name    { font-size: var(--font-size-base); font-weight: 500; margin-top: 0.2rem; }
.seed-card-gen     { font-size: 11px; color: var(--cat-muted); margin-left: 0.3rem; }

.seed-card-parents {
  font-size: 11px;
  color: var(--cat-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seed-card-meta {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.seed-card-tag {
  font-size: 11px;
  background: #f0f0ec;
  color: #555;
  border-radius: 4px;
  padding: 1px 7px;
}

/* ==================
   LOGIN PAGE
   ================== */

.login-wrap  { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #eef2f6; }
.login-card  { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 2.5rem 3rem; box-shadow: 0 8px 20px rgba(15,23,42,0.06); text-align: center; max-width: 360px; width: 100%; }
.login-title { font-size: 1.25rem; font-weight: 700; color: #111827; margin: 0 0 0.25rem; }
.login-sub   { font-size: 0.875rem; color: #6b7280; margin: 0 0 2rem; }
.login-note  { margin-top: 1.5rem; font-size: 0.78rem; color: #9ca3af; }
.btn-google  { display: inline-flex; align-items: center; gap: 0.75rem; background: #fff; border: 1px solid #dadce0; border-radius: 0.5rem; padding: 0.7rem 1.25rem; font-size: 0.95rem; font-weight: 500; color: #3c4043; cursor: pointer; width: 100%; justify-content: center; transition: background 0.15s; }
.btn-google:hover { background: #f8f9fa; }
