/* About Robothrone — responsive from 320px to 2500px */

/* Section container: fill ~90% of viewport height and center content */
.about {
  background: var(--light, #f8fafc);
  min-height: 90vh;
  display: flex;
  align-items: center;
}

.about .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 16px;
  width: 100%;
  box-sizing: border-box;
}

.about .section-title h2 {
  margin-bottom: 16px;
  text-align: center;
  color: var(--tg-navy, #1e293b);
  font-size: clamp(1.6rem, 2.6vw, 2rem);
}

/* Base layout: single column (320px up) filling section height */
.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
  height: 100%;
}

/* Two columns for tablets/desktops */
@media (min-width: 768px) {
  .about-content {
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
  }
}

.about-text,
.about-gallery {
  height: 100%;
  min-height: 0;
}

.about-text {
  background: linear-gradient(9deg, #0bf51d6b 0%, #f8fafc 100%);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Wrap paragraphs inside .about-copy in HTML */
.about-copy {
  padding: 16px 20px;
  overflow-y: auto; /* scroll internally if text exceeds viewport height */
}

.about-text p {
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.6;
}

@media (min-width: 993px) {
  .about-text p { font-size: 1.05rem; line-height: 1.7; }
}

.about-powered-block.section-card {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  margin-top: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.9);
}

.logo-img {
  width: 150px;
  height: 80px;
  border-radius: 12px;
}

.partner-title { display: block; }
.partner-description { color: rgba(0,0,0,0.75); }

/* Black background for the anchor as requested */
.about-powered-block a.powered-link {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  background: transparent;
  color: inherit;
  border-radius: 12px;
  padding: 16px;
}

/* Theme color for Powered by text */
.partner-title { color: var(--tg-pine); }

/* Highlight color structure for description phrases */
.highlight-sky { color: var(--tg-teal); }
.highlight-tech { color: var(--tg-beer); }
.highlight-innovation { color: var(--tg-coral); }
.highlight-excellence { color: var(--tg-navy); }

/* Minimal utility classes used by powered block */
.flex-column { display: flex; flex-direction: column; }
.align-center { align-items: center; }
.gap-15 { gap: 15px; }
.no-underline { text-decoration: none; }

/* Gallery */
.about-gallery {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.gallery-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.gallery-item {
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-description {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  padding: 20px;
  transform: translateY(100%);
  transition: all 0.3s ease;
}
.gallery-item:hover .gallery-description { transform: translateY(0); }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}
.gallery-nav:hover { background: rgba(255,255,255,0.3); }
.gallery-nav.prev { left: 14px; }
.gallery-nav.next { right: 14px; }

.gallery-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}
.dot.active { background: #fff; transform: scale(1.2); }

/* Mobile tweaks (320–767px): allow taller content, stacked layout */
@media (max-width: 767.98px) {
  .about {
    align-items: flex-start; /* start at top on very small screens */
    min-height: auto;
  }

  .about .container {
    padding: 32px 12px;
  }

  .about-content {
    grid-template-columns: 1fr;
    height: auto;
  }

  .about-text,
  .about-gallery {
    height: auto;
  }

  .about-gallery {
    min-height: 260px;
    box-sizing: border-box;
  }
}

/* Large screens: keep content centered and constrained */
@media (min-width: 1400px) {
  .about .container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Reduce gaps in the powered block for tighter layout */
.powered-link { gap: 8px; }

@media (min-width: 1130px) {
  .about { --about-height: 520px; }
}

/* Powered-link compact banner overrides */
.about .about-powered-block.section-card {
  margin-top: 12px;       /* avoid large gap above anchor */
  border: none;
  padding: 0;
  background: transparent;
}

.about .about-powered-block.section-card a.powered-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  height: auto;           /* auto-fit content height */
  min-height: unset;
  overflow: visible;      /* allow multi-line text when needed */
}

.about .powered-link .logo-img {
  width: calc(var(--powered-height, 80px) - 20px);
  height: calc(var(--powered-height, 80px) - 20px);
}

.about .partner-title {
  font-weight: 700;
  font-size: clamp(12px, 2vw, 16px);
  line-height: 1.2;
  white-space: normal;    /* allow wrapping */
  overflow: visible;
  text-overflow: clip;
  padding: 12px;
}
.about .partner-description { display: block; }

/* Remove powered-link fixed height across breakpoints */

/* Mobile & Tablet: show logo text lines inside anchor, safely clamped */
@media (max-width: 1139.98px) {
  .about .powered-link .partner-content { min-width: 0; }
  .about .partner-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: clamp(12px, 2.2vw, 15px);
    line-height: 1.25;
  }
  .about .partner-description {
    display: block;
    margin-top: 2px;
    color: rgba(0,0,0,0.8);
    overflow: visible;
    font-size: clamp(11px, 1.9vw, 13px);
    line-height: 1.25;
  }
}

@media (min-width: 1200px) {
  .about-content { align-items: stretch; }
  .about-text { height: 100%; }
  .about-text p { font-size: clamp(1.1rem, 1.2vw, 1.35rem); line-height: 1.85; }
  .about .about-powered-block.section-card a.powered-link { padding: 20px; }
  .about .partner-title { font-size: clamp(14px, 1.6vw, 20px); }
  .about .partner-description { font-size: clamp(12px, 1.4vw, 18px); }
  .about .logo-img { width: 150px; height: 80px; }
}

/* Tablet: ensure natural wrapping and alignment */
@media (min-width: 778px) and (max-width: 1139.98px) {
  .about .about-powered-block.section-card a.powered-link { align-items: flex-start; }
}

/* Tablet range (778px–1030px): enforce consistent gallery height to remove whitespace */
@media (min-width: 778px) and (max-width: 1030px) {
  .about-content { align-items: stretch; }
  .about-gallery { aspect-ratio: auto; height: 100%; }
  .gallery-container { height: 100%; }
  .gallery-track { height: 100%; }
  .gallery-item { height: 100%; }
  .gallery-item img { height: 100%; object-fit: contain; }
}

/* Tablet/desktop range (1031px–1516px): make gallery fill grid cell height */
@media (min-width: 1031px) and (max-width: 1516px) {
  .about-content { align-items: stretch; }
  .about-gallery { aspect-ratio: auto; height: 100%; }
  .about-text { height: 100%; }
  .gallery-container { height: 100%; }
  .gallery-track { height: 100%; }
  .gallery-item { height: 100%; }
  .gallery-item img { height: 100%; object-fit: contain; }
}

/* Desktop wide range (1500px–2085px): ensure gallery maintains parent height */
@media (min-width: 1500px) and (max-width: 2085px) {
  .about-content { align-items: stretch; }
  .about-gallery { aspect-ratio: auto; height: 100%; }
  .about-text { height: 100%; }
  .gallery-container { height: 100%; }
  .gallery-track { height: 100%; }
  .gallery-item { height: 100%; }
  .gallery-item img { height: 100%; object-fit: contain; }
}

@media (min-width: 1800px) {
  .about-content { align-items: stretch; }
  .about-gallery { aspect-ratio: auto; height: 100%; }
  .about-text { height: 100%; }
  .gallery-container { height: 100%; }
  .gallery-track { height: 100%; }
  .gallery-item { height: 100%; }
  .gallery-item img { height: 100%; object-fit: contain; }
  .about-text p { font-size: clamp(1.2rem, 1.1vw, 1.6rem); line-height: 1.95; }
  .about .about-powered-block.section-card a.powered-link { padding: 24px; }
  .about .partner-title { font-size: clamp(16px, 1.6vw, 22px); }
  .about .partner-description { font-size: clamp(13px, 1.4vw, 20px); }
  .about .logo-img { width: 150px; height: 80px; }
}

/* Ensure logo image never overflows and fits inside fixed-height banner */
.about .powered-link .logo-img { object-fit: contain; flex: 0 0 auto; }
.about .gallery-item img { display: block; object-fit: fill; flex: 0 0 auto; }
