// ds topsites wraps the original topsites, with a few css changes.
.ds-top-sites {

  // This is the override layer.
  .top-sites {
    // Slightly different alignment with the other DS components than AS has.
    margin: 0 (-$section-horizontal-padding);

    .top-site-outer {
      padding: 0 12px;

      .top-site-inner > a:-moz-any(.active, :focus) .tile {
        @include ds-fade-in;
      }
    }

    .top-sites-list {
      margin: 0 -12px;
    }
  }

  // Only show 6 cards for 2/3 and 1/3
  // XXX hide-for-narrow is wrapping a previous functionality, can do better.
  .hide-for-narrow {
    display: none;
  }
}

// Only show 8 cards for the full row.
// XXX hide-for-narrow is wrapping a previous functionality, can do better.
.ds-column-9,
.ds-column-10,
.ds-column-11,
.ds-column-12 {
  .ds-top-sites {
    .hide-for-narrow {
      display: inline-block;
    }
  }
}

// Size overrides for topsites in the 2/3 view.
.ds-column-5,
.ds-column-6,
.ds-column-7,
.ds-column-8 {
  .ds-top-sites {

    .top-site-outer {
      padding: 0 10px;
    }

    .top-sites-list {
      margin: 0 -10px;
    }

    .top-site-inner {
      --leftPanelIconWidth: 84.67px;

      .tile {
        width: var(--leftPanelIconWidth);
        height: var(--leftPanelIconWidth);
      }

      .title {
        width: var(--leftPanelIconWidth);
      }
    }
  }
}

// Size overrides for topsites in the 1/3 view.
.ds-column-1,
.ds-column-2,
.ds-column-3,
.ds-column-4 {
  .ds-top-sites {

    .top-site-outer {
      padding: 0 8px;
    }

    .top-sites-list {
      margin: 0 -8px;
    }

    .top-site-inner {
      --rightPanelIconWidth: 82.67px;

      .tile {
        width: var(--rightPanelIconWidth);
        height: var(--rightPanelIconWidth);
      }

      .title {
        width: var(--rightPanelIconWidth);
      }
    }
  }
}
