/* Page-specific styles. */

/* ---------- Home: category grid ---------- */
.ibm-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap-desktop);
}
@media (max-width: 992px) { .ibm-cat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--grid-gap-tablet); } }
@media (max-width: 576px) {
  .ibm-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ibm-cat-tile__label { padding: 12px; }
  .ibm-cat-tile__title { font-size: 14px; }
  .ibm-cat-tile__more { font-size: 10px; }
}

.ibm-cat-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-bg-dark);
  aspect-ratio: 4 / 3;
  color: #fff;
  text-decoration: none;
  transition: transform var(--transition-base);
}
.ibm-cat-tile:hover { transform: translateY(-2px); text-decoration: none; }
.ibm-cat-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}
.ibm-cat-tile:hover .ibm-cat-tile__img { transform: scale(1.05); }
.ibm-cat-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}
.ibm-cat-tile__label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-5);
  color: #fff;
}
.ibm-cat-tile__title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  margin: 0 0 var(--space-1);
  color: #fff;
}
.ibm-cat-tile__more {
  font-size: var(--fs-caption);
  color: var(--color-cream);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Home: process (left image + right steps) ---------- */
.ibm-process {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-15);
  align-items: center;
}
.ibm-process__media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.ibm-process__eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  line-height: 1.4;
}
.ibm-process__title {
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  margin: 0 0 var(--space-3);
  line-height: var(--lh-tight);
}
.ibm-process__lede {
  color: var(--color-text-secondary);
  font-size: var(--fs-body);
  margin: 0 0 var(--space-5);
  line-height: var(--lh-body);
}
.ibm-process__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ibm-process__step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
}
.ibm-process__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ibm-process__step-title {
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  margin: 0;
  color: var(--color-text);
  line-height: 1.3;
}
.ibm-process__step-desc {
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  margin: 4px 0 0;
  line-height: 1.4;
}
.ibm-process__cta {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 992px) {
  .ibm-process { grid-template-columns: 1fr; gap: var(--space-8); }
  .ibm-process__title { font-size: 24px; line-height: 28px; }
  .ibm-process__media img { aspect-ratio: 16 / 9; }
}
@media (max-width: 576px) {
  .ibm-process { gap: var(--space-5); }
  .ibm-process__title { font-size: 22px; line-height: 26px; }
  .ibm-process__step { gap: var(--space-3); }
  .ibm-process__num { width: 30px; height: 30px; font-size: 12px; }
  .ibm-process__step-title { font-size: var(--fs-body-sm); }
  .ibm-process__step-desc { font-size: 12px; }
  .ibm-process__cta { width: 100%; }
}

/* ---------- Home: brand wall ---------- */
.ibm-brands {
  list-style: none;
  padding: 0;
  margin: var(--space-8) 0 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-5);
  align-items: center;
  justify-items: center;
}
.ibm-brands li {
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
}
.ibm-brands img {
  max-width: 80%;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter var(--transition-base), opacity var(--transition-base);
}
.ibm-brands li:hover img {
  filter: grayscale(0%);
  opacity: 1;
}
@media (max-width: 992px) {
  .ibm-brands { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
  .ibm-brands li { height: 70px; }
}
@media (max-width: 576px) {
  .ibm-brands { grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
  .ibm-brands li { height: 56px; }
  .ibm-brands img { max-height: 44px; }
}

/* ---------- Home: value props ---------- */
.ibm-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  text-align: center;
}
@media (max-width: 992px) { .ibm-values { grid-template-columns: repeat(2, 1fr); } }
/* Stay 2 columns on mobile (was 1) */
@media (max-width: 576px) {
  .ibm-values { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .ibm-value__title { font-size: 12px; }
  .ibm-value__desc  { font-size: 12px; line-height: 1.4; }
  .ibm-value__icon  { width: 48px; height: 48px; font-size: 18px; }
}
.ibm-value__icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-circle);
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: var(--fw-bold);
}
.ibm-value__title { font-size: var(--fs-h4); margin-bottom: var(--space-2); }
.ibm-value__desc  { font-size: var(--fs-body-sm); color: var(--color-text-secondary); margin: 0; }

/* ---------- Product single ---------- */
.ibm-product-single {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-15);
  padding: var(--space-15) 0;
}
@media (max-width: 992px) {
  .ibm-product-single { grid-template-columns: 1fr; gap: var(--space-8); padding: var(--space-8) 0; }
}
/* Gallery with thumbnails */
.ibm-product-gallery__main {
  position: relative;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg-soft);
  aspect-ratio: 1 / 1;
  margin-bottom: var(--space-3);
}

/* Prev/Next arrows */
.ibm-product-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text);
  font-size: 24px;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  opacity: 0;
}
.ibm-product-gallery:hover .ibm-product-gallery__arrow,
.ibm-product-gallery__arrow:focus-visible {
  opacity: 1;
}
.ibm-product-gallery__arrow:hover {
  background: #fff;
  color: var(--color-primary);
  transform: translateY(-50%) scale(1.05);
}
.ibm-product-gallery__arrow--prev { left: 12px; }
.ibm-product-gallery__arrow--next { right: 12px; }

/* On touch devices keep arrows visible (no hover) */
@media (hover: none) {
  .ibm-product-gallery__arrow { opacity: 0.85; }
}
.ibm-product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #fff;
}
/* Thumbs wrapper — horizontal scroll with prev/next arrows */
.ibm-product-gallery__thumbs-wrapper {
  position: relative;
}
.ibm-product-gallery__thumbs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ibm-product-gallery__thumbs::-webkit-scrollbar { display: none; }
.ibm-product-gallery__thumbs li {
  margin: 0;
  flex: 0 0 calc((100% - 4 * var(--space-2)) / 5);
}
.ibm-product-gallery__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: #fff;
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.ibm-product-gallery__thumb:hover { border-color: var(--color-primary); }
.ibm-product-gallery__thumb.is-active { border-color: var(--color-primary); }
.ibm-product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Thumb scroll arrows */
.ibm-product-gallery__thumbs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text);
  font-size: 20px;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  box-shadow: var(--shadow-card-hover);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.ibm-product-gallery__thumbs-arrow:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.ibm-product-gallery__thumbs-arrow--prev { left: -12px; }
.ibm-product-gallery__thumbs-arrow--next { right: -12px; }

@media (max-width: 576px) {
  .ibm-product-gallery__thumbs li { flex: 0 0 calc((100% - 3 * var(--space-2)) / 4); }
  .ibm-product-gallery__thumbs-arrow--prev { left: -4px; }
  .ibm-product-gallery__thumbs-arrow--next { right: -4px; }
}

/* Tabs */
.ibm-tabs__nav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.ibm-tabs__nav::-webkit-scrollbar { display: none; }
.ibm-tabs__tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-family);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  margin-bottom: -1px;
}
.ibm-tabs__tab:hover { color: var(--color-text); }
.ibm-tabs__tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.ibm-tabs__panel { display: none; }
.ibm-tabs__panel.is-active { display: block; }
.ibm-tabs__panel[hidden] { display: none; }
.ibm-tabs__panel.is-active[hidden] { display: block; }

@media (max-width: 576px) {
  .ibm-tabs__tab { font-size: var(--fs-body-sm); padding: 10px 12px; }
}

/* FAQs accordion */
.ibm-faqs { list-style: none; padding: 0; margin: 0; }
.ibm-faq {
  margin: 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.ibm-faq:first-child { border-top: 1px solid var(--color-border-subtle); }
.ibm-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 0;
  padding: var(--space-4) 0;
  font-family: var(--font-family);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  gap: var(--space-3);
}
.ibm-faq__q:hover { color: var(--color-primary); }
.ibm-faq__caret {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: var(--fw-regular);
  line-height: 1;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
}
.ibm-faq.is-open .ibm-faq__caret { transform: rotate(45deg); }
.ibm-faq__a {
  display: none;
  padding: 0 0 var(--space-4);
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  line-height: var(--lh-body);
}
.ibm-faq.is-open .ibm-faq__a { display: block; }
.ibm-faq__a p { margin: 0 0 var(--space-2); }
.ibm-faq__a p:last-child { margin-bottom: 0; }

@media (max-width: 576px) {
  .ibm-faq__q { font-size: var(--fs-body-sm); padding: var(--space-3) 0; }
}
.ibm-product-title {
  font-size: var(--fs-display);
  margin: 0 0 var(--space-2);
}
.ibm-product-subtitle {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-5);
}
.ibm-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: var(--fs-body-sm);
}
.ibm-spec-table th,
.ibm-spec-table td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}
.ibm-spec-table th {
  font-weight: var(--fw-bold);
  color: var(--color-text);
  width: 30%;
  background: var(--color-bg-soft);
}
.ibm-features-list {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0;
}
.ibm-features-list li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-2);
  font-size: var(--fs-body-sm);
}
.ibm-features-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary);
  font-weight: var(--fw-bold);
}

/* ---------- Inquiry form ---------- */
.ibm-inquiry {
  background: var(--color-bg-soft);
  padding: var(--space-8) var(--space-5);
  border-radius: var(--radius);
}
.ibm-inquiry h3 { margin-bottom: var(--space-4); font-size: var(--fs-h3); line-height: var(--lh-h3); }
.ibm-inquiry__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 576px) { .ibm-inquiry__grid { grid-template-columns: 1fr; } }
.ibm-inquiry__row--full { grid-column: 1 / -1; }

/* ---------- About page ---------- */
.ibm-about-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-15);
  align-items: center;
}
@media (max-width: 992px) { .ibm-about-hero { grid-template-columns: 1fr; gap: var(--space-5); } }
.ibm-about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin: var(--space-15) 0;
  text-align: center;
}
@media (max-width: 992px) { .ibm-about-stats { grid-template-columns: repeat(2, 1fr); } }
.ibm-stat__num {
  font-size: 48px;
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.ibm-stat__label {
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Download / Mockups list ---------- */
.ibm-download-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: #fff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius);
  transition: box-shadow var(--transition-fast);
}
.ibm-download-card:hover { box-shadow: var(--shadow-card-hover); }
.ibm-download-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: var(--fw-bold);
}
.ibm-download-card__body { flex: 1; }
.ibm-download-card__title { font-size: var(--fs-h4); font-weight: var(--fw-bold); margin: 0 0 var(--space-1); }
.ibm-download-card__meta  { font-size: var(--fs-caption); color: var(--color-text-muted); margin: 0; }

/* ---------- Blog ---------- */
.ibm-post-meta {
  font-size: var(--fs-caption);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.ibm-post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-15) var(--space-5);
}
.ibm-post-content h2 { margin-top: var(--space-8); }
.ibm-post-content h3 { margin-top: var(--space-5); }

/* ---------- 404 / Search ---------- */
.ibm-empty {
  text-align: center;
  padding: var(--space-21) var(--space-5);
}
.ibm-empty__code {
  font-size: 96px;
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-4);
}
.ibm-search-form {
  display: flex;
  max-width: 500px;
  margin: var(--space-4) auto 0;
  gap: var(--space-2);
}
.ibm-search-form input { flex: 1; }

/* ============================================================
   Mobile responsive overrides — global sweep for tablet/mobile
   ============================================================ */

/* Tablet (≤768px) */
@media (max-width: 768px) {
  /* Page header padding */
  .ibm-page-header { padding: var(--space-8) 0; }
  .ibm-page-header h1 { font-size: 24px; line-height: 28px; }
  .ibm-page-header__lede { font-size: var(--fs-body-sm); }

  /* Section titles */
  .ibm-section__title { font-size: 22px; line-height: 26px; }
  .ibm-section__lede { font-size: var(--fs-body-sm); margin-bottom: var(--space-5); }

  /* Spec table */
  .ibm-spec-table { font-size: var(--fs-body-sm); }
  .ibm-spec-table th { width: 35%; padding: var(--space-2); }
  .ibm-spec-table td { padding: var(--space-2); word-break: break-word; }

  /* Product title */
  .ibm-product-title { font-size: 22px; line-height: 26px; }
  .ibm-product-subtitle { font-size: var(--fs-body-sm); }

  /* About stats */
  .ibm-stat__num { font-size: 32px; }
  .ibm-stat__label { font-size: 11px; }

  /* Download cards stack */
  .ibm-download-card {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  .ibm-download-card__body { flex: 1 1 100%; order: 1; }
  .ibm-download-card__icon { order: 0; }
  .ibm-download-card .ibm-btn--ghost { width: 100%; }

  /* Footer bottom: stack */
  .ibm-footer__bottom { flex-direction: column; text-align: center; gap: 6px; }

  /* Post content padding */
  .ibm-post-content { padding: var(--space-8) var(--space-3); }
  .ibm-post-content h2 { font-size: 20px; }
  .ibm-post-content h3 { font-size: 16px; }

  /* CTA strip */
  .ibm-cta-strip { padding: var(--space-8) var(--space-4); }
  .ibm-cta-strip h2 { font-size: 22px; line-height: 26px; }

  /* 404 page */
  .ibm-empty__code { font-size: 64px; }
  .ibm-empty { padding: var(--space-15) var(--space-3); }
  .ibm-search-form { flex-direction: column; }
  .ibm-search-form .ibm-btn--primary { width: 100%; }

  /* Inquiry section heading */
  .ibm-inquiry { padding: var(--space-5) var(--space-3); }
  .ibm-inquiry h3 { font-size: 18px; line-height: 22px; }

  /* About hero image fits */
  .ibm-about-hero img { width: 100%; }
}

/* Small mobile (≤480px) */
@media (max-width: 480px) {
  .ibm-page-header h1 { font-size: 22px; line-height: 26px; }
  .ibm-section__title { font-size: 20px; line-height: 24px; }
  .ibm-product-title { font-size: 20px; line-height: 24px; }
  .ibm-stat__num { font-size: 28px; }

  /* Spec table: stack label + value */
  .ibm-spec-table,
  .ibm-spec-table tbody,
  .ibm-spec-table tr,
  .ibm-spec-table th,
  .ibm-spec-table td { display: block; width: auto; }
  .ibm-spec-table th {
    background: transparent;
    padding: var(--space-2) 0 0;
    border-bottom: 0;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }
  .ibm-spec-table td { padding: 0 0 var(--space-2); border-bottom: 1px solid var(--color-border-subtle); }

  /* Two CTAs on product page stack */
  .ibm-product-meta .ibm-btn { width: 100%; }
}
