/**
 * Activities Tabs Widget Styles
 * Vertical bookmark-tab layout with active tab merging into content panel.
 */

/* ========================================
   Widget Container
   ======================================== */
.at-widget {
  background-color: transparent;
  padding: 0;
}

/* ========================================
   Section Header
   ======================================== */
.at-section-header {
  margin-bottom: 28px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.at-section-title {
  font-family: var(--iabt-font-family, "Inter", system-ui, sans-serif);
  font-weight: var(--iabt-font-bold, 700);
  color: var(--iabt-text-heading, #111827);
  line-height: 1.2;
  margin: 0;
}

.at-section-subtitle {
  font-family: var(--iabt-font-family, "Inter", system-ui, sans-serif);
  font-size: var(--iabt-text-base, 1rem);
  line-height: 1.6;
  color: var(--iabt-text-body, #4b5563);
  max-width: 600px;
  margin: 12px auto 0;
}

/* ========================================
   Main Container — Flex Layout
   ======================================== */
.at-container {
  display: flex;
  align-items: stretch;
}

/* ========================================
   Tab Navigation (Vertical)
   ======================================== */
.at-tabs-nav {
  width: 176px;
  display: flex;
  flex-direction: column;
  align-items: end;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.at-tab-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--iabt-border, #dde3ed);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background-color: var(--iabt-bg-main, #ffffff);
  color: var(--iabt-text-secondary, #475569);
  font-family: var(--iabt-font-family, "Inter", system-ui, sans-serif);
  font-size: var(--iabt-text-sm, 1rem);
  font-weight: var(--iabt-font-medium, 500);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, width 0.2s ease, font-weight 0.2s ease;
  margin-top: -1px;
  position: relative;
}

.at-tab-btn:first-child {
  margin-top: 0;
}

/* Active tab — merges into content panel */
.at-tab-btn.active {
  width: 90%;
  background-color: var(--iabt-bg-soft, #f8fafc);
  color: var(--iabt-primary, hsl(214, 83%, 26%));
  font-weight: var(--iabt-font-semibold, 600);
  border-color: var(--iabt-border, #dde3ed);
  margin-right: -1px;
  z-index: 3;
}

/* Hover for inactive tabs */
.at-tab-btn:not(.active):hover {
  background-color: var(--iabt-bg-soft, #f8fafc);
  color: var(--iabt-text-primary, #111827);
}

/* Focus visible */
.at-tab-btn:focus-visible {
  outline: 2px solid var(--iabt-primary, hsl(214, 83%, 26%));
  outline-offset: -2px;
}

/* ========================================
   Content Wrapper
   ======================================== */
.at-content-wrapper {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--iabt-border, #dde3ed);
  border-radius: 0 16px 16px 16px;
  background-color: var(--iabt-bg-soft, #f8fafc);
  position: relative;
  z-index: 1;
  display: grid;
  overflow: hidden;
}

/* ========================================
   Content Panel
   ======================================== */
.at-content-panel {
  grid-row: 1;
  grid-column: 1;
  padding: 40px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.at-content-panel.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.at-content-panel.leaving {
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

/* Children default to invisible; animate when panel is active */
.at-content-panel .at-content-image,
.at-content-panel .at-content-text {
  opacity: 0;
}

.at-content-panel.active .at-content-image {
  animation: atSlideIn 0.35s ease forwards;
}

.at-content-panel.active .at-content-text {
  animation: atSlideIn 0.35s ease 0.1s forwards;
}

.at-content-panel.leaving .at-content-image {
  opacity: 1;
  animation: atSlideOut 0.35s ease forwards;
}

.at-content-panel.leaving .at-content-text {
  opacity: 1;
  animation: atSlideOut 0.35s ease 0.05s forwards;
}

@keyframes atSlideIn {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes atSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-24px); }
}

/* ========================================
   Content Area — Text + Image
   ======================================== */
.at-content-area {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.at-content-text {
  flex: 1;
  min-width: 0;
}

.at-content-title {
  font-family: var(--iabt-font-family, "Inter", system-ui, sans-serif);
  font-size: var(--iabt-h3, 1.5rem);
  font-weight: var(--iabt-font-bold, 700);
  color: var(--iabt-text-heading, #111827);
  line-height: 1.3;
  margin: 0 0 12px 0;
}

.at-content-desc {
  font-family: var(--iabt-font-family, "Inter", system-ui, sans-serif);
  font-size: var(--iabt-text-base, 1rem);
  line-height: 1.6;
  color: var(--iabt-text-body, #4b5563);
  margin: 0 0 24px 0;
}

/* ========================================
   Bullet List
   ======================================== */
.at-bullet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.at-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.at-bullet-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--iabt-primary);
}

.at-bullet-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.at-bullet-text {
  font-family: var(--iabt-font-family, "Inter", system-ui, sans-serif);
  font-size: var(--iabt-text-base, 1rem);
  line-height: 1.5;
  color: var(--iabt-text-body, #4b5563);
}

.at-bullet-label {
  font-weight: var(--iabt-font-semibold, 600);
  color: var(--iabt-text-primary, #111827);
}

.at-bullet-desc {
  color: var(--iabt-text-body, #4b5563);
}

/* ========================================
   Content Image
   ======================================== */
.at-content-image {
  flex-shrink: 0;
  width: 45%;
  max-width: 440px;
  order: -1;
}

.at-content-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  object-fit: cover;
}

/* ========================================
   Layout: Top (Horizontal Tabs on Desktop)
   ======================================== */
.at-layout-top {
  flex-direction: column;
}

.at-layout-top .at-tabs-nav {
  width: 100%;
  flex-direction: row;
  align-items: flex-end;
  gap: 0;
  z-index: 2;
}

.at-layout-top .at-tab-btn {
  width: auto;
  min-width: max-content;
  border: 1px solid var(--iabt-border, #dde3ed);
  border-right: 1px solid var(--iabt-border, #dde3ed);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-top: 0;
  margin-left: -1px;
  white-space: nowrap;
  padding: 12px 20px;
}

.at-layout-top .at-tab-btn:first-child {
  margin-left: 0;
}

.at-layout-top .at-tab-btn.active {
  width: auto;
  margin-right: 0;
  margin-bottom: -1px;
  padding-bottom: 13px;
  border-bottom: none;
  background-color: var(--iabt-bg-soft, #f8fafc);
  z-index: 3;
}

.at-layout-top .at-content-wrapper {
  border-radius: 0 16px 16px 16px;
}

.at-layout-top .at-content-panel {
  padding: 28px;
}

/* ========================================
   Responsive — Tablet (≤ 1024px)
   ======================================== */
@media (max-width: 1024px) {
  .at-content-area {
    flex-direction: column;
    gap: 24px;
  }

  .at-content-image {
    width: 100%;
    max-width: 100%;
  }

  .at-content-panel {
    padding: 28px;
  }

  .at-tab-btn {
    padding: 14px 16px;
    font-size: 0.9375rem;
  }
}

@media (max-width: 768px) {
  h1.at-section-title { font-size: var(--iabt-h2); }
  h2.at-section-title { font-size: var(--iabt-h3); }
  h3.at-section-title { font-size: var(--iabt-h4); }
  h4.at-section-title { font-size: var(--iabt-h5); }
  h5.at-section-title { font-size: var(--iabt-h6); }
  h6.at-section-title { font-size: var(--iabt-h6); }
}

/* ========================================
   Responsive — Mobile (≤ 768px)
   ======================================== */
@media (max-width: 768px) {
  .at-container {
    flex-direction: column;
  }

  /* Tabs flip to horizontal top bar */
  .at-tabs-nav {
    width: 100%;
    flex-direction: row;
    align-items: flex-end;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
  }

  .at-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .at-tab-btn {
    width: auto;
    min-width: max-content;
    border: 1px solid var(--iabt-border, #dde3ed);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-top: 0;
    margin-left: -1px;
    padding: 10px 18px;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .at-tab-btn:first-child {
    margin-left: 0;
  }

  .at-tab-btn.active {
    width: auto;
    margin-right: 0;
    padding-top: 8px;
    padding-bottom: 9px;
    border-bottom: none;
    background-color: var(--iabt-bg-soft, #f8fafc);
    z-index: 3;
  }

  .at-content-wrapper {
    border-radius: 0 0 16px 16px;
  }

  .at-content-panel {
    padding: 24px 20px;
  }

  .at-content-title {
    font-size: 1.25rem;
  }

  @keyframes atSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes atSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(20px); }
  }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .at-content-panel.active {
    animation: none;
  }

  .at-content-panel.active .at-content-image,
  .at-content-panel.active .at-content-text {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .at-content-panel.leaving .at-content-image,
  .at-content-panel.leaving .at-content-text {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .at-tab-btn {
    transition: none;
  }
}
