/* Programmatic SEO Kit — Frontend Styles */

/* ── Flags ────────────────────────────────────────────────── */
.psk-flags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.psk-flag {
  display: inline-block;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Templates ────────────────────────────────────────────── */
.psk-template {
  margin: 0 0 1em;
  line-height: 1.7;
}

/* ── Long text blocks ─────────────────────────────────────── */
.psk-longtext {
  margin: 0 0 1.5em;
  line-height: 1.8;
}

/* ── Metric badges ────────────────────────────────────────── */
.psk-metric {
  display: inline-block;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.9em;
  margin: 0 4px 4px 0;
}

/* ── FAQ accordion ────────────────────────────────────────── */
.psk-faq {
  margin: 1.5em 0;
}

.psk-faq h2 {
  margin-bottom: 0.75em;
}

.psk-faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

.psk-faq-item summary {
  cursor: pointer;
  padding: 14px 18px;
  background: #f9fafb;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background 0.15s;
}

.psk-faq-item summary::-webkit-details-marker {
  display: none;
}

.psk-faq-item summary::after {
  content: "+";
  font-size: 1.2em;
  font-weight: 400;
  color: #6b7280;
  margin-left: 12px;
  transition: transform 0.2s;
}

.psk-faq-item[open] > summary {
  background: #f0f4ff;
}

.psk-faq-item[open] > summary::after {
  content: "−";
}

.psk-faq-item summary:hover {
  background: #f0f4ff;
}

.psk-faq-a {
  padding: 14px 18px;
  line-height: 1.7;
  border-top: 1px solid #e5e7eb;
}

.psk-faq-q {
  flex: 1;
}

/* ── Error / empty states ─────────────────────────────────── */
.psk-map-error,
.psk-matrix-empty {
  background: #fef3cd;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 10px 14px;
  color: #92400e;
  font-size: 0.9em;
}

/* ── Route map wrapper ────────────────────────────────────── */
.psk-route-map-wrapper {
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.psk-route-map,
.psk-matrix-map {
  width: 100%;
  display: block;
}

/* ── Time-Distance Matrix ─────────────────────────────────── */
.psk-time-distance-matrix {
  margin: 1.5em 0;
}

.psk-time-distance-matrix h2 {
  margin-bottom: 0.75em;
}

.psk-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}

.psk-matrix-table th,
.psk-matrix-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.psk-matrix-table th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.psk-matrix-table tr:last-child td {
  border-bottom: none;
}

.psk-matrix-table tr:hover td {
  background: #f9fafb;
}

/* ── Responsive overrides ─────────────────────────────────── */
@media (max-width: 640px) {
  .psk-matrix-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .psk-faq-item summary {
    padding: 12px 14px;
  }

  .psk-faq-a {
    padding: 12px 14px;
  }

  .psk-route-map-wrapper {
    border-radius: 4px;
  }
}
