/* Cases list/detail pages (PbootCMS listtpl/contenttpl) */

:root {
  --c-bg: #f6f8fc;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-border: rgba(15, 23, 42, 0.12);
  --c-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --c-blue: #00327e;
  --c-blue2: #00255e;
}

body.page-cases {
  margin: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
}

body.page-cases {
  --pg-primary: var(--c-blue);
  --pg-muted: var(--c-muted);
}

@media (min-width: 1600px) {
  body.page-cases {
    zoom: min(1.75, max(1, 100vw / 1760));
  }
}

.page-cases .container {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: clamp(12px, 3vw, 32px);
  padding-right: clamp(12px, 3vw, 32px);
}

@media (min-width: 1200px) {
  .page-cases .container {
    max-width: 75%;
  }
}

@media (min-width: 2000px) {
  .page-cases .container {
    max-width: min(1820px, 80vw);
    padding-left: clamp(16px, 3.2vw, 44px);
    padding-right: clamp(16px, 3.2vw, 44px);
  }
}

@media (min-width: 2600px) {
  .page-cases .container {
    max-width: min(2160px, 84vw);
  }
}

/* ---------- Page hero ---------- */
.c-hero {
  position: relative;
  padding-top: calc(var(--landing-header-height, 80px) + clamp(28px, 3.2vw, 56px));
  padding-bottom: clamp(24px, 3vw, 48px);
  background:
    radial-gradient(900px 500px at 70% 30%, rgba(0, 50, 126, 0.14) 0%, rgba(0, 50, 126, 0) 60%),
    linear-gradient(180deg, #ffffff 0%, #edf0f7 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.c-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  pointer-events: none;
  z-index: 1;
}

.c-hero > .container {
  position: relative;
  z-index: 2;
}

.c-hero__bg {
  width: 100%;
  height: auto;
  display: block;
}

/* Image-based hero: full-width image, auto height, text vertically centered */
.c-hero--img {
  display: grid;
  grid-template-areas: "stack";
  padding-top: 0;
  padding-bottom: 0;
  background: none;
}

.c-hero--img .c-hero__bg { grid-area: stack; }
.c-hero--img::before { grid-area: stack; }

.c-hero--img > .container {
  grid-area: stack;
  padding-top: calc(var(--landing-header-height, 80px) + clamp(28px, 3.2vw, 56px));
  padding-bottom: clamp(24px, 3vw, 48px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 767px) {
  .c-hero--img {
    min-height: 240px;
  }

  .c-hero--img .c-hero__bg {
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}

.c-breadcrumb {
  font-size: clamp(13px, 1vw, 15px);
  color: rgba(255, 255, 255, 0.85);
}

.c-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.c-breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.c-title {
  margin: clamp(10px, 1.2vw, 14px) 0 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.15;
}

.c-subtitle {
  margin: 10px 0 0;
  max-width: 62rem;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.6;
}

/* ---------- List grid ---------- */
.c-section {
  padding: clamp(26px, 3.2vw, 56px) 0;
}

.c-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(14px, 2vw, 24px);
}

.c-count {
  color: var(--c-muted);
  font-size: 14px;
}

.c-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 1.8vw, 24px);
}

@media (min-width: 768px) {
  .c-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .c-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.c-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.c-card--btn {
  width: 100%;
  padding: 0;
  text-align: left;
  cursor: zoom-in;
  border: 0;
  background: transparent;
  font: inherit;
}

.c-card--btn:focus-visible {
  outline: 3px solid rgba(0, 50, 126, 0.35);
  outline-offset: 2px;
}

.c-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--c-shadow);
}

.c-card__media {
  position: relative;
  background: #e6edf5;
}

.c-card__media::before {
  content: "";
  display: block;
  padding-top: 62%;
  background: linear-gradient(135deg, rgba(0, 50, 126, 0.12) 0%, rgba(15, 23, 42, 0.04) 70%);
}

.c-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-card__body {
  padding: clamp(16px, 1.6vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.c-card__title {
  margin: 0;
  font-size: clamp(16px, 1.15vw, 18px);
  font-weight: 900;
  line-height: 1.28;
  color: var(--c-text);
}

.c-card__desc {
  margin: 0;
  color: var(--c-muted);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.c-card__meta {
  margin-top: 2px;
  color: var(--c-muted);
  font-size: 13px;
}

/* ---------- Lightbox ---------- */
html.is-lightbox-open,
html.is-lightbox-open body {
  overflow: hidden;
}

.c-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}

.c-lightbox[hidden] {
  display: none !important;
}

.c-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}

.c-lightbox__dialog {
  position: relative;
  width: min(1100px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border-radius: 14px;
  overflow: hidden;
  background: #0b1220;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.c-lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 28px);
  object-fit: contain;
  background: #0b1220;
}

.c-lightbox__caption {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 18, 32, 0.95);
  color: rgba(255, 255, 255, 0.92);
}

.c-lightbox__cap-title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.c-lightbox__cap-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.c-lightbox__cap-meta {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.c-lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.c-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Detail ---------- */
.c-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.4vw, 36px);
}

@media (min-width: 1024px) {
  .c-detail {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.c-detail__media {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.c-detail__media img {
  display: block;
  width: 100%;
  height: auto;
}

.c-detail__panel {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.c-detail__panel-inner {
  padding: clamp(18px, 2vw, 28px);
}

.c-h1 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--c-text);
}

.c-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--c-muted);
  font-size: 14px;
}

.c-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.c-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1.2;
}

.c-btn--primary {
  background: var(--c-blue);
  color: #fff;
}

.c-btn--primary:hover {
  background: var(--c-blue2);
}

.c-btn--ghost {
  background: rgba(0, 50, 126, 0.08);
  color: var(--c-blue);
}

.c-btn--ghost:hover {
  background: rgba(0, 50, 126, 0.12);
}

.c-content {
  margin-top: clamp(16px, 2.4vw, 28px);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.c-content__inner {
  padding: clamp(18px, 2vw, 28px);
  color: #334155;
  line-height: 1.8;
  font-size: 16px;
}

.c-content__inner img {
  max-width: 100%;
  height: auto;
}

.c-siblings {
  margin-top: clamp(16px, 2.4vw, 28px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .c-siblings {
    grid-template-columns: 1fr 1fr;
  }
}

.c-sibling {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.c-sibling__k {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--c-muted);
  letter-spacing: 0.08em;
}

.c-sibling__t {
  font-size: 15px;
  font-weight: 900;
  color: var(--c-text);
  line-height: 1.25;
}

.c-sibling:hover .c-sibling__t {
  color: var(--c-blue);
}

