@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-Thin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-light.woff2') format('woff2');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-Medium.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-SemiBold.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-Bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-ExtraBold.woff2') format('woff2');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'Pelak';
  src: url('/WOFF2/PelakFA-Black.woff2') format('woff2');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

* { box-sizing: border-box; }

:root {
  --catalog-theme-color: #2E5E4E;
  --catalog-button-text-color: #ffffff;
  --catalog-header-color: #ffffff;
  --viewer-height: 700px;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #f3f3f3;
  font-family: 'Pelak', Arial, sans-serif;
}

body { min-height: 100dvh; }

.topbar {
  position: relative;
  z-index: 999;
  min-height: 56px;
  padding: 10px 16px;
  background: var(--catalog-header-color);
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  white-space: nowrap;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

button, #downloadBtn, #callBtn {
  border: 0;
  background: var(--catalog-theme-color);
  color: var(--catalog-button-text-color);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

button:disabled { opacity: .45; cursor: not-allowed; }
#pageInfo { font-size: 13px; color: #333; white-space: nowrap; }

.hint-box {
  background: #fff;
  color: #555;
  text-align: center;
  font-size: 13px;
  padding: 8px 12px;
  border-bottom: 1px solid #e9e9e9;
}

body:not(.theme-ready) .topbar,
body:not(.theme-ready) .hint-box,
body:not(.theme-ready) .viewer-wrap { visibility: hidden; }

.viewer-wrap {
  width: 100%;
  height: var(--viewer-height);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f3f3f3;
  overscroll-behavior: contain;
}

.viewer {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  direction: ltr;
}

.page-slot {
  width: 100%;
  min-height: var(--viewer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* The author-level .page-slot display rule can override the browser's native
   [hidden] behavior. Keep non-active pages physically out of layout in
   single-page mode so the visible image always matches the page counter. */
.page-slot[hidden] { display: none !important; }
.no-scroll .page-slot { display: none !important; }
.no-scroll .page-slot.is-current-page { display: flex !important; }

.page {
  position: relative;
  width: min(100%, 1100px);
  aspect-ratio: var(--page-ratio, .707);
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  flex: 0 0 auto;
}

.catalog-page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.page-slot .page { opacity: 0; visibility: hidden; }
.page-slot.is-loaded .page { opacity: 1; visibility: visible; }
.page-slot.is-loaded .page { box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }

.pdf-link {
  position: absolute;
  display: block;
  z-index: 20;
  background: transparent;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.fit-scroll, .fit-scroll body { height: 100%; overflow: hidden; }
.fit-scroll .viewer-wrap {
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.no-scroll, .no-scroll body { height: 100%; overflow: hidden; }
.no-scroll .viewer-wrap { overflow: hidden; }
.no-scroll .page-slot { min-height: var(--viewer-height); }

.fullscreen-active .topbar,
.fullscreen-active .hint-box,
.ios-fullscreen .topbar,
.ios-fullscreen .hint-box { display: none !important; }

.fullscreen-active .viewer-wrap,
.ios-fullscreen .viewer-wrap {
  height: 100dvh !important;
  --viewer-height: 100dvh !important;
}

.fullscreen-active .page-slot,
.ios-fullscreen .page-slot { min-height: 100dvh !important; }
.fullscreen-active .page, .ios-fullscreen .page { box-shadow: none; }

.error {
  max-width: 700px;
  margin: 40px auto;
  padding: 18px;
  background: #fff;
  color: #b00020;
  border-radius: 12px;
  text-align: center;
  direction: rtl;
}

#iosExitFullscreenBtn { display: none; }
body.ios-fullscreen { position: fixed; inset: 0; overflow: hidden; background: #f3f3f3; }
body.ios-fullscreen #iosExitFullscreenBtn {
  display: block !important;
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 100000;
  border-radius: 999px;
  padding: 9px 14px;
}

.install-notice {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 100001;
  direction: rtl;
}
.install-notice[hidden] { display: none; }
.install-notice__inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  color: #222;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.install-notice__message { flex: 1; font-size: 13px; line-height: 1.8; white-space: pre-line; }
.install-notice__close { flex: 0 0 auto; }

@media (max-width: 768px) {
  .topbar {
    min-height: 96px;
    align-items: stretch;
    flex-direction: column;
    padding: 8px 10px;
    gap: 8px;
  }
  .actions { justify-content: center; flex-wrap: wrap; }
  button, #downloadBtn, #callBtn { padding: 8px 10px; font-size: 12px; }
  .hint-box { font-size: 12px; padding: 7px 10px; }
  .page { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fit-scroll .viewer-wrap { scroll-behavior: auto; }
}

.page-slot.is-loading { background: #f3f3f3; }
.page-load-error {
  max-width: min(92%, 520px);
  white-space: normal;
  line-height: 1.8;
  text-align: center;
}

/* SEO and public directory enhancements */
.topbar .title {
  margin: 0;
  line-height: 1.5;
}

.seo-panel {
  position: relative;
  z-index: 20;
  width: min(100% - 24px, 1100px);
  margin: 8px auto;
  border: 1px solid #e2e7e5;
  border-radius: 12px;
  background: #fff;
  color: #222;
  box-shadow: 0 3px 14px rgba(0,0,0,.04);
  direction: rtl;
}

.seo-panel summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #26352f;
  user-select: none;
}

.seo-panel__content {
  max-height: min(48dvh, 460px);
  overflow: auto;
  padding: 0 16px 16px;
  border-top: 1px solid #eef1ef;
  line-height: 2;
  font-size: 14px;
}

.seo-panel__content h2 {
  margin: 14px 0 4px;
  font-size: 18px;
}

.seo-panel__content p { margin: 8px 0; }

.seo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.seo-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef4f1;
  color: #2d5144;
  font-size: 12px;
}

.brand-website a {
  color: #215c48;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.catalog-directory {
  min-height: 100dvh;
  overflow: auto;
  background: #f4f6f5;
  color: #1f2925;
}

.directory-header {
  padding: 48px 20px 38px;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e2e7e5;
}

.directory-brand {
  display: inline-block;
  margin-bottom: 14px;
  color: #2e5e4e;
  font-weight: 700;
  text-decoration: none;
}

.directory-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
}

.directory-header p {
  max-width: 760px;
  margin: 14px auto 0;
  color: #53615b;
  line-height: 2;
}

.directory-main {
  width: min(1120px, calc(100% - 28px));
  margin: 30px auto;
}

.catalog-directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.catalog-directory-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #e1e7e4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(24,55,44,.05);
}

.catalog-directory-card img {
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  background: #f3f3f3;
}

.catalog-directory-card h2 {
  margin: 2px 0 8px;
  font-size: 18px;
}

.catalog-directory-card h2 a {
  color: #173f31;
  text-decoration: none;
}

.catalog-directory-card h2 a:hover { text-decoration: underline; }
.catalog-directory-card p { margin: 0; color: #5b6863; font-size: 13px; line-height: 1.9; }
.directory-empty { padding: 28px; text-align: center; border-radius: 14px; background: #fff; }

.directory-footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid #e2e7e5;
  background: #fff;
}

.directory-footer a { color: #2e5e4e; text-decoration: none; font-weight: 700; }

.public-error {
  width: min(620px, calc(100% - 32px));
  margin: 12vh auto 0;
  padding: 34px;
  text-align: center;
  border: 1px solid #e2e7e5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(0,0,0,.07);
}

.public-error img { border-radius: 22px; }
.public-error h1 { margin: 18px 0 10px; font-size: 24px; }
.public-error p { color: #5c6762; line-height: 2; }
.public-error a { color: #2e5e4e; font-weight: 700; }

@media (max-width: 760px) {
  .seo-panel { width: calc(100% - 16px); margin: 6px auto; }
  .seo-panel summary { padding: 9px 12px; font-size: 13px; }
  .seo-panel__content { padding: 0 12px 12px; font-size: 13px; }
  .catalog-directory-grid { grid-template-columns: 1fr; }
  .catalog-directory-card { padding: 14px; }
  .directory-header { padding: 34px 16px 28px; }
}
