/* =========================================================
   ZF AJAX BLOG – Stylesheet
   ========================================================= */

/* ---------- Tokens  ---------- */
:root {
  --zf-accent: #f5a800;
  --zf-text: #ffffff;
  --zf-bg-2: #0f0f0f;
  --zf-border: #ffffff1c;
  --zf-border-2: #3a3a3a;
  --zf-gray-1: #2b2b2b;
}

/* ---------- Utils ---------- */
.zf-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.zf-root.is-loading {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Messages */
.zf-error {
  color: #ff6b6b;
  text-align: center;
  padding: 20px;
  margin: 20px 0;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
}
.zf-empty {
  text-align: center;
  color: var(--zf-text);
  padding: 40px 20px;
  font-style: italic;
}

/* ---------- Toolbar (pill + search) ---------- */
.zf-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 32px;
}

/* Fallback if JS is not available */
.zf-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: 2px solid var(--zf-accent);
  border-radius: 999px;
  padding: 14px 24px;
  color: var(--zf-accent);
  font: 400 20px/1 'Filson Pro', sans-serif;
  min-width: 200px;
  cursor: pointer;
}
.zf-select {
  position: relative;
}

/*  Pill + Overlay */
.zf-pill {
  width: 100% !important;
  max-width: 400px !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px !important;
  border: 1px solid var(--zf-accent) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--zf-accent) !important;
  font: 400 16px/1.2 'Filson Pro', sans-serif !important;
  height: auto !important;
}
.zf-pill::after {
  content: '';
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-left: 12px;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23f5a800' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.zf-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: 320px;
  width: 28rem;
  max-width: 90vw;
  border-radius: 12px;
  border: 1px solid var(--zf-border);
  box-shadow: 0 0 9.3px 3px rgba(0, 0, 0, 0.18);

  background: var(--zf-bg-2);
  padding: 18px 20px;
  z-index: 50;
}
.zf-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zf-panel-list li {
  margin: 8px 0;
}
.zf-panel-list a {
  display: block;
  text-decoration: none;
  color: var(--zf-text) !important;
  font: 400 16px/1.25 'Filson Pro', sans-serif;
}

.zf-panel-list li:hover a {
  color: var(--zf-accent) !important;
}

.zf-panel-list li.is-active a {
  color: var(--zf-accent) !important;
}

/* Search with Icon */
.zf-search {
  position: relative;
  flex: 1 1;
  width: 100%;
  max-width: 430px;
}
.zf-search::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 14px;
  width: 20px;
  height: 20px;
  opacity: 0.8;
  z-index: 2;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%23CFCFCF' stroke-width='2'/%3E%3Cpath d='M20 20L17 17' stroke='%23CFCFCF' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.zf-search input {
  width: 100%;
  background: var(--zf-gray-1);
  color: var(--zf-text);
  border: 0;
  border-radius: 16px !important;
  padding: 0 15px 0 42px !important;
  font: 400 16px/48px 'Filson Pro', sans-serif;
  height: 48px;
  box-sizing: border-box;
  display: block;
}
.zf-search input::placeholder {
  color: var(--zf-text);
  opacity: 0.6;
}

/* ---------- Header: Title + Counter ---------- */
.zf-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
}
.zf-title {
  text-transform: capitalize;
  font-family: 'Filson Pro', sans-serif !important;
  font-weight: 500;
  font-size: 40px;
  color: var(--zf-text) !important;
  margin: 0;
}
.zf-count {
  color: var(--zf-text);
  font-size: 20px;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .zf-title {
    font-size: 24px !important;
  }
  .zf-count {
    font-size: 14px !important;
  }
}

/* ---------- Grid & Cards ---------- */
.zf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  margin: 0 0 26px;
}

/* Card */
.zf-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
}

/* Image */
.zf-thumb {
  display: block;
  margin: 0 0 16px;
  border-radius: 18px;
  overflow: hidden;
  width: 100%;
}
.zf-thumb img {
  width: 100%;
  height: 340px !important;
  object-fit: cover;
  display: block;
  border-radius: 18px !important;
}

/* Details */
.zf-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Category Badge */
.zf-badge {
  background: transparent;
  color: var(--zf-accent);
  padding: 0;
  border-radius: 0;
  font: 400 18px/1.2 'Filson Pro', sans-serif;
  margin-bottom: 8px;
}

/* Title + Excerpt */
.zf-card-title {
  font: 700 34px/1.2 'Filson Pro', sans-serif !important;
  margin: 0 0 12px 0;
}
.zf-card-title a {
  color: var(--zf-text) !important;
  text-decoration: none;
}
.zf-card-title a:hover {
  text-decoration: none;
}

.zf-excerpt {
  color: var(--zf-text);
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 8px 0;
}

.zf-date {
  color: var(--zf-text);
  font-size: 15px;
  margin: 0;
}

@media (max-width: 768px) {
  .zf-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin: 0 0 32px;
  }

  .zf-thumb img {
    height: 200px;
  }

  .zf-details {
    gap: 10px;
  }

  .zf-badge {
    font-size: 14px;
    margin-bottom: 6px;
  }
  .zf-card-title {
    font-size: 24px !important;
    line-height: 1.3;
    margin: 0 0 10px 0;
  }
  .zf-excerpt {
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 6px 0;
  }
  .zf-date {
    font-size: 12px;
  }

  /* Better mobile toolbar spacing */
  .zf-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin: 0 0 20px;
  }

  .zf-header {
    margin: 0 0 20px;
    flex-direction: column;
  }

  .zf-pill {
    max-width: none !important;
    font-size: 15px !important;
    margin-bottom: 10px;
  }

  .zf-search {
    max-width: none;
    width: 100%;
    margin-bottom: 28px;
  }
  .zf-search input {
    font-size: 14px;
  }
}

/* Additional mobile improvements for very small screens */
@media (max-width: 480px) {
  .zf-grid {
    gap: 24px;
  }

  .zf-card-title {
    font-size: 20px;
  }

  .zf-thumb img {
    height: 180px;
  }

  .zf-toolbar {
    gap: 12px;
    margin: 0 0 16px;
  }

  .zf-header {
    margin: 0 0 16px;
  }
}

/* ---------- Pagination ---------- */
.zf-pagination {
  margin: 56px 0 100px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.zf-pages {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  width: 100%;
  justify-content: center;
  background: transparent;
  border-radius: 24px;
  padding: 8px;
}

/* Chevron arrows */
.zf-chevron {
  width: 32px !important;
  height: 32px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none;
  color: var(--zf-text) !important;
  cursor: pointer !important;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.7;
  padding: 0 !important;
}

.zf-chevron:hover:not(.disabled) {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.zf-chevron.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.zf-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Pages container with overflow handling */
.zf-pages-container {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  flex: 1;
  justify-content: center;
  max-width: 520px;
}

/* Page number links */
.zf-pages-container a {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zf-text) !important;
  font-family: 'Filson Pro', sans-serif !important;
  font-size: 18px;
  font-weight: 350;
  border-radius: 50%;
  transition: all 0.2s ease;
  position: relative;
  opacity: 0.6;
}

.zf-pages-container a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  opacity: 1;
}

.zf-pages-container a.is-active {
  background: rgba(255, 255, 255, 0.2) !important;
  color: var(--zf-text) !important;
  opacity: 1;
}

.zf-pages-container a.is-active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 50%;
}

/* Hide overflow pages - JavaScript will manage visibility */
.zf-pages-container a.hidden {
  display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .zf-pages {
    max-width: 100%;
    margin: 0 16px;
  }

  .zf-pages-container {
    max-width: calc(100% - 80px);
  }

  .zf-pages-container a {
    min-width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .zf-chevron {
    width: 28px;
    height: 28px;
  }
}

/* ---------- Accessibility ---------- */
.zf-pill:focus,
.zf-search input:focus,
.zf-pages-container a:focus,
.zf-chevron:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.25);
  border-color: var(--zf-accent);
}

/* Focus visible for keyboard navigation */
.zf-pages-container a:focus-visible,
.zf-chevron:focus-visible {
  outline: 2px solid rgba(245, 168, 0, 0.8);
  outline-offset: 2px;
}
