/*
Theme Name: wpbase
Theme URI: https://github.com/balatonapro/wpbase-tools
Description: Többoldalas hirdetés-listázó téma. Per-site beállítások a WP Customizer-ben (Testreszabás → Honlap azonosítás), egyedi viselkedés a `wpbase` plugin hookjain keresztül. Markup forrása: a Pencil design fájlok (kbsz/index.html + kbsz/single.html, 2026-05-04).
Version: 0.2
Author: balatonapro
Text Domain: wpbase
*/

:root {
  --primary: #4040D9;
  --primary-light: #4040d966;
  --white: #FFFFFF;
  --bgr-primary: #f2f2f8;
  --text-dark: #2D2D3A;
  --text-secondary: #5A5A72;
  --text-muted: #8888A0;
  --border: #DDDDE8;
  --bg-placeholder: #ECEDF2;  /* image-loading placeholder bg — themes can override */
  --link: #0000da;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bgr-primary);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.page {
  max-width: 1264px; width: 100%; margin: 0 auto;
  background: var(--bgr-primary);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px; background: var(--white); width: 100%;
}
.nav-icon { color: var(--primary); cursor: pointer; background: none; border: none; }
.nav-icon svg { width: 24px; height: 24px; }
.nav-icon-muted { color: var(--text-muted); }
.search-field {
  display: flex; align-items: center; justify-content: space-between;
  width: 840px; max-width: 100%;
  padding: 8px 12px 8px 20px;
  border-radius: 9999px; background: var(--white);
  border: 1px solid var(--primary);
  gap: 8px;
}
.search-field input {
  flex: 1; border: none; outline: none;
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text-dark);
  background: transparent;
}
.search-field input::placeholder { color: var(--text-muted); }
.search-btn {
  width: 30px; height: 30px;
  border-radius: 9999px; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; flex-shrink: 0;
}
.search-btn svg { width: 14px; height: 14px; color: var(--white); }

/* Content Section (lista) */
.content-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px; width: 100%; gap: 0;
}

/* List Title Block */
.list-title-block {
  display: flex; align-items: center; justify-content: space-between;
  width: 840px; max-width: 100%; padding-bottom: 10px;
}
.list-title-left { display: flex; align-items: center; gap: 6px; }
.list-title-left svg { width: 20px; height: 20px; color: var(--primary); }
.list-title-main { font-size: 14px; font-weight: 700; color: var(--text-dark); }
.list-title-count { font-size: 16px; color: var(--text-muted); }
.list-title-right {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  color: inherit; text-decoration: none;
}
.list-title-right .sort-label { font-size: 14px; color: var(--text-muted); }
.list-title-right svg { width: 20px; height: 20px; color: var(--primary); }

/* Accommodation List */
.accommodation-list {
  display: flex; flex-direction: column; gap: 10px;
  width: 840px; max-width: 100%;
}

/* List Item */
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px; background: var(--white); border-radius: 12px;
  border: 1px solid var(--primary-light);
  height: 110px; cursor: pointer; text-decoration: none;
  transition: box-shadow 0.15s ease;
  color: inherit;
}
.list-item:hover { box-shadow: 0 2px 12px rgba(64, 64, 217, 0.1); }
.list-item-thumb {
  width: 140px; height: 80px;
  border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--bg-placeholder);
  transition: opacity 0.3s ease;
}
/* Lazy fade: az `inc/js/lazy.js` adja a .wpbase-fade class-t in-flight képekre.
   Default opacity:1, így JS nélkül (ad-blocker / disabled) is láthatóak. */
.list-item-thumb.wpbase-fade { opacity: 0; }
.list-item-thumb.lazy-error { opacity: 0; }
.list-item-info {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1; min-width: 0;
}
.list-item-title-clip { overflow: hidden; height: 20px; }
.list-item-title {
  font-size: 16px; font-weight: 700; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-loc-clip { overflow: hidden; height: 21px; }
.list-item-loc {
  font-size: 18px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-meta { display: flex; align-items: center; gap: 8px; }
.list-item-link { font-size: 16px; color: var(--link); text-decoration: none; }
.list-item-detail { font-size: 16px; color: var(--text-muted); }
.list-item-right { display: flex; align-items: flex-end; height: 100%; }
.list-item-right svg { width: 20px; height: 20px; color: var(--primary-light); }

/* Pagination */
.pagination-block {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 15px 0; width: 840px; max-width: 100%;
}
.page-info { font-size: 14px; color: var(--text-muted); text-align: center; }
.pagination {
  display: flex; justify-content: center; gap: 8px;
  padding-bottom: 25px; width: 100%;
}
.page-btn {
  width: 36px; height: 36px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  border: 1px solid var(--border); background: var(--white); color: var(--text-secondary);
  text-decoration: none; font-family: 'Inter', sans-serif;
}
.page-btn.active, .page-btn.current {
  background: var(--primary); color: var(--white);
  border-color: var(--primary); font-weight: 600;
}
.page-btn svg { width: 16px; height: 16px; color: var(--text-secondary); }
.pagination .dots { display: flex; align-items: center; padding: 0 4px; color: var(--text-muted); }

/* Single — Breadcrumb / Single Top */
.single-top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.breadcrumb-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.breadcrumb-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--white);
  padding: 4px 10px; border-radius: 9999px;
  text-decoration: none;
}
.breadcrumb-item svg { width: 15px; height: 15px; color: #000; }
.breadcrumb-item span { color: var(--primary); font-size: 14px; font-weight: 700; }
.breadcrumb-title { color: var(--text-dark); font-size: 14px; font-weight: 700; }
.breadcrumb-right {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  text-decoration: none;
}
.breadcrumb-right span { color: var(--text-muted); font-size: 14px; }
.breadcrumb-right svg { width: 20px; height: 20px; color: var(--primary); }

/* Single content */
.single-content-section {
  display: flex; justify-content: center; padding: 24px; width: 100%;
}
.container {
  width: 840px; max-width: 100%;
  display: flex; flex-direction: column; gap: 15px;
}

/* Main Card */
.main-card {
  background: var(--white); border-radius: 10px; padding: 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 15px;
  overflow: hidden;
}
.article {
  width: 640px; max-width: 100%;
  display: flex; flex-direction: column;
  padding-bottom: 30px; overflow: hidden;
}

/* Gallery */
.gallery {
  display: flex; justify-content: center;
  padding: 20px 0; width: 100%;
}
.gallery-inner {
  width: 640px; max-width: 100%; height: 280px; position: relative;
}
.gallery-inner img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 12px;
  background: var(--bg-placeholder);
  transition: opacity 0.4s ease;
}
.gallery-inner img.wpbase-fade { opacity: 0; }
.gallery-inner img.lazy-error { opacity: 0; }
.gallery-overlay {
  position: absolute; inset: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}
.photo-btn {
  position: absolute; bottom: 17.5px; right: 17.5px;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 7px 14px;
  border-radius: 9999px; background: rgba(255, 255, 255, 0.87);
  cursor: pointer; border: none;
}
.photo-btn svg { width: 14px; height: 14px; color: var(--text-dark); }
.photo-btn span { font-size: 16px; font-weight: 600; color: var(--text-dark); }

/* Description */
.description {
  padding: 0 15px 30px 15px;
  display: flex; flex-direction: column; gap: 12px; width: 100%;
}
.desc-title-section { display: flex; flex-direction: column; gap: 6px; }
.desc-subtitle-clip {
  display: flex; flex-direction: column; gap: 5px; overflow: hidden;
}
.desc-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); }
.desc-tagline { font-size: 16px; font-weight: 700; color: var(--text-secondary); line-height: 1.5; }
.desc-body { font-size: 16px; color: var(--text-secondary); line-height: 1.5; }
/* WP wpautop() bekezdés-tördelést készít; a téma `* { margin: 0 }` reset-je
   miatt a <p>-k összefolynak — itt visszaadjuk a vizuális szellőt. */
.desc-body p + p { margin-top: 0.75em; }
.desc-link { font-size: 16px; color: var(--primary); cursor: pointer; text-decoration: none; }
.desc-link:hover { text-decoration: underline; }

/* "teljes szöveg" toggler — JS-mentes
 * FONTOS: az <input#desc-toggle>, a .desc-body és a .desc-link
 * TESTVÉREK (siblings) kell legyenek ugyanabban a szülőben,
 * különben a ~ (general sibling) selector nem működik! */
.desc-toggle { position: absolute; opacity: 0; pointer-events: none; }
.desc-toggle ~ .desc-body { max-height: 7em; overflow: hidden; }
.desc-toggle:checked ~ .desc-body { max-height: none; }
.desc-link::after { content: 'teljes szöveg'; }
.desc-toggle:checked ~ .desc-link::after { content: 'kevesebb'; }
.desc-link { display: inline-block; }

/* Pricing Section */
.arak {
  background: #fafafaff;
  border-radius: 8px; border: 1px solid var(--border);
  padding: 15px;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
}
.price-box {
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.price-header { display: flex; flex-direction: column; gap: 4px; }
.price-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.price-name-clip { overflow: hidden; height: 22px; }
.price-name { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.address-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.address-text { font-size: 16px; color: var(--text-dark); }
.ntak-text { font-size: 16px; color: var(--text-muted); }

.amenity-list {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 0;
}
.amenity-row { display: flex; align-items: center; gap: 8px; }
.amenity-row svg { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.amenity-row span { font-size: 13px; color: var(--text-dark); }

.price-notes {
  padding: 15px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.price-notes-text {
  font-size: 16px; color: var(--text-secondary);
  line-height: 1.5; white-space: pre-line;
}

.price-footer { display: flex; flex-direction: column; gap: 4px; }
.price-disclaimer {
  font-size: 12px; color: var(--text-secondary);
  line-height: 1.4; white-space: pre-line;
}

.cta-buttons {
  display: flex; gap: 10px;
  padding: 20px 0 15px 0;
  flex-wrap: wrap;
}
.btn-email {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 8px; background: var(--primary);
  border: none; cursor: pointer; text-decoration: none;
}
.btn-email svg { width: 15px; height: 15px; color: var(--white); }
.btn-email span { font-size: 16px; font-weight: 600; color: var(--white); }
.btn-email:hover { background: var(--text-dark); }
.btn-phone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 8px; background: var(--white);
  border: 1px solid var(--primary);
  cursor: pointer; text-decoration: none;
}
.btn-phone span { font-size: 16px; font-weight: 600; color: var(--primary); }
.btn-phone:hover { background: var(--bgr-primary); }

/* Updated / Meta Row */
.meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; width: 100%;
}
.meta-left { display: flex; align-items: center; gap: 6px; }
.meta-left svg { width: 20px; height: 20px; color: var(--primary); }
.meta-left span { font-size: 12px; color: var(--text-dark); }
.meta-right span { font-size: 12px; color: var(--text-muted); }

/* Footer */
.footer {
  display: flex; justify-content: center;
  padding: 15px; width: 100%;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-inner {
  width: 840px; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 15px 0 40px 0;
  border-top: 1px solid var(--border);
}
.footer-line1 { font-size: 13px; color: var(--text-secondary); text-align: center; }
.footer-line2 { font-size: 13px; color: var(--text-muted); text-align: center; }

/* Empty state */
.empty-state { padding: 24px; text-align: center; color: var(--text-muted); }

/* Responsive: <720px */
@media (max-width: 720px) {
  .navbar { padding: 8px 12px; }
  .search-field { padding: 6px 8px 6px 14px; }
  .content-section { padding: 16px 12px; }
  .single-content-section { padding: 16px 12px; }

  .list-item { height: auto; padding: 10px; gap: 10px; flex-wrap: nowrap; }
  .list-item-thumb { width: 100px; height: 80px; }
  .list-item-title { font-size: 14px; }
  .list-item-loc {
    font-size: 13px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .list-item-loc-clip { height: auto; max-height: 36px; }
  .list-item-link, .list-item-detail { font-size: 12px; }

  .gallery-inner { height: 200px; }
  .article { padding-bottom: 20px; }
  .description { padding: 0 12px 20px 12px; }
  .desc-title { font-size: 16px; }
  .desc-tagline, .desc-body { font-size: 14px; }
  .price-notes-text { font-size: 14px; }
  .cta-buttons { flex-direction: column; }
  .btn-email, .btn-phone { width: 100%; }

  .breadcrumb-left { gap: 6px; }
  .breadcrumb-item { padding: 3px 8px; }
  .breadcrumb-item span, .breadcrumb-title { font-size: 12px; }
}

/* ─── Toplist tabs ─────────────────────────────────────────────── */

.toplist-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 16px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.toplist-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.toplist-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.toplist-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 600;
}
.toplist-tab.active:hover { color: var(--white); }

/* Toplista rank badge — CSS counter számolja, piros kör + fehér szám */
.toplist-page .accommodation-list { counter-reset: rank; }
.toplist-page .accommodation-list .list-item { counter-increment: rank; position: relative; }
.toplist-page .accommodation-list .list-item::before {
  content: counter(rank);
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d63638;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
@media (max-width: 600px) {
  .toplist-tab { padding: 6px 12px; font-size: 12px; }
  .toplist-page .accommodation-list .list-item::before { width: 24px; height: 24px; font-size: 12px; top: 6px; left: 6px; }
}
