/**
 * File: styles/style.css
 * Main styles for Reconcile EA plugin
 */

/* ==========================================================================
   Base Styles for Jobs & Tenders
   ========================================================================== */

.jobs .single-job,
.tenders .single-tender {
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

@media (max-width: 800px) {
  .jobs .single-job,
  .tenders .single-tender {
    flex-direction: column;
  }
  .single-job .details,
  .single-tender .details {
    padding-bottom: 10px;
  }
}

.single-job .nectar-button,
.single-tender .nectar-button {
  margin: 0;
}

.single-job .details,
.single-tender .details {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.jobs .single-job:not(:last-child) {
  border-bottom: 1px solid #1ba160;
}

/* ==========================================================================
   Single Event Page
   ========================================================================== */

.event-single .event-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .event-single .event-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  
  .event-single .event-content > div:first-child {
    grid-column: 1 / -1;
  }
}

.event-meta > div,
.event-time > div {
  padding: 8px 0;
}

/* ==========================================================================
   Map Styles
   ========================================================================== */

.info.legend.leaflet-control {
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.square {
  width: 15px;
  height: 15px;
  display: inline-block;
}

/* ==========================================================================
   Shared Container & Grid Styles
   ========================================================================== */

.reconcile-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* .heading-text {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 700;
} */

/* Filter Buttons */
.reconcile-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 10px 24px;
  border: 2px solid #ddd;
  border-radius: 25px;
  background: #fff;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  border-color: #1ba160;
  color: #1ba160;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(51, 153, 103, 0.2);
}

.filter-btn.active {
  background-color: #1ba160;
  border-color: #1ba160;
  color: #fff;
  box-shadow: 0 4px 12px rgba(51, 153, 103, 0.3);
}

/* Responsive Grid */
.reconcile-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 768px) {
  .reconcile-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .reconcile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .reconcile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* No items message */
.no-items {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 18px;
}

/* ==========================================================================
   Card Component Styles (Events & Publications)
   ========================================================================== */

article.publication-card{
  --img-scale: 1.001;
  --title-color: #333;
  --link-icon-translate: -20px;
  --link-icon-opacity: 0;
  position: relative;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #fff;
  transform-origin: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-wrapper,
.article-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Card Images */
.card-image,
figure {
  margin: 0;
  padding: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f5f5f5;
}

article img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transform: scale(var(--img-scale));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Body */
.card-body,
.article-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

article h3 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--title-color);
  transition: color 0.3s ease;
  font-weight: 700;
}

article h3 a {
  text-decoration: none;
  color: inherit;
}

.card-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

/* Category Badges */
.publication-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f0f0;
  color: #666;
  font-size: 12px;
  border-radius: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
}

article a.read-more,
article a.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #1ba160;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 0;
  transition: all 0.3s ease;
}

article a.download-btn {
  padding: 8px 16px;
  background: #1ba160;
  color: #fff;
  border-radius: 6px;
}

article a .icon {
  min-width: 20px;
  width: 20px;
  height: 20px;
  transform: translateX(var(--link-icon-translate));
  opacity: var(--link-icon-opacity);
  transition: all 0.3s ease;
}

article a.download-btn .icon {
  transform: none;
  opacity: 1;
}

/* Hover Effects */
/* article:hover,
article:focus-within {
  --img-scale: 1.08;
  --title-color: #1ba160;
  --link-icon-translate: 0;
  --link-icon-opacity: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
} */

article:hover a.download-btn,
article:focus-within a.download-btn {
  background: #2d8558;
  box-shadow: 0 4px 12px rgba(51, 153, 103, 0.3);
}

/* ==========================================================================
   Single Publication Page
   ========================================================================== */

/* .publication-single {
  max-width: 900px;
  margin: 0 auto;
} */

.publication-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.publication-header h1 {
  margin-bottom: 15px;
}

.publication-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: #666;
  font-size: 14px;
  margin-top: 15px;
}

.publication-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.publication-meta .icon {
  width: 18px;
  height: 18px;
}

.publication-featured-image {
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.publication-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.publication-body {
  line-height: 1.8;
  color: #333;
  margin-bottom: 40px;
}

.publication-download {
  text-align: center;
  /* padding: 30px 0;
  border-top: 2px solid #f0f0f0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 50px; */
}

.publication-download .nectar-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.publication-download .icon {
  width: 20px;
  height: 20px;
}

/* Related Publications */
.related-publications {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid #f0f0f0;
}

.related-publications h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.75rem;
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

article a:focus {
  outline: 2px solid #1ba160;
  outline-offset: 2px;
}

.filter-btn:focus {
  outline: 2px solid #1ba160;
  outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.reconcile-grid[data-loading="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ==========================================================================
   Pagination Styles
   ========================================================================== */

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
  padding: 20px 0;
}

/* Load More Button */
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: #1ba160;
  color: #fff;
  border: 2px solid #1ba160;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.load-more-btn:hover {
  background: #2d8558;
  border-color: #2d8558;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(51, 153, 103, 0.3);
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.load-more-btn .spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
}

.load-more-btn .spinner .path {
  stroke: #fff;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Standard Pagination */
.pagination-nav {
  width: 100%;
}

.pagination-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.pagination-list li {
  margin: 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  color: #666;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover {
  border-color: #1ba160;
  color: #1ba160;
  background: #f8f8f8;
}

.page-btn.active {
  background: #1ba160;
  border-color: #1ba160;
  color: #fff;
  cursor: default;
}

.page-btn.prev-btn,
.page-btn.next-btn {
  padding: 0 16px;
}

.page-btn svg {
  width: 16px;
  height: 16px;
}

.pagination-dots {
  padding: 0 8px;
  color: #999;
  font-size: 18px;
  font-weight: bold;
}

.no-more-posts {
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Loading State */
.reconcile-grid.loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.reconcile-error {
  padding: 30px;
  text-align: center;
  color: #d32f2f;
  background: #ffebee;
  border-radius: 8px;
  font-weight: 600;
}

/* ==========================================================================
   Single Publication Enhancements
   ========================================================================== */

.publication-breadcrumbs {
  margin-bottom: 30px;
  font-size: 14px;
}

.publication-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.publication-breadcrumbs ol li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.publication-breadcrumbs ol li:not(:last-child)::after {
  content: "›";
  color: #999;
  font-size: 16px;
}

.publication-breadcrumbs a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.publication-breadcrumbs a:hover {
  color: #1ba160;
}

.publication-breadcrumbs [aria-current="page"] {
  color: #333;
  font-weight: 600;
}

/* .publication-article {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
} */

/* @media (max-width: 768px) {
  .publication-article {
    padding: 20px;
  }
} */

.publication-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #222;
}

@media (max-width: 768px) {
  .publication-title {
    font-size: 1.75rem;
  }
}

.publication-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.share-label {
  font-weight: 600;
  color: #666;
  margin-right: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #666;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn svg {
  width: 18px;
  height: 18px;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn.twitter:hover {
  background: #1DA1F2;
  color: #fff;
}

.share-btn.linkedin:hover {
  background: #0077B5;
  color: #fff;
}

.share-btn.facebook:hover {
  background: #1877F2;
  color: #fff;
}

.share-btn.copy-link:hover {
  background: #1ba160;
  color: #fff;
}

.publication-content-wrapper {
  margin-top: 40px;
}

.publication-featured-image {
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.publication-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.image-caption {
  padding: 12px 16px;
  background: #f8f8f8;
  font-size: 14px;
  color: #666;
  font-style: italic;
}

.publication-body {
  line-height: 1.8;
  color: #444;
  font-size: 17px;
}

.publication-body h2,
.publication-body h3,
.publication-body h4 {
  margin-top: 36px;
  margin-bottom: 16px;
  color: #222;
}

.publication-body p {
  margin-bottom: 20px;
}

.publication-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 30px 0;
}

.publication-body ul,
.publication-body ol {
  margin: 20px 0;
  padding-left: 30px;
}

.publication-body li {
  margin-bottom: 10px;
}

.publication-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 40px 0;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.tags-label {
  font-weight: 600;
  color: #666;
  margin-right: 8px;
}

.tag-link {
  display: inline-block;
  padding: 6px 14px;
  background: #f0f0f0;
  color: #666;
  font-size: 13px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag-link:hover {
  background: #1ba160;
  color: #fff;
  transform: translateY(-1px);
}

.publication-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  /* padding: 30px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  margin: 40px 0;
  border: 2px dashed #1ba160; */
}

@media (max-width: 768px) {
  .publication-download {
    flex-direction: column;
    text-align: center;
  }
}

.download-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .download-info {
    flex-direction: column;
  }
}

.download-icon {
  width: 50px;
  height: 50px;
  color: #1ba160;
  flex-shrink: 0;
}

.download-details h3 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  color: #222;
}

.file-meta {
  display: flex;
  gap: 15px;
  margin: 0;
  font-size: 14px;
  color: #666;
}

.file-type,
.file-size {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.publication-download .nectar-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.publication-download .icon {
  width: 20px;
  height: 20px;
}

.related-publications {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid #eee;
}

.related-publications h3 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.75rem;
  color: #222;
}

.publication-navigation {
  text-align: center;
  margin: 40px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #f8f8f8;
  color: #666;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.back-link:hover {
  background: #1ba160;
  color: #fff;
  transform: translateX(-4px);
}

.back-link svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .reconcile-filters,
  .filter-btn,
  .card-actions,
  .pagination-container,
  .publication-share,
  .publication-navigation {
    display: none;
  }
  
  /* article {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  } */
  
  /* .publication-article {
    box-shadow: none;
    padding: 0;
  } */
}