/* ===========================
   Functional CSS (shared)
   =========================== */
.tabbed-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.tabbed-panel .tab-bar,
.tabbed-panel nav.tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}

/* Content area wrapper */
.tabbed-panel .section-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Tab content fills rest of space */
.tabbed-panel .tab-content {
  min-height: 0;
  overflow: hidden;
}

/* Individual panels */
.tabbed-panel .tab-content .case-panel {
  height: calc(100% - 85px);
  flex: 1 1 auto;
  line-height: 1.65;
  color: var(--paper-ink);
  position: relative;
  z-index: 1;
  overflow: auto;
}

.tabbed-panel .glass-panel-bg,
.tabbed-panel::before,
.tabbed-panel::after {
  display: none !important;
  content: none !important;
}

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  outline: none;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}

.tab img.icon-img {
  width: 20px;
  height: 20px;
}

/* The case area (the right side) */
#case-file {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden; /* prevent global scroll */
}

.case-panel {
  display: none;
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.case-panel:not([hidden]) {
  display: block;
}

.tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  line-height: 1.65;
  position: relative;
  min-height: 0;
  overflow: hidden;
  z-index: 1;
}

/* ===========================
   Visual CSS: Parchment Theme
   =========================== */
.tab-style-parchment {
  color: var(--paper-ink);
  background: var(--tab-dim);
  border: 1px solid var(--tab-edge);
  border-bottom: none;
  margin-right: 2px;
  box-shadow: inset 0 -6px 10px -3px rgba(0,0,0,.5);
  font-weight: 700;
}

.tab-style-parchment:hover {
  background: var(--tab);
}

.tab-style-parchment.active {
  background: url('/wp-content/themes/yoricktours/assets/images/bg/parchment-bg.avif') repeat;
  background-size: cover;
  border-color: var(--paper-edge);
  box-shadow: none;
  z-index: 1;
}

.tab-style-parchment.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--paper);
  z-index: 5;
}

.tab-content-style-parchment {
  color: var(--paper-ink);
  background: url('/wp-content/themes/yoricktours/assets/images/bg/parchment-bg.avif') repeat;
  background-size: cover;
  border-top-right-radius: 8px;
  margin-top: 0;
  padding-top: 8px;
  overflow: hidden;
}

/* ===========================
   Sources Styling
   =========================== */
.case-sources-container {
  margin:10px;
}
.case-source-target {
  text-align: left;
}

.case-source-ref {
    display: inline-flex;
    white-space: nowrap;
    vertical-align: baseline;
    line-height: 1;
}

.case-source-ref a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    white-space: nowrap;

    min-width: 1.35em;
    height: 1.35em;
    padding: 0 .35em;
    margin-left: .18em;

    font-size: .72em;
    font-weight: 700;
    line-height: 1;

    color: #1b140b;
    background: linear-gradient(
        180deg,
        rgba(245, 220, 145, .95),
        rgba(160, 105, 35, .9)
    );

    border: 1px solid rgba(255, 235, 170, .9);
    border-radius: 999px;
    text-decoration: none;
    text-shadow: none;

    box-shadow:
        0 0 0 1px rgba(50, 25, 5, .45),
        0 2px 5px rgba(0, 0, 0, .45),
        inset 0 1px 0 rgba(255, 255, 255, .45);
}

.case-source-ref a:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

.case-sources li {
  padding: 2px 4px;
  border-radius: 4px;
}

.case-sources li.glow,
.case-sources .glow,
li.glow {
  animation: glowFlash 5s ease;
  border-radius: 4px;
}

@keyframes glowFlash {
  0% {
    background-color: rgba(255, 230, 80, 0.9);
    box-shadow: 0 0 0 4px rgba(255, 230, 80, 0.35);
  }

  100% {
    background-color: transparent;
    box-shadow: none;
  }
}