/* ==========================================================================
   Grzybo Encyklopedia — front-end styles
   Zależności: Tailwind Play CDN (inline na stronie).
   ========================================================================== */

/* --- Wyszukiwarka --- */
.grzybo-enc-search {
  position: relative;
  max-width: 720px;
  margin: 0 auto 3rem;
}

/* Search info badge (po ?s= w archiwum). */
.grzybo-enc-archive__searchinfo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 720px;
  margin: -1.5rem auto 2rem;
  padding: 0.75rem 1.25rem;
  background: #f0f4f1;
  border: 1px solid #d4e0d8;
  border-radius: 9999px;
  color: #2d3a31;
  font-size: 0.95rem;
}
.grzybo-enc-archive__searchinfo .material-symbols-outlined {
  font-size: 1.25rem;
  color: #84a98c;
}
.grzybo-enc-archive__searchinfo strong {
  font-weight: 600;
  color: #1f2a23;
}
.grzybo-enc-archive__searchclear {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  transition: background 0.15s;
}
.grzybo-enc-archive__searchclear:hover {
  background: #fff;
  color: #1f2a23;
}
.grzybo-enc-archive__searchclear .material-symbols-outlined {
  font-size: 1rem;
}

.grzybo-enc-search__label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280; /* gray-500 */
  pointer-events: none;
  display: flex;
  align-items: center;
}

.grzybo-enc-search__label .material-symbols-outlined {
  font-size: 1.5rem;
}

.grzybo-enc-search__input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1.125rem;
  border: 2px solid #e5e7eb; /* gray-200 */
  border-radius: 9999px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.grzybo-enc-search__input:focus {
  border-color: #84a98c; /* sage green */
  box-shadow: 0 0 0 3px rgba(132, 169, 140, 0.2);
}

.grzybo-enc-search__results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
  z-index: 50;
  max-height: 480px;
  overflow-y: auto;
}

.grzybo-enc-search__results[hidden] {
  display: none;
}

.grzybo-enc-search__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.grzybo-enc-search__item:last-child {
  border-bottom: none;
}

.grzybo-enc-search__item:hover,
.grzybo-enc-search__item:focus {
  background: #f9fafb; /* gray-50 */
  outline: none;
}

.grzybo-enc-search__item-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 0.5rem;
  background: #f3f4f6;
  object-fit: cover;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grzybo-enc-search__item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grzybo-enc-search__item-thumb-placeholder {
  color: #d1d5db;
}

.grzybo-enc-search__item-thumb-placeholder .material-symbols-outlined {
  font-size: 2rem;
}

.grzybo-enc-search__item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.grzybo-enc-search__item-title {
  font-weight: 600;
  color: #111827;
  font-size: 1rem;
  line-height: 1.3;
  margin: 0;
}

.grzybo-enc-search__item-lat {
  font-style: italic;
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

.grzybo-enc-search__item-cat {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #84a98c;
  background: #f0f4f1;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.grzybo-enc-search__status {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

.grzybo-enc-search__results + .grzybo-enc-search__status {
  top: calc(100% + 0.5rem + 100px);
}

.grzybo-enc-search__highlight {
  background: #fef3c7; /* amber-100 */
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* --- Sortowanie --- */
.grzybo-enc-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 auto 2rem;
  max-width: 720px;
  justify-content: flex-end;
}

.grzybo-enc-sort__label {
  font-size: 0.875rem;
  color: #6b7280;
}

.grzybo-enc-sort__btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}

.grzybo-enc-sort__btn:hover {
  border-color: #84a98c;
  color: #84a98c;
}

.grzybo-enc-sort__btn.is-active {
  background: #84a98c;
  border-color: #84a98c;
  color: #fff;
}

/* --- Karta grzyba (grid) --- */
.grzybo-enc-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.grzybo-enc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

.grzybo-enc-card__img {
  aspect-ratio: 5/4;
  width: 100%;
  background: linear-gradient(135deg, #f0f4f1 0%, #e7ede8 100%);
  position: relative;
  overflow: hidden;
}

.grzybo-enc-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grzybo-enc-card__img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #84a98c;
}

.grzybo-enc-card__img-placeholder .material-symbols-outlined {
  font-size: 4rem;
}

.grzybo-enc-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: #52796f;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
}

.grzybo-enc-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.grzybo-enc-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.grzybo-enc-card__lat {
  font-style: italic;
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

.grzybo-enc-card__excerpt {
  color: #4b5563;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  flex: 1;
}

.grzybo-enc-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #84a98c;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-top: auto;
}

.grzybo-enc-card__cta .material-symbols-outlined {
  font-size: 1.125rem;
  transition: transform 0.2s;
}

.grzybo-enc-card:hover .grzybo-enc-card__cta .material-symbols-outlined {
  transform: translateX(4px);
}

/* --- Single page grzyba --- */
.grzybo-enc-single {
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.grzybo-enc-single__hero {
  position: relative;
  height: 360px;
  border-radius: 1.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #2d3a35 0%, #52796f 100%);
}

.grzybo-enc-single__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grzybo-enc-single__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  color: #fff;
}

.grzybo-enc-single__title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.grzybo-enc-single__lat {
  font-style: italic;
  font-size: 1.25rem;
  opacity: 0.9;
  margin: 0 0 1rem;
}

.grzybo-enc-single__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.grzybo-enc-single__meta-chip {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.grzybo-enc-single__section {
  margin: 2.5rem 0;
}

.grzybo-enc-single__section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grzybo-enc-single__section-title .material-symbols-outlined {
  color: #84a98c;
}

.grzybo-enc-single__warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  margin: 2rem 0;
}

.grzybo-enc-single__warning-title {
  color: #92400e;
  font-weight: 700;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grzybo-enc-single__warning-body {
  color: #78350f;
  line-height: 1.6;
  margin: 0;
}

.grzybo-enc-single__info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.grzybo-enc-single__info-item {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 0.75rem;
}

.grzybo-enc-single__info-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 0.25rem;
}

.grzybo-enc-single__info-value {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.grzybo-enc-single__related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.grzybo-enc-single__related-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.grzybo-enc-single__related-item:hover {
  border-color: #84a98c;
  transform: translateY(-2px);
}

.grzybo-enc-single__related-title {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.25rem;
}

.grzybo-enc-single__related-lat {
  font-style: italic;
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

/* --- Brak wyników (archive empty state) --- */
.grzybo-enc-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

.grzybo-enc-empty .material-symbols-outlined {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.grzybo-enc-empty__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem;
}

/* --- Strona archiwum (header) --- */
.grzybo-enc-archive {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.grzybo-enc-archive__intro {
  text-align: center;
  margin-bottom: 3rem;
}

.grzybo-enc-archive__title {
  font-size: 3rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.grzybo-enc-archive__lead {
  font-size: 1.25rem;
  color: #4b5563;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

.grzybo-enc-archive__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* --- SR-only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .grzybo-enc-archive__title { font-size: 2rem; }
  .grzybo-enc-single__hero { height: 240px; }
  .grzybo-enc-single__title { font-size: 1.75rem; }
  .grzybo-enc-single__lat { font-size: 1rem; }
  .grzybo-enc-search__input { font-size: 1rem; padding: 0.875rem 1rem 0.875rem 2.75rem; }
}
