/* ==========================================================================
   WTMA — Направления (Directions) Page Styles
   3D Book-Flip / Interactive Card Unfold Experience
   ========================================================================== */

/* --- Master Container & Layout --- */
.directions-page-body {
  background-color: #070a0f;
  color: #f9fafb;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-sans);
}

/* Ensure the header on this dark page starts in dark theme */
.directions-page-body .site-header {
  background: rgba(7, 10, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.directions-page-body .site-header .brand-logo .logo-mark {
  color: #ffffff;
}

.directions-page-body .site-header .brand-logo .logo-details {
  border-left-color: rgba(255, 255, 255, 0.2);
}

.directions-page-body .site-header .brand-logo .logo-line {
  color: #cbd5e1;
}

.directions-page-body .site-header .nav-link {
  color: #cbd5e1;
}

.directions-page-body .site-header .nav-link:hover,
.directions-page-body .site-header .nav-link.active {
  color: var(--brand-accent-red);
}

.directions-page-body .site-header .action-btn,
.directions-page-body .site-header .lang-btn {
  color: #ffffff;
  transition: color var(--transition-fast);
}

.directions-page-body .site-header .action-btn:hover,
.directions-page-body .site-header .lang-btn:hover {
  color: var(--brand-accent-red);
}

.directions-page-body .site-header .btn-contact-pill {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.08);
}

.directions-page-body .site-header .btn-contact-pill:hover {
  background-color: var(--brand-accent-red);
  color: #ffffff;
  border-color: var(--brand-accent-red);
}

.directions-page-body .site-header .burger-toggle .bar {
  background-color: #ffffff;
}

/* Main Wrapper */
.directions-main {
  position: relative;
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 30px);
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Background Texture / Silk Waves */
.directions-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.directions-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.35;
  filter: contrast(1.1) brightness(0.85);
}

.directions-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 75% 30%, rgba(199, 168, 119, 0.06) 0%, transparent 55%),
              linear-gradient(180deg, rgba(7, 10, 15, 0.6) 0%, rgba(7, 10, 15, 0.92) 100%);
}

.directions-content-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   STAGE 1: 5-CARDS OVERVIEW VIEW
   ========================================================================== */
.overview-stage {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.overview-stage.hidden-view {
  display: none;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

/* Left Hero Text Column */
.overview-intro-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 12px;
}

.overview-kicker-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 14px;
}

.overview-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-accent-red);
}

.overview-badge-line {
  display: block;
  width: 32px;
  height: 2px;
  background-color: var(--brand-accent-red);
  border-radius: 1px;
}

.overview-title {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 2.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.18;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.overview-desc {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 24px;
  font-weight: 400;
  max-width: 270px;
}

.btn-overview-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  width: fit-content;
  transition: all var(--transition-fast);
}

.btn-overview-cta:hover {
  background: #ffffff;
  color: #070a0f;
  border-color: #ffffff;
  transform: translateX(3px);
}

.btn-overview-cta .arrow {
  transition: transform var(--transition-fast);
}

.btn-overview-cta:hover .arrow {
  transform: translateX(4px);
}

/* Right Cards Grid (5 Directions in Connected Panel) */
.directions-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background-color: #0c1119;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.direction-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 380px;
  background-color: #0c1119;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  user-select: none;
}

.direction-card:last-child {
  border-right: none;
}

.direction-card:hover {
  z-index: 3;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 20px rgba(224, 68, 52, 0.2);
}

/* Background Image Box (Fills entire card behind text) */
.card-image-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #070a0f;
  z-index: 0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  filter: brightness(1.02) contrast(1.04);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.direction-card:hover .card-img {
  transform: scale(1.08);
  filter: brightness(1.1) contrast(1.08);
}

/* Gradient Overlay: dark at top for text readability, clear in center/bottom to reveal high-res artwork */
.card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 17, 25, 0.92) 0%,
    rgba(12, 17, 25, 0.82) 26%,
    rgba(12, 17, 25, 0.35) 48%,
    rgba(12, 17, 25, 0.0) 65%,
    rgba(12, 17, 25, 0.2) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Top Information Area (Overlaid inside the card at top) */
.card-top-info {
  position: relative;
  z-index: 2;
  padding: 24px 18px 16px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.card-index {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.card-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

.card-subtitle {
  font-size: 0.74rem;
  line-height: 1.45;
  color: #cbd5e1;
  font-weight: 400;
  margin-bottom: 14px;
  min-height: 32px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.card-arrow-btn {
  font-size: 1.1rem;
  color: #ffffff;
  line-height: 1;
  transition: transform var(--transition-fast), color var(--transition-fast);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.direction-card:hover .card-arrow-btn {
  color: var(--brand-accent-red);
  transform: translateX(4px);
}

.direction-card.card-turning {
  transform: perspective(1200px) rotateY(-28deg) scale(1.03) !important;
  box-shadow: -15px 20px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(224, 68, 52, 0.45) !important;
  border-color: var(--brand-accent-red) !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease !important;
}

/* ==========================================================================
   STAGE 2: 3D BOOK-FLIP SPREAD VIEW
   ========================================================================== */
.book-stage-wrapper {
  display: none;
  perspective: 2000px;
  width: 100%;
  margin-top: 10px;
}

.book-stage-wrapper.active-view {
  display: block;
}

.book-spread-container {
  display: grid;
  grid-template-columns: 46% 54%;
  min-height: 600px;
  background-color: #0c1119;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.85), 0 0 50px rgba(0, 0, 0, 0.6);
  position: relative;
  transform-style: preserve-3d;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* 3D Left Page Flip Open (Cover swing) */
@keyframes bookLeftPageFlip {
  0% {
    transform: rotateY(-52deg);
    box-shadow: inset -28px 0 40px rgba(0, 0, 0, 0.95);
    filter: brightness(0.75);
  }
  65% {
    transform: rotateY(3deg);
    filter: brightness(1.05);
  }
  100% {
    transform: rotateY(0deg);
    box-shadow: inset -4px 0 14px rgba(0, 0, 0, 0.35);
    filter: brightness(1);
  }
}

/* 3D Right Page Flip Open (Spine unfold) */
@keyframes bookRightPageFlip {
  0% {
    transform: rotateY(46deg);
    box-shadow: inset 28px 0 40px rgba(0, 0, 0, 0.95);
    opacity: 0.7;
  }
  65% {
    transform: rotateY(-2.5deg);
  }
  100% {
    transform: rotateY(0deg);
    box-shadow: inset 4px 0 14px rgba(0, 0, 0, 0.35);
    opacity: 1;
  }
}

/* 3D Book Close Keyframes */
@keyframes bookLeftPageClose {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
    filter: brightness(1);
  }
  100% {
    transform: rotateY(-58deg);
    opacity: 0;
    filter: brightness(0.5);
    box-shadow: inset -32px 0 45px rgba(0, 0, 0, 0.95);
  }
}

@keyframes bookRightPageClose {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  100% {
    transform: rotateY(58deg);
    opacity: 0;
    box-shadow: inset 32px 0 45px rgba(0, 0, 0, 0.95);
  }
}

@keyframes overviewReturn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Center Spine of the Book */
.book-spine-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 46%;
  width: 3px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22) 15%, rgba(255, 255, 255, 0.22) 85%, transparent);
  box-shadow: 0 0 18px 4px rgba(0, 0, 0, 0.95);
  z-index: 10;
  pointer-events: none;
}

/* Left Page: Visual Cover & Tagline (3D Book Front Page) */
.book-page-left {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  background-color: #0a0e16;
  transform-origin: right center;
  transform-style: preserve-3d;
  animation: bookLeftPageFlip 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.book-page-left-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.book-page-left-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.65) saturate(1.05);
  transition: transform 0.8s ease;
}

.book-spread-container:hover .book-page-left-img {
  transform: scale(1.03);
}

.book-page-left-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(7, 10, 15, 0.2) 0%, rgba(7, 10, 15, 0.7) 60%, rgba(7, 10, 15, 0.96) 100%);
}

.book-page-left-content {
  position: relative;
  z-index: 2;
}

.detail-nav-back {
  position: absolute;
  top: 36px;
  left: 48px;
  z-index: 10;
}

.btn-book-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-book-back:hover {
  background: #ffffff;
  color: #070a0f;
  border-color: #ffffff;
  transform: translateX(-3px);
}

.detail-index-num {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5vw, 4.2rem);
  font-weight: 600;
  color: var(--brand-accent-red);
  line-height: 1;
  margin-bottom: 8px;
}

.detail-main-title {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 16px;
  line-height: 1.15;
}

.detail-tagline {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #cbd5e1;
  font-weight: 400;
  max-width: 420px;
}

/* Right Page: Services List (3D Book Inner Page) */
.book-page-right {
  position: relative;
  padding: 44px 48px;
  background-color: #0c1119;
  display: flex;
  flex-direction: column;
  transform-origin: left center;
  transform-style: preserve-3d;
  animation: bookRightPageFlip 0.76s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Book Closing State Animations */
.book-spread-container.book-closing {
  transform: scale(0.92) rotateY(-8deg) !important;
  opacity: 0 !important;
  transition: transform 0.44s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.38s ease !important;
}

.book-spread-container.book-closing .book-page-left {
  animation: bookLeftPageClose 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
}

.book-spread-container.book-closing .book-page-right {
  animation: bookRightPageClose 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
}

/* Top Mini Direction Switcher Tabs */
.book-direction-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.book-direction-tabs::-webkit-scrollbar {
  display: none;
}

.dir-tab-btn {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.dir-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.dir-tab-btn.active {
  background: var(--brand-accent-red);
  color: #ffffff;
  border-color: var(--brand-accent-red);
  box-shadow: 0 0 12px rgba(224, 68, 52, 0.5);
}

/* Numbered Services List (Matching Reference Design) */
.services-list-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.service-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #ffffff;
  transition: background-color 0.2s ease, padding 0.2s ease;
  cursor: pointer;
}

.service-row-item:last-child {
  border-bottom: none;
}

.service-row-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  padding-left: 20px;
  padding-right: 20px;
}

.service-item-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.service-num {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-accent-red);
  min-width: 26px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.service-name {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.service-arrow {
  color: #cbd5e1;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease;
}

.service-row-item:hover .service-arrow {
  color: var(--brand-accent-red);
  transform: translateX(6px);
}

/* ==========================================================================
   MINIMAL LUXURY FOOTER (MATCHING REFERENCE DESIGN)
   ========================================================================== */
.directions-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 10, 15, 0.95);
  padding: 32px 0;
  margin-top: auto;
}

.footer-inner-grid {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-col-brand .footer-brand-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.footer-col-brand .footer-brand-sub {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #94a3b8;
  text-transform: uppercase;
}

.footer-col-motto {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #94a3b8;
  text-transform: uppercase;
  text-align: center;
}

.footer-col-vision {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #64748b;
  text-transform: uppercase;
  text-align: right;
  max-width: 320px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
  .overview-stage {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .overview-intro-col {
    max-width: 600px;
  }
  .directions-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .book-spread-container {
    grid-template-columns: 1fr;
  }
  .book-spine-line {
    display: none;
  }
  .book-page-left {
    min-height: 380px;
  }
  .book-page-left, .book-page-right {
    transform: none !important;
    animation: fadeInUp 0.45s ease forwards !important;
  }
}

@media (max-width: 768px) {
  .directions-cards-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .direction-card {
    min-height: 300px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .direction-card:last-child {
    border-bottom: none;
  }
  .footer-inner-grid {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .footer-col-vision {
    text-align: center;
  }
  .book-page-left, .book-page-right {
    padding: 28px 20px;
  }
}
