:root {
  --teal: #1F9094;
  --teal-medium: #8FC6C8;
  --teal-light: #E0EEEF;
  --teal-dark: #176a6d;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

/* Sticky header */
#site-header {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Hero photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
}
@media (min-width: 640px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .photo-grid { grid-template-columns: repeat(6, 1fr); }
}

.photo-cell {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
  background-color: rgba(31, 144, 148, 0.15);
  background-size: cover;
  background-position: center;
  filter: grayscale(0.7) brightness(1.2);
}

.photo-cell .tooltip-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-cell:hover .tooltip-overlay {
  opacity: 1;
}

.tooltip-info {
  margin-top: 0.5rem;
  font-size: 0.625rem;
  opacity: 0.7;
}

/* Hero overlay */
.hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.55) 50%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 32rem;
  width: 90%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 2rem;
  transform: translateY(1rem);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-content {
  transform: translateY(0);
}

/* CTA dropdown */
.cta-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  min-width: 220px;
  z-index: 60;
}

.cta-dropdown.active {
  opacity: 1;
  pointer-events: auto;
}

.cta-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 0.5rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  color: #333;
  transition: background 0.15s;
}

.cta-dropdown button:hover {
  background: var(--teal-light);
}

@media (min-width: 640px) {
  .cta-dropdown {
    padding: 0.5rem 0.625rem;
    width: max-content;
  }

  .cta-dropdown button {
    padding: 0.875rem 1.25rem 0.875rem 1rem;
    font-size: 1rem;
    white-space: nowrap;
  }
}

/* Counter animation */
.counter-value {
  transition: transform 0.3s ease;
  display: inline-block;
}

/* Char counter */
.char-counter {
  font-size: 0.75rem;
  text-align: right;
}

.char-counter.warn {
  color: #e53e3e;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--teal);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #e53e3e;
}

/* Upload preview */
.upload-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 0.5rem;
  border: 2px dashed var(--teal-medium);
}

/* Form inputs */
input[type="text"],
input[type="email"],
textarea,
select {
  font-family: 'Poppins', sans-serif;
}

/* Campaign info section */
#campaign-info {
  background: #155b5e;
}

.petition-box {
  background: var(--teal);
  border-radius: 1rem;
  padding: 1.5rem;
  color: white;
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* Gallery section */
#gallery {
  background: #111827; /* match footer bg-gray-900 to eliminate white line */
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(6, 1fr); }
}

.gallery-cell {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
  background-color: rgba(31, 144, 148, 0.15);
  background-size: cover;
  background-position: center;
  filter: grayscale(0.7) brightness(1.2);
}

.gallery-cell .tooltip-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-cell:hover .tooltip-overlay {
  opacity: 1;
}

.gallery-sentinel {
  height: 1px;
}

.gallery-spinner {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.gallery-spinner.hidden {
  display: none;
}

/* Story cards (pribehy page) */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.story-card {
  background: var(--teal-light);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .story-card {
    flex-direction: row;
    aspect-ratio: 4 / 1;
  }
  .story-card-reverse {
    flex-direction: row-reverse;
  }
}

.story-card-img {
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(31, 144, 148, 0.1);
  aspect-ratio: 3 / 4;
}

@media (min-width: 640px) {
  .story-card-img {
    height: 100%;
    width: auto;
  }
}

.story-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-card-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

@media (min-width: 640px) {
  .story-card-body {
    padding: 1.25rem 4rem;
  }
}

.story-card-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #2d4a4b;
  margin: 0;
}

.story-card-info {
  font-size: 0.75rem;
  color: #5f8a8c;
  margin: 0.75rem 0 0;
  line-height: 1.4;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 2rem 0 0;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: white;
  text-decoration: none;
  transition: background 0.15s;
}

.pagination-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pagination-current {
  background: var(--teal);
  font-weight: 600;
}

.pagination-current:hover {
  background: var(--teal);
}

.pagination-dots {
  color: rgba(255, 255, 255, 0.5);
  padding: 0 0.25rem;
  font-size: 0.875rem;
}

/* Social icons */
.social-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.3);
}

.social-icon svg {
  width: 1rem;
  height: 1rem;
  fill: white;
}
