/* ==========================================================
   panel.css — information panel styles
   ========================================================== */

/* ----------------------------------------------------------
   Panel inner structure — vertical stack
   ---------------------------------------------------------- */
.panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ----------------------------------------------------------
   Panel header
   ---------------------------------------------------------- */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-main);
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.2;
}

/* Close button */
.panel-close {
  position: relative;
  min-width: 60px;
  min-height: 60px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: none;
  flex-shrink: 0;
  margin-left: 1rem;
  padding: 0;
}

.panel-close:focus {
  outline: none;
}

/* SVG container */
.panel-close-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); 
}

/* Background circle */
.close-ring-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2.5;
}

/* Progress circle */
.close-ring-progress {
  fill: none;
  stroke: var(--color-dark);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8; /* fully hidden by default */
  transition: stroke-dashoffset 0.1s linear;
}

/* Cross icon above the SVG */
.panel-close-icon {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  color: var(--color-text-light);
  line-height: 1;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.panel-close:hover .panel-close-icon {
  color: var(--color-dark);
}

/* ----------------------------------------------------------
   Panel body
   ---------------------------------------------------------- */
.panel-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ----------------------------------------------------------
   Photo slider
   ---------------------------------------------------------- */
.panel-slider-col {
  flex: 0 0 60%;
  position: relative;
  overflow: hidden;
  background-color: var(--color-slider-bg);
}

.slider-viewport {
  position: absolute;
  inset: 0;
}

/* Fade slider */
.slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.slider-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: opacity;
}

.slider-slide.is-active {
  opacity: 1;
}

.slider-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder when no photos are available */
.slider-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4c5a9, #b8a98a);
  color: rgba(255, 255, 255, 0.45);
  font-size: 3vw;
}

/* Indicator dots above the photo */
.slider-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.55);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: none;
  padding: 0;
  position: relative;
}

.slider-dot::after {
  content: '';
  position: absolute;
  inset: -8px;
}

.slider-dot.is-active {
  background-color: #fff;
  transform: scale(1.3);
}

/* ----------------------------------------------------------
   Text
   ---------------------------------------------------------- */
.panel-text-col-wrapper {
  position: relative;
}
.panel-text-col {
  flex: 1;
  padding: 1.75rem 1.75rem 1.75rem 1.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  min-height: 0;
}

.panel-text-col::-webkit-scrollbar {
  width: 4px;
}

.panel-text-col::-webkit-scrollbar-track {
  background: transparent;
}

.panel-text-col::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 2px;
}

.panel-text {
  font-family: var(--font-main);
  font-size: clamp(0.85rem, 1.1vw, 1.05rem);
  line-height: 1.8;
  color: var(--color-text);
}

.panel-text p + p {
  margin-top: 1em;
}
.panel-text-ornament {
	overflow: hidden;
	width: 100%;
	position: absolute;
	bottom: 0;
	display: flex;
	justify-content: center;
	opacity: 0.5;
}
.panel-text-ornament img {
	height: 50px;
}
/* ----------------------------------------------------------
   Audio button
   ---------------------------------------------------------- */
.panel-audio-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 52px;
  margin-top: 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: none;
  padding: 0;
}

.panel-audio-btn:focus {
  outline: none;
}

/* SVG frame */
.panel-audio-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Background frame */
.audio-rect-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2;
}

/* Progress frame */
.audio-rect-progress {
  fill: none;
  stroke: var(--color-dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 488;
  stroke-dashoffset: 488;
}

/* Button label */
.panel-audio-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.panel-audio-btn:hover .panel-audio-label {
  color: var(--color-dark);
}

.panel-audio-btn.is-playing .panel-audio-label {
  color: var(--color-text);
}

/* ==========================================================
   PANEL RESPONSIVENESS
   ========================================================== */

@media (max-width: 1024px) and (orientation: portrait) {
  .panel-header {
    padding: 1.25rem 1.5rem 1rem;
  }

  .panel-title {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
  }

  .panel-slider-col {
    flex: 0 0 50%;
  }

  .panel-text {
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    line-height: 1.65;
  }

  .panel-audio-btn {
    width: 160px;
    height: 44px;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .panel-inner {
    overflow-y: auto;
  }

  .panel-body {
    flex-direction: column;
    overflow: visible;
    flex: none;
  }

  .panel-slider-col {
    flex: none;
    height: 32vw;
    min-height: 140px;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .panel-text-col {
    padding: 1rem 1.25rem;
    overflow-y: visible;
	flex:none;
  }
  
  .panel-text-ornament {
	  display: none;
  }

  .panel-title {
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  }

  .panel-text {
    font-size: clamp(0.8rem, 3.5vw, 0.95rem);
    line-height: 1.6;
  }

  .panel-header {
    padding: 1rem 1.25rem 0.75rem;
  }

  .panel-close {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
  }

  .panel-audio-btn {
    width: 140px;
    height: 42px;
    margin-top: 1rem;
  }

  .slider-dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .panel-header {
    padding: 0.75rem 1.25rem 0.5rem;
  }

  .panel-title {
    font-size: clamp(1rem, 2.5vh, 1.4rem);
  }

  .panel-text {
    font-size: clamp(0.75rem, 1.6vh, 0.9rem);
    line-height: 1.5;
  }

  .panel-text-col {
    padding: 0.75rem 1rem;
  }

  .panel-close {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .panel-audio-btn {
    width: 140px;
    height: 40px;
    margin-top: 0.75rem;
  }
}
